:root {
    --primary-blue: #B5EF00;
    --deep-blue: #B5EF00;
    --night: #20211F;
    --silver: #F7F7F0;
    --bg-primary: #20211F;
    --bg-secondary: #252722;
    --bg-tertiary: #32352D;
    --bg-card: #292C25;
    --bg-card-hover: #31362A;
    --border: #414638;
    --border-light: #59614C;
    --text-primary: #F7F7F0;
    --text-secondary: #C2C8B9;
    --text-muted: #A6AE9B;
    --accent: #B5EF00;
    --accent-hover: #C7FF35;
    --accent-glow: rgba(181, 239, 0, 0.35);
    --gradient-primary: linear-gradient(135deg, #B5EF00 0%, #B5EF00 100%);
    --success: #10B981;
    --warning: #F59E0B;
    --error: #EF4444;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6);
    --shadow-accent: 0 4px 24px rgba(181, 239, 0, 0.4);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Blue Theme (Logo Colors) */
[data-theme="blue"] {
    --bg-primary: #20211F;
    --bg-secondary: #252722;
    --bg-tertiary: #32352D;
    --bg-card: #292C25;
    --bg-card-hover: #31362A;
    --border: #414638;
    --border-light: #59614C;
    --text-primary: #F7F7F0;
    --text-secondary: #C2C8B9;
    --text-muted: #A6AE9B;
    --accent: #B5EF00;
    --accent-hover: #C7FF35;
    --accent-glow: rgba(181, 239, 0, 0.35);
    --gradient-primary: linear-gradient(135deg, #B5EF00 0%, #B5EF00 100%);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6);
    --shadow-accent: 0 4px 24px rgba(181, 239, 0, 0.4);
}

/* Silver Theme */
[data-theme="silver"] {
    --bg-primary: #F7F7F0;
    --bg-secondary: #FFFFFF;
    --bg-tertiary: #EEF0E5;
    --bg-card: #FFFFFF;
    --bg-card-hover: #F0F3E6;
    --border: #DDE1D2;
    --border-light: #CBD1BE;
    --text-primary: #20211F;
    --text-secondary: #535C47;
    --text-muted: #657057;
    --accent: #B5EF00;
    --accent-hover: #395200;
    --accent-glow: rgba(181, 239, 0, 0.15);
    --gradient-primary: linear-gradient(135deg, #B5EF00 0%, #B5EF00 100%);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-accent: 0 4px 24px rgba(181, 239, 0, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 72px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.5s ease, color 0.5s ease;
}

body, body * {
    transition-property: background-color, border-color, color, box-shadow;
    transition-duration: 0.3s;
    transition-timing-function: ease;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

/* ========== Header ========== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(8, 18, 31, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 72px;
    gap: 32px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-icon {
    font-size: 1.8rem;
}

.logo-text {
    font-size: 1.3rem;
    font-weight: 700;
    background: linear-gradient(135deg, #F7F7F0 0%, #B5EF00 80%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.main-nav {
    display: flex;
    gap: 8px;
}

.nav-link {
    appearance: none;
    border: 0;
    background: transparent;
    font: inherit;
    padding: 8px 16px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    cursor: pointer;
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.nav-link.active {
    color: var(--accent-primary);
    background: var(--bg-tertiary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 8px 16px;
    transition: var(--transition);
    width: 260px;
}

.search-box:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-icon {
    font-size: 0.9rem;
    opacity: 0.6;
}

.search-box input {
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.9rem;
    width: 100%;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.btn-refresh {
    width: 40px;
    height: 40px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 1.1rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-refresh:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* ========== Hero Section ========== */
.hero {
    position: relative;
    min-height: 400px;
    padding: 140px 24px 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse 600px 400px at 20% 50%, rgba(181, 239, 0, 0.15) 0%, transparent 60%),
        radial-gradient(ellipse 400px 300px at 80% 30%, rgba(181, 239, 0, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    text-align: center;
    max-width: 800px;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #F7F7F0 0%, #B5EF00 80%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    line-height: 1.6;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 60px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 8px;
}

/* ========== Sections ========== */
.section {
    padding: 80px 24px;
    max-width: 1400px;
    margin: 0 auto;
}

.tab-panel[hidden] {
    display: none;
}

.tab-panel.active {
    animation: tab-panel-enter 0.28s ease-out;
}

@keyframes tab-panel-enter {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.mobile-main-tabs {
    display: none;
}

.section-alt {
    max-width: none;
    background: var(--bg-secondary);
    margin: 40px 0;
}

.section-alt > * {
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.section-title-wrapper {
    flex: 1;
    min-width: 280px;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.section-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.section-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition);
}

.filter-tab:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.filter-tab.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* ========== Button Actions ========== */
.btn-action {
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-action.primary {
    background: var(--accent);
    color: white;
}

.btn-action.primary:hover {
    background: var(--accent-hover);
}

.btn-action.secondary {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-action.secondary:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

/* ========== Apps Grid ========== */
.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.app-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
}

.app-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: var(--shadow-accent);
}

.app-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.app-icon {
    width: 48px;
    height: 48px;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.app-info {
    flex: 1;
    min-width: 0;
}

.app-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 2px;
    overflow: hidden;
}

.app-name-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 1;
    min-width: 0;
}

.app-source {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.source-dot {
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
}

.app-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.app-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.app-tag {
    padding: 2px 10px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.app-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    margin-bottom: 12px;
}

.app-rating {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.app-updated {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.app-badges {
    display: inline-flex;
    gap: 4px;
    margin-left: 4px;
    vertical-align: middle;
}

.app-badge {
    padding: 1px 6px;
    background: var(--accent);
    color: white;
    font-size: 0.62rem;
    font-weight: 600;
    border-radius: 3px;
    line-height: 1.4;
    white-space: nowrap;
}

.app-badge.new { background: var(--success); }
.app-badge.hot { background: var(--error); }
.app-badge.official { background: linear-gradient(135deg, #B5EF00, #B5EF00); }

.interaction-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.interaction-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.85rem;
    transition: var(--transition);
}

.interaction-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.interaction-btn.liked {
    background: rgba(181, 239, 0, 0.18);
    border-color: #B5EF00;
    color: #B5EF00;
}

.interaction-btn.disliked {
    background: rgba(239, 68, 68, 0.18);
    border-color: #ef4444;
    color: #ef4444;
}

.interaction-btn:last-child {
    margin-left: auto;
    background: var(--accent);
    color: white;
    border: none;
    text-decoration: none;
}

.interaction-btn:last-child:hover {
    background: var(--accent-hover);
}

/* ========== News Section (Horizontal Layout) ========== */
.news-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.news-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.news-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
    transform: translateX(4px);
}

.news-item.featured {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-tertiary) 100%);
    border-color: var(--accent);
}

.news-item.featured .news-title {
    font-size: 1.25rem;
}

.news-thumb {
    width: 80px;
    height: 80px;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    flex-shrink: 0;
}

.news-content {
    flex: 1;
    min-width: 0;
}

.featured-badge {
    display: inline-block;
    padding: 3px 10px;
    background: var(--accent);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 4px;
    margin-bottom: 8px;
}

.news-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.4;
}

.news-summary {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.8rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.news-category {
    padding: 2px 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    font-size: 0.75rem;
}

.news-date {
    color: var(--text-muted);
    font-size: 0.75rem;
    opacity: 0.8;
}

.news-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.news-actions .interaction-btn {
    padding: 4px 10px;
    font-size: 0.8rem;
}

.news-read-more {
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 500;
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

/* ========== Theme Switch ========== */
.theme-switch {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.theme-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.theme-btn:hover {
    background: var(--bg-tertiary);
}

.theme-btn.active {
    background: var(--bg-tertiary);
    box-shadow: 0 0 0 2px var(--accent);
}

.theme-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: block;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ========== Language Switch ========== */
.lang-switch {
    display: flex;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.lang-btn {
    white-space: nowrap;
    flex-shrink: 0;
    padding: 6px 12px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.lang-btn.active {
    background: var(--accent);
    color: white;
}

.lang-btn:hover:not(.active) {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

/* ========== Categories ========== */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.category-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    gap: 16px;
    align-items: center;
}

.category-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.category-icon {
    width: 52px;
    height: 52px;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
}

.category-info {
    flex: 1;
    min-width: 0;
}

.category-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.category-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.category-count {
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 500;
}

.category-count .count-num {
    font-weight: 700;
}

.category-arrow {
    color: var(--text-muted);
    font-size: 1.2rem;
}

.category-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.category-detail-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* ========== Empty / Loading ========== */
.scroll-loader {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    gap: 12px;
    color: var(--text-muted);
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.scroll-end {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.load-more-wrapper {
    text-align: center;
    padding: 24px;
}

.btn-load-more {
    padding: 12px 32px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-load-more:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* ========== Back to Top ========== */
.back-to-top {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 48px;
    height: 48px;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    font-size: 1.2rem;
    box-shadow: var(--shadow-accent);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 800;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-2px);
}

/* ========== Footer ========== */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 48px 24px 24px;
    margin-top: 40px;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
}

.logo-footer .logo-text {
    font-size: 1.1rem;
}

.footer-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-top: 12px;
}

.footer-col h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.footer-col a {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.footer-col a:hover {
    color: var(--accent);
}

.footer-bottom {
    max-width: 1400px;
    margin: 40px auto 0;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.filing-link {
    color: var(--text-muted);
    text-decoration: none;
}

.filing-link:hover {
    color: var(--accent);
}

.update-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ========== Modal ========== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 24px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    background: var(--bg-tertiary);
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 1rem;
    z-index: 2;
}

.modal-close:hover {
    background: var(--accent);
    color: white;
}

.modal-header {
    padding: 40px 32px 20px;
    border-bottom: 1px solid var(--border);
}

.modal-header-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.modal-icon {
    width: 56px;
    height: 56px;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
}

.modal-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-meta {
    display: flex;
    gap: 16px;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.modal-body {
    padding: 24px 32px;
}

.modal-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
}

.modal-footer {
    padding: 20px 32px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ========== Warning Modal ========== */
.warning-modal {
    max-width: 420px;
    text-align: center;
    padding: 40px 32px;
}

.warning-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.warning-modal h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--warning);
    margin-bottom: 12px;
}

.warning-modal p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.warning-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
}

/* ========== Responsive ========== */
@media (max-width: 1024px) {
    .apps-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
    
    .news-container {
        grid-template-columns: 1fr;
    }
    
    .categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .main-nav {
        display: none;
    }

    .mobile-main-tabs {
        position: sticky;
        top: 64px;
        z-index: 900;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        max-width: 720px;
        margin: 0 auto;
        padding: 8px;
        background: color-mix(in srgb, var(--bg-primary) 88%, transparent);
        border: 1px solid var(--border-color);
        border-radius: 16px;
        backdrop-filter: blur(16px);
        box-shadow: var(--shadow-md);
    }

    .mobile-main-tabs .main-tab {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 7px;
        min-height: 44px;
        padding: 8px 12px;
        border: 0;
        border-radius: 11px;
        background: transparent;
        color: var(--text-secondary);
        font: inherit;
        font-size: 0.88rem;
        font-weight: 600;
        cursor: pointer;
    }

    .mobile-main-tabs .main-tab.active {
        color: #fff;
        background: linear-gradient(135deg, #B5EF00, #B5EF00);
        box-shadow: 0 6px 20px rgba(181, 239, 0, 0.24);
    }
}

@media (max-width: 768px) {
    .header-inner {
        padding: 0 16px;
        height: 64px;
    }
    
    .search-box {
        width: 160px;
        padding: 6px 12px;
    }
    
    .hero {
        padding: 120px 16px 60px;
        min-height: 320px;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 0.95rem;
    }
    
    .hero-stats {
        gap: 32px;
    }
    
    .stat-value {
        font-size: 2rem;
    }
    
    .section { padding: 36px 16px 60px; }
    
    .section-title {
        font-size: 1.4rem;
    }
    
    .section-header {
        flex-direction: column;
    }
    
    .apps-grid {
        grid-template-columns: 1fr;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
    }
    
    .app-card {
        padding: 16px;
    }
    
    .news-card {
        padding: 16px;
    }
    
    .news-card.featured {
        padding: 20px;
    }
    
    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 24px;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .btn-refresh {
        display: none;
    }
}

@media (max-width: 480px) {
    .search-box {
        display: none;
    }
    
    .hero {
        padding: 100px 16px 40px;
    }
    
    .hero-title {
        font-size: 1.8rem;
    }
    
    .hero-stats {
        gap: 20px;
    }
    
    .stat-value {
        font-size: 1.6rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
    
    .section { padding: 28px 12px 48px; }

    .mobile-main-tabs {
        margin: 0 10px;
        border-radius: 14px;
    }

    .mobile-main-tabs .main-tab {
        padding: 7px 5px;
        font-size: 0.78rem;
    }
    
    .filter-tabs {
        overflow-x: auto;
        scrollbar-width: none;
        flex-wrap: nowrap;
        width: 100%;
    }
    
    .filter-tabs::-webkit-scrollbar {
        display: none;
    }
    
    .filter-tab {
        flex-shrink: 0;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
    
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
    }
}

/* Side Floating Navigation */
.side-nav {
    display: flex;
    flex-direction: column;
    position: fixed;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 999;
    background: rgba(30, 35, 50, 0.9);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 40px;
    padding: 8px 6px;
    gap: 2px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.side-nav-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.5);
    transition: all 0.25s ease;
    cursor: pointer;
}

.side-nav-icon {
    font-size: 1.2rem;
    line-height: 1;
    transition: transform 0.25s ease;
}

.side-nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.side-nav-item.active {
    background: linear-gradient(135deg, #B5EF00, #B5EF00);
    color: #fff;
    box-shadow: 0 4px 16px rgba(181, 239, 0, 0.4);
}

.side-nav-item.active .side-nav-icon {
    transform: scale(1.1);
}

.side-nav-item:active {
    transform: scale(0.92);
}

.side-nav-tooltip {
    position: absolute;
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    background: rgba(30, 35, 50, 0.95);
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.side-nav-tooltip::after {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-left-color: rgba(30, 35, 50, 0.95);
}

.side-nav-item:hover .side-nav-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(-4px);
}

.side-nav-divider {
    width: 24px;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 4px auto;
}

/* Side nav visibility based on scroll */
.side-nav.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-50%) translateX(20px);
}

.side-nav {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .side-nav {
        right: 10px;
        padding: 6px 5px;
    }
    
    .side-nav-item {
        width: 36px;
        height: 36px;
    }
    
    .side-nav-icon {
        font-size: 1rem;
    }
    
    .side-nav-tooltip {
        display: none;
    }
}

/* funnybit v0.3: approved raster lockups, lime / charcoal / warm white.
   Legacy theme keys stay stable to preserve existing preferences. */
:root, [data-theme="blue"] {
    color-scheme: dark;
    --brand-lime: #B5C879;
    --brand-ink: #20211F;
    --accent: #B5C879;
    --accent-primary: var(--accent);
    --accent-hover: #C4D592;
    --accent-glow: rgba(181, 200, 121, 0.12);
    --on-accent: #20211F;
    --gradient-primary: #B5C879;
    --shadow-accent: none;
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 22px;
    --radius-xl: 28px;
}
[data-theme="silver"] {
    color-scheme: light;
    --accent: #395200;
    --accent-hover: #263900;
    --accent-primary: var(--accent);
    --on-accent: #F7F7F0;
    --accent-glow: rgba(57, 82, 0, 0.08);
    --gradient-primary: #B5C879;
    --shadow-accent: none;
}
[hidden] { display: none !important; }
body { font-family: ui-rounded, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; }
.header { background: var(--bg-primary); backdrop-filter: none; }
.header-inner { gap: 20px; height: 80px; }
.brand-lockup { display: block; width: 160px; flex: 0 0 160px; }
.brand-lockup img { display: none; width: 160px; height: auto; object-fit: contain; }
.brand-lockup .brand-zh.brand-dark { display: block; }
[data-theme="silver"] .brand-lockup .brand-dark { display: none; }
[data-theme="silver"] .brand-lockup .brand-zh.brand-light { display: block; }
html[lang="en"] .brand-lockup .brand-zh { display: none; }
html[lang="en"] .brand-lockup .brand-en.brand-dark { display: block; }
html[lang="en"][data-theme="silver"] .brand-lockup .brand-en.brand-dark { display: none; }
html[lang="en"][data-theme="silver"] .brand-lockup .brand-en.brand-light { display: block; }
.hero { min-height: 0; padding: 124px 24px 40px; background: var(--bg-primary); }
.hero-bg { display: none; }
.hero-title { font-size: clamp(1.9rem, 4vw, 3.4rem); font-weight: 800; letter-spacing: -.04em; color: var(--text-primary); background: none; -webkit-text-fill-color: currentColor; line-height: 1.25; }
.hero-subtitle { max-width: 650px; line-height: 1.8; }
.hero-stats { margin-top: 28px; gap: 36px; }
.stat-value { font-size: 1.65rem; }
body[data-view="news"] main, body[data-view="categories"] main { padding-top: 112px; }
.nav-link.active, .mobile-main-tabs .main-tab.active {
    background: var(--brand-lime); color: var(--brand-ink); box-shadow: none; font-weight: 700;
}
.app-card, .category-card, .news-item { background: var(--bg-card); box-shadow: none; }
.app-card:hover, .category-card:hover, .news-item:hover { border-color: var(--accent); box-shadow: none; }
.app-description { line-height: 1.7; }
.app-badge.official, .app-badge.new, .btn-action.primary, .btn-load-more, .back-to-top {
    background: var(--brand-lime); color: var(--brand-ink); box-shadow: none;
}
.interaction-btn.liked { color: var(--accent); border-color: var(--accent); background: var(--accent-glow); }
.filter-tab.active, .lang-btn.active, .featured-badge,
.modal-close:hover, .btn-load-more:hover, .interaction-btn:last-child { color: var(--on-accent); }
.btn-action.primary:hover { background: var(--brand-lime); color: var(--brand-ink); }
.interaction-btn { min-height: 44px; }
.interaction-btn .count { display: inline-block; min-width: 1.5em; font-variant-numeric: tabular-nums; }
.section-title { letter-spacing: -.025em; }
.news-featured { background: var(--bg-card); }
.modal { border: 1px solid var(--border-light); }
.footer { background: var(--bg-secondary); }
.logo-footer { margin-bottom: 20px; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
@media (max-width: 1050px) {
    .header-inner { gap: 12px; }
    .search-box { width: 190px; }
    .nav-link { padding: 10px 12px; }
}
@media (max-width: 768px) {
    .header-inner { height: auto; min-height: 80px; }
    .hero { padding-top: 160px; padding-bottom: 24px; }
    .mobile-main-tabs { background: var(--bg-primary); border-color: var(--border); }
    body[data-view="news"] main, body[data-view="categories"] main { padding-top: 20px; }
    body[data-view="news"] .mobile-main-tabs, body[data-view="categories"] .mobile-main-tabs { margin-top: 148px; }
    .section-header { gap: 16px; }
}
@media (max-width: 480px) {
    .brand-lockup, .brand-lockup img { width: 138px; }
    .brand-lockup { flex-basis: 138px; }
    .hero-title { font-size: 1.95rem; }
    .hero-stats { gap: 24px; }
    .stat-value { font-size: 1.35rem; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

@media (max-width: 1024px) {
    .mobile-main-tabs { top: 80px; background: var(--bg-primary); border-color: var(--border); }
    body[data-view="news"] .mobile-main-tabs, body[data-view="categories"] .mobile-main-tabs { margin-top: 96px; }
    body[data-view="news"] main, body[data-view="categories"] main { padding-top: 12px; }
}
@media (max-width: 768px) {
    .hero { padding-top: 116px; }
    .header-actions { gap: 8px; }
}


/* v0.3 layout: palette remains provisional until funnybit master logo is supplied. */
[hidden] { display: none !important; }
.header { border-bottom: 1px solid var(--border-light); }
.main-tab.active { color: var(--text-primary); background: var(--bg-tertiary); box-shadow: inset 0 -3px var(--accent); }
.hero { min-height: 0; padding: 52px 24px 32px; }
.hero-title { font-size: clamp(1.8rem, 4vw, 3rem); letter-spacing: -.04em; }
.hero-subtitle { max-width: 650px; margin: 16px auto 0; line-height: 1.8; }
.hero-stats { margin-top: 28px; gap: 36px; }
.stat-value { font-size: 1.5rem; }
body[data-view="news"] main, body[data-view="categories"] main { padding-top: 32px; }
.discovery-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; margin: 22px 0 12px; }
.discovery-tools label { display: flex; align-items: center; gap: 10px; color: var(--text-secondary); font-size: .85rem; }
.discovery-tools select { max-width: 210px; padding: 10px 30px 10px 12px; border: 1px solid var(--border-light); border-radius: var(--radius-sm); background: var(--bg-card); color: var(--text-primary); font: inherit; }
#catalogCount { margin-left: auto; font-size: .85rem; color: var(--text-secondary); }
.catalog-note { font-size: .8rem; color: var(--text-secondary); margin-bottom: 24px; line-height: 1.7; }
.app-card { display: flex; flex-direction: column; min-width: 0; }
.app-description { -webkit-line-clamp: 3; min-height: 4.8em; line-height: 1.6; }
.app-context { font-size: .8rem; line-height: 1.6; color: var(--text-secondary); margin: 0 0 16px; }
.app-card-footer { font-size: .72rem; color: var(--text-secondary); gap: 12px; margin-top: auto; }
.app-name-text { overflow-wrap: anywhere; }
.app-detail-btn { border: 0; background: none; text-align: left; padding: 0; color: inherit; font: inherit; cursor: pointer; }
.app-visit { margin-left: auto; }
.interaction-btn { min-height: 44px; }
.interaction-btn .count { display: inline-block; min-width: 1.8em; font-variant-numeric: tabular-nums; }
button:focus-visible, a:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.modal-body h3 { margin: 22px 0 8px; font-size: 1rem; }
.modal-body p { line-height: 1.8; color: var(--text-secondary); }
@media (max-width: 640px) {
    .hero { padding: 28px 20px 24px; }
    .hero-stats { gap: 24px; }
    .hero-title { font-size: 1.9rem; }
    .discovery-tools { gap: 12px; }
    .discovery-tools label { width: 100%; justify-content: space-between; }
    .discovery-tools select { flex: 1; }
    #catalogCount { margin-left: 0; }
    .section-header { align-items: flex-start; gap: 16px; }
    .filter-tabs { flex-wrap: wrap; }
}

.hero { padding-top: 124px; }
body[data-view="news"] main, body[data-view="categories"] main { padding-top: 112px; }
@media(max-width:1024px) { body[data-view="news"] main, body[data-view="categories"] main { padding-top: 12px; } }

/* Continue discovery after the last application. */
.app-end-content { display: inline-flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; }
.end-news-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 44px;
    padding: 11px 22px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: var(--brand-lime);
    color: var(--brand-ink);
    font-size: .85rem;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    white-space: nowrap;
    transition: background .2s ease;
}
.end-news-link:hover { background: #C4D592; }
.end-news-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
