@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

body { visibility: hidden; min-height: 100vh; }
body.ready { visibility: visible; }

:root {
    /* Warm-tinted zinc palette — more character than pure gray */
    --color-text: #18181b;
    --color-text-secondary: #52525b;
    --color-blue: #2563eb;
    --color-purple: #7c3aed;
    --color-green: #059669;
    --color-orange: #d97706;
    --color-pink: #db2777;
    --color-cyan: #0891b2;
    --color-indigo: #4f46e5;
    --color-red: #dc2626;
    --color-border: rgba(0, 0, 0, 0.05);
    --color-border-strong: rgba(0, 0, 0, 0.10);
    --color-border-accent: rgba(37, 99, 235, 0.2);
    --color-muted: #a1a1aa;
    --color-bg: #fafaf9;
    --color-surface: #ffffff;
    --color-surface-dim: #f4f4f5;
    --color-hover: rgba(0, 0, 0, 0.025);
    --color-active: rgba(0, 0, 0, 0.05);

    /* Spacing scale — 4px base, consistent rhythm */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;
    --space-20: 80px;

    /* Radius */
    --radius: 10px;
    --radius-lg: 14px;
    --radius-sm: 6px;
    --radius-full: 9999px;

    /* Layered shadows — ambient + directional for natural depth */
    --shadow-xs: 0 1px 1px rgba(0, 0, 0, 0.03);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 4px 6px -2px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.04), 0 0 0 1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 12px 16px -4px rgba(0, 0, 0, 0.06), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 24px 32px -8px rgba(0, 0, 0, 0.08), 0 8px 16px -4px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    --shadow-glow-warm: 0 0 0 3px rgba(124, 58, 237, 0.1);

    /* Motion */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --duration-fast: 120ms;
    --duration-normal: 200ms;
    --duration-slow: 400ms;
}

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

html {
    scroll-behavior: smooth;
    text-size-adjust: 100%;
    overflow-y: scroll;
    overflow-x: hidden;
}

body {
    font-family: 'Sora', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
    background: var(--color-bg);
    color: var(--color-text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.5;
    letter-spacing: -0.005em;
}

::selection {
    background: rgba(37, 99, 235, 0.1);
    color: var(--color-text);
}

:focus-visible {
    outline: 2px solid var(--color-blue);
    outline-offset: 2px;
    border-radius: 4px;
}

@keyframes pageEnter {
    from { opacity: 0; }
    to { opacity: 1; }
}

.page-section.active {
    display: block;
    animation: pageEnter 0.2s ease;
}

#page-user-center.active {
    animation: none;
}

/* Subtle background tint — warmer, more atmospheric */
.bg-gradient {
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(ellipse at 0% 0%, rgba(37, 99, 235, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 100% 0%, rgba(124, 58, 237, 0.025) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 100%, rgba(8, 145, 178, 0.02) 0%, transparent 60%);
    pointer-events: none;
}

/* Navigation */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: 52px;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(20px) saturate(200%) brightness(1.02);
    -webkit-backdrop-filter: blur(20px) saturate(200%) brightness(1.02);
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 var(--space-8);
}

.nav-container {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 1400px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 48px;
    cursor: pointer;
    text-decoration: none;
}

.nav-logo-text {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: -0.02em;
    color: var(--color-text);
    min-width: 100px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: color var(--duration-fast) ease, background var(--duration-fast) ease;
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: -0.005em;
}

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

.nav-link.active {
    color: var(--color-text);
    font-weight: 600;
}

.nav-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    visibility: hidden;
}

.btn-login {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    background: var(--color-text);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--duration-fast) ease, transform var(--duration-fast) var(--ease-spring), box-shadow var(--duration-fast) ease;
    letter-spacing: -0.005em;
}

.btn-login:hover {
    background: #27272a;
    box-shadow: var(--shadow-sm);
}

.btn-login:active {
    background: var(--color-text);
    transform: scale(0.97);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.06);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.user-avatar.has-image {
    background-color: transparent;
}

.user-avatar.has-image svg {
    display: none;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
}

.btn-dev-center {
    padding: 6px 12px;
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 11px;
    font-weight: 600;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color var(--duration-normal) ease, box-shadow var(--duration-normal) ease, background var(--duration-normal) ease;
    display: flex;
    align-items: center;
    gap: 5px;
    letter-spacing: 0;
}

.btn-dev-center:hover {
    border-color: rgba(0, 0, 0, 0.2);
    box-shadow: var(--shadow-xs);
    background: var(--color-bg);
}

.btn-logout {
    padding: 6px 12px;
    background: transparent;
    color: var(--color-text-secondary);
    font-size: 11px;
    font-weight: 600;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color var(--duration-normal) ease, color var(--duration-normal) ease, background var(--duration-normal) ease;
    display: flex;
    align-items: center;
    gap: 5px;
    letter-spacing: 0;
}

.btn-logout:hover {
    border-color: rgba(220, 38, 38, 0.3);
    color: #dc2626;
    background: rgba(220, 38, 38, 0.05);
}

/* Mobile menu toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
    margin-left: auto;
}

.mobile-menu-toggle span {
    width: 22px;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    transition: all var(--duration-normal) ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.mobile-menu-toggle.open span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.open span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.open span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Sidebar collapse toggle for mobile */
.sidebar-collapse-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    background: var(--color-bg);
    color: var(--color-muted);
    cursor: pointer;
    transition: background var(--duration-normal) ease;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--color-border);
    margin-bottom: 12px;
    width: 100%;
}

.sidebar-collapse-toggle:hover {
    background: var(--color-hover);
}

.sidebar-collapse-toggle svg {
    transition: transform var(--duration-normal) ease;
}

.sidebar-collapse-toggle.collapsed svg {
    transform: rotate(180deg);
}

/* Mobile menu overlay */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 52px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 99;
    opacity: 0;
    transition: opacity var(--duration-normal) ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
}

.mobile-menu-overlay.show {
    display: block;
    opacity: 1;
}

/* Mobile menu */
.mobile-menu {
    display: none;
    position: fixed;
    top: 52px;
    left: 0;
    right: 0;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    max-height: calc(100vh - 56px);
    overflow-y: auto;
    transform: translateY(-100%);
    transition: transform var(--duration-normal) ease;
}

.mobile-menu.active {
    transform: translateY(0);
}

.mobile-menu.open {
    display: block;
    transform: translateY(0);
}

.mobile-menu-content {
    padding: 16px 20px;
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 16px;
}

.mobile-nav-link {
    padding: 12px 14px;
    font-size: 15px;
    font-weight: 500;
    color: var(--color-muted);
    border-radius: 8px;
    transition: all var(--duration-fast) ease;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.mobile-nav-link:hover {
    color: var(--color-text);
    background: var(--color-hover);
}

.mobile-nav-link.active {
    color: var(--color-text);
    background: rgba(0, 0, 0, 0.04);
    font-weight: 600;
}

.mobile-nav-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
}

.mobile-btn-login {
    width: 100%;
    padding: 12px 20px;
    background: var(--color-text);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.mobile-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--color-bg);
    border-radius: 8px;
}

.mobile-btn-dev-center {
    width: 100%;
    padding: 12px 20px;
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.mobile-btn-logout {
    width: 100%;
    padding: 12px 20px;
    background: transparent;
    color: var(--color-text-secondary);
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
}

.mobile-btn-logout:hover {
    border-color: rgba(220, 38, 38, 0.3);
    color: #dc2626;
    background: rgba(220, 38, 38, 0.05);
}

/* Main content */
.main-content {
    position: relative;
    z-index: 1;
    padding-top: 52px;
    min-height: calc(100vh - 52px);
}

.page-section {
    display: none;
}

/* Hero Section */
.hero {
    padding: var(--space-12) var(--space-8) var(--space-10);
    background: var(--color-surface);
    display: flex;
    flex-direction: column;
    align-items: center;
    border-bottom: 1px solid var(--color-border);
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.1), transparent);
}

.hero-content {
    width: 100%;
    max-width: 1400px;
}

/* Hero Grid: left carousel + right announcements */
.hero-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--space-6);
    margin-bottom: var(--space-8);
}

/* Carousel */
.hero-carousel {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    min-height: 240px;
    min-width: 0;
}

.carousel-track {
    position: relative;
    width: 100%;
    height: 100%;
}

.carousel-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.6s var(--ease-in-out);
    pointer-events: none;
}

.carousel-slide.active {
    opacity: 1;
    pointer-events: auto;
}

.carousel-slide-content {
    height: 100%;
    min-height: 240px;
    padding: var(--space-8) var(--space-10);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-radius: var(--radius-lg);
}

.carousel-slide-content h3 {
    font-size: 26px;
    font-weight: 700;
    margin: 0 0 var(--space-3);
    letter-spacing: -0.02em;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
}

.carousel-slide-content p {
    font-size: 14px;
    opacity: 0.85;
    margin: 0;
    max-width: 380px;
    line-height: 1.6;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
}

.carousel-slide-tag {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    margin-bottom: var(--space-4);
    width: fit-content;
    letter-spacing: 0.02em;
}

.carousel-dots {
    position: absolute;
    bottom: var(--space-4);
    right: var(--space-5);
    display: flex;
    gap: var(--space-2);
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-dot.active {
    width: 24px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.9);
}

/* Announcements */
.hero-announce {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-5) var(--space-5) var(--space-3);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.announce-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--color-border);
    margin-bottom: var(--space-2);
}

.announce-more {
    margin-left: auto;
    font-size: 12px;
    font-weight: 500;
    color: var(--color-muted);
    cursor: pointer;
    transition: color 0.2s;
}

.announce-more:hover {
    color: var(--color-blue);
}

.announce-list {
    display: flex;
    flex-direction: column;
}

.announce-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-1);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background 0.15s ease;
    text-decoration: none;
}

.announce-item:hover {
    background: var(--color-hover);
}

.announce-date {
    font-size: 13px;
    color: var(--color-muted);
    font-family: 'JetBrains Mono', monospace;
    flex-shrink: 0;
}

.announce-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-secondary);
    letter-spacing: -0.01em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* CM Article Cards */
.cm-article-card {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s, border-color 0.2s;
}
.cm-article-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--color-primary);
}
.cm-article-thumb {
    width: 120px;
    height: 80px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
}
.cm-article-body {
    flex: 1;
    min-width: 0;
}
.cm-article-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 6px;
    color: var(--color-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cm-article-excerpt {
    font-size: 13px;
    color: var(--color-text-secondary);
    margin: 0 0 8px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.cm-article-date {
    font-size: 12px;
    color: var(--color-muted);
}
/* Markdown content styling */
.cm-article-content h1 { font-size: 1.8em; font-weight: 700; margin: 1.2em 0 0.6em; padding-bottom: 0.3em; border-bottom: 1px solid #e5e7eb; line-height: 1.3; color: #111827; }
.cm-article-content h2 { font-size: 1.5em; font-weight: 700; margin: 1.1em 0 0.5em; padding-bottom: 0.25em; border-bottom: 1px solid #f3f4f6; line-height: 1.3; color: #1f2937; }
.cm-article-content h3 { font-size: 1.25em; font-weight: 600; margin: 1em 0 0.4em; color: #374151; }
.cm-article-content h4 { font-size: 1.1em; font-weight: 600; margin: 0.9em 0 0.3em; color: #4b5563; }
.cm-article-content h5 { font-size: 1em; font-weight: 600; margin: 0.8em 0 0.2em; color: #4b5563; }
.cm-article-content p { margin: 0.6em 0; line-height: 1.8; }
.cm-article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
    margin: 1em auto;
}
.cm-article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
    font-size: 14px;
    border: 1px solid #d1d5db;
}
.cm-article-content th {
    border: 1px solid #d1d5db;
    padding: 10px 14px;
    text-align: left;
    background: #f3f4f6;
    font-weight: 600;
    color: #374151;
}
.cm-article-content td {
    border: 1px solid #d1d5db;
    padding: 10px 14px;
    text-align: left;
    color: #4b5563;
}
.cm-article-content tr:nth-child(even) td {
    background: #f9fafb;
}
.cm-article-content tr:hover td {
    background: #f3f4f6;
}
.cm-article-content blockquote {
    border-left: 4px solid #6366f1;
    padding: 10px 18px;
    margin: 1em 0;
    color: #6b7280;
    background: #f5f3ff;
    border-radius: 0 8px 8px 0;
}
.cm-article-content pre {
    background: #1e1e2e;
    color: #cdd6f4;
    padding: 16px 20px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'JetBrains Mono', 'SF Mono', 'Menlo', monospace;
    font-size: 13px;
    line-height: 1.6;
    margin: 1em 0;
}
.cm-article-content pre code {
    background: none;
    padding: 0;
    font-size: inherit;
    color: inherit;
}
.cm-article-content code {
    background: #fce7f3;
    color: #be185d;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', 'SF Mono', 'Menlo', monospace;
    font-size: 0.88em;
}
.cm-article-content ul, .cm-article-content ol {
    padding-left: 1.5em;
    margin: 0.6em 0;
}
.cm-article-content li { margin: 0.3em 0; line-height: 1.7; }
.cm-article-content hr { border: none; border-top: 1px solid #e5e7eb; margin: 1.5em 0; }
.cm-article-content a { color: #4f46e5; text-decoration: underline; }
.cm-article-content a:hover { color: #4338ca; }

/* Model debug chat markdown */
.md-debug-msg p { margin: 0.4em 0; line-height: 1.6; }
.md-debug-msg p:first-child { margin-top: 0; }
.md-debug-msg > :last-child { margin-bottom: 0; }
.md-debug-msg pre { background: #1a1a2e; color: #e2e8f0; padding: 10px 12px; border-radius: 6px; font-size: 12px; line-height: 1.5; overflow-x: auto; margin: 8px 0; }
.md-debug-msg pre code { background: none; padding: 0; font-size: 12px; }
.md-debug-msg code { background: rgba(0,0,0,0.08); padding: 2px 5px; border-radius: 3px; font-size: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.md-debug-msg ul, .md-debug-msg ol { padding-left: 20px; margin: 4px 0; }
.md-debug-msg li { margin: 2px 0; }
.md-debug-msg table { border-collapse: collapse; width: 100%; margin: 8px 0; font-size: 12px; }
.md-debug-msg th, .md-debug-msg td { border: 1px solid #d1d5db; padding: 4px 8px; text-align: left; }
.md-debug-msg th { background: #f3f4f6; font-weight: 600; }
.md-debug-msg h1, .md-debug-msg h2, .md-debug-msg h3, .md-debug-msg h4, .md-debug-msg h5 { font-weight: 600; line-height: 1.3; margin: 8px 0 4px; }
.md-debug-msg h1 { font-size: 1.25em; }
.md-debug-msg h2 { font-size: 1.15em; }
.md-debug-msg h3 { font-size: 1.05em; }
.md-debug-msg blockquote { border-left: 3px solid #d1d5db; padding-left: 10px; margin: 6px 0; color: #6b7280; }
.md-debug-msg strong { font-weight: 600; }
.md-debug-msg a { color: #4f46e5; text-decoration: underline; }
.md-debug-msg hr { border: none; border-top: 1px solid #e5e7eb; margin: 10px 0; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-4);
    max-width: 720px;
    margin: 0 auto;
}

.stat-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: var(--space-5) var(--space-4);
    text-align: center;
    transition: border-color var(--duration-normal) var(--ease-out),
                box-shadow var(--duration-normal) var(--ease-out),
                transform var(--duration-normal) var(--ease-out);
}

.stat-card:hover {
    border-color: var(--color-border-strong);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.stat-icon {
    width: 36px;
    height: 36px;
    margin: 0 auto var(--space-2);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-number {
    font-family: 'JetBrains Mono', monospace;
    font-size: 24px;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.03em;
    margin-bottom: 2px;
    font-feature-settings: 'tnum';
}

.stat-label {
    font-size: 12px;
    color: var(--color-muted);
    font-weight: 500;
    letter-spacing: 0.01em;
}

/* Section */
.section {
    padding: var(--space-12) var(--space-5);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.section.detail-section {
    padding-top: var(--space-5);
}

.section-content {
    width: 100%;
    max-width: 1400px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-6);
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.025em;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.section-more {
    font-size: 13px;
    color: var(--color-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: color var(--duration-fast) ease, transform var(--duration-fast) ease;
    font-weight: 500;
    letter-spacing: -0.005em;
}

.section-more:hover {
    color: var(--color-blue);
    transform: translateX(2px);
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-4);
}

/* Home Packages Grid */
.home-packages-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-4);
}

.home-package-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-5) var(--space-5);
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
    user-select: none;
}

.home-package-card:hover {
    border-color: var(--color-border-accent);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.home-package-credit {
    font-family: 'JetBrains Mono', monospace;
    font-size: 28px;
    font-weight: 800;
    color: var(--color-text);
    margin-bottom: 2px;
}

.home-package-credit-unit {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-muted);
    margin-left: 2px;
}

.home-package-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-3);
}

.home-package-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-blue);
    margin-bottom: var(--space-4);
}

.home-package-buy-btn {
    width: 100%;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: var(--color-surface);
    color: var(--color-text);
    letter-spacing: -0.005em;
    transition: background 0.2s, border-color 0.2s;
}

.home-package-buy-btn:hover {
    background: var(--color-bg);
    border-color: var(--color-text);
}

.home-package-period {
    font-size: 11px;
    color: var(--color-muted);
    margin-top: var(--space-2);
}

/* Experience List */
.experience-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

/* Experience Item */
.experience-item {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: var(--space-5);
    transition: border-color var(--duration-normal) var(--ease-out),
                box-shadow var(--duration-normal) var(--ease-out),
                transform var(--duration-normal) var(--ease-out);
    cursor: pointer;
}

.experience-item:hover {
    border-color: var(--color-border-strong);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.experience-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-2);
}

.experience-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 2px;
    letter-spacing: -0.01em;
}

.experience-category {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: rgba(37, 99, 235, 0.06);
    color: var(--color-blue);
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0;
}

.experience-summary {
    color: var(--color-text-secondary);
    font-size: 12px;
    line-height: 1.5;
    margin-bottom: var(--space-3);
    letter-spacing: -0.005em;
}

.experience-meta {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    font-size: 11px;
    color: var(--color-muted);
}

.experience-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.experience-meta-item svg {
    width: 13px;
    height: 14px;
}

/* Agent Access Block */
.agent-access-block {
    background: linear-gradient(135deg, #18181b 0%, #27272a 100%);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    margin-bottom: 20px;
    color: #fff;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.agent-access-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.agent-access-icon {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.agent-access-title {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 2px;
}

.agent-access-subtitle {
    font-size: 13px;
    opacity: 0.6;
    font-weight: 400;
}

.agent-access-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.agent-access-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.agent-access-label {
    font-size: 13px;
    font-weight: 500;
    opacity: 0.6;
    min-width: 56px;
}

.agent-access-url {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 6px;
    padding: 8px 12px;
    flex: 1;
}

.agent-access-url code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: rgba(255,255,255,0.85);
    flex: 1;
    user-select: all;
}

.agent-access-copy {
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 4px;
    cursor: pointer;
    transition: background var(--duration-fast) ease;
    white-space: nowrap;
}

.agent-access-copy:hover {
    background: rgba(255,255,255,0.18);
    color: #fff;
}

.agent-access-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 14px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 6px;
    transition: background var(--duration-fast) ease;
}

.agent-access-link:hover {
    background: rgba(255,255,255,0.15);
}

/* Card */
.card {
    position: relative;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: var(--space-5);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    transition: border-color var(--duration-normal) var(--ease-out),
                box-shadow var(--duration-normal) var(--ease-out),
                transform var(--duration-normal) var(--ease-out);
    will-change: transform;
}

.card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
    pointer-events: none;
    transition: opacity var(--duration-normal) ease;
}

.card:hover {
    border-color: var(--color-border-strong);
    box-shadow: var(--shadow-lg), 0 0 0 1px var(--color-border);
    transform: translateY(-2px);
}

.card:hover::before {
    opacity: 0.5;
}

.card-header {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}

.card-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--color-surface-dim);
    border: 1px solid var(--color-border);
    overflow: hidden;
}

.card-title-group {
    flex: 1;
    min-width: 0;
}

.card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    letter-spacing: -0.01em;
    margin-bottom: 1px;
    line-height: 1.4;
}

.card-provider {
    font-size: 12px;
    color: var(--color-muted);
    font-weight: 400;
    letter-spacing: 0;
}

.card-model-id {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--color-muted);
    letter-spacing: -0.01em;
    margin-top: 2px;
    opacity: 0.7;
    font-feature-settings: 'tnum';
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-desc {
    font-size: 13px;
    color: var(--color-text-secondary);
    line-height: 1.5;
    margin-bottom: var(--space-4);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    letter-spacing: -0.005em;
}

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

.card-tags {
    display: flex;
    gap: var(--space-1);
    flex-wrap: nowrap;
    overflow: hidden;
}

.tag {
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    background: var(--color-surface-dim);
    color: var(--color-text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: 0;
    border: 1px solid var(--color-border);
}

.tag.colored {
    color: #fff;
    border: none;
}

.card-price {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text);
    font-feature-settings: 'tnum';
    letter-spacing: -0.01em;
}

.card-price-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 12px;
    color: var(--color-muted);
    font-family: 'JetBrains Mono', monospace;
}

.card-date {
    font-size: 12px;
    color: var(--color-muted);
}

/* Marketplace Layout */
.marketplace-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    min-height: calc(100vh - 120px);
}

.marketplace-sidebar {
    width: 240px;
    flex-shrink: 0;
    position: sticky;
    top: 64px;
    max-height: calc(100vh - 76px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}

.marketplace-sidebar:hover {
    scrollbar-color: rgba(0, 0, 0, 0.12) transparent;
}

.marketplace-sidebar::-webkit-scrollbar {
    width: 4px;
}

.marketplace-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.marketplace-sidebar::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 2px;
}

.marketplace-sidebar:hover::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.12);
}

.marketplace-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

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

/* Sidebar */
.sidebar-section {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: var(--space-4);
    margin-bottom: var(--space-3);
}

.sidebar-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--color-muted);
    margin-bottom: var(--space-3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.sidebar-search {
    width: 100%;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    transition: border-color var(--duration-normal) ease, box-shadow var(--duration-normal) ease;
    background: var(--color-bg);
    letter-spacing: -0.005em;
    color: var(--color-text);
}

.sidebar-search::placeholder {
    color: #c0c0c0;
}

.sidebar-search:focus {
    outline: none;
    border-color: var(--color-blue);
    box-shadow: var(--shadow-glow);
    background: var(--color-surface);
}

.sidebar-filters {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-filter {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: background var(--duration-fast) ease, color var(--duration-fast) ease;
    background: transparent;
    letter-spacing: -0.005em;
}

.sidebar-filter:hover {
    background: var(--color-hover);
    color: var(--color-text);
}

.sidebar-filter.active {
    background: var(--color-active);
    color: var(--color-text);
    font-weight: 600;
}

.sidebar-filter.active svg {
    stroke: var(--color-text) !important;
}

.sidebar-filter-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--color-muted);
    cursor: pointer;
    transition: all var(--duration-normal) ease;
    font-size: 12px;
    border: 1px dashed var(--color-border-strong);
    margin-top: var(--space-2);
}

.sidebar-filter-toggle:hover {
    background: var(--color-hover);
    color: var(--color-text);
    border-color: rgba(0, 0, 0, 0.2);
}

.sidebar-filter-toggle svg {
    transition: transform var(--duration-normal) ease;
}

.sidebar-filter-toggle.expanded svg {
    transform: rotate(180deg);
}

#industry-more-items {
    display: block;
    width: 100%;
}

#industry-more-items .sidebar-filter {
    margin-bottom: 4px;
}

#industry-more-items .sidebar-filter:last-child {
    margin-bottom: 0;
}

.sidebar-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 12px;
    background: var(--color-bg);
    cursor: pointer;
    transition: border-color var(--duration-normal) ease;
}

.sidebar-select:focus {
    outline: none;
    border-color: var(--color-blue);
}

/* Filter Bar */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    padding: 16px;
    background: var(--color-surface);
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
}

.filter-label {
    font-size: 13px;
    color: var(--color-muted);
    font-weight: 600;
    margin-right: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-chip {
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-muted);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    cursor: pointer;
    transition: all var(--duration-fast) ease;
}

.filter-chip:hover {
    background: var(--color-hover);
    border-color: var(--color-border-strong);
}

.filter-chip.active {
    color: var(--color-text);
    background: rgba(0, 0, 0, 0.04);
    border-color: var(--color-border-strong);
    font-weight: 600;
}

.search-input {
    margin-left: auto;
    padding: 8px 14px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    color: var(--color-text);
    font-size: 13px;
    outline: none;
    width: 240px;
    transition: border-color var(--duration-normal) ease, box-shadow var(--duration-normal) ease;
}

.search-input::placeholder { color: #c0c0c0; }
.search-input:focus {
    border-color: var(--color-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.06);
}

.provider-select {
    padding: 6px 14px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    color: var(--color-text);
    font-size: 13px;
    font-weight: 500;
    outline: none;
    cursor: pointer;
    transition: border-color var(--duration-normal) ease;
}

.provider-select:hover {
    border-color: var(--color-border-strong);
}

/* Detail Page */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--color-muted);
    margin-bottom: var(--space-5);
    letter-spacing: 0;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.breadcrumb-link {
    color: var(--color-muted);
    text-decoration: none;
    transition: color var(--duration-fast) ease;
    cursor: pointer;
}

.breadcrumb-link:hover {
    color: var(--color-text);
}

.breadcrumb-separator {
    color: var(--color-border-strong);
}

.breadcrumb-current {
    color: var(--color-text);
    font-weight: 600;
}

.detail-page-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--space-5);
    align-items: start;
}

#experienceDetailContent {
    display: block;
}

.detail-main {
    /* Main content area */
}

.detail-sidebar {
    position: sticky;
    top: 64px;
}

/* Detail Header */
.detail-header {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    margin-bottom: var(--space-4);
    position: relative;
    overflow: hidden;
}

.detail-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--color-blue) 0%, var(--color-purple) 50%, var(--color-cyan) 100%);
    opacity: 0.9;
}

.detail-header-top {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

.detail-logo {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--color-surface-dim);
    border: 1px solid var(--color-border);
    overflow: hidden;
}

.detail-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.025em;
    line-height: 1.3;
}

.detail-provider {
    font-size: 12px;
    color: var(--color-muted);
    margin-top: 2px;
    font-weight: 500;
    letter-spacing: 0;
}

.btn-add-platform {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px var(--space-5);
    background: var(--color-text);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--duration-fast) ease, transform var(--duration-fast) var(--ease-spring);
    width: 100%;
    justify-content: center;
    letter-spacing: -0.005em;
}

.btn-add-platform:hover {
    background: #3f3f46;
}

.btn-add-platform:active {
    background: var(--color-text);
    transform: scale(0.97);
}

.detail-desc {
    font-size: 13px;
    color: var(--color-text-secondary);
    line-height: 1.6;
    letter-spacing: -0.005em;
}

.detail-desc-price-row {
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.detail-body {
    /* Remove padding - let blocks flow naturally */
}

@media (max-width: 1024px) {
    .detail-page-content {
        grid-template-columns: 1fr;
    }

    .detail-sidebar {
        position: static;
    }
}

/* Login Modal */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.show {
    display: flex;
    animation: fadeIn var(--duration-normal) var(--ease-out);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.login-modal-content {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 400px;
    padding: 32px;
    position: relative;
    box-shadow: var(--shadow-xl);
    animation: modalSlideUp var(--duration-slow) var(--ease-out);
}

@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(16px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--color-bg);
    cursor: pointer;
    transition: background var(--duration-fast) ease, transform var(--duration-fast) ease;
    border: none;
    z-index: 1;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.08);
    transform: rotate(90deg);
}

/* Detail blocks */
.detail-block {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: var(--space-5);
    margin-bottom: var(--space-3);
}

.detail-block-title {
    font-size: 10px;
    font-weight: 700;
    color: var(--color-muted);
    margin-bottom: var(--space-3);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-2);
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-2) var(--space-3);
    background: var(--color-bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
}

.detail-item-label {
    font-size: 11px;
    color: var(--color-muted);
    font-weight: 500;
    letter-spacing: 0;
}

.detail-item-value {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text);
    font-family: 'JetBrains Mono', monospace;
    font-feature-settings: 'tnum';
    letter-spacing: -0.01em;
}

/* Comments */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.comment-item {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: var(--space-4);
}

.comment-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--color-surface-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.comment-user {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 1px;
    letter-spacing: -0.005em;
}

.comment-time {
    font-size: 11px;
    color: var(--color-muted);
}

.comment-rating {
    display: flex;
    gap: 2px;
}

.comment-content {
    font-size: 13px;
    line-height: 1.7;
    color: var(--color-muted);
}

/* Pricing table */
.pricing-table {
    width: 100%;
    border-collapse: collapse;
}

.pricing-table th {
    font-size: 10px;
    font-weight: 600;
    color: var(--color-muted);
    text-align: left;
    padding: var(--space-2) var(--space-3);
    border-bottom: 1px solid var(--color-border);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.pricing-table td {
    font-size: 12px;
    color: var(--color-text-secondary);
    padding: var(--space-2) var(--space-3);
    border-bottom: 1px solid var(--color-border);
    font-family: 'JetBrains Mono', monospace;
    font-feature-settings: 'tnum';
    font-weight: 500;
    letter-spacing: -0.01em;
}

.pricing-table tr:last-child td { border-bottom: none; }

/* Code block */
.code-block {
    background: #18181b;
    border-radius: var(--radius);
    padding: var(--space-5);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    line-height: 1.7;
    color: #d4d4d4;
    overflow-x: auto;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
    white-space: pre-wrap;
    word-wrap: break-word;
}

.code-block .keyword { color: #c084fc; }
.code-block .string { color: #4ade80; }
.code-block .comment { color: #525252; font-style: italic; }
.code-block .number { color: #fbbf24; }

.code-tabs {
    display: flex;
    gap: 2px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 6px;
    padding: 2px;
}

.code-tab {
    background: transparent;
    border: none;
    color: #71717a;
    font-size: 11px;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.code-tab:hover {
    color: #52525b;
}

.code-tab.active {
    background: #fff;
    color: #18181b;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

/* Tool Group Tabs */
.tool-group-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin-top: 20px;
    border-bottom: 1px solid var(--color-border);
    overflow-x: visible;
}

.tool-group-tabs::-webkit-scrollbar {
    display: none;
}

.tool-tab {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #71717a;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 120px;
}

.tool-tab:hover {
    color: #3f3f46;
    background: rgba(0, 0, 0, 0.02);
}

.tool-tab.active {
    color: #06b6d4;
    border-bottom-color: #06b6d4;
    font-weight: 600;
}

.tool-tab-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: left;
}

.tool-tab-name {
    font-size: 13px;
    font-weight: inherit;
}

.tool-tab-desc {
    font-size: 11px;
    color: #9ca3af;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    max-width: 150px;
}

.tool-tab.active .tool-tab-desc {
    color: #67e8f9;
}

/* File Tree */
.file-tree {
    background: #fafafa;
    border-radius: 6px;
    padding: 8px 0;
    border: 1px solid var(--color-border);
}

.file-tree-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    font-size: 12px;
    color: #3f3f46;
    transition: background 0.15s ease;
}

.file-tree-item:hover {
    background: rgba(0, 0, 0, 0.03);
}

.file-tree-item svg {
    flex-shrink: 0;
}

.file-tree-arrow {
    transition: transform 0.15s ease;
    flex-shrink: 0;
}

.file-tree-dir {
    cursor: pointer;
    user-select: none;
}

.code-copy {
    position: absolute;
    top: var(--space-3);
    right: var(--space-3);
    padding: 4px 10px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--duration-fast) ease;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.code-copy:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

/* Login Modal */
.login-modal-content {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 380px;
    padding: var(--space-8);
    position: relative;
    box-shadow: var(--shadow-xl);
}

.login-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.025em;
    margin-bottom: var(--space-2);
    line-height: 1.3;
}

.login-subtitle {
    font-size: 13px;
    color: var(--color-muted);
    margin-bottom: 24px;
}

.login-tabs {
    display: flex;
    gap: 4px;
    margin-top: 24px;
    margin-bottom: 24px;
    background: var(--color-bg);
    border-radius: 8px;
    padding: 4px;
}

.login-tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-muted);
    background: transparent;
    cursor: pointer;
    transition: all var(--duration-normal) ease;
    border: none;
    border-radius: 6px;
}

.login-tab.active {
    color: var(--color-text);
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
}

.form-group {
    margin-bottom: 14px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    color: var(--color-text);
    font-size: 14px;
    outline: none;
    transition: border-color var(--duration-normal) ease, box-shadow var(--duration-normal) ease;
}

.form-input::placeholder { color: #c0c0c0; }
.form-input:focus {
    border-color: var(--color-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.06);
}

.form-input-row {
    display: flex;
    gap: 10px;
}

.form-input-row .form-input { flex: 1; }

.btn-sms {
    padding: 10px 16px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    color: var(--color-text);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background var(--duration-normal) ease, border-color var(--duration-normal) ease;
}

.btn-sms:hover {
    background: var(--color-hover);
    border-color: var(--color-border-strong);
}

.btn-sms:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: var(--color-surface);
}

/* Form agreement */
.form-agreement {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 16px;
    padding: 0 2px;
}

.agreement-checkbox {
    position: relative;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-top: 1px;
    cursor: pointer;
}

.agreement-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.agreement-checkmark {
    position: absolute;
    inset: 0;
    border-radius: 4px;
    border: 2px solid rgba(0, 0, 0, 0.15);
    background: var(--color-surface);
    transition: all var(--duration-normal) ease;
}

.agreement-checkbox input:checked + .agreement-checkmark {
    background: var(--color-blue);
    border-color: var(--color-blue);
}

.agreement-checkbox input:checked + .agreement-checkmark::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.agreement-text {
    font-size: 12px;
    color: var(--color-muted);
    line-height: 1.6;
}

.agreement-link {
    color: var(--color-blue);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--duration-fast) ease;
}

.agreement-link:hover {
    text-decoration: underline;
}

.btn-submit {
    width: 100%;
    padding: 12px;
    background: var(--color-text);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background var(--duration-fast) ease, transform var(--duration-fast) var(--ease-spring);
    margin-top: 8px;
}

.btn-submit:hover {
    background: #404040;
}

.btn-submit:active {
    background: #000;
    transform: scale(0.96);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.form-error {
    color: #dc2626;
    font-size: 13px;
    padding: 8px 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    margin-bottom: 12px;
}

/* Footer */
.footer {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding: var(--space-10) var(--space-5) var(--space-8);
    margin-top: var(--space-16);
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.06), transparent);
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-5);
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    letter-spacing: -0.01em;
}

.footer-links {
    display: flex;
    gap: var(--space-6);
    flex-wrap: wrap;
    justify-content: center;
}

.footer-link {
    color: var(--color-muted);
    text-decoration: none;
    font-size: 12px;
    transition: color var(--duration-fast) ease;
    letter-spacing: 0;
}

.footer-link:hover {
    color: var(--color-text);
}

.footer-divider {
    width: 100%;
    max-width: 1400px;
    height: 1px;
    background: var(--color-border);
}

.footer-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: var(--color-muted);
    font-size: 11px;
}

.footer-copyright {
    text-align: center;
    font-size: 11px;
    letter-spacing: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .nav { padding: 0 16px; }

    .hero { padding: 24px 16px 20px; }
    .hero-grid { grid-template-columns: 1fr; gap: 12px; }
    .hero-carousel { min-height: 180px; }
    .carousel-slide-content { min-height: 180px; padding: 20px 24px; }
    .carousel-slide-content h3 { font-size: 20px; }
    .carousel-slide-content p { font-size: 13px; }
    .hero-announce { padding: 12px; }
    .hero-title { font-size: 28px; }
    .hero-subtitle { font-size: 14px; margin-bottom: 28px; }
    .hero-subtitle br { display: none; }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .stat-card { padding: 16px 12px; }
    .stat-number { font-size: 22px; }
    .stat-label { font-size: 12px; }

    .section { padding: 16px 16px 32px !important; }
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 16px;
    }
    .section-title { font-size: 18px; }
    .section-more { font-size: 12px; padding: 4px 8px; }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    /* Show mobile menu toggle */
    .mobile-menu-toggle {
        display: flex;
    }

    /* Hide desktop nav links and login button */
    .nav-links,
    .nav-right {
        display: none;
    }

    /* Marketplace responsive */
    .marketplace-layout {
        flex-direction: column;
        min-height: auto;
    }
    .marketplace-sidebar {
        width: 100%;
        position: static;
    }
    .marketplace-content {
        width: 100%;
    }
    .sidebar-section { margin-bottom: 10px; }
    .sidebar-filters {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .sidebar-filter { flex: 0 0 auto; }

    /* Agent access block */
    .agent-access-block { padding: 16px; }
    .agent-access-title { font-size: 15px; }
    .agent-access-subtitle { font-size: 12px; }
    .agent-access-row { flex-direction: column; align-items: stretch; gap: 8px; }
    .agent-access-url { flex-wrap: wrap; }
    .agent-access-url code { font-size: 11px; word-break: break-all; }
    .agent-access-icon { width: 36px; height: 36px; }
    .agent-access-icon svg { width: 20px; height: 20px; }

    /* Experience list items */
    .experience-item { padding: 16px; }
    .experience-header { flex-direction: column; gap: 6px; }
    .experience-title { font-size: 14px; }
    .experience-meta { flex-wrap: wrap; gap: 10px; }

    /* Detail pages */
    .detail-page-content {
        grid-template-columns: 1fr;
    }
    .detail-sidebar { position: static; }
    .detail-block { padding: 16px; }
    .detail-grid { grid-template-columns: 1fr; }
    #experienceDetailContent > div {
        grid-template-columns: 1fr !important;
    }

    /* Detail page headers/titles */
    .detail-header { padding: 20px 16px; }
    .detail-title { font-size: 20px; }
    .detail-desc { font-size: 13px; }
    .detail-desc-price-row { flex-direction: column; align-items: flex-start; gap: 8px; }

    /* Pricing table */
    .pricing-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }

    /* Code blocks */
    pre, code { max-width: 100%; overflow-x: auto; white-space: pre-wrap; word-break: break-word; }

    /* Modal */
    .modal-overlay { padding: 0; align-items: flex-end; }
    .login-modal-content {
        width: 100%;
        border-radius: 14px 14px 0 0;
        max-height: 85vh;
        overflow-y: auto;
        padding: 28px 20px 20px;
        max-width: 100%;
    }
    .login-title { font-size: 18px; }
    .login-subtitle { font-size: 12px; }
    .modal-close { top: 14px !important; right: 20px !important; }

    /* Card internal adjustments */
    .card { padding: 16px; }

    /* Footer */
    .footer { padding: 32px 16px 24px; margin-top: 40px; }
    .footer-links { gap: 16px; }
    .footer-logo { font-size: 14px; }

    /* Breadcrumb */
    .breadcrumb { flex-wrap: wrap; gap: 4px; }

    /* Sidebar collapse toggle */
    .sidebar-collapse-toggle { display: flex; }
    .marketplace-sidebar.collapsed .sidebar-section:not(.sidebar-section-search) { display: none; }

    /* Tool group tabs */
    .tool-group-tabs { margin-top: 14px; flex-wrap: wrap; overflow-x: visible; }
    .tool-tab { padding: 8px 12px; font-size: 12px; min-width: auto; }
}

@media (max-width: 480px) {
    .nav { padding: 0 12px; }
    .nav-logo { gap: 8px; margin-right: 24px; }
    .nav-logo-text { font-size: 14px; }
    .nav-logo svg { width: 26px; height: 26px; }

    .hero { padding: 20px 16px 24px; }
    .hero-title { font-size: 24px; margin-bottom: 12px; }
    .hero-subtitle { font-size: 13px; margin-bottom: 24px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .stat-card { padding: 14px 10px; border-radius: 8px; }
    .stat-number { font-size: 20px; }
    .stat-label { font-size: 11px; }
    .stat-icon { width: 32px; height: 32px; }

    .section { padding: 16px 12px 24px !important; }
    .section-title { font-size: 17px; }
    .section-header { margin-bottom: 12px; }

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

    .cards-grid { gap: 10px; }

    .card { padding: 14px; }
    .card-title { font-size: 14px; }
    .card-desc { font-size: 12px; }
    .card-price { font-size: 11px; }
    .card-tags { gap: 4px; flex-wrap: wrap; }
    .card-tag { font-size: 10px; padding: 2px 8px; }

    .marketplace-sidebar { padding: 0; }
    .sidebar-section { padding: 12px; }
    .sidebar-filter { font-size: 12px; padding: 6px 10px; }
    .sidebar-search { font-size: 12px; padding: 8px 12px; }

    /* Experience */
    .experience-item { padding: 14px; }
    .experience-title { font-size: 14px; }
    .experience-summary { font-size: 12px; }
    .experience-meta { font-size: 11px; }
    .experience-category { font-size: 11px; padding: 3px 8px; }

    /* Agent access */
    .agent-access-block { padding: 14px; }
    .agent-access-title { font-size: 14px; }
    .agent-access-subtitle { font-size: 12px; }
    .agent-access-header { gap: 10px; margin-bottom: 12px; }
    .agent-access-icon { width: 32px; height: 32px; }
    .agent-access-icon svg { width: 16px; height: 16px; }
    .agent-access-url { padding: 6px 8px; }
    .agent-access-url code { font-size: 10px; }
    .agent-access-copy { font-size: 10px; padding: 3px 8px; }
    .agent-access-link { font-size: 12px; padding: 6px 10px; }

    /* Detail page */
    .detail-header { padding: 16px 12px; }
    .detail-title { font-size: 18px; }
    .detail-desc { font-size: 12px; }
    .detail-block { padding: 14px; }
    .detail-block-title { font-size: 11px; }

    /* Tool group tabs */
    .tool-group-tabs { margin-top: 10px; flex-wrap: wrap; overflow-x: visible; }
    .tool-tab { padding: 6px 10px; font-size: 12px; min-width: auto; }

    /* Login modal */
    .login-modal-content { padding: 24px 16px 16px; }
    .login-title { font-size: 17px; margin-bottom: 6px; }
    .login-subtitle { font-size: 12px; margin-bottom: 16px; }
    .login-tabs { margin-bottom: 20px; padding: 4px; gap: 4px; }
    .login-tab { font-size: 13px; padding: 8px 0; }
    .form-group { margin-bottom: 10px; }
    .form-label { font-size: 12px; margin-bottom: 4px; }
    .form-input { font-size: 13px; padding: 8px 12px; }
    .form-input-row { gap: 8px; }
    .btn-sms { font-size: 12px; padding: 8px 12px; }
    .btn-submit { font-size: 13px; padding: 10px; }
    .modal-close { top: 14px !important; right: 14px !important; }
    .modal-close svg { width: 16px; height: 16px; }
    .form-agreement { margin-top: 12px; }
    .agreement-text { font-size: 11px; }
    .agreement-checkbox { width: 14px; height: 14px; }

    /* Footer */
    .footer { padding: 24px 12px 20px; margin-top: 32px; }
    .footer-links { gap: 12px; }
    .footer-link { font-size: 12px; }
    .footer-bottom { font-size: 11px; }

    /* Mobile menu */
    .mobile-menu { width: 100%; }
    .mobile-nav-link { font-size: 14px; padding: 12px 16px; }
    .mobile-btn-login { font-size: 13px; padding: 10px; }
    .mobile-user-info { padding: 12px 16px; }
    .mobile-user-name { font-size: 14px; }
    .mobile-btn-dev-center { font-size: 12px; padding: 8px 14px; }

    /* Stats on detail pages */
    .stats-mini { grid-template-columns: 1fr 1fr; gap: 8px; }
    .stat-mini-item { padding: 10px; }

    /* Comment */
    .comment-item { padding: 12px; }
    .comment-content { font-size: 12px; }
    .comment-avatar { width: 28px; height: 28px; font-size: 14px; }
    .comment-user { font-size: 12px; }
    .comment-time { font-size: 11px; }

    /* Breadcrumb */
    .breadcrumb { font-size: 12px; }
    .breadcrumb-item { font-size: 12px; }

    /* Browse/empty states */
    .empty-state { padding: 24px 12px; }
    .empty-state-icon { width: 40px; height: 40px; }
    .empty-state-text { font-size: 13px; }

    /* Pagination */
    .pagination-container { margin-top: 24px; }
    .pagination-btn { width: 32px; height: 32px; font-size: 12px; }
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
    padding: 20px 0;
}

.pagination-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--duration-normal) ease;
}

.pagination-btn:hover:not(:disabled):not(.active) {
    border-color: var(--color-border-strong);
    background: var(--color-hover);
}

.pagination-btn.active {
    background: var(--color-text);
    border-color: var(--color-text);
    color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-ellipsis {
    color: var(--color-muted);
    font-size: 14px;
    padding: 0 4px;
}

/* Load more indicator */
.load-more-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 40px 0;
    color: var(--color-muted);
    font-size: 13px;
}

.load-more-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-border);
    border-top-color: var(--color-text);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* No more indicator */
.no-more-indicator {
    text-align: center;
    padding: 40px 0;
    color: var(--color-muted);
    font-size: 13px;
}

/* Scrollbar for the whole page */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

/* Subtle shimmer animation for loading states */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton {
    background: linear-gradient(90deg,
        var(--color-bg) 25%,
        rgba(0, 0, 0, 0.04) 50%,
        var(--color-bg) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 6px;
}

/* ============================================
   User Center Styles
   ============================================ */

/* Page Header */
.page-header {
    margin-bottom: 32px;
}

.page-title {
    font-size: 32px;
    font-weight: 800;
    background: linear-gradient(135deg, #0a0a0a 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.03em;
    margin-bottom: 8px;
}

.page-subtitle {
    font-size: 15px;
    color: #666;
    font-weight: 500;
}

/* Content Section */
.content-section {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.content-section.active {
    display: block;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 32px;
    border-bottom: 2px solid rgba(229, 229, 229, 0.5);
    padding-bottom: 0;
}

.tab {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    color: #999;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab:hover {
    color: #666;
    transform: translateY(-2px);
}

.tab.active {
    color: var(--color-text);
    border-bottom-color: var(--color-blue);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}

/* Premium Card */
.uc-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(229, 229, 229, 0.8);
    border-radius: 20px;
    padding: 28px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.uc-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.4s;
}

.uc-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12);
    border-color: rgba(59, 130, 246, 0.3);
}

.uc-card:hover::before {
    opacity: 1;
}

.uc-card-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

.uc-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.uc-card:hover .uc-card-icon {
    transform: scale(1.1) rotate(5deg);
}

.uc-card-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 4px;
    letter-spacing: -0.01em;
}

.uc-card-subtitle {
    font-size: 13px;
    color: #999;
    font-weight: 500;
}

.uc-card-desc {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

/* Buttons with gradient */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 50%, #8b5cf6 100%);
    color: #fff;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.35);
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.4s;
}

.btn-primary:hover::before {
    opacity: 1;
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.45);
}

.btn-primary:active {
    transform: translateY(0) scale(0.98);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.9);
    color: var(--color-text);
    border: 1px solid rgba(229, 229, 229, 0.8);
    backdrop-filter: blur(20px);
}

.btn-secondary:hover {
    border-color: var(--color-blue);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.15);
    transform: translateY(-2px);
}

/* Table with enhanced styling */
.table-container {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(229, 229, 229, 0.8);
    border-radius: 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
}

.table th {
    padding: 18px 24px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 1px solid rgba(229, 229, 229, 0.5);
}

.table td {
    padding: 18px 24px;
    font-size: 14px;
    color: #666;
    border-bottom: 1px solid rgba(245, 245, 245, 0.8);
    transition: background 0.2s;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table tbody tr:hover {
    background: rgba(59, 130, 246, 0.03);
}

/* Badge with gradient */
.badge {
    display: inline-block;
    padding: 5px 14px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 8px;
    letter-spacing: 0.02em;
}

.badge-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.1) 100%);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(245, 158, 11, 0.1) 100%);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(239, 68, 68, 0.1) 100%);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(59, 130, 246, 0.1) 100%);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* Chart Container */
.chart-container {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(229, 229, 229, 0.8);
    border-radius: 20px;
    padding: 28px;
    margin-bottom: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.chart-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 20px;
}

/* API Key Card */
.apikey-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(229, 229, 229, 0.8);
    border-radius: 20px;
    padding: 28px;
    margin-bottom: 16px;
    transition: all 0.3s;
    width: 100%;
}

.apikey-card:hover {
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
}

.apikey-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    gap: 12px;
}

.apikey-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text);
}

.apikey-value {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: #fafafa;
    border: 1px solid rgba(229, 229, 229, 0.6);
    border-radius: 12px;
    margin-bottom: 12px;
}

.apikey-value code {
    flex: 1;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: #666;
}

.copy-btn {
    padding: 6px 12px;
    background: #fff;
    border: 1px solid rgba(229, 229, 229, 0.8);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}

.copy-btn:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

/* Package Card */
.package-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(229, 229, 229, 0.8);
    border-radius: 20px;
    padding: 32px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.package-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12);
}

.package-card.featured {
    border-color: var(--color-blue);
    box-shadow: 0 8px 32px rgba(59, 130, 246, 0.2);
}

.package-name {
    font-size: 20px;
    font-weight: 800;
    color: var(--color-text);
    margin-bottom: 8px;
}

.package-price {
    font-size: 36px;
    font-weight: 800;
    background: linear-gradient(135deg, #0a0a0a 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
}

.package-price span {
    font-size: 16px;
    -webkit-text-fill-color: #999;
    font-weight: 500;
}

.package-features {
    list-style: none;
    margin: 24px 0;
}

.package-features li {
    padding: 8px 0;
    font-size: 14px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Form */
.form-block {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(229, 229, 229, 0.8);
    border-radius: 20px;
    padding: 32px;
}

.form-block h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 8px;
}

.form-input, .form-textarea, .form-select {
    width: 100%;
    padding: 12px 16px;
    background: #fafafa;
    border: 1px solid rgba(229, 229, 229, 0.8);
    border-radius: 12px;
    font-size: 14px;
    color: var(--color-text);
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
    border-color: #3b82f6;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

/* User Center Modal */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    padding: 40px;
    overflow-y: auto;
}

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

.modal {
    background: #fff;
    border-radius: 24px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    box-shadow: 0 24px 64px rgba(0,0,0,0.2);
    position: relative;
}

.modal-header {
    padding: 32px 32px 0;
    margin-bottom: 24px;
}

.modal-title {
    font-size: 24px;
    font-weight: 800;
    background: linear-gradient(135deg, #0a0a0a 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
}

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

.modal-close {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 40px;
    height: 40px;
    background: #f5f5f5;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid rgba(229, 229, 229, 0.8);
    transition: all 0.2s;
}

.modal-close:hover {
    background: #fff;
    border-color: #3b82f6;
}

/* Body scroll lock - iOS safe */
.scroll-lock {
    overflow: hidden !important;
}

/* Permission config model filter */
.perm-hidden {
    display: none !important;
}

/* Subscribe layout */
.subscribe-top-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 16px;
    margin-bottom: 24px;
}

/* User Center Sidebar */
#page-user-center .uc-sidebar {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 12px;
}

#page-user-center .uc-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

#page-user-center .uc-sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 450;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    position: relative;
}

#page-user-center .uc-sidebar-item svg {
    stroke: var(--color-muted);
    flex-shrink: 0;
    transition: stroke 0.15s ease;
}

#page-user-center .uc-sidebar-item:hover {
    background: var(--color-hover);
    color: var(--color-text);
}

#page-user-center .uc-sidebar-item:hover svg {
    stroke: var(--color-text-secondary);
}

#page-user-center .uc-sidebar-item.active {
    background: var(--color-active);
    color: var(--color-text);
    font-weight: 550;
}

#page-user-center .uc-sidebar-item.active svg {
    stroke: var(--color-text);
}

/* Stat Cards Grid */
.uc-stat-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.uc-stat-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 18px 20px;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.uc-stat-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

.uc-stat-card-label {
    font-size: 13px;
    color: var(--color-text-secondary);
    font-weight: 500;
    margin-bottom: 10px;
    line-height: 1;
}

.uc-stat-card-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-text-secondary);
    letter-spacing: -0.02em;
    line-height: 1.2;
    font-family: 'Sora', sans-serif;
}

.uc-stat-card-value.small {
    font-size: 18px;
}

.uc-stat-card-sub {
    font-size: 11px;
    color: var(--color-muted);
    margin-top: 4px;
}

@media (max-width: 1024px) {
    .uc-stat-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .uc-stat-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .uc-stat-card {
        padding: 14px 14px;
    }

    .uc-stat-card-value {
        font-size: 18px;
    }

    .uc-stat-card-label {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .uc-stat-cards {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .uc-stat-card {
        padding: 12px 14px;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .uc-stat-card-label {
        font-size: 12px;
        margin-bottom: 0;
    }

    .uc-stat-card-value {
        font-size: 16px;
    }
}

/* Detail Section Filter */
.uc-detail-filter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    padding: 16px 20px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.uc-detail-tabs {
    display: flex;
    gap: 4px;
    background: var(--color-bg);
    padding: 3px;
    border-radius: 8px;
}

.uc-detail-tab {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-secondary);
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.uc-detail-tab:hover {
    color: var(--color-text);
}

.uc-detail-tab.active {
    background: var(--color-surface);
    color: var(--color-text);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.uc-detail-date-filter {
    display: flex;
    align-items: center;
    gap: 8px;
}

.uc-date-input {
    padding: 7px 12px;
    font-size: 13px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-surface);
    color: var(--color-text);
    outline: none;
    cursor: pointer;
    transition: border-color 0.15s ease;
}

.uc-date-input:focus {
    border-color: var(--color-blue);
}

.uc-empty-row td {
    text-align: center;
    padding: 40px 20px !important;
    color: var(--color-muted) !important;
}

/* Detail responsive */
@media (max-width: 768px) {
    .uc-detail-filter {
        flex-direction: column;
        align-items: stretch;
        padding: 14px;
        gap: 12px;
    }

    .uc-detail-tabs {
        justify-content: center;
    }

    .uc-detail-tab {
        flex: 1;
        padding: 10px 12px;
    }

    .uc-detail-date-filter {
        flex-wrap: wrap;
        justify-content: center;
    }

    .uc-date-input {
        flex: 1;
        min-width: 0;
    }

    .uc-detail-date-filter .btn-secondary {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .uc-detail-filter {
        padding: 12px;
    }

    .uc-detail-tab {
        font-size: 12px;
        padding: 8px 10px;
    }

    .uc-date-input {
        font-size: 12px;
        padding: 6px 8px;
    }
}

/* Credit Page */
.uc-credit-breakdown {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.uc-credit-item {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 16px 20px;
}

.uc-credit-item-label {
    font-size: 12px;
    color: var(--color-text-secondary);
    font-weight: 500;
    margin-bottom: 8px;
}

.uc-credit-item-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.uc-credit-item-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--color-text-secondary);
    font-family: 'Sora', sans-serif;
    letter-spacing: -0.02em;
}

.uc-credit-purchase-btn {
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 500;
    color: #fff;
    background: #333;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.uc-credit-purchase-btn:hover {
    background: #000;
}

/* Credit Flow List */
.uc-flow-type-select {
    padding: 6px 24px 6px 12px;
    font-size: 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-text);
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
}

.uc-flow-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    transition: border-color 0.15s ease;
}

.uc-flow-item:hover {
    border-color: var(--color-border-strong);
}

.uc-flow-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.uc-flow-type {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text);
}

.uc-flow-time {
    font-size: 11px;
    color: var(--color-muted);
}

.uc-flow-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.uc-flow-amount {
    font-size: 15px;
    font-weight: 600;
    font-family: 'Sora', sans-serif;
}

.uc-flow-amount.plus {
    color: var(--color-green);
}

.uc-flow-amount.minus {
    color: var(--color-red);
}

.uc-flow-balance {
    font-size: 11px;
    color: var(--color-muted);
}

/* Package List in Modal */
.uc-package-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.uc-package-card {
    background: #fafafa;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    padding: 18px 14px 14px;
    text-align: center;
    transition: border-color 0.15s ease;
    min-width: 0;
    overflow: hidden;
}

.uc-package-card:hover {
    border-color: #bbb;
}

.uc-package-name {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.uc-package-credit-row {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
    margin-bottom: 6px;
}

.uc-package-credit-num {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    font-family: 'Sora', sans-serif;
    line-height: 1;
}

.uc-package-credit-unit {
    font-size: 12px;
    color: #999;
}

.uc-package-credit {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    font-family: 'Sora', sans-serif;
    margin-bottom: 2px;
}

.uc-package-credit-label {
    font-size: 12px;
    color: #999;
    margin-bottom: 16px;
}

.uc-package-price {
    font-size: 14px;
    color: #666;
    margin-bottom: 4px;
}

.uc-package-period {
    font-size: 11px;
    color: #999;
    margin-bottom: 12px;
}

.uc-package-remark {
    font-size: 11px;
    color: #999;
    margin-bottom: 12px;
    line-height: 1.5;
}

.uc-package-buy-btn {
    width: 100%;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    background: #333;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.uc-package-buy-btn:hover {
    background: #000;
}

@media (max-width: 768px) {
    .uc-credit-breakdown {
        grid-template-columns: 1fr;
        gap: 10px;
    }

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

@media (max-width: 480px) {
    .uc-package-grid {
        grid-template-columns: 1fr;
    }
}

/* Touch device: disable hover effects */
@media (hover: none) and (pointer: coarse) {
    .uc-card:hover,
    .modal-close:hover,
    .btn-primary:hover,
    .btn-secondary:hover {
        transform: none !important;
        box-shadow: none !important;
        background: inherit !important;
    }
    .uc-card:hover {
        transform: none !important;
        box-shadow: none !important;
        border-color: rgba(229, 229, 229, 0.8) !important;
    }
    .modal-close:hover {
        background: #f5f5f5 !important;
        border-color: rgba(229, 229, 229, 0.8) !important;
    }
    /* Touch active state feedback */
    .uc-sidebar-item:active,
    .btn:active,
    button:active {
        transform: scale(0.97) !important;
        transition: transform 0.1s !important;
    }
    .modal-close:active {
        background: #e8e8e8 !important;
        transform: scale(0.92) !important;
    }
}

/* User Center Responsive */
@media (max-width: 1024px) {
    #page-user-center .marketplace-layout {
        flex-direction: column;
        min-height: auto;
    }

    #page-user-center .marketplace-sidebar {
        width: 100%;
        position: static;
    }

    #page-user-center .uc-sidebar {
        padding: 10px;
    }

    #page-user-center .uc-sidebar-nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 4px;
    }

    #page-user-center .uc-sidebar-item {
        flex: 0 0 auto;
        padding: 8px 12px;
    }
}

@media (max-width: 768px) {
    /* iOS: prevent auto-zoom on input focus */
    #page-user-center input,
    #page-user-center select,
    #page-user-center textarea,
    .modal-body input,
    .modal-body select,
    .modal-body textarea {
        font-size: 16px !important;
    }

    /* Marketplace layout stacked */
    #page-user-center .marketplace-layout {
        flex-direction: column;
        gap: 16px;
        min-height: auto;
    }

    #page-user-center .marketplace-sidebar {
        width: 100%;
        position: static;
    }

    #page-user-center .uc-sidebar {
        padding: 8px;
    }

    #page-user-center .uc-sidebar-nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 4px;
    }

    #page-user-center .uc-sidebar-item {
        flex: 0 0 auto;
        padding: 8px 12px;
        font-size: 13px;
    }

    #page-user-center .uc-sidebar-item svg {
        width: 14px;
        height: 14px;
    }

    /* Page header */
    .page-title {
        font-size: 24px;
    }

    .page-subtitle {
        font-size: 13px;
    }

    .page-header {
        margin-bottom: 24px;
    }

    /* Table horizontal scroll */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain auto;
        border-radius: 14px;
    }

    .table th {
        padding: 14px 16px;
        font-size: 11px;
        white-space: nowrap;
    }

    .table td {
        padding: 14px 16px;
        font-size: 12px;
        white-space: nowrap;
    }

    /* Table row touch target */
    .table td,
    .table th {
        min-height: 44px;
    }

    .table tbody tr {
        min-height: 44px;
    }

    /* Charts */
    .chart-container {
        padding: 20px;
        border-radius: 14px;
    }

    .chart-title {
        font-size: 14px;
        margin-bottom: 14px;
    }

    /* Stats cards */
    #usage-stats-cards,
    #usage-stats-today-cards {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    #usage-stats-cards > div,
    #usage-stats-today-cards > div {
        padding: 16px !important;
    }

    /* Prevent label text from breaking vertically */
    #usage-stats-cards span,
    #usage-stats-today-cards span {
        white-space: nowrap !important;
    }

    /* Tabs - horizontal scroll */
    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        padding-bottom: 4px;
        gap: 4px;
    }

    .tab {
        flex-shrink: 0;
        font-size: 12px;
        padding: 8px 14px;
    }

    /* Subscribe plans */
    #subscribe-info-cards > div:first-child {
        padding: 16px !important;
    }

    #subscribe-info-cards > div:first-child > div:nth-child(2) {
        font-size: 18px !important;
    }

    /* Subscribe credit info */
    #subscribe-info-cards > div:nth-child(2) > div {
        gap: 12px !important;
    }

    #subscribe-info-cards > div:nth-child(2) {
        padding: 12px 16px !important;
    }

    /* Hide vertical dividers in credit info on mobile */
    #subscribe-info-cards > div:nth-child(2) [style*="width:1px"] {
        display: none !important;
    }

    /* Purchased items grid */
    #purchased-skills {
        grid-template-columns: 1fr !important;
    }

    #purchased-tools {
        grid-template-columns: 1fr !important;
    }

    /* Package cards */
    #section-platform > div:last-child {
        grid-template-columns: 1fr !important;
    }

    .package-card {
        padding: 24px;
    }

    /* Profile section */
    #section-profile > div:nth-child(2) {
        grid-template-columns: 1fr !important;
    }

    /* Logs filter */
    #section-logs > div:first-of-type {
        padding: 16px !important;
        gap: 8px !important;
    }

    #section-logs > div:first-of-type > div {
        min-width: calc(50% - 8px) !important;
        flex: 1 1 calc(50% - 8px);
    }

    /* Modals - bottom sheet */
    .modal-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .modal-overlay.show {
        align-items: flex-end;
    }

    .modal {
        width: 100%;
        max-width: 100%;
        border-radius: 24px 24px 0 0;
        max-height: 85vh;
        margin: 0;
        padding: 24px 20px 32px;
        padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px));
        animation: slideUp 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    }

    @keyframes slideUp {
        from { transform: translateY(100%); opacity: 0; }
        to { transform: translateY(0); opacity: 1; }
    }

    .modal-header {
        margin-bottom: 20px;
    }

    .modal-title {
        font-size: 18px;
    }

    .modal-body .form-group {
        margin-bottom: 14px;
    }

    .modal-body .form-label {
        font-size: 12px;
        margin-bottom: 4px;
    }

    .modal-body .form-input,
    .modal-body .form-select,
    .modal-body .form-textarea {
        font-size: 13px;
        padding: 10px 14px;
    }

    .modal-close {
        top: 16px;
        right: 16px;
        width: 36px;
        height: 36px;
        background: #f5f5f5;
        border: none;
    }

    /* Touch target minimum size */
    .btn-primary,
    .btn-secondary {
        min-height: 44px;
    }

    #page-user-center .uc-sidebar-item {
        min-height: 44px;
    }

    .tab {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    /* API Key cards */
    .apikey-card {
        padding: 20px;
        border-radius: 14px;
        max-width: 100%;
        overflow: hidden;
    }

    .apikey-value {
        padding: 10px 14px;
        gap: 8px;
    }

    .apikey-value code {
        font-size: 11px;
        word-break: break-all;
        flex: 1;
        min-width: 0;
    }

    .apikey-name {
        font-size: 14px;
    }

    /* Upload/filter buttons */
    #section-publish button.btn-primary:first-of-type,
    #section-apikeys button.btn-primary:first-of-type {
        width: 100%;
        justify-content: center;
    }
}

/* Landscape phones (480px - 768px) */
@media (max-width: 768px) and (orientation: landscape) {
    .modal {
        max-height: 80vh;
        padding: 16px 20px 20px;
        padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    }

    .modal-header {
        margin-bottom: 12px;
        padding-top: 12px !important;
    }

    .modal-body {
        padding-bottom: 16px !important;
    }

    .modal-body .form-group {
        margin-bottom: 8px;
    }

    .modal-body button {
        padding: 10px !important;
    }

    #usage-stats-cards,
    #usage-stats-today-cards {
        grid-template-columns: 1fr 1fr !important;
        width: 100% !important;
        max-width: 100% !important;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 20px;
    }

    .page-subtitle {
        font-size: 12px;
    }

    .page-header {
        margin-bottom: 20px;
    }

    /* Sidebar */
    #page-user-center .uc-sidebar {
        padding: 6px;
    }

    #page-user-center .uc-sidebar-item {
        padding: 6px 10px;
        font-size: 12px;
        gap: 6px;
    }

    #page-user-center .uc-sidebar-item svg {
        width: 14px;
        height: 14px;
    }

    /* Stats cards */
    #usage-stats-cards,
    #usage-stats-today-cards {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    #usage-stats-cards {
        margin-bottom: 10px !important;
    }

    #usage-stats-today-cards {
        margin-bottom: 24px !important;
    }

    #usage-stats-cards > div,
    #usage-stats-today-cards > div {
        padding: 16px !important;
    }

    /* Charts */
    .chart-container {
        padding: 14px;
        border-radius: 12px;
        margin-bottom: 16px;
    }

    .chart-title {
        font-size: 13px;
        margin-bottom: 10px;
    }

    /* Tabs */
    .tab {
        font-size: 11px;
        padding: 6px 12px;
    }

    /* Table */
    .table th {
        padding: 10px 12px;
        font-size: 10px;
    }

    .table td {
        padding: 10px 12px;
        font-size: 11px;
    }

    /* Subscribe */
    #subscribe-info-cards {
        gap: 10px !important;
    }

    #subscribe-info-cards > div:first-child {
        padding: 14px !important;
    }

    #subscribe-info-cards > div:first-child > div:nth-child(2) {
        font-size: 16px !important;
    }

    #subscribe-info-cards > div:nth-child(2) {
        padding: 10px 14px !important;
    }

    #subscribe-info-cards > div:nth-child(2) > div {
        gap: 8px !important;
    }

    /* Plan cards */
    #section-subscribe > div:nth-child(3) {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }

    #section-subscribe > div:nth-child(3) > div {
        padding: 20px !important;
    }

    /* Purchased items */
    #purchased-skills > div,
    #purchased-tools > div {
        padding: 16px !important;
    }

    /* Publish section */
    #section-publish button.btn-primary:first-of-type,
    #section-apikeys button.btn-primary:first-of-type {
        font-size: 12px !important;
        padding: 8px 16px !important;
    }

    /* Logs filter */
    #section-logs > div:first-of-type > div {
        min-width: 100% !important;
        flex: 1 1 100%;
    }

    #section-logs > div:first-of-type {
        padding: 12px !important;
        border-radius: 12px !important;
        gap: 8px !important;
    }

    /* API Keys */
    .apikey-card {
        padding: 14px;
        border-radius: 12px;
    }

    .apikey-header {
        gap: 8px;
        margin-bottom: 10px;
    }

    .apikey-name {
        font-size: 13px;
    }

    .apikey-value {
        padding: 8px 10px;
        gap: 6px;
    }

    .apikey-value code {
        font-size: 10px;
        word-break: break-all;
    }

    .copy-btn {
        padding: 4px 10px;
        font-size: 11px;
        flex-shrink: 0;
    }

    /* Package cards */
    .package-card {
        padding: 20px;
    }

    .package-card .package-name {
        font-size: 16px !important;
    }

    .package-card .package-price {
        font-size: 22px !important;
    }

    .package-card .package-features li {
        font-size: 12px !important;
        padding: 4px 0 !important;
    }

    /* Profile */
    .form-block {
        padding: 20px !important;
        border-radius: 14px !important;
    }

    .form-block h3 {
        font-size: 15px !important;
        margin-bottom: 16px !important;
    }

    .form-block .form-group {
        margin-bottom: 14px !important;
    }

    .form-block .form-label {
        font-size: 12px !important;
    }

    /* Modal */
    .modal-overlay {
        padding: 12px !important;
    }

    .modal {
        padding: 20px 16px 28px;
        padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
        max-height: 90vh;
    }

    .modal-title {
        font-size: 16px;
    }

    .modal-header {
        margin-bottom: 16px;
    }

    .modal-close {
        top: 12px;
        right: 12px;
        width: 32px;
        height: 32px;
    }

    .modal-body .form-input,
    .modal-body .form-select,
    .modal-body .form-textarea {
        font-size: 16px;
        padding: 10px 12px;
    }

    .modal-body {
        padding: 0 16px 24px !important;
    }

    .modal-body .form-group {
        margin-bottom: 12px;
    }

    .modal-body button {
        font-size: 13px !important;
        padding: 10px !important;
    }
}

/* API Keys table - no wrap + sticky action column */
.uc-apikeys-table th,
.uc-apikeys-table td {
    white-space: nowrap;
}

.uc-apikeys-table .uc-sticky-col {
    position: sticky;
    right: 0;
    background: #fff;
    box-shadow: -4px 0 8px rgba(0, 0, 0, 0.06);
    z-index: 1;
}

.uc-apikeys-table thead .uc-sticky-col {
    background: #f9fafb;
}

/* API Key name tooltip */
.uc-key-name {
    cursor: default;
}

.uc-tooltip {
    position: fixed;
    background: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 99999;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Permission config tabs */
.perm-tab {
    flex: 1;
    text-align: center;
    padding: 10px 0;
    font-size: 13px;
    font-weight: 500;
    color: #999;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.perm-tab:hover {
    color: #666;
}

.perm-tab.active {
    color: var(--color-blue, #2563eb);
    border-bottom-color: var(--color-blue, #2563eb);
}

/* Permission list items */
.perm-item {
    transition: background 0.15s;
}

.perm-item:hover {
    background: #f8fafc;
}

.perm-item-all {
    background: #fafbfc;
}

.perm-item-all:hover {
    background: #f1f5f9;
}
