/* ============================================
   APK Store - Modern Dark Theme Stylesheet
   Version: 2.0
   Features: Dark/Light theme, Glassmorphism, Animations
   ============================================ */

/* CSS Variables - Theme System */
:root {
    /* Primary Colors */
    --primary: #4361ee;
    --primary-light: #4895ef;
    --primary-dark: #3a0ca3;
    --secondary: #f72585;
    --accent: #4cc9f0;
    
    /* Light Theme (Default) */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-card: #ffffff;
    --bg-hover: #f0f4f8;
    --text-primary: #1a1a1a;
    --text-secondary: #4a4a4a;
    --text-muted: #8a8a8a;
    --border-color: #e0e0e0;
    
    /* Gradient Backgrounds */
    --gradient-primary: linear-gradient(135deg, #4361ee 0%, #4895ef 50%, #f72585 100%);
    --gradient-card: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    --gradient-button: linear-gradient(135deg, #4361ee 0%, #4895ef 100%);
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 6px 12px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.16);
    --shadow-glow: 0 0 25px rgba(67, 97, 238, 0.3);
    
    /* Spacing */
    --container-width: 1280px;
    --section-gap: 2.5rem;
    --card-gap: 1.25rem;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.4s ease;
    --transition-slow: 0.6s ease;

    /* Semantic Colors */
    --color-rating: #fbbf24;

    /* Avatar Gradients */
    --gradient-avatar-indigo: linear-gradient(135deg, #6366f1, #8b5cf6);
    --gradient-avatar-pink: linear-gradient(135deg, #ec4899, #f43f5e);
    --gradient-avatar-green: linear-gradient(135deg, #10b981, #34d399);
    --gradient-avatar-amber: linear-gradient(135deg, #f59e0b, #fbbf24);
    --gradient-avatar-cyan: linear-gradient(135deg, #06b6d4, #22d3ee);
}

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-fast);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Container */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */
.header {
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all var(--transition-normal);
}

.header > .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    box-shadow: var(--shadow-glow);
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Navigation */
.nav-main {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links {
    display: flex;
    gap: 0.5rem;
}

.nav-links a {
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.9375rem;
    color: var(--text-secondary);
    transition: all var(--transition-normal);
    cursor: pointer;
    display: inline-block;
    position: relative;
    overflow: hidden;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
    background: rgba(67, 97, 238, 0.1);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width var(--transition-normal);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

/* Search Bar */
.search-wrapper {
    position: relative;
    width: 320px;
}

.search-input {
    width: 100%;
    padding: 0.625rem 2.5rem 0.625rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: all var(--transition-fast);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

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

.search-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: var(--gradient-button);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: transform var(--transition-fast);
}

.search-btn:hover {
    transform: translateY(-50%) scale(1.05);
}

/* Theme Toggle & Mobile Menu */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 1001;
    position: relative;
}

.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.theme-toggle:hover {
    background: var(--bg-hover);
    color: var(--primary-light);
}

.mobile-menu-btn,
.mobile-search-btn {
    display: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: transparent;
    border: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 1.25rem;
    transition: color var(--transition-fast), background var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
}

.mobile-menu-btn:hover,
.mobile-search-btn:hover {
    color: var(--primary);
    background: rgba(67, 97, 238, 0.08);
}

.mobile-menu-btn:active,
.mobile-search-btn:active {
    background: rgba(67, 97, 238, 0.15);
}

.mobile-search {
    display: none;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
}

.mobile-search .search-wrapper {
    display: flex;
    width: 100%;
}

.mobile-search .search-input {
    flex: 1;
}

.mobile-menu {
    display: block;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

.mobile-menu.hidden {
    display: none;
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0;
}

.mobile-nav-links a {
    padding: 0.875rem 1rem 0.875rem 2.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: background var(--transition-fast), color var(--transition-fast);
    font-size: 0.9375rem;
    display: flex;
    align-items: center;
    position: relative;
    border-bottom: 1px solid var(--border-color);
}

.mobile-nav-links a:last-child {
    border-bottom: none;
}

/* Left icon */
.mobile-nav-links a .menu-icon {
    position: absolute;
    left: 1rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    width: 1.125rem;
    text-align: center;
}

/* Right chevron */
.mobile-nav-links a::after {
    content: '\f054';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.625rem;
    color: var(--text-muted);
    margin-left: auto;
    transition: transform var(--transition-fast), color var(--transition-fast);
}

.mobile-nav-links a:hover,
.mobile-nav-links a.active {
    color: var(--primary);
    background: rgba(67, 97, 238, 0.06);
}

.mobile-nav-links a.active .menu-icon,
.mobile-nav-links a:hover .menu-icon {
    color: var(--primary);
}

.mobile-nav-links a:hover::after,
.mobile-nav-links a.active::after {
    transform: translateX(3px);
    color: var(--primary);
}

/* ============================================
   MAIN LAYOUT
   ============================================ */
.main-wrapper {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
    padding-top: 1rem;
    padding-bottom: 3rem;
}

.main-content {
    min-width: 0;
}

.sidebar {
    position: sticky;
    top: 90px;
    height: fit-content;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    background: var(--gradient-card);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    margin-bottom: var(--section-gap);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 500px;
    height: 500px;
    background: var(--gradient-primary);
    opacity: 0.1;
    border-radius: 50%;
    filter: blur(60px);
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 2.75rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 600px;
    line-height: 1.6;
}

.hero-stats {
    display: flex;
    gap: 2rem;
}

.hero-stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hero-stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-light);
}

.hero-stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ============================================
   SECTION STYLES
   ============================================ */
.section {
    margin-bottom: var(--section-gap);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
}

.section-icon {
    width: 36px;
    height: 36px;
    background: var(--gradient-primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    color: white;
}

.view-all {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--primary-light);
    transition: gap var(--transition-fast);
}

.view-all:hover {
    gap: 0.5rem;
}

/* ============================================
   APP CARDS GRID
   ============================================ */
.app-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--card-gap);
}

.app-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all var(--transition-normal);
    cursor: pointer;
    display: flex;
    padding: 1rem;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
}

.app-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
    background: var(--gradient-card);
}

.app-card-icon {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: var(--bg-secondary);
}

.app-card-content {
    padding: 0;
    flex: 1;
    min-width: 0;
}

.app-card-name {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-card-category {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.app-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.app-card-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-rating);
}

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

/* ============================================
   TRENDING LIST
   ============================================ */
.trending-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.trending-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.trending-item:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
}

.trending-rank {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-muted);
}

.trending-rank.top {
    background: var(--gradient-primary);
    color: white;
}

.trending-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: var(--bg-primary);
}

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

.trending-name {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.trending-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.trending-btn {
    padding: 0.5rem 1rem;
    background: var(--gradient-button);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.trending-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-glow);
}

/* ============================================
   CATEGORY TAGS
   ============================================ */
.category-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    margin-bottom: var(--section-gap);
}

.category-tag {
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.category-tag:hover,
.category-tag.active {
    background: var(--gradient-button);
    border-color: transparent;
    color: white;
}

/* ============================================
   SIDEBAR WIDGETS
   ============================================ */
.sidebar-widget {
    background: var(--gradient-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.sidebar-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-normal);
    color: inherit;
    text-decoration: none;
}

.sidebar-item:hover {
    background: var(--bg-hover);
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
}

.sidebar-item-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: var(--bg-secondary);
}

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

.sidebar-item-name {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.sidebar-item-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================
   BREADCRUMBS
   ============================================ */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.breadcrumbs a {
    color: var(--text-muted);
}

.breadcrumbs a:hover {
    color: var(--primary-light);
}

.breadcrumbs .current {
    color: var(--text-primary);
    font-weight: 500;
}

.breadcrumbs-separator {
    color: var(--text-muted);
}

/* ============================================
   APP DETAIL PAGE
   ============================================ */
.app-detail-hero {
    background: var(--gradient-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    margin-bottom: var(--section-gap);
}

.app-detail-header {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.app-detail-icon {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-lg);
    object-fit: cover;
    background: var(--bg-secondary);
    box-shadow: var(--shadow-lg);
}

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

.app-detail-name {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.app-detail-developer {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.app-detail-stats {
    display: flex;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    align-items: center;
}

.mobile-share-btn {
    display: none;
}

.app-detail-stat {
    display: flex;
    flex-direction: column;
}

.app-detail-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-light);
}

.app-detail-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.app-detail-actions {
    display: flex;
    gap: 1rem;
}

.btn-primary {
    padding: 0.875rem 2rem;
    background: var(--gradient-button);
    border: none;
    border-radius: var(--radius-lg);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-glow);
    scale: 1.02;
}

.btn-secondary {
    padding: 0.875rem 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

/* App Info Grid */
.app-info-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    padding-top: 0;
}

.app-info-grid {
    background: var(--gradient-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    margin-top: 1rem;
}

.app-info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.app-info-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

.app-info-value {
    font-size: 0.9375rem;
    font-weight: 600;
    word-break: break-all;
}

/* Screenshots */
.screenshots {
    margin-bottom: var(--section-gap);
}

.screenshots-grid {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) var(--bg-secondary);
}

.screenshots-grid::-webkit-scrollbar {
    height: 6px;
}

.screenshots-grid::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
}

.screenshots-grid::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.screenshots-grid::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.screenshot-item {
    flex: 0 0 160px;
    aspect-ratio: 9/16;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-secondary);
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.screenshot-item:hover {
    transform: scale(1.02);
}

.screenshot-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Screenshot Lightbox */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform var(--transition-normal);
}

.lightbox-overlay.active .lightbox-content img {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: -10px;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 1.25rem;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-fast);
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 1.25rem;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-fast);
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.3);
}

.lightbox-prev {
    left: -60px;
}

.lightbox-next {
    right: -60px;
}

.lightbox-counter {
    position: absolute;
    bottom: -36px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
}

@media (max-width: 768px) {
    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .lightbox-close {
        top: -44px;
        right: 0;
    }

    .lightbox-nav {
        width: 38px;
        height: 38px;
    }
}

/* Description */
.description {
    background: var(--gradient-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    margin-bottom: var(--section-gap);
}

.description h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
}

.description-content {
    color: var(--text-secondary);
    line-height: 1.8;
    overflow-wrap: break-word;
    word-break: break-word;
}

.description-content h2 {
    border-bottom: none;
    padding-bottom: 0;
    display: block;
}

.description-content p {
    margin-bottom: 1rem;
}

/* FAQ Section */
.faq-section {
    margin-bottom: var(--section-gap);
}

.faq-item {
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.faq-question {
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-weight: 600;
    transition: background var(--transition-fast);
}

.faq-question h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    flex: 1;
    min-width: 0;
    overflow-wrap: break-word;
    word-break: break-word;
}

.faq-question:hover {
    background: var(--bg-hover);
}

.faq-answer {
    padding: 0 1.25rem 1rem;
    color: var(--text-secondary);
    display: none;
}

.faq-item.active .faq-answer {
    display: block;
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
}

/* Comments */
.comments-section {
    background: var(--gradient-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    margin-bottom: var(--section-gap);
}

.comment-form {
    margin-bottom: 1.5rem;
}

.comment-textarea {
    width: 100%;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9375rem;
    resize: vertical;
    min-height: 100px;
    margin-bottom: 1rem;
}

.comment-textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.comment-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
}

.comment-content {
    flex: 1;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.comment-author {
    font-weight: 600;
}

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

.comment-text {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

/* ============================================
   SEARCH PAGE
   ============================================ */
.search-header {
    margin-bottom: var(--section-gap);
}

.search-term {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.search-count {
    color: var(--text-muted);
}

.search-filters {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.search-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.search-item {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.25rem;
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.search-item:hover {
    border-color: var(--primary);
    transform: translateX(4px);
}

.search-item-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-md);
    object-fit: cover;
    background: var(--bg-secondary);
}

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

.search-item-name {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.search-item-category {
    font-size: 0.875rem;
    color: var(--primary-light);
    margin-bottom: 0.5rem;
}

.search-item-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.search-item-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

.search-item-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--color-rating);
    font-weight: 600;
}

.search-item-size {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* No Results */
.no-results {
    text-align: center;
    padding: 4rem 2rem;
}

.no-results-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.no-results-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.no-results-text {
    color: var(--text-muted);
}

/* ============================================
   AUTHOR PAGE
   ============================================ */
.author-header {
    background: var(--gradient-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 2rem;
    margin-bottom: var(--section-gap);
    text-align: center;
}

.author-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    margin: 0 auto 1rem;
    box-shadow: var(--shadow-glow);
}

.author-name {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    overflow-wrap: break-word;
    word-break: break-word;
}

.author-bio {
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 1.5rem;
    overflow-wrap: break-word;
    word-break: break-word;
}

.author-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
}

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

.author-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-light);
}

.author-stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
    padding: 0.75rem;
    flex-wrap: wrap;
}

.pagination .text-muted {
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 40px;
    user-select: none;
}

.page-btn {
    min-width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.875rem;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
    font-family: inherit;
    line-height: 1;
}

.page-btn:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #111827;
}

.page-btn.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #ffffff;
    font-weight: 600;
}

.page-btn.active:hover {
    background: #2563eb;
    border-color: #2563eb;
}

.page-btn[disabled],
.page-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

/* ============================================
   LOAD MORE
   ============================================ */
.load-more-wrap {
    text-align: center;
    margin-top: 2rem;
}

.btn-load-more {
    display: inline-block;
    padding: 0.75rem 2.5rem;
    background: var(--gradient-button);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-load-more:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-load-more:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 3rem 0 1.5rem;
    margin-top: 3rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-brand {
    max-width: 300px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.footer-desc {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.7;
    overflow-wrap: break-word;
    word-break: break-word;
}

.footer-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-links a {
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--primary-light);
}

.footer-bottom {
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-copyright {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.footer-social {
    display: flex;
    gap: 1rem;
}

.footer-social a {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.footer-social a:hover {
    background: var(--primary);
    color: white;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.hidden { display: none; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-center { text-align: center; }
.text-primary-light { color: var(--primary-light); }
.font-medium { font-weight: 500; }
.flex-1 { flex: 1; }

/* Footer modifier */
.footer-bottom--centered { text-align: center; }

/* Hero modifiers */
.hero--compact { padding: 1.5rem 2rem; }
.hero-title--sm { font-size: 2rem; }

/* Rating star */
.rating-star {
    color: var(--color-rating);
}

.rating-star--inline {
    color: var(--color-rating);
    font-size: 1rem;
    font-weight: 600;
}

/* List utility */
.list-indented {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

/* Category tags modifier */
.category-tags--flush { margin-bottom: 0; }

/* Sidebar item modifier */
.sidebar-item--compact { padding: 0.5rem 0.625rem; }

/* Pagination ellipsis */
.page-ellipsis { color: var(--text-muted); }

/* Button modifier */
.btn-secondary--full {
    width: 100%;
    justify-content: center;
}

/* ============================================
   LEGAL PAGE (Privacy / DMCA)
   ============================================ */
.legal-content {
    max-width: 800px;
}

.legal-content h1 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

.legal-content h2 {
    font-size: 1.25rem;
    margin: 1.5rem 0 1rem;
}

.legal-content h3 {
    font-size: 1rem;
    margin: 1rem 0 0.5rem;
    color: var(--primary-light);
}

.legal-content p + ul,
.legal-content ul {
    margin: 0.5rem 0 1rem 1.5rem;
    color: var(--text-secondary);
}

.legal-content .contact-box {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: var(--radius-md);
    margin: 1rem 0;
}

.legal-content .last-updated {
    margin-top: 2rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ============================================
   DEVELOPER SIDEBAR WIDGET
   ============================================ */
.developer-widget {
    text-align: center;
    padding: 1rem 0;
}

.developer-widget-avatar {
    width: 80px;
    height: 80px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 2rem;
    color: white;
}

.developer-widget h4 {
    margin-bottom: 0.5rem;
}

.developer-widget-location {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================
   INFO LIST (Author sidebar)
   ============================================ */
.info-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.info-list-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
}

/* ============================================
   USER AVATAR (colored icon squares)
   ============================================ */
.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
}

.user-avatar--indigo { background: var(--gradient-avatar-indigo); }
.user-avatar--pink { background: var(--gradient-avatar-pink); }
.user-avatar--green { background: var(--gradient-avatar-green); }
.user-avatar--amber { background: var(--gradient-avatar-amber); }
.user-avatar--cyan { background: var(--gradient-avatar-cyan); }

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* --- Tablet: ≤1024px --- */
@media (max-width: 1024px) {
    .main-wrapper {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .sidebar-widget {
        margin-bottom: 0;
    }

    .app-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .app-info-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* --- Mobile: ≤768px --- */
@media (max-width: 768px) {
    :root {
        --section-gap: 1.5rem;
        --card-gap: 0.625rem;
    }

    .container {
        padding: 0 0.75rem;
    }

    /* ── Header ── */
    .header > .container {
        height: 52px;
    }

    .nav-main,
    .nav-links,
    .search-wrapper {
        display: none;
    }

    .header-actions {
        display: flex;
        gap: 0.375rem;
    }

    .mobile-search-btn,
    .mobile-menu-btn {
        display: flex;
        font-size: 1.25rem;
    }

    .mobile-search {
        display: none;
    }

    .mobile-search.active {
        display: block;
    }

    .logo {
        gap: 0.5rem;
    }

    .logo-icon {
        width: 32px;
        height: 32px;
        font-size: 1rem;
        border-radius: 10px;
    }

    .logo-text {
        font-size: 1.125rem;
    }

    /* ── Main Layout ── */
    .main-wrapper {
        gap: 1.5rem;
        padding-top: 0.625rem;
        padding-bottom: 2rem;
        overflow-x: hidden;
    }

    .main-content {
        margin-top: 10px;
        max-width: 100%;
    }

    /* ── Hero ── */
    .hero {
        padding: 1.25rem 1rem;
        margin-bottom: 1rem;
        border-radius: var(--radius-md);
        max-width: 100%;
    }

    .hero::before {
        display: none;
    }

    .hero--compact {
        padding: 1rem 0.75rem;
    }

    .hero-title {
        font-size: 1.25rem;
        margin-bottom: 0.375rem;
    }

    .hero-subtitle {
        font-size: 0.8125rem;
        margin-bottom: 0.75rem;
        line-height: 1.5;
        max-width: 100%;
        overflow-wrap: break-word;
    }

    .hero-stats {
        gap: 1.5rem;
        flex-wrap: wrap;
    }

    .hero-stat-number {
        font-size: 1.0625rem;
    }

    .hero-stat-label {
        font-size: 0.6875rem;
    }

    /* ── Section headers ── */
    .section-header {
        margin-bottom: 0.75rem;
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .section-title {
        font-size: 1rem;
        gap: 0.5rem;
    }

    .section-icon {
        width: 28px;
        height: 28px;
        font-size: 0.875rem;
    }

    .view-all {
        font-size: 0.8125rem;
    }

    /* ── App Grid → 3 列纵向卡片（类似 Google Play / APKPure H5 风格） ── */
    .app-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.625rem;
    }

    .app-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 0.625rem 0.5rem;
        gap: 0.5rem;
        border-radius: var(--radius-md);
        box-shadow: none;
        border: 1px solid var(--border-color);
    }

    .app-card:hover {
        transform: none;
        box-shadow: var(--shadow-sm);
    }

    .app-card-icon {
        width: 54px;
        height: 54px;
        border-radius: var(--radius-md);
    }

    .app-card-content {
        padding: 0;
        width: 100%;
    }

    .app-card-name {
        font-size: 0.75rem;
        margin-bottom: 0.125rem;
        line-height: 1.3;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        white-space: normal;
    }

    .app-card-category {
        display: none;
    }

    .app-card-meta {
        justify-content: center;
        gap: 0.25rem;
    }

    .app-card-rating {
        font-size: 0.6875rem;
    }

    .app-card-size {
        font-size: 0.625rem;
    }

    /* ── Category tags → 平铺换行 ── */
    .category-tags {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-bottom: 1rem;
    }

    .category-tag {
        padding: 0.375rem 0.875rem;
        font-size: 0.8125rem;
    }

    /* ── Sidebar → 保持原列表样式，紧凑间距 ── */
    .sidebar {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        min-width: 0;
    }

    .sidebar-widget {
        padding: 0.875rem;
        margin-bottom: 0;
    }

    .sidebar-title {
        font-size: 0.9375rem;
        margin-bottom: 0.625rem;
    }

    .sidebar-list {
        gap: 0.375rem;
    }

    .sidebar-item {
        padding: 0.5rem;
        gap: 0.625rem;
    }

    .sidebar-item:hover {
        transform: none;
    }

    .sidebar-item-icon {
        width: 36px;
        height: 36px;
    }

    .sidebar-item-name {
        font-size: 0.8125rem;
    }

    .sidebar-item-meta {
        font-size: 0.6875rem;
    }

    /* ── Detail page ── */
    .app-detail-hero {
        padding: 1rem;
        border-radius: var(--radius-md);
    }

    .app-detail-header {
        flex-direction: row;
        align-items: flex-start;
        gap: 0.875rem;
        margin-bottom: 0;
    }

    .app-detail-icon {
        width: 76px;
        height: 76px;
        border-radius: var(--radius-md);
        box-shadow: var(--shadow-sm);
    }

    .app-detail-name {
        font-size: 1.25rem;
        margin-bottom: 0.125rem;
    }

    .app-detail-developer {
        font-size: 0.8125rem;
        margin-bottom: 0.5rem;
    }

    .app-detail-stats {
        gap: 0.375rem;
        margin-bottom: 0.875rem;
        flex-wrap: nowrap;
        align-items: center;
    }

    .app-detail-stat {
        min-width: 0;
        flex-shrink: 1;
        align-items: center;
    }

    .app-detail-stat-value {
        font-size: 0.8125rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .app-detail-stat-label {
        font-size: 0.5625rem;
        white-space: nowrap;
    }

    .app-detail-actions {
        flex-direction: row;
        gap: 0.5rem;
    }

    .app-detail-actions .btn-primary {
        flex: 1;
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
        justify-content: center;
    }

    .desktop-share-btn {
        display: none;
    }

    .mobile-share-btn {
        display: inline-flex;
        align-items: center;
        gap: 0.25rem;
        padding: 0.25rem 0.5rem;
        font-size: 0.6875rem;
        margin-left: auto;
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* App Info Grid */
    .app-info-grid {
        grid-template-columns: repeat(2, 1fr);
        padding: 0.875rem;
        gap: 0.75rem;
    }

    .app-info-label {
        font-size: 0.625rem;
    }

    .app-info-value {
        font-size: 0.8125rem;
        word-break: break-all;
    }

    /* Screenshots */
    .screenshot-item {
        flex: 0 0 120px;
    }

    /* Description */
    .description {
        padding: 1rem;
        border-radius: var(--radius-md);
    }

    .description h2 {
        font-size: 1rem;
        margin-bottom: 0.625rem;
        padding-bottom: 0.5rem;
    }

    .description-content {
        font-size: 0.8125rem;
        line-height: 1.7;
    }

    /* FAQ */
    .faq-question {
        padding: 0.75rem 0.875rem;
    }

    .faq-question h3 {
        font-size: 0.8125rem;
    }

    .faq-answer {
        padding: 0 0.875rem 0.75rem;
        font-size: 0.8125rem;
    }

    /* Comments */
    .comments-section {
        padding: 1rem;
        border-radius: var(--radius-md);
    }

    .comment-form .btn-primary {
        width: 100%;
        justify-content: center;
    }

    .comment-textarea {
        min-height: 72px;
        font-size: 0.8125rem;
        padding: 0.75rem;
    }

    .comment-item {
        gap: 0.625rem;
        padding: 0.625rem 0;
    }

    .comment-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.6875rem;
    }

    .comment-author {
        font-size: 0.8125rem;
    }

    .comment-text {
        font-size: 0.8125rem;
        line-height: 1.5;
    }

    /* Search results */
    .search-header {
        margin-bottom: 1rem;
    }

    .search-term {
        font-size: 1.125rem;
        overflow-wrap: break-word;
        word-break: break-word;
    }

    .search-item {
        padding: 0.75rem;
        gap: 0.625rem;
    }

    .search-item-icon {
        width: 48px;
        height: 48px;
    }

    .search-item-name {
        font-size: 0.875rem;
    }

    .search-item-category {
        font-size: 0.6875rem;
        margin-bottom: 0.125rem;
    }

    .search-item-desc {
        font-size: 0.75rem;
        -webkit-line-clamp: 1;
    }

    .search-item-meta {
        flex-direction: column;
        align-items: flex-end;
        gap: 0.125rem;
        flex-shrink: 0;
    }

    .search-item-rating {
        font-size: 0.8125rem;
    }

    .search-item-size {
        font-size: 0.6875rem;
    }

    /* Search filters */
    .search-filters {
        overflow-x: auto;
        scrollbar-width: none;
        flex-wrap: nowrap;
        padding-bottom: 0.25rem;
    }

    .search-filters::-webkit-scrollbar {
        display: none;
    }

    /* No results - mobile */
    .no-results {
        padding: 2rem 1rem;
    }

    .no-results-icon {
        font-size: 2.5rem;
    }

    .no-results-title {
        font-size: 1.25rem;
    }

    /* Pagination - mobile: match image2.png style */
    .pagination {
        padding: 0.5rem 0;
        gap: 0.5rem;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        justify-content: center;
    }

    .pagination::-webkit-scrollbar {
        display: none;
    }

    .page-btn {
        min-width: 38px;
        height: 38px;
        padding: 0 0.75rem;
        font-size: 0.8125rem;
        border-radius: 8px;
        flex-shrink: 0;
    }

    .page-btn.page-extra {
        display: none;
    }

    /* Author page */
    .author-header {
        padding: 1.25rem 1rem;
    }

    .author-avatar {
        width: 64px;
        height: 64px;
        font-size: 1.75rem;
        margin-bottom: 0.75rem;
    }

    .author-name {
        font-size: 1.25rem;
        margin-bottom: 0.375rem;
    }

    .author-bio {
        font-size: 0.8125rem;
        margin-bottom: 1rem;
        max-width: 100%;
    }

    .author-stats {
        gap: 1.5rem;
        flex-wrap: wrap;
    }

    .author-stat-value {
        font-size: 1.25rem;
    }

    .author-stat-label {
        font-size: 0.75rem;
    }

    /* Footer */
    .footer {
        padding: 1.5rem 0 1rem;
        margin-top: 2rem;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1.25rem;
    }

    .footer-brand {
        grid-column: 1 / -1;
        max-width: none;
    }

    .footer-desc {
        font-size: 0.8125rem;
        line-height: 1.6;
    }

    .footer-title {
        font-size: 0.875rem;
        margin-bottom: 0.625rem;
    }

    .footer-links {
        gap: 0.5rem;
    }

    .footer-links a {
        font-size: 0.8125rem;
    }

    .footer-bottom {
        padding-top: 1rem;
    }

    .footer-copyright {
        font-size: 0.75rem;
    }

    .footer-social {
        justify-content: center;
    }

    /* Breadcrumbs */
    .breadcrumbs {
        font-size: 0.75rem;
        margin-bottom: 0.75rem;
        gap: 0.25rem;
        flex-wrap: nowrap;
    }

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

    .breadcrumbs a,
    .breadcrumbs .breadcrumbs-separator {
        flex-shrink: 0;
    }

    /* Legal pages */
    .legal-content h1 {
        font-size: 1.375rem;
    }

    .legal-content h2 {
        font-size: 1.0625rem;
    }

    .legal-content p,
    .legal-content li {
        font-size: 0.8125rem;
    }

    .legal-content p + ul,
    .legal-content ul {
        margin-left: 1rem;
    }

    /* Trending */
    .trending-item {
        padding: 0.625rem;
    }

    .trending-btn {
        display: none;
    }

    .trending-icon {
        width: 40px;
        height: 40px;
    }

    .trending-name {
        font-size: 0.8125rem;
    }

    /* Developer widget */
    .developer-widget-avatar {
        width: 56px;
        height: 56px;
        font-size: 1.375rem;
    }

    /* Mobile nav touch */
    .mobile-nav-links a {
        min-height: 44px;
        padding: 0.75rem 1rem 0.75rem 2.5rem;
        font-size: 0.875rem;
    }
}

/* --- Small phone: ≤420px --- */
@media (max-width: 420px) {
    .container {
        padding: 0 0.625rem;
    }

    /* Header */
    .header > .container {
        height: 48px;
    }

    .logo-icon {
        width: 28px;
        height: 28px;
        font-size: 0.875rem;
        border-radius: 8px;
    }

    .logo-text {
        font-size: 1rem;
    }

    .mobile-search-btn,
    .mobile-menu-btn {
        font-size: 1.125rem;
    }

    /* Hero */
    .hero {
        padding: 1rem 0.75rem;
    }

    .hero-title {
        font-size: 1.125rem;
    }

    .hero-subtitle {
        font-size: 0.75rem;
    }

    .hero-stats {
        gap: 1rem;
    }

    .hero-stat-number {
        font-size: 1rem;
    }

    /* App Grid: 保持 3 列但更紧凑 */
    .app-grid {
        gap: 0.5rem;
    }

    .app-card {
        padding: 0.5rem 0.375rem;
        gap: 0.375rem;
    }

    .app-card-icon {
        width: 48px;
        height: 48px;
    }

    .app-card-name {
        font-size: 0.6875rem;
    }

    .app-card-rating {
        font-size: 0.625rem;
    }

    .app-card-size {
        font-size: 0.5625rem;
    }

    /* Category tags */
    .category-tag {
        padding: 0.3125rem 0.625rem;
        font-size: 0.75rem;
    }

    /* Detail page */
    .app-detail-hero {
        padding: 0.75rem;
    }

    .app-detail-icon {
        width: 64px;
        height: 64px;
    }

    .app-detail-name {
        font-size: 1.125rem;
    }

    .app-detail-developer {
        font-size: 0.75rem;
    }

    .app-detail-stat-value {
        font-size: 0.875rem;
    }

    .app-detail-actions {
        flex-direction: column;
    }

    .app-detail-actions .btn-primary,
    .app-detail-actions .btn-secondary {
        width: 100%;
        justify-content: center;
    }

    /* Screenshots */
    .screenshot-item {
        flex: 0 0 100px;
    }

    /* Search */
    .search-item-desc {
        display: none;
    }

    /* Pagination */
    .pagination {
        gap: 0.375rem;
        padding: 0.375rem 0;
    }

    .page-btn {
        min-width: 36px;
        height: 36px;
        padding: 0 0.75rem;
        font-size: 0.8125rem;
        border-radius: 8px;
    }

    /* No results */
    .no-results {
        padding: 1.5rem 0.75rem;
    }

    .no-results-icon {
        font-size: 2rem;
        margin-bottom: 0.75rem;
    }

    .no-results-title {
        font-size: 1.125rem;
    }

    /* Author */
    .author-avatar {
        width: 56px;
        height: 56px;
        font-size: 1.5rem;
    }

    .author-name {
        font-size: 1.125rem;
    }

    .author-stats {
        gap: 1.25rem;
    }

    .author-stat-value {
        font-size: 1.125rem;
    }

    /* Footer - keep 2 columns for categories & legal on small screens */
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    /* Sidebar */
    .sidebar-item-icon {
        width: 48px;
        height: 48px;
    }

    .sidebar-item-name {
        font-size: 0.75rem;
    }

    /* Section header */
    .section-title {
        font-size: 0.9375rem;
    }

    .section-icon {
        width: 26px;
        height: 26px;
        font-size: 0.8125rem;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease forwards;
}

.animate-slide-in {
    animation: slideIn 0.5s ease forwards;
}

/* Loading Skeleton */
.skeleton {
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-hover) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Selection */
::selection {
    background: var(--primary);
    color: white;
}

/* ============================================
   MOBILE FINE-TUNING
   ============================================ */

/* Disable hover transforms on touch devices for better UX */
@media (hover: none) {
    .app-card:hover {
        transform: none;
    }

    .sidebar-item:hover {
        transform: none;
    }

    .nav-links a:hover {
        transform: none;
    }

    .btn-primary:hover {
        transform: none;
        scale: 1;
    }
}

/* Utility Classes (used by download.js) */
.opacity-0 { opacity: 0; }
.opacity-75 { opacity: 0.75; }
.pointer-events-none { pointer-events: none; }

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    transition: opacity 0.3s ease;
    max-width: calc(100vw - 2rem);
    text-align: center;
}
