/* ==========================================
   🔓 越狱源 - 毛玻璃风格样式表
   ========================================== */

:root {
    --primary: #667eea;
    --primary-light: #7c94f5;
    --secondary: #764ba2;
    --accent: #f093fb;
    --success: #00c853;
    --warning: #ffd600;
    --danger: #ff1744;
    --bg-dark: #0a0a1a;
    --bg-card: rgba(255, 255, 255, 0.05);
    --bg-glass: rgba(255, 255, 255, 0.08);
    --bg-glass-hover: rgba(255, 255, 255, 0.12);
    --border-glass: rgba(255, 255, 255, 0.12);
    --border-glass-hover: rgba(255, 255, 255, 0.2);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.65);
    --text-muted: rgba(255, 255, 255, 0.4);
    --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 40px rgba(102, 126, 234, 0.15);
    --blur: 20px;
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* ==========================================
   背景动画效果
   ========================================== */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse 80% 50% at 20% 20%, rgba(102, 126, 234, 0.15) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 80% 80%, rgba(118, 75, 162, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse 50% 30% at 50% 50%, rgba(240, 147, 251, 0.06) 0%, transparent 60%);
    z-index: 0;
    pointer-events: none;
}

/* 浮动光球动画 */
.bg-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    z-index: 0;
    pointer-events: none;
    animation: orbFloat 20s ease-in-out infinite;
}

.bg-orb-1 {
    width: 400px;
    height: 400px;
    background: var(--primary);
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.bg-orb-2 {
    width: 350px;
    height: 350px;
    background: var(--secondary);
    bottom: -50px;
    right: -80px;
    animation-delay: -7s;
}

.bg-orb-3 {
    width: 250px;
    height: 250px;
    background: var(--accent);
    top: 50%;
    left: 50%;
    animation-delay: -14s;
    opacity: 0.15;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -40px) scale(1.05); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(40px, 30px) scale(1.02); }
}

/* ==========================================
   毛玻璃基础组件
   ========================================== */
.glass {
    background: var(--bg-glass);
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
    border: 1px solid var(--border-glass);
    border-radius: var(--radius);
    box-shadow: var(--shadow-glass);
    transition: var(--transition);
}

.glass:hover {
    background: var(--bg-glass-hover);
    border-color: var(--border-glass-hover);
    box-shadow: var(--shadow-glass), var(--shadow-glow);
    transform: translateY(-2px);
}

.glass-static {
    background: var(--bg-glass);
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
    border: 1px solid var(--border-glass);
    border-radius: var(--radius);
    box-shadow: var(--shadow-glass);
}

/* ==========================================
   容器布局
   ========================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

/* ==========================================
   导航栏
   ========================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(10, 10, 26, 0.7);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-bottom: 1px solid var(--border-glass);
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.navbar-content {
    max-width: 1200px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
}

.navbar-logo {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: white;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

.navbar-title {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.navbar-links {
    display: flex;
    gap: 8px;
    list-style: none;
}

.navbar-links a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: var(--radius-xs);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

.navbar-links a:hover,
.navbar-links a.active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

/* ==========================================
   Hero 区域
   ========================================== */
.hero {
    padding: 140px 0 80px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.8) 50%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero .subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto 32px;
    font-weight: 400;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 40px;
}

.hero-stat {
    text-align: center;
}

.hero-stat .number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-light);
    display: block;
}

.hero-stat .label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* 添加源按钮 */
.add-source-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
}

.add-source-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(102, 126, 234, 0.5);
}

/* ==========================================
   搜索栏
   ========================================== */
.search-section {
    margin-bottom: 40px;
    position: relative;
    z-index: 1;
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px;
    background: var(--bg-glass);
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
    border: 1px solid var(--border-glass);
    border-radius: 50px;
    max-width: 600px;
    margin: 0 auto;
    transition: var(--transition);
}

.search-bar:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15), var(--shadow-glass);
}

.search-bar input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.95rem;
    padding: 12px 20px;
    font-family: inherit;
}

.search-bar input::placeholder {
    color: var(--text-muted);
}

.search-icon {
    padding: 0 16px;
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* ==========================================
   分类筛选
   ========================================== */
.filter-tabs {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 40px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.filter-tab {
    padding: 8px 20px;
    border-radius: 50px;
    border: 1px solid var(--border-glass);
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition);
    font-family: inherit;
}

.filter-tab:hover {
    color: var(--text-primary);
    border-color: var(--border-glass-hover);
    background: var(--bg-glass-hover);
}

.filter-tab.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-color: transparent;
    color: white;
    box-shadow: 0 2px 12px rgba(102, 126, 234, 0.3);
}

/* ==========================================
   包列表网格
   ========================================== */
.packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
    margin-bottom: 60px;
    position: relative;
    z-index: 1;
}

/* ==========================================
   包卡片
   ========================================== */
.package-card {
    background: var(--bg-glass);
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
    border: 1px solid var(--border-glass);
    border-radius: var(--radius);
    padding: 24px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.package-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
    opacity: 0;
    transition: var(--transition);
}

.package-card:hover {
    background: var(--bg-glass-hover);
    border-color: var(--border-glass-hover);
    box-shadow: var(--shadow-glass), var(--shadow-glow);
    transform: translateY(-4px);
}

.package-card:hover::before {
    opacity: 1;
}

.package-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.package-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.package-icon.theme {
    background: linear-gradient(135deg, #ff6b6b, #feca57);
}

.package-icon.utility {
    background: linear-gradient(135deg, #00c853, #69f0ae);
}

.package-info {
    flex: 1;
    min-width: 0;
}

.package-name {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}

.package-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.package-version {
    font-size: 0.78rem;
    color: var(--primary-light);
    background: rgba(102, 126, 234, 0.12);
    padding: 2px 10px;
    border-radius: 50px;
    font-weight: 600;
}

.package-section {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.package-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.package-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.package-author {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.package-author span {
    color: var(--text-secondary);
}

.btn {
    padding: 8px 20px;
    border-radius: 50px;
    border: none;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.5);
    transform: translateY(-1px);
}

.btn-detail {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    border: 1px solid var(--border-glass);
}

.btn-detail:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

/* ==========================================
   页脚
   ========================================== */
.footer {
    text-align: center;
    padding: 40px 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border-glass);
    position: relative;
    z-index: 1;
}

.footer a {
    color: var(--primary-light);
    text-decoration: none;
}

/* ==========================================
   Depiction 详情页
   ========================================== */
.depiction {
    padding: 100px 0 60px;
    position: relative;
    z-index: 1;
}

.depiction-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 32px;
}

.depiction-icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: rgba(102, 126, 234, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-glass);
}

.depiction-title h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.depiction-title .meta {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 4px;
}

.depiction-section {
    background: var(--bg-glass);
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
    border: 1px solid var(--border-glass);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
}

.depiction-section h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.depiction-section p {
    color: var(--text-secondary);
    line-height: 1.7;
}

.depiction-section ul {
    list-style: none;
    padding: 0;
}

.depiction-section ul li {
    padding: 8px 0;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-left: 20px;
    position: relative;
}

.depiction-section ul li::before {
    content: '✦';
    position: absolute;
    left: 0;
    color: var(--primary-light);
    font-size: 0.7rem;
}

.depiction-section ul li:last-child {
    border-bottom: none;
}

/* 信息表 */
.info-table {
    width: 100%;
    border-collapse: collapse;
}

.info-table tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.info-table tr:last-child {
    border-bottom: none;
}

.info-table td {
    padding: 10px 0;
    font-size: 0.9rem;
}

.info-table td:first-child {
    color: var(--text-muted);
    width: 120px;
    font-weight: 500;
}

.info-table td:last-child {
    color: var(--text-secondary);
}

/* 截图网格 */
.screenshot-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.screenshot-placeholder {
    aspect-ratio: 9/16;
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed var(--border-glass);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
    padding: 16px;
}

/* 更新日志 */
.changelog-item {
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.changelog-item:last-child {
    border-bottom: none;
}

.changelog-item .version {
    font-weight: 700;
    color: var(--primary-light);
    margin-right: 12px;
}

.changelog-item .date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ==========================================
   空状态
   ========================================== */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.empty-state .icon {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.3rem;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

/* ==========================================
   响应式设计
   ========================================== */
@media (max-width: 768px) {
    .navbar-links { display: none; }
    
    .hero { padding: 120px 0 60px; }
    .hero h1 { font-size: 2rem; }
    
    .hero-stats { gap: 24px; }
    .hero-stat .number { font-size: 1.5rem; }
    
    .packages-grid {
        grid-template-columns: 1fr;
    }
    
    .screenshot-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .depiction-header {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container { padding: 0 16px; }
    .package-card { padding: 20px; }
    .filter-tabs { gap: 6px; }
    .filter-tab { padding: 6px 14px; font-size: 0.8rem; }
}

/* ==========================================
   滚动条美化
   ========================================== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ==========================================
   动画
   ========================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

.animate-in:nth-child(1) { animation-delay: 0.05s; }
.animate-in:nth-child(2) { animation-delay: 0.1s; }
.animate-in:nth-child(3) { animation-delay: 0.15s; }
.animate-in:nth-child(4) { animation-delay: 0.2s; }
.animate-in:nth-child(5) { animation-delay: 0.25s; }
.animate-in:nth-child(6) { animation-delay: 0.3s; }

/* ==========================================
   Toast 通知
   ========================================== */
.toast {
    position: fixed;
    top: 80px;
    right: 24px;
    padding: 14px 24px;
    background: var(--bg-glass);
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    z-index: 9999;
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-glass);
}

.toast.show {
    transform: translateX(0);
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--primary); }
