/* ==========================================
   IDC洞察 — Design System & Global Styles
   Theme: Modern Minimal (Apple/SaaS inspired)
   ========================================== */

/* --- CSS Variables (Design Tokens) --- */
:root {
    /* Primary palette — Cool Indigo / Slate */
    --primary-50: #f5f7ff;
    --primary-100: #ebf0fe;
    --primary-200: #ced9fd;
    --primary-300: #b1c2fc;
    --primary-400: #7794f9;
    --primary-500: #3d66f6;
    --primary-600: #375ce0;
    --primary-700: #2e4dc5;
    --primary-800: #253d9e;
    --primary-900: #1e3280;

    /* Semantic colors */
    --success-50: #ecfdf5;
    --success-200: #a7f3d0;
    --success-500: #10b981;
    --success-600: #059669;

    --warning-50: #fffbeb;
    --warning-200: #fde68a;
    --warning-500: #f59e0b;
    --warning-600: #d97706;

    --danger-50: #fef2f2;
    --danger-200: #fecaca;
    --danger-500: #ef4444;
    --danger-600: #dc2626;

    /* Neutrals - High contrast modern grays */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* Core Application Variables */
    --bg: #f9fafb;
    --bg-secondary: #f3f4f6;
    --surface: #ffffff;
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-tertiary: #9ca3af;
    --border: #e5e7eb;
    --border-hover: #d1d5db;

    /* Shadows - extremely refined and soft */
    --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;

    /* Spacing & Layout */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);

    --navbar-height: 72px;
}

[data-theme="dark"] {
    --bg: #030712;
    --bg-secondary: #111827;
    --surface: #1f2937;
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-tertiary: #9ca3af;
    --border: #374151;
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3);
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

a:hover {
    color: var(--primary-700);
}

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

/* --- Navbar --- */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    border-bottom: 1px solid var(--border);
    height: var(--navbar-height);
}

[data-theme="dark"] .navbar {
    background: rgba(31, 41, 55, 0.7);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-6);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.nav-logo i {
    color: var(--primary-500);
    font-size: 1.3rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
    background: var(--gray-100);
}

[data-theme="dark"] .nav-link:hover,
[data-theme="dark"] .nav-link.active {
    background: var(--gray-800);
}

/* --- Main Structure --- */
.main-content {
    flex: 1;
    width: 100%;
}

.footer {
    padding: var(--space-8) 0;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.85rem;
}

.footer-copyright {
    font-weight: 600;
    margin-bottom: var(--space-2);
}

.footer-disclaimer {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    max-width: 800px;
    margin: var(--space-4) auto 0;
    line-height: 1.6;
    padding-top: var(--space-4);
    border-top: 1px solid var(--border);
}

.footer-disclaimer i {
    margin-right: 4px;
    color: var(--gray-400);
}

/* ======================
   HERO / INDEX PAGE
   ====================== */
.hero-section {
    position: relative;
    min-height: calc(100vh - var(--navbar-height));
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    width: 100%;
    max-width: 780px;
    padding: var(--space-8) var(--space-6);
}

.hero-title {
    font-size: clamp(3.5rem, 8vw, 4.5rem);
    font-weight: 800;
    margin-bottom: var(--space-2);
    letter-spacing: -0.04em;
    line-height: 1.1;
    color: var(--text-primary);
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-6);
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.hero-meanings {
    display: flex;
    justify-content: center;
    gap: var(--space-3);
    margin-bottom: var(--space-10);
    flex-wrap: nowrap;
    /* 强制单行 */
    overflow-x: auto;
    padding: 4px;
    scrollbar-width: none;
    /* Hide scrollbar Firefox */
}

.hero-meanings::-webkit-scrollbar {
    display: none;
    /* Hide scrollbar Chrome/Safari */
}

.meaning-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--space-2);
    padding: 6px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    white-space: nowrap;
}

.meaning-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-300);
}

.meaning-char {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--primary-500);
    background: var(--primary-50);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.meaning-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Search Form */
.search-form {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: var(--space-2);
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
}

.search-input-wrapper:focus-within {
    border-color: var(--primary-300);
    box-shadow: 0 0 0 4px var(--primary-50), var(--shadow-md);
    transform: translateY(-1px);
}

.search-icon {
    position: absolute;
    left: var(--space-6);
    color: var(--text-tertiary);
    font-size: 1.2rem;
    pointer-events: none;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-family: inherit;
    font-size: 1.1rem;
    color: var(--text-primary);
    padding: var(--space-4) var(--space-4) var(--space-4) var(--space-16);
    min-width: 0;
}

.search-input::placeholder {
    color: var(--text-tertiary);
    font-weight: 400;
}

.search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border: none;
    border-radius: 50%;
    background: var(--primary-500);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.search-btn:hover {
    background: var(--primary-600);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(61, 102, 246, 0.3);
}

.search-btn:active {
    transform: scale(0.98);
}

.error-message {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-6);
    padding: var(--space-3) var(--space-5);
    background: var(--danger-50);
    color: var(--danger-600);
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Background aesthetic decor */
.hero-bg-decoration {
    display: none;
    /* Keep it perfectly minimal, remove noisy circles */
}

/* ======================
   OVERVIEW PAGE
   ====================== */
.overview-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-12) var(--space-6);
}

.section-title {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.section-subtitle {
    margin-top: var(--space-2);
    color: var(--text-secondary);
    font-size: 1rem;
}

.overview-header {
    margin-bottom: var(--space-8);
}

.hero-stats {
    margin-top: var(--space-6);
    margin-bottom: var(--space-16);
}

/* Feature Grid at bottom to balance weight */
.hero-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-6);
    width: 100%;
    max-width: 900px;
    margin-top: var(--space-8);
    text-align: left;
}

.feature-item {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    padding: var(--space-5);
    border-radius: var(--radius-lg);
    display: flex;
    gap: var(--space-4);
    transition: all 0.3s ease;
}

.feature-item:hover {
    background: white;
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.feature-item i {
    font-size: 1.5rem;
    color: var(--primary-500);
    margin-top: 4px;
}

.feature-text h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.feature-text p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

@media (max-width: 768px) {
    .hero-features {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }
}

.filter-bar {
    margin-top: var(--space-6);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.filter-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.filter-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-right: var(--space-3);
    min-width: 80px;
}

.filter-chip {
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg);
    border: 1px solid var(--border);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.filter-chip:hover {
    color: var(--text-primary);
    border-color: var(--gray-300);
    background: var(--gray-50);
}

.filter-chip.active {
    background: var(--primary-500);
    color: white;
    border-color: var(--primary-500);
    box-shadow: 0 2px 4px rgba(61, 102, 246, 0.2);
}

.sites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-6);
}

.site-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.site-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--gray-300);
}

.site-card-logo {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: var(--space-6);
}

.site-card-logo img {
    max-height: 48px;
    object-fit: contain;
    /* 通过投影自动衬托透明纯白Logo的轮廓，对普通彩色Logo也有轻微立体浮雕效果 */
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2)) drop-shadow(0 0 8px rgba(0, 0, 0, 0.15));
}

.site-card-logo-fallback {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--primary-100);
    color: var(--primary-600);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.site-card-body {
    padding: var(--space-5);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.site-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-1);
    letter-spacing: -0.01em;
}

.site-card-domain {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    margin-bottom: var(--space-4);
}

.site-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.site-tag {
    font-size: 0.75rem;
    padding: 2px 8px;
    background: var(--primary-50);
    color: var(--primary-700);
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.site-tag i {
    margin-right: 2px;
}

.site-tag-alt {
    font-size: 0.75rem;
    padding: 2px 8px;
    background: var(--gray-100);
    color: var(--gray-700);
    border-radius: var(--radius-sm);
    font-weight: 500;
}

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

.site-card-type {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--gray-100);
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

/* ======================
   DETAIL PAGE
   ====================== */
.detail-page {
    max-width: 1100px;
    margin: 0 auto;
    padding-bottom: var(--space-16);
}

.detail-hero {
    position: relative;
    padding: var(--space-12) var(--space-8);
    background: var(--surface);
    border-radius: var(--radius-xl);
    margin: var(--space-8) var(--space-6);
    box-shadow: 0 10px 30px -10px rgba(61, 102, 246, 0.15), inset 0 0 0 1px var(--border);
    overflow: hidden;
}

/* Subtle glowing orb under the hero */
.detail-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(119, 148, 249, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 0;
    pointer-events: none;
}

.detail-hero-inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    gap: var(--space-8);
}

.detail-logo-area {
    flex-shrink: 0;
}

.detail-logo,
.detail-logo-fallback {
    width: 140px;
    /* Limit width */
    height: auto;
    /* Auto height to prevent stretching */
    min-height: 80px;
    border-radius: var(--radius-xl);
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}

.detail-logo img {
    width: 100%;
    height: auto;
    object-fit: contain;
    /* 自动勾勒白色透明商家的边缘 */
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.2)) drop-shadow(0 0 10px rgba(0, 0, 0, 0.15));
}

.detail-logo-fallback {
    background: linear-gradient(135deg, var(--primary-100), var(--primary-50));
    color: var(--primary-500);
    font-size: 3rem;
    font-weight: 800;
}

.detail-info {
    flex: 1;
}

.detail-company-name {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: var(--space-3);
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.detail-meta-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4) var(--space-8);
    margin-bottom: var(--space-6);
}

.detail-meta-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.detail-meta-item i {
    color: var(--primary-500);
    font-size: 1.1rem;
}

.refresh-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: var(--space-4);
}

.refresh-btn i {
    color: inherit;
    font-size: 0.85rem;
}

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

.refresh-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Badges */
.detail-badges {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
}

.badge {
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.badge-system {
    background: var(--gray-50);
    color: var(--gray-600);
    border: 1px solid var(--gray-200);
}

.badge-count {
    background: var(--primary-50);
    color: var(--primary-600);
    border: 1px solid var(--primary-200);
}

.badge-self {
    background: var(--success-50);
    color: var(--success-600);
    border: 1px solid var(--success-200);
}

.badge-agent {
    background: var(--warning-50);
    color: var(--warning-600);
    border: 1px solid var(--warning-200);
}

/* Sections */
.detail-section {
    padding: 0 var(--space-6);
    margin-top: var(--space-12);
}

.detail-section-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: var(--space-6);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.detail-section-title i {
    color: var(--primary-500);
}

/* Relations (Upstream/Downstream) */
.relations-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-6);
}

@media (min-width: 768px) {
    .relations-container {
        grid-template-columns: 1fr 1fr;
    }
}

.relation-group {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    box-shadow: var(--shadow-sm);
}

.relation-label {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: var(--space-4);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.relation-cards {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
}

.relation-card {
    display: inline-flex;
    align-items: center;
    padding: var(--space-2) var(--space-4);
    background: var(--bg);
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    transition: all var(--transition-fast);
    max-width: 100%;
    overflow: hidden;
}

.relation-card:hover {
    border-color: var(--primary-400);
    background: var(--primary-50);
    box-shadow: 0 4px 12px rgba(61, 102, 246, 0.1);
    transform: translateY(-2px);
}

.relation-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-right: var(--space-3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
    /* 控制最大名宽度，避免长名字跨行或溢出 */
}

.relation-logo {
    max-height: 28px;
    max-width: 80px;
    width: auto;
    object-fit: contain;
    margin-right: var(--space-3);
    border-radius: 4px;
    /* 自动勾勒白色透明商家的边缘 */
    filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.15));
}

.relation-domain {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    font-family: var(--font-mono);
    flex-shrink: 0;
    margin-left: auto;
}

/* Product List */
.product-group {
    margin-bottom: var(--space-8);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.product-group-title {
    padding: var(--space-5) var(--space-6);
    background: var(--surface);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    border-bottom: 1px solid var(--border);
    transition: background var(--transition-fast);
}

.product-group-title:hover {
    background: var(--primary-50);
}

.group-toggle-icon {
    font-size: 0.9rem;
    color: var(--primary-500);
    transition: transform var(--transition-fast);
}

.product-group.collapsed .group-toggle-icon {
    transform: rotate(-90deg);
}

.product-count {
    margin-left: auto;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-700);
    background: var(--primary-100);
    padding: 4px 12px;
    border-radius: var(--radius-full);
}

.product-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-5);
    padding: var(--space-6);
    background: var(--bg);
}

.product-group.collapsed .product-cards {
    display: none;
}

.product-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    border-color: var(--primary-300);
    box-shadow: var(--shadow-lg);
    transform: translateY(-5px);
}

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

.product-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    margin: 0;
}

/* Product Tag (Agent/Self) */
.product-tag {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: 3px var(--space-3);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.product-tag-self {
    background: var(--success-50);
    color: var(--success-600);
    border: 1px solid var(--success-200);
}

.product-tag-agent {
    background: var(--warning-50);
    color: var(--warning-600);
    border: 1px solid var(--warning-200);
}

.product-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-4);
    border-bottom: 1px dashed var(--gray-200);
}

.product-price {
    display: flex;
    align-items: baseline;
}

.price-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--danger-500);
    letter-spacing: -0.02em;
}

.price-cycle {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    font-weight: 500;
    margin-left: 2px;
}

.product-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-6);
    max-height: 140px;
    overflow-y: auto;
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: var(--gray-300) transparent;
}

/* Custom Scrollbar for Descriptions */
.product-desc::-webkit-scrollbar {
    width: 4px;
}

.product-desc::-webkit-scrollbar-track {
    background: transparent;
}

.product-desc::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 4px;
}

/* HTML Description Content */
.product-desc-html {
    font-size: 0.88rem;
}

.product-desc-html ul,
.product-desc-html ol {
    padding-left: var(--space-4);
    margin: var(--space-2) 0;
}

.product-desc-html li {
    margin-bottom: var(--space-1);
    color: var(--text-secondary);
}

.product-desc-html p {
    margin-bottom: var(--space-2);
}

.product-desc-html strong {
    color: var(--gray-900);
}

.product-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: auto;
}

.product-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
    padding: var(--space-2) var(--space-5);
    background: var(--primary-500);
    border-radius: var(--radius-full);
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(61, 102, 246, 0.2);
}

.product-link:hover {
    transform: translateY(-2px);
    background: var(--primary-600);
    box-shadow: 0 4px 10px rgba(61, 102, 246, 0.3);
    color: white;
}

/* V10 Parent Categories */
.group-parent-name {
    color: var(--text-tertiary);
    font-weight: 500;
}

.group-separator {
    color: var(--border);
    font-size: 0.7rem;
}

/* Collecting Page Styles */
.collecting-section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.collecting-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: var(--space-8);
    max-width: 500px;
    width: 100%;
    text-align: center;
    border: 1px solid var(--border);
}

.collecting-icon {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-6);
    background: var(--primary-50);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-500);
    font-size: 2rem;
}

.pulse-ring {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border: 2px solid var(--primary-300);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.9);
        opacity: 1;
    }

    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

.collecting-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--space-2);
}

.collecting-domain {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-2);
}

.collecting-status {
    display: inline-block;
    padding: 4px 12px;
    background: var(--primary-50);
    color: var(--primary-600);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: var(--space-6);
}

.collecting-progress {
    margin-bottom: var(--space-6);
}

.progress-bar-wrapper {
    height: 8px;
    background: var(--gray-100);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: var(--space-3);
    position: relative;
}

.progress-bar {
    height: 100%;
    background: var(--primary-500);
    width: 0%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-bar-animated {
    width: 30%;
    position: absolute;
    animation: indeterminate 1.5s infinite ease-in-out;
}

@keyframes indeterminate {
    0% {
        left: -30%;
    }

    100% {
        left: 100%;
    }
}

.progress-text {
    font-size: 0.9rem;
    color: var(--text-tertiary);
}

.collecting-steps {
    text-align: left;
    margin-bottom: var(--space-8);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding: 0 var(--space-6);
}

.step-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    color: var(--text-tertiary);
    font-size: 0.95rem;
}

.step-item .step-icon {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.step-item[data-active="true"] {
    color: var(--primary-500);
    font-weight: 500;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}

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

/* Jump Page Styles */
.jump-section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
    padding: var(--space-6);
}

.jump-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: var(--space-10);
    max-width: 550px;
    width: 100%;
    text-align: center;
}

.jump-icon {
    width: 80px;
    height: 80px;
    background: var(--gray-50);
    color: var(--gray-400);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.25rem;
    margin: 0 auto var(--space-8);
}

.jump-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: var(--space-4);
    letter-spacing: -0.02em;
}

.jump-warning {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-8);
    font-size: 1.05rem;
}

.jump-target {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-4) var(--space-6);
    margin-bottom: var(--space-10);
    text-align: left;
    word-break: break-all;
}

.jump-url-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.jump-url-text {
    font-size: 0.95rem;
    color: var(--primary-600);
    font-weight: 500;
}

.jump-actions {
    display: flex;
    gap: var(--space-4);
    margin-bottom: var(--space-8);
}

.jump-btn-confirm {
    flex: 1;
    background: var(--primary-500);
    color: white;
    padding: var(--space-4) var(--space-6);
    border-radius: var(--radius-lg);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.jump-btn-confirm:hover {
    background: var(--primary-600);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(61, 102, 246, 0.25);
}

.jump-btn-cancel {
    flex: 1;
    background: var(--surface);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: var(--space-4) var(--space-6);
    border-radius: var(--radius-lg);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.jump-btn-cancel:hover {
    background: var(--gray-50);
    color: var(--text-primary);
}

.jump-auto-redirect {
    font-size: 0.85rem;
    color: var(--text-tertiary);
}

#countdown {
    color: var(--primary-500);
    font-weight: 700;
}

/* ======================
   Snapshots & Status
   ====================== */
.snapshot-section {
    margin-bottom: var(--space-8);
}

.snapshot-tabs {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--space-4);
    box-shadow: var(--shadow-sm);
}

.snapshot-tabs-header {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: var(--space-3);
    display: flex;
    align-items: center;
    gap: 8px;
}

.snapshot-tabs-list {
    display: flex;
    gap: var(--space-3);
    overflow-x: auto;
    scrollbar-width: none;
}

.snapshot-tabs-list::-webkit-scrollbar {
    display: none;
}

.snapshot-tab-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    background: var(--gray-50);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    transition: all 0.2s;
}

.snapshot-tab-item:hover {
    border-color: var(--primary-300);
    background: var(--primary-50);
    color: var(--primary-600);
}

.snapshot-tab-item.active {
    background: var(--primary-500);
    border-color: var(--primary-600);
    color: white;
    box-shadow: 0 4px 12px rgba(61, 102, 246, 0.2);
}

.tab-tag {
    font-size: 0.75rem;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.snapshot-tab-item.active .tab-tag {
    background: rgba(255, 255, 255, 0.3);
}

.closed-alert {
    background: #fffbeb;
    border: 1px solid #fef3c7;
    border-radius: var(--radius-lg);
    padding: var(--space-4) var(--space-6);
    color: #92400e;
    font-size: 0.95rem;
    margin-bottom: var(--space-8);
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
    line-height: 1.5;
}

.closed-alert i {
    font-size: 1.25rem;
    margin-top: 2px;
}

.product-source-mini {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    color: var(--slate-600);
    text-decoration: none;
    font-size: 0.73rem;
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    cursor: pointer;
}

.product-source-mini:hover {
    background: var(--primary-50);
    border-color: var(--primary-400);
    color: var(--primary-600);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(61, 102, 246, 0.15);
}

.product-source-mini i {
    font-size: 0.7rem;
    color: var(--primary-500);
}

.badge-closed-inline {
    font-size: 0.85rem;
    padding: 4px 12px;
    background: #fee2e2;
    color: #ef4444;
    border-radius: var(--radius-full);
    font-weight: 700;
    vertical-align: middle;
    margin-left: 12px;
}