/* ============ CSS Variables ============ */
:root {
    --primary: #1a73e8;
    --primary-dark: #1557b0;
    --primary-light: #e8f0fe;
    --accent: #00c9a7;
    --accent-dark: #00a88a;
    --gold: #f5a623;
    --gold-light: #fef3d6;
    --danger: #e74c3c;
    --success: #27ae60;
    --warning: #f39c12;
    --dark: #1a1a2e;
    --dark-2: #16213e;
    --dark-3: #0f3460;
    --text: #2c3e50;
    --text-light: #7f8c8d;
    --text-muted: #bdc3c7;
    --bg: #f8fafc;
    --bg-card: #ffffff;
    --border: #e2e8f0;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.15);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

/* ============ Reset & Base ============ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; min-height: 100vh; overflow-x: hidden; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; font-family: inherit; font-size: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }

/* ============ Navbar ============ */
.navbar { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-bottom: 1px solid var(--border); transition: var(--transition); }
.navbar.scrolled { box-shadow: var(--shadow); }
.nav-container { max-width: 1280px; margin: 0 auto; padding: 0 24px; height: 64px; display: flex; align-items: center; justify-content: space-between; }
.nav-logo { display: flex; align-items: center; gap: 8px; font-size: 1.25rem; font-weight: 700; color: var(--dark); }
.logo-icon { font-size: 1.5rem; }
.logo-version { font-size: 0.625rem; padding: 2px 6px; background: var(--primary); color: white; border-radius: 4px; font-weight: 700; vertical-align: super; }
.nav-links { display: flex; gap: 4px; }
.nav-link { padding: 8px 14px; border-radius: var(--radius-sm); font-weight: 500; color: var(--text); transition: var(--transition); font-size: 0.9375rem; display: flex; align-items: center; gap: 6px; }
.nav-link i { font-size: 0.8125rem; }
.nav-link:hover, .nav-link.active { color: var(--primary); background: var(--primary-light); }
.nav-auth { display: flex; align-items: center; gap: 12px; }
.mobile-menu-btn { display: none; background: none; font-size: 1.25rem; color: var(--text); }
.mobile-menu { display: none; position: fixed; top: 64px; left: 0; right: 0; background: white; padding: 16px; flex-direction: column; gap: 8px; border-bottom: 1px solid var(--border); box-shadow: var(--shadow); z-index: 999; }
.mobile-menu.show { display: flex; }
.mobile-menu a { padding: 12px 16px; border-radius: var(--radius-sm); font-weight: 500; transition: var(--transition); display: flex; align-items: center; gap: 8px; }
.mobile-menu a:hover { background: var(--primary-light); color: var(--primary); }

/* ============ Buttons ============ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 24px; border-radius: var(--radius-sm); font-weight: 600; font-size: 0.9375rem; transition: var(--transition); white-space: nowrap; }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: white; box-shadow: 0 4px 15px rgba(26, 115, 232, 0.3); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(26, 115, 232, 0.4); }
.btn-secondary { background: white; color: var(--primary); border: 2px solid var(--primary); }
.btn-secondary:hover { background: var(--primary-light); }
.btn-accent { background: linear-gradient(135deg, var(--accent), var(--accent-dark)); color: white; box-shadow: 0 4px 15px rgba(0, 201, 167, 0.3); }
.btn-accent:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0, 201, 167, 0.4); }
.btn-hero-login { background: rgba(255, 255, 255, 0.1); color: white; border: 2px solid rgba(255, 255, 255, 0.3); backdrop-filter: blur(4px); }
.btn-hero-login:hover { background: rgba(255, 255, 255, 0.2); border-color: rgba(255, 255, 255, 0.5); transform: translateY(-2px); }
.btn-gold { background: linear-gradient(135deg, var(--gold), #e09100); color: white; box-shadow: 0 4px 15px rgba(245, 166, 35, 0.3); }
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(245, 166, 35, 0.4); }
.btn-ghost { background: transparent; color: var(--text); padding: 8px 16px; }
.btn-ghost:hover { background: var(--bg); }
.btn-danger { background: var(--danger); color: white; }
.btn-sm { padding: 6px 14px; font-size: 0.8125rem; }
.btn-lg { padding: 14px 36px; font-size: 1.0625rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none !important; }
.btn .spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.3); border-top-color: white; border-radius: 50%; animation: spin 0.6s linear infinite; }
.btn-icon-remove { background: none; color: var(--danger); padding: 4px 8px; font-size: 0.875rem; border-radius: 4px; }
.btn-icon-remove:hover { background: rgba(231, 76, 60, 0.1); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ Hero Section ============ */
.hero { min-height: 100vh; display: flex; align-items: center; background: linear-gradient(135deg, var(--dark) 0%, var(--dark-2) 50%, var(--dark-3) 100%); position: relative; overflow: hidden; padding-top: 64px; }
.hero::before { content: ''; position: absolute; top: -50%; right: -20%; width: 800px; height: 800px; background: radial-gradient(circle, rgba(26, 115, 232, 0.15), transparent 70%); border-radius: 50%; }
.hero::after { content: ''; position: absolute; bottom: -30%; left: -10%; width: 600px; height: 600px; background: radial-gradient(circle, rgba(0, 201, 167, 0.1), transparent 70%); border-radius: 50%; }
.hero-container { max-width: 1280px; margin: 0 auto; padding: 60px 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; position: relative; z-index: 1; }
.hero-badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 16px; background: rgba(0, 201, 167, 0.15); border: 1px solid rgba(0, 201, 167, 0.3); border-radius: 50px; color: var(--accent); font-size: 0.875rem; font-weight: 600; margin-bottom: 24px; }
.hero h1 { font-size: 3rem; font-weight: 800; color: white; line-height: 1.2; margin-bottom: 20px; }
.hero h1 .gradient-text { background: linear-gradient(135deg, var(--accent), var(--primary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero-description { font-size: 1.0625rem; color: rgba(255, 255, 255, 0.7); margin-bottom: 36px; line-height: 1.8; }
.hero-buttons { display: flex; gap: 16px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 36px; margin-top: 48px; }
.hero-stat { text-align: center; }
.hero-stat .number { font-size: 1.75rem; font-weight: 800; color: white; }
.hero-stat .label { font-size: 0.8125rem; color: rgba(255, 255, 255, 0.5); margin-top: 4px; }

/* Hero Right Preview */
.hero-visual { position: relative; }
.dashboard-preview { background: rgba(255, 255, 255, 0.05); backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: var(--radius-lg); padding: 24px; position: relative; }
.dashboard-preview .preview-header { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; }
.preview-dot { width: 12px; height: 12px; border-radius: 50%; }
.preview-dot.red { background: #ff5f57; } .preview-dot.yellow { background: #ffbd2e; } .preview-dot.green { background: #28c840; }
.stock-preview-card { background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.stock-preview-card .stock-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.stock-preview-card .stock-name { color: white; font-weight: 600; font-size: 0.9375rem; }
.qs-badge { padding: 4px 12px; border-radius: 50px; font-weight: 700; font-size: 0.8125rem; }
.qs-badge.high { background: rgba(39, 174, 96, 0.2); color: #27ae60; }
.qs-badge.medium { background: rgba(245, 166, 35, 0.2); color: var(--gold); }
.qs-badge.low { background: rgba(231, 76, 60, 0.2); color: var(--danger); }
.mini-bar-group { display: flex; flex-direction: column; gap: 6px; }
.mini-bar { display: flex; align-items: center; gap: 8px; font-size: 0.75rem; color: rgba(255,255,255,0.5); }
.mini-bar-track { flex: 1; height: 4px; background: rgba(255,255,255,0.1); border-radius: 2px; overflow: hidden; }
.mini-bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--primary)); border-radius: 2px; }
.floating-tag { position: absolute; padding: 8px 16px; border-radius: var(--radius-sm); font-size: 0.8125rem; font-weight: 600; backdrop-filter: blur(10px); animation: float 3s ease-in-out infinite; }
.floating-tag.tag-1 { top: -20px; right: -20px; background: rgba(0, 201, 167, 0.2); border: 1px solid rgba(0, 201, 167, 0.3); color: var(--accent); animation-delay: 0s; }
.floating-tag.tag-2 { bottom: 40px; right: -30px; background: rgba(26, 115, 232, 0.2); border: 1px solid rgba(26, 115, 232, 0.3); color: #5da8ff; animation-delay: 1s; }
.floating-tag.tag-3 { bottom: -10px; left: 20px; background: rgba(245, 166, 35, 0.2); border: 1px solid rgba(245, 166, 35, 0.3); color: var(--gold); animation-delay: 2s; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* ============ Sections ============ */
.section { padding: 80px 24px; max-width: 1280px; margin: 0 auto; }
.section-header { text-align: center; margin-bottom: 48px; }
.section-header .section-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 14px; background: var(--primary-light); color: var(--primary); border-radius: 50px; font-size: 0.8125rem; font-weight: 600; margin-bottom: 16px; }
.section-header h2 { font-size: 2.25rem; font-weight: 800; color: var(--dark); margin-bottom: 16px; }
.section-header p { font-size: 1.0625rem; color: var(--text-light); max-width: 600px; margin: 0 auto; }
.section-title { font-size: 1.25rem; font-weight: 700; color: var(--dark); margin-bottom: 20px; display: flex; align-items: center; gap: 8px; }
.section-title i { color: var(--primary); }

/* Features Grid */
.features-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; max-width: 1000px; margin: 0 auto; }
.feature-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; transition: var(--transition); }
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--primary); }
.feature-card .icon { width: 56px; height: 56px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; margin-bottom: 20px; }
.feature-card .icon.blue { background: var(--primary-light); } .feature-card .icon.green { background: rgba(0, 201, 167, 0.1); }
.feature-card .icon.gold { background: var(--gold-light); } .feature-card .icon.purple { background: rgba(155, 89, 182, 0.1); }
.feature-card h3 { font-size: 1.125rem; font-weight: 700; margin-bottom: 12px; color: var(--dark); }
.feature-card p { font-size: 0.9375rem; color: var(--text-light); line-height: 1.7; margin-bottom: 16px; }
.feature-link { color: var(--primary); font-weight: 600; font-size: 0.875rem; display: flex; align-items: center; gap: 4px; }

/* ============ Market Overview (Home) ============ */
.market-overview-grid { max-width: 1280px; margin: 0 auto; }
.market-indices { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.market-index-card { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: var(--radius); padding: 20px; text-align: center; }
.idx-name { font-size: 0.875rem; color: rgba(255,255,255,0.5); margin-bottom: 4px; }
.idx-value { font-size: 1.5rem; font-weight: 800; color: white; }
.idx-change { font-size: 1rem; font-weight: 600; margin-top: 4px; }
.idx-change.up { color: #27ae60; } .idx-change.down { color: #e74c3c; }
.market-extra { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; padding-bottom: 40px; }
.market-stat-card { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08); border-radius: var(--radius-sm); padding: 16px; text-align: center; }
.mstat-label { font-size: 0.75rem; color: rgba(255,255,255,0.4); margin-bottom: 4px; }
.mstat-value { font-size: 1.125rem; font-weight: 700; color: white; }
.mstat-value .up, .up { color: #27ae60; } .mstat-value .down, .down { color: #e74c3c; }

/* ============ Top Stocks (Home) ============ */
.top-stocks-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.top-stock-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; transition: var(--transition); cursor: pointer; }
.top-stock-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.ts-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.ts-name { font-size: 1.0625rem; font-weight: 700; color: var(--dark); }
.ts-code { font-size: 0.8125rem; color: var(--text-muted); margin-top: 2px; }
.qs-score-ring { width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; font-weight: 800; border: 3px solid; }
.qs-score-ring.score-high { border-color: #27ae60; color: #27ae60; background: rgba(39,174,96,0.08); }
.qs-score-ring.score-medium { border-color: var(--gold); color: var(--gold); background: rgba(245,166,35,0.08); }
.qs-score-ring.score-low { border-color: #e67e22; color: #e67e22; background: rgba(230,126,34,0.08); }
.qs-score-ring.score-very-low { border-color: var(--danger); color: var(--danger); background: rgba(231,76,60,0.08); }
.ts-footer { display: flex; align-items: center; gap: 12px; }
.ts-price { font-weight: 600; color: var(--dark); font-size: 0.9375rem; }
.ts-change { font-size: 0.8125rem; font-weight: 600; }
.ts-change.up { color: #27ae60; } .ts-change.down { color: #e74c3c; }

/* Signal Tags */
.signal-tag { display: inline-flex; padding: 3px 10px; border-radius: 50px; font-size: 0.75rem; font-weight: 700; }
.signal-tag.strong_buy { background: rgba(39,174,96,0.1); color: #27ae60; }
.signal-tag.buy { background: rgba(0,201,167,0.1); color: var(--accent); }
.signal-tag.hold { background: rgba(245,166,35,0.1); color: var(--gold); }
.signal-tag.sell { background: rgba(231,76,60,0.1); color: #e74c3c; }
.signal-tag.strong_sell { background: rgba(192,57,43,0.1); color: #c0392b; }
.sector-tag { display: inline-flex; padding: 2px 8px; background: var(--bg); border-radius: 4px; font-size: 0.75rem; color: var(--text-light); }

/* ============ Page Layout ============ */
.page-container { max-width: 1200px; margin: 0 auto; padding: 80px 24px 60px; }
.page-header { margin-bottom: 32px; padding: 32px 0; border-bottom: 1px solid var(--border); }
.page-header h1 { font-size: 2rem; font-weight: 800; color: var(--dark); margin-bottom: 8px; }
.page-header p { color: var(--text-light); font-size: 1.0625rem; }

/* ============ Rating Page ============ */
.rating-search-box { margin-bottom: 32px; }
.rating-search-box .search-input-wrapper { max-width: 700px; position: relative; }
.rating-search-box .search-input { width: 100%; padding: 16px 16px 16px 48px; border: 2px solid var(--border); border-radius: var(--radius); font-size: 1.0625rem; background: var(--bg-card); transition: var(--transition); }
.rating-search-box .search-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(26,115,232,0.1); }
.rating-search-box .search-input-wrapper > i { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 1rem; }
.search-results-dropdown { position: absolute; top: 100%; left: 0; right: 0; background: white; border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); z-index: 100; display: none; max-height: 300px; overflow-y: auto; margin-top: 4px; }
.search-results-dropdown.show { display: block; }
.search-result-item { padding: 12px 16px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; transition: var(--transition); border-bottom: 1px solid var(--border); }
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--primary-light); }
.search-result-item .stock-code { font-weight: 600; color: var(--primary); margin-right: 12px; }
.search-result-item .stock-sector { font-size: 0.8125rem; color: var(--text-muted); padding: 2px 8px; background: var(--bg); border-radius: 4px; }

.rating-placeholder, .error-state { text-align: center; padding: 60px 24px; color: var(--text-light); }
.rating-ph-icon, .error-icon { font-size: 3rem; margin-bottom: 16px; }
.error-state h3 { color: var(--danger); }

/* Rating Card */
.rating-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 40px; }
.rating-card-top { padding: 28px 32px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); background: linear-gradient(135deg, rgba(26,115,232,0.03), rgba(0,201,167,0.03)); }
.rating-stock-info h2 { font-size: 1.5rem; font-weight: 800; color: var(--dark); }
.rating-stock-info h2 small { font-size: 0.875rem; color: var(--text-muted); font-weight: 500; margin-left: 8px; }
.rating-meta { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.rating-score-big { width: 100px; height: 100px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 4px solid; flex-shrink: 0; }
.rating-score-big.score-high { border-color: #27ae60; background: rgba(39,174,96,0.06); }
.rating-score-big.score-medium { border-color: var(--gold); background: rgba(245,166,35,0.06); }
.rating-score-big.score-low { border-color: #e67e22; background: rgba(230,126,34,0.06); }
.rating-score-big.score-very-low { border-color: var(--danger); background: rgba(231,76,60,0.06); }
.rating-score-big .score-number { font-size: 2rem; font-weight: 800; line-height: 1; }
.rating-score-big .score-label { font-size: 0.625rem; font-weight: 700; color: var(--text-muted); margin-top: 2px; letter-spacing: 0.5px; }
.rating-score-big.score-high .score-number { color: #27ae60; }
.rating-score-big.score-medium .score-number { color: var(--gold); }
.rating-score-big.score-low .score-number { color: #e67e22; }
.rating-score-big.score-very-low .score-number { color: var(--danger); }

.rating-body-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; padding: 32px; }
.rating-chart-container { display: flex; align-items: center; justify-content: center; }
.rating-dims { display: flex; flex-direction: column; gap: 14px; justify-content: center; }
.dim-row { display: flex; align-items: center; gap: 12px; }
.dim-info { display: flex; flex-direction: column; min-width: 48px; }
.dim-name { font-size: 0.875rem; font-weight: 600; color: var(--text); }
.dim-weight { font-size: 0.6875rem; color: var(--text-muted); }
.dim-bar-track { flex: 1; height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; min-width: 120px; }
.dim-bar-fill { height: 100%; border-radius: 4px; transition: width 0.8s ease; }
.dim-bar-fill.score-high { background: linear-gradient(90deg, #27ae60, #2ecc71); }
.dim-bar-fill.score-medium { background: linear-gradient(90deg, var(--gold), #f7c948); }
.dim-bar-fill.score-low { background: linear-gradient(90deg, #e67e22, #f39c12); }
.dim-bar-fill.score-very-low { background: linear-gradient(90deg, #e74c3c, #c0392b); }
.dim-score { font-size: 0.9375rem; font-weight: 700; min-width: 32px; text-align: right; }
.dim-score.score-high { color: #27ae60; } .dim-score.score-medium { color: var(--gold); }
.dim-score.score-low { color: #e67e22; } .dim-score.score-very-low { color: var(--danger); }

.rating-market-data { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; padding: 0 32px 24px; }
.mdata-item { text-align: center; padding: 16px 8px; background: var(--bg); border-radius: var(--radius-sm); }
.mdata-label { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 4px; }
.mdata-value { font-size: 1rem; font-weight: 700; color: var(--dark); }
.mdata-value.up { color: #27ae60; } .mdata-value.down { color: #e74c3c; }

.rating-ranking { display: flex; justify-content: space-between; align-items: center; padding: 16px 32px; border-top: 1px solid var(--border); }
.ranking-text { font-size: 0.9375rem; color: var(--text); font-weight: 600; }
.rating-change { font-size: 0.875rem; font-weight: 600; }
.rating-change.up { color: #27ae60; } .rating-change.down { color: #e74c3c; }
.rating-disclaimer { padding: 16px 32px; background: var(--bg); font-size: 0.8125rem; color: var(--text-muted); text-align: center; }
.rating-section { margin-top: 40px; }

/* ============ Data Table ============ */
.data-table { width: 100%; border-collapse: collapse; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.data-table thead th { background: var(--bg); padding: 12px 16px; font-size: 0.8125rem; font-weight: 700; color: var(--text-light); text-align: left; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 2px solid var(--border); white-space: nowrap; }
.data-table tbody td { padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 0.9375rem; }
.data-table tbody tr:hover { background: rgba(26,115,232,0.02); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table.compact thead th { padding: 8px 12px; } .data-table.compact tbody td { padding: 8px 12px; font-size: 0.875rem; }
.rank-badge { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--bg); font-size: 0.8125rem; font-weight: 700; color: var(--text-light); }
.rank-badge.top3 { background: linear-gradient(135deg, var(--gold), #e09100); color: white; }
.qs-inline { display: inline-flex; padding: 4px 10px; border-radius: 50px; font-size: 0.875rem; font-weight: 700; }
.qs-inline.score-high { background: rgba(39,174,96,0.1); color: #27ae60; } .qs-inline.score-medium { background: rgba(245,166,35,0.1); color: var(--gold); }
.qs-inline.score-low { background: rgba(230,126,34,0.1); color: #e67e22; } .qs-inline.score-very-low { background: rgba(231,76,60,0.1); color: var(--danger); }
.text-muted { color: var(--text-muted); }
.rating-table-container { overflow-x: auto; }

/* ============ Screener Page ============ */
.screener-section { margin-bottom: 32px; }
.template-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.template-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; display: flex; align-items: center; gap: 16px; cursor: pointer; transition: var(--transition); }
.template-card:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-2px); }
.tpl-icon { font-size: 2rem; flex-shrink: 0; }
.tpl-info h3 { font-size: 1rem; font-weight: 700; color: var(--dark); margin-bottom: 4px; }
.tpl-info p { font-size: 0.8125rem; color: var(--text-light); line-height: 1.5; }
.tpl-arrow { color: var(--text-muted); margin-left: auto; }

.screener-panel { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.condition-rows { display: flex; flex-direction: column; gap: 12px; }
.condition-row { display: flex; gap: 12px; align-items: center; }
.form-select { padding: 10px 14px; border: 2px solid var(--border); border-radius: var(--radius-sm); font-size: 0.9375rem; background: var(--bg); transition: var(--transition); appearance: auto; min-width: 150px; }
.form-select:focus { outline: none; border-color: var(--primary); }
.form-input-sm { padding: 10px 14px; border: 2px solid var(--border); border-radius: var(--radius-sm); font-size: 0.9375rem; background: var(--bg); width: 120px; transition: var(--transition); }
.form-input-sm:focus { outline: none; border-color: var(--primary); }
.screener-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); }
.result-count { font-size: 0.875rem; font-weight: 500; color: var(--text-muted); }
.screener-result-table { overflow-x: auto; }

/* ============ Backtest Page ============ */
.backtest-config-panel { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 32px; margin-bottom: 32px; box-shadow: var(--shadow); }
.bt-config-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.bt-conditions { display: flex; flex-direction: column; gap: 12px; }

.backtest-report { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 32px; box-shadow: var(--shadow); }
.bt-kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 32px; }
.bt-kpi { background: var(--bg); border-radius: var(--radius); padding: 20px; text-align: center; border-left: 4px solid var(--border); }
.bt-kpi.positive { border-left-color: #27ae60; }
.bt-kpi.negative { border-left-color: #e74c3c; }
.bt-kpi.neutral { border-left-color: var(--primary); }
.kpi-label { font-size: 0.8125rem; color: var(--text-muted); margin-bottom: 4px; }
.kpi-value { font-size: 1.5rem; font-weight: 800; color: var(--dark); }
.bt-kpi.positive .kpi-value { color: #27ae60; }
.bt-kpi.negative .kpi-value { color: #e74c3c; }
.bt-chart-container { margin-bottom: 32px; background: var(--bg); border-radius: var(--radius); padding: 24px; position: relative; height: 350px; }
.bt-chart-container h3 { font-size: 1rem; font-weight: 700; color: var(--dark); margin-bottom: 16px; }
.bt-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.bt-detail-card { background: var(--bg); border-radius: var(--radius); padding: 24px; }
.bt-detail-card h3 { font-size: 1rem; font-weight: 700; color: var(--dark); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.bt-detail-card h3 i { color: var(--primary); }
.detail-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 0.9375rem; }
.detail-row:last-child { border-bottom: none; }
.detail-row span:first-child { color: var(--text-light); }
.detail-row span:last-child { font-weight: 600; color: var(--dark); }

/* ============ Portfolio Page ============ */
.portfolio-create { display: flex; gap: 12px; margin-bottom: 32px; }
.portfolio-create .form-input { flex: 1; max-width: 400px; padding: 12px 16px; border: 2px solid var(--border); border-radius: var(--radius-sm); font-size: 1rem; transition: var(--transition); background: var(--bg-card); }
.portfolio-create .form-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(26,115,232,0.1); }
.portfolio-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 20px; overflow: hidden; transition: var(--transition); }
.portfolio-card:hover { box-shadow: var(--shadow); }
.pf-header { padding: 24px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); }
.pf-header h3 { font-size: 1.25rem; font-weight: 700; color: var(--dark); }
.pf-total-value { font-size: 1.5rem; font-weight: 800; color: var(--dark); text-align: right; }
.pf-pnl { font-size: 0.875rem; font-weight: 600; text-align: right; }
.pf-pnl.up { color: #27ae60; } .pf-pnl.down { color: #e74c3c; }
.pf-holdings { padding: 0 24px; overflow-x: auto; }
.pf-actions { padding: 16px 24px; display: flex; gap: 12px; border-top: 1px solid var(--border); }

/* Distribution bars in modal */
.dist-container { display: flex; flex-direction: column; gap: 10px; }
.dist-row { display: flex; align-items: center; gap: 12px; }
.dist-name { min-width: 60px; font-size: 0.875rem; font-weight: 600; color: var(--text); }
.dist-bar-track { flex: 1; height: 10px; background: var(--border); border-radius: 5px; overflow: hidden; }
.dist-bar-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 5px; }
.dist-pct { min-width: 40px; text-align: right; font-size: 0.875rem; font-weight: 600; color: var(--dark); }
.risk-alert { padding: 10px 14px; background: rgba(231,76,60,0.06); border: 1px solid rgba(231,76,60,0.15); border-radius: var(--radius-sm); margin-bottom: 8px; font-size: 0.875rem; color: var(--danger); display: flex; align-items: center; gap: 8px; }

/* ============ Pricing Page ============ */
.free-tier-banner { display: flex; justify-content: space-between; align-items: center; background: var(--bg); border: 2px solid var(--border); border-radius: var(--radius); padding: 24px 32px; margin-bottom: 32px; max-width: 1000px; margin-left: auto; margin-right: auto; }
.free-tier-content h3 { font-size: 1.125rem; font-weight: 700; color: var(--dark); margin-bottom: 4px; }
.free-tier-content p { font-size: 0.875rem; color: var(--text-light); }
.free-tier-price { font-size: 2rem; font-weight: 800; color: var(--accent); }
.pricing-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; max-width: 1200px; margin: 0 auto; align-items: start; }
.pricing-card { background: var(--bg-card); border: 2px solid var(--border); border-radius: var(--radius-lg); padding: 32px; transition: var(--transition); position: relative; }
.pricing-card.popular { border-color: var(--primary); transform: scale(1.03); box-shadow: var(--shadow-xl); }
.pricing-card .popular-badge { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); background: linear-gradient(135deg, var(--primary), var(--accent)); color: white; padding: 4px 20px; border-radius: 50px; font-size: 0.8125rem; font-weight: 700; }
.plan-badge-top { margin-bottom: 8px; font-size: 0.8125rem; }
.plan-name { font-size: 1.125rem; font-weight: 700; color: var(--dark); margin-bottom: 8px; }
.plan-price { font-size: 2.5rem; font-weight: 800; color: var(--primary); line-height: 1; margin-bottom: 4px; }
.plan-price .currency { font-size: 1rem; vertical-align: top; margin-right: 2px; }
.plan-price .period { font-size: 0.875rem; color: var(--text-light); font-weight: 500; }
.original-price { text-decoration: line-through; color: var(--text-muted); font-size: 0.875rem; margin-bottom: 8px; }
.save-badge { display: inline-flex; padding: 3px 10px; background: rgba(39,174,96,0.1); color: #27ae60; border-radius: 50px; font-size: 0.75rem; font-weight: 700; margin-bottom: 16px; }
.features-list { list-style: none; margin-bottom: 24px; }
.features-list li { padding: 6px 0; display: flex; align-items: center; gap: 8px; font-size: 0.875rem; color: var(--text); }
.features-list li i { color: var(--accent); font-size: 0.75rem; }

/* ============ Member Badge ============ */
.member-badge { padding: 2px 8px; font-size: 0.625rem; font-weight: 700; border-radius: 50px; letter-spacing: 0.5px; }
.member-badge.pro { background: linear-gradient(135deg, var(--primary), #4A90D9); color: white; }
.member-badge.ultimate { background: linear-gradient(135deg, var(--gold), #e09100); color: white; }
.member-badge-lg { display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px; font-size: 0.75rem; font-weight: 700; border-radius: 50px; }
.member-badge-lg.pro { background: linear-gradient(135deg, var(--primary), #4A90D9); color: white; }
.member-badge-lg.ultimate { background: linear-gradient(135deg, var(--gold), #e09100); color: white; }

/* ============ Forms ============ */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-weight: 600; font-size: 0.875rem; color: var(--text); margin-bottom: 6px; }
.form-input { width: 100%; padding: 12px 16px; border: 2px solid var(--border); border-radius: var(--radius-sm); font-size: 1rem; transition: var(--transition); background: var(--bg); }
.form-input:focus { outline: none; border-color: var(--primary); background: white; box-shadow: 0 0 0 4px rgba(26, 115, 232, 0.1); }
.form-error { color: var(--danger); font-size: 0.8125rem; margin-top: 4px; }
.form-divider { display: flex; align-items: center; gap: 16px; margin: 24px 0; color: var(--text-muted); font-size: 0.875rem; }
.form-divider::before, .form-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.form-link { color: var(--primary); font-weight: 600; cursor: pointer; transition: var(--transition); }
.form-link:hover { color: var(--primary-dark); text-decoration: underline; }
.form-textarea { resize: vertical; min-height: 80px; }
.form-hint { display: block; font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }

/* ============ Modal ============ */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); z-index: 2000; align-items: center; justify-content: center; padding: 24px; }
.modal-overlay.show { display: flex; }
.modal { background: white; border-radius: var(--radius-lg); width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; padding: 36px; position: relative; box-shadow: var(--shadow-xl); animation: modalIn 0.3s ease; }
@keyframes modalIn { from { opacity: 0; transform: scale(0.95) translateY(20px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal-close { position: absolute; top: 16px; right: 16px; background: none; font-size: 1.5rem; color: var(--text-muted); width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 50%; transition: var(--transition); }
.modal-close:hover { background: var(--bg); color: var(--text); }
.modal-title { font-size: 1.5rem; font-weight: 800; color: var(--dark); margin-bottom: 8px; }
.modal-subtitle { color: var(--text-light); font-size: 0.9375rem; margin-bottom: 28px; }

/* ============ Toast ============ */
.toast-container { position: fixed; top: 80px; right: 24px; z-index: 3000; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 14px 20px; border-radius: var(--radius-sm); font-size: 0.9375rem; font-weight: 500; box-shadow: var(--shadow-lg); animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards; display: flex; align-items: center; gap: 10px; min-width: 280px; }
.toast.success { background: #d4edda; color: #155724; border-left: 4px solid var(--success); }
.toast.error { background: #f8d7da; color: #721c24; border-left: 4px solid var(--danger); }
.toast.info { background: #d1ecf1; color: #0c5460; border-left: 4px solid var(--primary); }
.toast.warning { background: #fff3cd; color: #856404; border-left: 4px solid var(--warning); }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(40px); } }

/* ============ User Menu ============ */
.user-menu { position: relative; }
.user-menu-trigger { display: flex; align-items: center; gap: 8px; padding: 6px 12px; background: var(--bg); border-radius: 50px; cursor: pointer; transition: var(--transition); border: 1px solid var(--border); }
.user-menu-trigger:hover { background: var(--primary-light); border-color: var(--primary); }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--accent)); color: white; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.8125rem; }
.user-avatar-img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.user-menu-trigger .username { font-weight: 600; font-size: 0.875rem; max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vip-badge { padding: 2px 8px; background: linear-gradient(135deg, var(--gold), #e09100); color: white; font-size: 0.625rem; font-weight: 700; border-radius: 50px; letter-spacing: 0.5px; }
.user-dropdown { display: none; position: absolute; top: calc(100% + 8px); right: 0; background: white; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); min-width: 200px; z-index: 100; overflow: hidden; }
.user-dropdown.show { display: block; }
.user-dropdown a { display: flex; align-items: center; gap: 10px; padding: 12px 16px; font-size: 0.9375rem; color: var(--text); transition: var(--transition); }
.user-dropdown a:hover { background: var(--primary-light); color: var(--primary); }
.user-dropdown a.danger { color: var(--danger); } .user-dropdown a.danger:hover { background: rgba(231, 76, 60, 0.1); }
.user-dropdown .dropdown-divider { height: 1px; background: var(--border); }

/* ============ VIP Lock ============ */
.vip-lock-container { text-align: center; padding: 80px 24px; }
.vip-lock-icon { font-size: 4rem; margin-bottom: 24px; }
.vip-lock-container h2 { font-size: 1.75rem; font-weight: 800; color: var(--dark); margin-bottom: 12px; }
.vip-lock-container p { color: var(--text-light); margin-bottom: 32px; max-width: 500px; margin-left: auto; margin-right: auto; }

/* ============ Empty & Loading ============ */
.empty-state { text-align: center; padding: 60px 24px; color: var(--text-light); }
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { font-size: 1.25rem; font-weight: 700; color: var(--dark); margin-bottom: 8px; }
.loading-overlay { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px; }
.loading-spinner { width: 40px; height: 40px; border: 4px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; }

/* ============ Payment ============ */
.payment-methods { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
.payment-method-option { display: flex; align-items: center; gap: 12px; padding: 16px; border: 2px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; transition: var(--transition); }
.payment-method-option:hover, .payment-method-option.selected { border-color: var(--primary); background: var(--primary-light); }
.payment-method-option i { font-size: 1.5rem; }

/* ============ Footer ============ */
.footer { background: var(--dark); color: rgba(255, 255, 255, 0.7); padding-top: 60px; }
.footer-content { max-width: 1280px; margin: 0 auto; padding: 0 24px; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; }
.footer-section h3 { color: white; font-size: 1.125rem; margin-bottom: 16px; }
.footer-section h4 { color: white; font-size: 0.9375rem; margin-bottom: 16px; }
.footer-section p { margin-bottom: 8px; font-size: 0.9375rem; }
.footer-section a { display: block; margin-bottom: 8px; font-size: 0.9375rem; transition: var(--transition); }
.footer-section a:hover { color: white; }
.footer-bottom { max-width: 1280px; margin: 0 auto; padding: 24px; margin-top: 40px; border-top: 1px solid rgba(255, 255, 255, 0.1); text-align: center; font-size: 0.875rem; }
.footer-bottom .disclaimer { margin-top: 8px; font-size: 0.8125rem; color: rgba(255, 255, 255, 0.4); }

/* ============ SMS Code Input ============ */
.sms-input-group { display: flex; gap: 12px; }
.sms-input-group .form-input { flex: 1; }
.btn-sms { display: inline-flex; align-items: center; justify-content: center; padding: 12px 20px; background: var(--bg); color: var(--primary); border: 2px solid var(--primary); border-radius: var(--radius-sm); font-weight: 600; font-size: 0.875rem; white-space: nowrap; transition: var(--transition); min-width: 120px; cursor: pointer; }
.btn-sms:hover:not(:disabled) { background: var(--primary-light); }
.btn-sms:disabled { opacity: 0.6; cursor: not-allowed; color: var(--text-muted); border-color: var(--border); }
.btn-sms.countdown { background: var(--bg); color: var(--text-muted); border-color: var(--border); }

/* ============ Login Tabs ============ */
.login-tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 24px; }
.login-tab { flex: 1; padding: 12px; background: none; border: none; font-size: 0.9375rem; font-weight: 600; color: var(--text-light); cursor: pointer; position: relative; transition: var(--transition); }
.login-tab.active { color: var(--primary); }
.login-tab.active::after { content: ''; position: absolute; bottom: -2px; left: 0; right: 0; height: 2px; background: var(--primary); border-radius: 2px 2px 0 0; }
.login-tab:hover { color: var(--primary); background: var(--primary-light); }

/* ============ Profile Page ============ */
.profile-container { max-width: 900px; margin: 0 auto; padding: 80px 24px 60px; }
.profile-header { position: relative; border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 0; background: var(--bg-card); border: 1px solid var(--border); box-shadow: var(--shadow); }
.profile-header-bg { height: 140px; background: linear-gradient(135deg, var(--dark) 0%, var(--dark-2) 50%, var(--dark-3) 100%); position: relative; }
.profile-header-bg::before { content: ''; position: absolute; top: -50%; right: -20%; width: 400px; height: 400px; background: radial-gradient(circle, rgba(26, 115, 232, 0.2), transparent 70%); border-radius: 50%; }
.profile-header-content { padding: 0 32px 24px; position: relative; }
.profile-avatar-section { display: flex; align-items: flex-end; gap: 20px; margin-top: -48px; margin-bottom: 20px; }
.profile-avatar { width: 96px; height: 96px; border-radius: 50%; border: 4px solid var(--bg-card); background: linear-gradient(135deg, var(--primary), var(--accent)); display: flex; align-items: center; justify-content: center; position: relative; cursor: pointer; overflow: hidden; box-shadow: var(--shadow-lg); flex-shrink: 0; }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar .avatar-letter { font-size: 2rem; font-weight: 800; color: white; }
.avatar-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; color: white; font-size: 1.25rem; opacity: 0; transition: var(--transition); border-radius: 50%; }
.profile-avatar:hover .avatar-overlay { opacity: 1; }
.profile-info h1 { font-size: 1.5rem; font-weight: 800; color: var(--dark); display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.profile-phone, .profile-email { font-size: 0.875rem; color: var(--text-light); margin-bottom: 2px; }
.profile-phone i, .profile-email i { width: 16px; text-align: center; margin-right: 6px; font-size: 0.75rem; }
.profile-bio { font-size: 0.9375rem; color: var(--text); margin-top: 8px; line-height: 1.6; }
.profile-stats-row { display: flex; gap: 32px; padding-top: 16px; border-top: 1px solid var(--border); }
.profile-stat-item { display: flex; flex-direction: column; align-items: center; }
.profile-stat-item .stat-num { font-size: 1.5rem; font-weight: 800; color: var(--primary); }
.profile-stat-item .stat-label { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

/* Profile Tabs */
.profile-tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 24px; margin-top: 24px; overflow-x: auto; }
.profile-tab { display: flex; align-items: center; gap: 6px; padding: 14px 20px; background: none; border: none; font-size: 0.9375rem; font-weight: 600; color: var(--text-light); cursor: pointer; position: relative; transition: var(--transition); white-space: nowrap; }
.profile-tab.active { color: var(--primary); }
.profile-tab.active::after { content: ''; position: absolute; bottom: -2px; left: 0; right: 0; height: 2px; background: var(--primary); border-radius: 2px 2px 0 0; }
.profile-tab:hover { color: var(--primary); background: rgba(26, 115, 232, 0.05); }
.profile-tab i { font-size: 0.875rem; }
.profile-content { min-height: 300px; }

/* Overview Grid */
.overview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.overview-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; transition: var(--transition); }
.overview-card:hover { box-shadow: var(--shadow); }
.overview-card:first-child { grid-column: 1 / -1; }
.overview-card-title { font-size: 1rem; font-weight: 700; color: var(--dark); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.overview-card-title i { color: var(--primary); }
.vip-card { background: linear-gradient(135deg, rgba(245, 166, 35, 0.05), rgba(245, 166, 35, 0.1)); border-color: rgba(245, 166, 35, 0.2); }
.vip-card-header { display: flex; align-items: center; gap: 8px; font-size: 1.125rem; font-weight: 700; color: var(--gold); margin-bottom: 12px; }
.vip-card-body { display: flex; align-items: center; justify-content: space-between; }
.vip-card-body p { color: var(--text); font-size: 0.9375rem; }
.cta-card { background: linear-gradient(135deg, var(--primary-light), rgba(26, 115, 232, 0.1)); border-color: rgba(26, 115, 232, 0.2); }
.cta-card-content h3 { font-size: 1.125rem; font-weight: 700; color: var(--dark); margin-bottom: 4px; }
.cta-card-content p { color: var(--text-light); font-size: 0.9375rem; margin-bottom: 16px; }

/* History & Records */
.history-list { display: flex; flex-direction: column; gap: 8px; }
.history-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; background: var(--bg); border-radius: var(--radius-sm); }
.history-stock { display: flex; align-items: center; gap: 8px; }
.stock-code-sm { font-weight: 700; color: var(--primary); font-size: 0.875rem; }
.history-date { font-size: 0.8125rem; color: var(--text-muted); }
.empty-text { text-align: center; color: var(--text-muted); font-size: 0.875rem; padding: 20px 0; }
.watchlist-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.stock-tag-sm { display: inline-flex; padding: 6px 14px; background: var(--primary-light); color: var(--primary); border-radius: 50px; font-size: 0.8125rem; font-weight: 600; }

/* Edit Form & Records */
.edit-form-container { max-width: 560px; margin: 0 auto; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; }
.records-list { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.records-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.records-header h3 { font-size: 1rem; font-weight: 700; color: var(--dark); display: flex; align-items: center; gap: 8px; }
.records-header h3 i { color: var(--primary); }
.records-count { font-size: 0.8125rem; color: var(--text-muted); }
.query-record-card { display: flex; justify-content: space-between; align-items: center; padding: 16px 24px; border-bottom: 1px solid var(--border); transition: var(--transition); }
.query-record-card:last-child { border-bottom: none; }
.query-record-card:hover { background: var(--bg); }
.query-record-main { display: flex; align-items: center; gap: 12px; }
.stock-code-badge { display: inline-flex; padding: 4px 10px; background: var(--primary-light); color: var(--primary); border-radius: 6px; font-size: 0.8125rem; font-weight: 700; }
.stock-name-text { font-weight: 600; color: var(--dark); }
.query-record-time { font-size: 0.8125rem; color: var(--text-muted); }

/* Order Cards */
.order-card { padding: 20px 24px; border-bottom: 1px solid var(--border); transition: var(--transition); }
.order-card:last-child { border-bottom: none; }
.order-card:hover { background: var(--bg); }
.order-main { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.order-info { display: flex; flex-direction: column; gap: 4px; }
.order-plan { font-weight: 700; color: var(--dark); }
.order-no { font-size: 0.75rem; color: var(--text-muted); }
.order-amount { font-size: 1.25rem; font-weight: 800; color: var(--primary); }
.order-footer { display: flex; justify-content: space-between; align-items: center; }
.order-status { font-size: 0.8125rem; font-weight: 600; padding: 2px 10px; border-radius: 50px; }
.order-status.paid { background: rgba(39,174,96,0.1); color: #27ae60; }
.order-status.pending { background: rgba(245,166,35,0.1); color: var(--gold); }
.order-time { font-size: 0.8125rem; color: var(--text-muted); }
.security-info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.security-info-item { background: var(--bg); border-radius: var(--radius-sm); padding: 16px; text-align: center; }
.security-info-item .info-label { display: block; font-size: 0.75rem; color: var(--text-muted); margin-bottom: 4px; }
.security-info-item .info-value { display: block; font-size: 0.9375rem; font-weight: 700; color: var(--dark); }

/* ============ Scrollbar ============ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-light); }

/* ============ Animations ============ */
.fade-in { animation: fadeIn 0.5s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.slide-up { animation: slideUp 0.6s ease; }
@keyframes slideUp { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: translateY(0); } }

/* ============ My Position & Rebalance Page ============ */
.pos-add-section { margin-bottom: 32px; }
.pos-add-panel { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow); }
.pos-add-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 120px; gap: 16px; align-items: end; }
.pos-search-wrapper { position: relative; }
.pos-search-dropdown { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: white; border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); z-index: 50; display: none; max-height: 280px; overflow-y: auto; }
.pos-search-dropdown.show { display: block; }
.pos-dd-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--border); transition: var(--transition); }
.pos-dd-item:last-child { border-bottom: none; }
.pos-dd-item:hover { background: var(--primary-light); }
.pos-dd-code { font-weight: 700; color: var(--primary); min-width: 70px; font-size: 0.875rem; }
.pos-dd-name { flex: 1; font-size: 0.9375rem; }
.pos-dd-market { font-size: 0.75rem; padding: 2px 8px; background: var(--bg); border-radius: 4px; color: var(--text-muted); }
.pos-dd-empty { padding: 16px; text-align: center; color: var(--text-muted); font-size: 0.875rem; }
.pos-selected { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 6px 12px; background: rgba(0,201,167,0.08); border: 1px solid rgba(0,201,167,0.2); border-radius: 50px; }
.pos-selected-name { font-size: 0.875rem; font-weight: 600; color: var(--accent-dark); }

.pos-list-section { margin-bottom: 32px; }
.pos-list-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.pos-total-weight { font-size: 0.9375rem; padding: 6px 16px; border-radius: 50px; font-weight: 700; }
.pos-total-weight.high { background: rgba(231,76,60,0.1); color: var(--danger); }
.pos-total-weight.medium { background: rgba(245,166,35,0.1); color: var(--gold); }
.pos-total-weight.low { background: rgba(39,174,96,0.1); color: var(--success); }

.pos-cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-bottom: 20px; }
.pos-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); transition: var(--transition); overflow: hidden; }
.pos-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.pos-card-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px 12px; border-bottom: 1px solid var(--border); }
.pos-card-name { font-size: 1rem; font-weight: 700; color: var(--dark); }
.pos-card-code { font-size: 0.8125rem; color: var(--text-muted); margin-top: 2px; }
.pos-card-weight-ring { width: 48px; height: 48px; border-radius: 50%; border: 3px solid var(--primary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: rgba(26,115,232,0.06); }
.pos-card-weight-ring span { font-size: 0.8125rem; font-weight: 800; color: var(--primary); }
.pos-card-body { padding: 12px 18px; }
.pos-card-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 0.875rem; }
.pos-card-row span:first-child { color: var(--text-light); }
.pos-card-row span:last-child { font-weight: 600; }
.pos-card-price { color: var(--dark); }
.pos-card-actions { padding: 10px 18px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; }

/* Weight bar */
.pos-weight-bar { margin-top: 4px; }
.pos-weight-bar-inner { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--border); }
.pos-weight-segment { transition: width 0.5s ease; position: relative; }
.pos-weight-segment:not(:last-child) { border-right: 1px solid rgba(255,255,255,0.5); }
.pos-weight-segment.empty { background: var(--border); }
.pos-weight-legend { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.pos-legend-item { display: flex; align-items: center; gap: 4px; font-size: 0.75rem; color: var(--text-light); }
.pos-legend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* Rebalance Section */
.rebalance-section { margin-bottom: 32px; }
.rebalance-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.rebalance-overview { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; margin-bottom: 24px; box-shadow: var(--shadow); }
.rb-grade-card { display: flex; align-items: center; gap: 20px; margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.rb-grade-ring { width: 80px; height: 80px; border-radius: 50%; border: 5px solid; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--bg); }
.rb-grade-letter { font-size: 2.5rem; font-weight: 900; }
.rb-grade-title { font-size: 1.25rem; font-weight: 800; color: var(--dark); margin-bottom: 4px; }
.rb-grade-desc { font-size: 0.9375rem; color: var(--text-light); }
.rb-stats-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.rb-stat { text-align: center; padding: 14px 8px; background: var(--bg); border-radius: var(--radius-sm); }
.rb-stat-value { font-size: 1.5rem; font-weight: 800; color: var(--dark); }
.rb-stat-value.accent { color: var(--accent); }
.rb-stat-value.danger { color: var(--danger); }
.rb-stat-label { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

/* Adjustment Cards */
.rb-detail-list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 24px; }
.rb-adj-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: var(--transition); border-left: 4px solid var(--border); }
.rb-adj-card.increase { border-left-color: var(--accent); }
.rb-adj-card.decrease { border-left-color: var(--danger); }
.rb-adj-card.hold { border-left-color: var(--primary); }
.rb-adj-card:hover { box-shadow: var(--shadow); }
.rb-adj-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px 12px; }
.rb-adj-name { font-size: 1.0625rem; font-weight: 700; color: var(--dark); }
.rb-adj-code { font-size: 0.8125rem; color: var(--text-muted); margin-top: 2px; }
.rb-adj-score { width: 48px; height: 48px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0; border: 3px solid; }
.rb-adj-score.score-high { border-color: #27ae60; background: rgba(39,174,96,0.06); }
.rb-adj-score.score-medium { border-color: var(--gold); background: rgba(245,166,35,0.06); }
.rb-adj-score.score-low { border-color: #e67e22; background: rgba(230,126,34,0.06); }
.rb-adj-score.score-very-low { border-color: var(--danger); background: rgba(231,76,60,0.06); }
.rb-qs-num { font-size: 1rem; font-weight: 800; line-height: 1; }
.rb-adj-score.score-high .rb-qs-num { color: #27ae60; }
.rb-adj-score.score-medium .rb-qs-num { color: var(--gold); }
.rb-adj-score.score-low .rb-qs-num { color: #e67e22; }
.rb-adj-score.score-very-low .rb-qs-num { color: var(--danger); }
.rb-qs-label { font-size: 0.5625rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.rb-adj-body { padding: 0 20px 16px; }
.rb-weight-change { display: flex; align-items: center; gap: 16px; padding: 12px 0; margin-bottom: 8px; }
.rb-weight-current, .rb-weight-target { text-align: center; }
.rb-wc-label { display: block; font-size: 0.6875rem; color: var(--text-muted); margin-bottom: 2px; text-transform: uppercase; letter-spacing: 0.5px; }
.rb-wc-value { font-size: 1.25rem; font-weight: 800; color: var(--dark); }
.rb-wc-value.increase { color: var(--accent); }
.rb-wc-value.decrease { color: var(--danger); }
.rb-wc-value.hold { color: var(--primary); }
.rb-weight-arrow { color: var(--text-muted); font-size: 1rem; }
.rb-weight-arrow.increase { color: var(--accent); }
.rb-weight-arrow.decrease { color: var(--danger); }
.rb-weight-diff { font-size: 1rem; font-weight: 800; padding: 4px 12px; border-radius: 50px; margin-left: auto; }
.rb-weight-diff.increase { color: var(--accent); background: rgba(0,201,167,0.1); }
.rb-weight-diff.decrease { color: var(--danger); background: rgba(231,76,60,0.1); }
.rb-weight-diff.hold { color: var(--primary); background: rgba(26,115,232,0.1); }
.rb-adj-action { margin-bottom: 8px; }
.rb-action-tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 14px; border-radius: 50px; font-size: 0.8125rem; font-weight: 700; }
.rb-action-tag.increase { background: rgba(0,201,167,0.1); color: var(--accent-dark); }
.rb-action-tag.decrease { background: rgba(231,76,60,0.1); color: var(--danger); }
.rb-action-tag.hold { background: rgba(26,115,232,0.1); color: var(--primary); }
.rb-adj-reason { font-size: 0.875rem; color: var(--text-light); line-height: 1.6; margin-bottom: 10px; padding: 8px 12px; background: var(--bg); border-radius: var(--radius-sm); }
.rb-adj-metrics { display: flex; flex-wrap: wrap; gap: 10px; font-size: 0.8125rem; color: var(--text-light); }
.rb-adj-metrics span { white-space: nowrap; }

/* Industry distribution */
.rb-industry-section { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 16px; }
.rb-industry-bars { display: flex; flex-direction: column; gap: 10px; }
.rb-ind-row { display: flex; align-items: center; gap: 12px; }
.rb-ind-name { min-width: 60px; font-size: 0.875rem; font-weight: 600; color: var(--text); }
.rb-ind-bar-track { flex: 1; height: 10px; background: var(--border); border-radius: 5px; overflow: hidden; }
.rb-ind-bar-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 5px; transition: width 0.5s ease; }
.rb-ind-bar-fill.warning { background: linear-gradient(90deg, var(--gold), #e09100); }
.rb-ind-bar-fill.danger { background: linear-gradient(90deg, var(--danger), #c0392b); }
.rb-ind-pct { min-width: 40px; text-align: right; font-size: 0.875rem; font-weight: 700; color: var(--dark); }

/* Risk Alerts */
.rb-alerts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.rb-alert-item { padding: 12px 16px; background: rgba(245,166,35,0.06); border: 1px solid rgba(245,166,35,0.15); border-radius: var(--radius-sm); font-size: 0.875rem; color: #856404; line-height: 1.5; }
.rb-disclaimer { padding: 16px; background: var(--bg); border-radius: var(--radius-sm); font-size: 0.8125rem; color: var(--text-muted); text-align: center; }

/* ============ Responsive ============ */
@media (max-width: 1024px) {
    .pricing-grid { grid-template-columns: repeat(2, 1fr); }
    .bt-config-grid { grid-template-columns: repeat(2, 1fr); }
    .bt-kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .rating-market-data { grid-template-columns: repeat(4, 1fr); }
    .rb-stats-row { grid-template-columns: repeat(3, 1fr); }
    .pos-add-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .nav-links { display: none; }
    .mobile-menu-btn { display: flex; }
    .hero-container { grid-template-columns: 1fr; gap: 40px; padding: 40px 24px; }
    .hero h1 { font-size: 2rem; }
    .hero-stats { gap: 20px; flex-wrap: wrap; }
    .hero-visual { display: none; }
    .features-grid, .top-stocks-grid { grid-template-columns: 1fr; }
    .template-grid { grid-template-columns: 1fr; }
    .pricing-grid { grid-template-columns: 1fr; }
    .pricing-card.popular { transform: none; }
    .market-indices, .market-extra { grid-template-columns: repeat(2, 1fr); }
    .bt-config-grid { grid-template-columns: 1fr; }
    .bt-kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .bt-detail-grid { grid-template-columns: 1fr; }
    .rating-body-grid { grid-template-columns: 1fr; }
    .rating-market-data { grid-template-columns: repeat(2, 1fr); }
    .rating-ranking { flex-direction: column; gap: 8px; text-align: center; }
    .condition-row { flex-wrap: wrap; }
    .form-select, .form-input-sm { min-width: 100px; flex: 1; }
    .free-tier-banner { flex-direction: column; text-align: center; gap: 12px; }
    .section { padding: 40px 16px; }
    .section-header h2 { font-size: 1.75rem; }
    .footer-content { grid-template-columns: 1fr; }
    .profile-container { padding: 72px 16px 40px; }
    .profile-header-content { padding: 0 16px 20px; }
    .profile-avatar-section { flex-direction: column; align-items: center; text-align: center; }
    .profile-info h1 { justify-content: center; }
    .profile-stats-row { justify-content: center; }
    .overview-grid { grid-template-columns: 1fr; }
    .security-info-grid { grid-template-columns: 1fr; }
    .sms-input-group { flex-direction: column; }
    .btn-sms { width: 100%; }
    .profile-tabs { gap: 0; }
    .profile-tab { padding: 12px 14px; font-size: 0.8125rem; }
    .pf-header { flex-direction: column; gap: 12px; align-items: flex-start; }
    .portfolio-create { flex-direction: column; }
    .portfolio-create .form-input { max-width: 100%; }
    .screener-actions { flex-direction: column; gap: 12px; }
    .pos-add-grid { grid-template-columns: 1fr; }
    .pos-cards-grid { grid-template-columns: 1fr; }
    .rb-stats-row { grid-template-columns: repeat(3, 1fr); }
    .rb-weight-change { flex-wrap: wrap; }
    .rebalance-header { flex-direction: column; gap: 12px; align-items: flex-start; }
    .rb-grade-card { flex-direction: column; text-align: center; }
}

/* ============ 推荐买入 (左侧资金注入) ============ */
.buy-rec-section { margin-top: 32px; }
.buy-rec-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 16px; margin-bottom: 20px;
}
.buy-rec-subtitle {
    font-size: 0.8125rem; color: var(--text-light); margin-top: 6px; line-height: 1.4;
}

/* 引导介绍 */
.buy-rec-intro {
    text-align: center; padding: 48px 24px;
    background: linear-gradient(135deg, rgba(245, 166, 35, 0.05), rgba(0, 201, 167, 0.05));
    border: 1px dashed rgba(245, 166, 35, 0.3); border-radius: 16px;
}
.buy-rec-intro-icon { font-size: 3rem; margin-bottom: 12px; }
.buy-rec-intro h3 { font-size: 1.125rem; margin-bottom: 8px; color: var(--text); }
.buy-rec-intro p {
    font-size: 0.875rem; color: var(--text-light); max-width: 500px;
    margin: 0 auto 20px; line-height: 1.6;
}

/* 扫描概览 */
.buy-rec-overview {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 12px; padding: 20px; margin-bottom: 20px;
}
.buy-rec-stats {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
.buy-rec-stat { text-align: center; }
.buy-rec-stat-value {
    font-size: 1.5rem; font-weight: 700; color: var(--text);
}
.buy-rec-stat.highlight .buy-rec-stat-value { color: #f5a623; }
.buy-rec-stat-label {
    font-size: 0.75rem; color: var(--text-light); margin-top: 4px;
}

/* 推荐卡片列表 */
.buy-rec-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }

.buy-rec-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 12px; overflow: hidden; transition: all 0.2s;
}
.buy-rec-card:hover { border-color: rgba(245, 166, 35, 0.4); box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
.buy-rec-card.strong { border-left: 3px solid #f5a623; }
.buy-rec-card.medium { border-left: 3px solid #00c9a7; }

.buy-rec-card-header {
    display: flex; align-items: center; gap: 12px; padding: 16px 16px 0;
}
.buy-rec-rank {
    width: 28px; height: 28px; border-radius: 50%;
    background: linear-gradient(135deg, #f5a623, #ff8c00);
    color: #fff; font-weight: 700; font-size: 0.8125rem;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.buy-rec-card.medium .buy-rec-rank { background: linear-gradient(135deg, #00c9a7, #0fa); }
.buy-rec-card:not(.strong):not(.medium) .buy-rec-rank { background: var(--text-lighter); }

.buy-rec-stock-info { flex: 1; }
.buy-rec-name { font-weight: 600; font-size: 1rem; color: var(--text); }
.buy-rec-code { font-size: 0.75rem; color: var(--text-light); margin-top: 2px; }

/* 信号强度环 */
.buy-rec-signal-score { text-align: center; flex-shrink: 0; }
.buy-rec-score-ring {
    width: 48px; height: 48px; border-radius: 50%;
    border: 3px solid var(--text-lighter);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1rem; color: var(--text);
}
.buy-rec-score-ring.strong { border-color: #f5a623; color: #f5a623; }
.buy-rec-score-ring.medium { border-color: #00c9a7; color: #00c9a7; }
.buy-rec-score-label { font-size: 0.625rem; color: var(--text-light); margin-top: 2px; }

/* 卡片体 */
.buy-rec-card-body { padding: 12px 16px; }

.buy-rec-price-row {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 10px;
}
.buy-rec-price { display: flex; align-items: baseline; gap: 8px; }
.buy-rec-price-val { font-size: 1.125rem; font-weight: 700; color: var(--text); }
.buy-rec-change { font-size: 0.8125rem; font-weight: 600; }
.buy-rec-change.up { color: var(--danger); }
.buy-rec-change.down { color: var(--success); }
.buy-rec-metrics { display: flex; gap: 10px; font-size: 0.75rem; color: var(--text-light); }

/* 量价数据行 */
.buy-rec-volume-row {
    display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 10px;
    padding: 8px 12px; background: rgba(245, 166, 35, 0.04); border-radius: 8px;
}
.buy-rec-vol-item {
    display: flex; align-items: center; gap: 4px;
    font-size: 0.8125rem; color: var(--text-light);
}
.buy-rec-vol-item i { color: #f5a623; font-size: 0.6875rem; }
.buy-rec-vol-item strong { color: var(--text); font-weight: 600; }

/* 标签 */
.buy-rec-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.buy-rec-tag {
    padding: 2px 8px; border-radius: 4px;
    font-size: 0.6875rem; font-weight: 500;
    background: rgba(255,255,255,0.06); color: var(--text-light);
    border: 1px solid var(--border);
}
.buy-rec-tag.primary {
    background: linear-gradient(135deg, rgba(245, 166, 35, 0.12), rgba(245, 166, 35, 0.06));
    color: #f5a623; border-color: rgba(245, 166, 35, 0.3);
}

/* 理由 */
.buy-rec-reasons { display: flex; flex-direction: column; gap: 4px; }
.buy-rec-reason {
    font-size: 0.8125rem; color: var(--text-light); line-height: 1.4;
    display: flex; align-items: flex-start; gap: 6px;
}
.buy-rec-reason i { color: #00c9a7; margin-top: 3px; font-size: 0.6875rem; flex-shrink: 0; }

/* 卡片操作 */
.buy-rec-card-actions {
    display: flex; gap: 8px; padding: 8px 16px 12px;
    border-top: 1px solid var(--border);
}

/* 免责声明 */
.buy-rec-disclaimer {
    padding: 12px 16px; margin-top: 8px;
    background: rgba(245, 166, 35, 0.05); border-radius: 8px;
    font-size: 0.75rem; color: var(--text-light); line-height: 1.5;
}
.buy-rec-disclaimer i { color: #f5a623; margin-right: 6px; }

@media (max-width: 768px) {
    .buy-rec-header { flex-direction: column; gap: 12px; align-items: flex-start; }
    .buy-rec-stats { grid-template-columns: repeat(2, 1fr); }
    .buy-rec-price-row { flex-direction: column; align-items: flex-start; gap: 6px; }
    .buy-rec-volume-row { gap: 8px; }
}

/* ============ AI投顾 - 聊天界面 ============ */
.advisor-container {
    display: flex;
    height: calc(100vh - 64px);
    margin-top: 64px;
    background: var(--bg);
    overflow: hidden;
}

/* Sidebar */
.advisor-sidebar {
    width: 280px;
    min-width: 280px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.sidebar-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-header h3 i { color: var(--primary); }

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--text-light);
    transition: var(--transition);
}

.btn-icon:hover { background: var(--primary-light); color: var(--primary); }

.conversation-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.conversation-item {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 4px;
    position: relative;
}

.conversation-item:hover { background: var(--bg); }
.conversation-item.active { background: var(--primary-light); }

.conv-preview {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 24px;
}

.conv-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.conv-delete {
    position: absolute;
    top: 12px;
    right: 10px;
    background: none;
    color: var(--text-muted);
    opacity: 0;
    transition: var(--transition);
    font-size: 0.75rem;
}

.conversation-item:hover .conv-delete { opacity: 1; }
.conv-delete:hover { color: var(--danger); }

.empty-list, .loading-placeholder {
    text-align: center;
    color: var(--text-muted);
    padding: 24px 16px;
    font-size: 0.875rem;
}

.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
}

.usage-info { font-size: 0.8rem; color: var(--text-light); }

.usage-bar {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin-bottom: 6px;
    overflow: hidden;
}

.usage-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Main Chat Area */
.advisor-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    position: relative;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    scroll-behavior: smooth;
}

/* Welcome Screen */
.welcome-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    padding: 32px;
}

.welcome-icon { font-size: 3.5rem; margin-bottom: 16px; }

.welcome-screen h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 8px;
}

.welcome-screen > p {
    color: var(--text-light);
    max-width: 500px;
    margin-bottom: 32px;
}

.quick-commands { width: 100%; max-width: 720px; }

.quick-commands h4 {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.command-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.command-card {
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
}

.command-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.command-icon { font-size: 1.5rem; }

.command-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text);
}

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

/* Chat Messages */
.chat-msg {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    max-width: 85%;
    animation: fadeInMsg 0.3s ease;
}

@keyframes fadeInMsg {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.user-msg { margin-left: auto; flex-direction: row-reverse; }

.msg-avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    color: white;
    background: var(--primary);
}

.msg-avatar.ai { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }

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

.user-msg .msg-text {
    background: var(--primary);
    color: white;
    padding: 12px 16px;
    border-radius: 18px 18px 4px 18px;
    font-size: 0.9375rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.ai-msg .msg-text {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 16px 20px;
    border-radius: 18px 18px 18px 4px;
    font-size: 0.9375rem;
    line-height: 1.7;
    word-break: break-word;
}

.ai-msg .msg-text.markdown-body h2 { font-size: 1.2rem; margin: 16px 0 8px; color: var(--dark); }
.ai-msg .msg-text.markdown-body h3 { font-size: 1.05rem; margin: 12px 0 6px; color: var(--dark); }
.ai-msg .msg-text.markdown-body h4 { font-size: 0.95rem; margin: 10px 0 4px; color: var(--dark); font-weight: 600; }
.ai-msg .msg-text.markdown-body p { margin-bottom: 8px; }
.ai-msg .msg-text.markdown-body ul { padding-left: 20px; margin: 8px 0; }
.ai-msg .msg-text.markdown-body li { margin-bottom: 4px; }
.ai-msg .msg-text.markdown-body code { background: #f1f3f5; padding: 2px 6px; border-radius: 4px; font-size: 0.85em; }
.ai-msg .msg-text.markdown-body pre { background: #1a1a2e; color: #e0e0e0; padding: 12px 16px; border-radius: 8px; overflow-x: auto; margin: 12px 0; }
.ai-msg .msg-text.markdown-body pre code { background: transparent; color: inherit; padding: 0; }
.ai-msg .msg-text.markdown-body strong { color: var(--dark); }

.ai-msg .msg-text.markdown-body .md-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 0.85rem;
}

.ai-msg .msg-text.markdown-body .md-table td {
    padding: 8px 12px;
    border: 1px solid var(--border);
}

.ai-msg .msg-text.markdown-body .md-table tr:first-child td {
    background: var(--bg);
    font-weight: 600;
}

.msg-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 4px;
    padding: 0 4px;
}

.user-msg .msg-time { text-align: right; }

/* Data Source Tags */
.data-sources {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    padding: 0 4px;
}

.source-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: #eef2ff;
    color: #4f46e5;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
}

.source-tag i { font-size: 0.6rem; }

.source-inline {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1px 8px;
    background: #eef2ff;
    color: #4f46e5;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 500;
    vertical-align: middle;
}

.source-inline i { font-size: 0.625rem; }

/* Typing Indicator */
.typing-indicator .msg-text {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-style: italic;
}

.typing-dots {
    display: inline-flex;
    gap: 3px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* Chat Input Area */
.chat-input-area {
    padding: 16px 24px;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
}

.input-toolbar {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
}

.toolbar-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--text-light);
    transition: var(--transition);
    font-size: 0.875rem;
}

.toolbar-btn:hover { background: var(--primary-light); color: var(--primary); }

.input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 8px 12px;
    transition: var(--transition);
}

.input-wrapper:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1); }

.input-wrapper textarea {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    resize: none;
    font-size: 0.9375rem;
    line-height: 1.5;
    max-height: 150px;
    color: var(--text);
}

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

.send-btn {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.send-btn:hover { background: var(--primary-dark); transform: scale(1.05); }
.send-btn:disabled { background: var(--text-muted); cursor: not-allowed; transform: none; }

.input-hint {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 6px;
    text-align: center;
}

/* Command Panel (popup) */
.command-panel {
    position: absolute;
    bottom: 120px;
    left: 24px;
    right: 24px;
    max-height: 320px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    overflow-y: auto;
}

.command-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 0.875rem;
}

.command-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: var(--transition);
}

.command-item:hover { background: var(--bg); }

.command-item-icon { font-size: 1.25rem; }

.command-item-info { flex: 1; }

.command-item-name { font-weight: 600; font-size: 0.875rem; color: var(--primary); }
.command-item-desc { font-size: 0.8rem; color: var(--text-light); }
.command-item-example { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; font-family: monospace; }

/* Mobile Sidebar Toggle */
.mobile-sidebar-btn { display: none; }

/* Responsive */
@media (max-width: 768px) {
    .advisor-sidebar {
        position: fixed;
        top: 64px;
        left: 0;
        bottom: 0;
        z-index: 999;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: var(--shadow-lg);
    }

    .advisor-sidebar.show { transform: translateX(0); }

    .mobile-sidebar-btn { display: flex; }

    .chat-messages { padding: 16px; }

    .chat-msg { max-width: 95%; }

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

    .chat-input-area { padding: 12px 16px; }

    .command-panel { left: 12px; right: 12px; }
}

/* ============ ChinaVeris — API 数据引擎页面 ============ */

/* Page Container */
.cv-page { min-height: 100vh; background: var(--bg); }

/* Hero */
.cv-hero {
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    padding: 120px 24px 60px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.cv-hero::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -15%;
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(0, 201, 167, 0.12), transparent 70%);
    border-radius: 50%;
}
.cv-hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(155, 89, 182, 0.1), transparent 70%);
    border-radius: 50%;
}
.cv-hero-inner { position: relative; z-index: 1; max-width: 800px; margin: 0 auto; }
.cv-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 18px;
    background: rgba(155, 89, 182, 0.2);
    border: 1px solid rgba(155, 89, 182, 0.4);
    border-radius: 50px;
    color: #c39bd3;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 20px;
}
.cv-hero-title {
    font-size: 2.75rem;
    font-weight: 800;
    color: white;
    line-height: 1.2;
    margin-bottom: 16px;
}
.cv-hero-title .gradient-text {
    background: linear-gradient(135deg, #00c9a7, #9b59b6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.cv-hero-desc {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.8;
    margin-bottom: 32px;
}
.cv-hero-stats {
    display: flex;
    justify-content: center;
    gap: 48px;
}
.cv-stat { text-align: center; }
.cv-stat-num { font-size: 1.75rem; font-weight: 800; color: white; }
.cv-stat-label { font-size: 0.8125rem; color: rgba(255, 255, 255, 0.45); margin-top: 2px; }

/* Tabs */
.cv-tabs-container {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 64px;
    z-index: 50;
}
.cv-tabs {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}
.cv-tab {
    padding: 16px 24px;
    background: none;
    border: none;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    transition: var(--transition);
    cursor: pointer;
}
.cv-tab:hover { color: var(--primary); background: rgba(26, 115, 232, 0.04); }
.cv-tab.active { color: #9b59b6; }
.cv-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #9b59b6, #00c9a7);
    border-radius: 3px 3px 0 0;
}
.cv-tab i { font-size: 0.875rem; }

/* Content */
.cv-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px 60px;
}

/* ---- Tools Tab ---- */
.cv-tools-layout { }
.cv-filter-bar { margin-bottom: 24px; }
.cv-search-box {
    position: relative;
    max-width: 600px;
    margin-bottom: 16px;
}
.cv-search-box i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}
.cv-search-box input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9375rem;
    background: var(--bg-card);
    transition: var(--transition);
}
.cv-search-box input:focus {
    outline: none;
    border-color: #9b59b6;
    box-shadow: 0 0 0 4px rgba(155, 89, 182, 0.1);
}
.cv-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.cv-chip {
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    background: var(--bg);
    color: var(--text-light);
    border: 1px solid var(--border);
    transition: var(--transition);
}
.cv-chip:hover { border-color: #9b59b6; color: #9b59b6; }
.cv-chip.active {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: white;
    border-color: transparent;
}
.cv-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

/* Tool Card */
.cv-tool-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}
.cv-tool-card:hover {
    border-color: rgba(155, 89, 182, 0.4);
    box-shadow: 0 4px 20px rgba(155, 89, 182, 0.1);
    transform: translateY(-2px);
}
.cv-tool-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}
.cv-tool-icon { font-size: 1.75rem; flex-shrink: 0; }
.cv-tool-title-area { flex: 1; min-width: 0; }
.cv-tool-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cv-tool-market { font-size: 0.75rem; color: var(--text-muted); }
.cv-weight-badge {
    padding: 2px 8px;
    background: rgba(245, 166, 35, 0.15);
    color: var(--gold);
    border-radius: 50px;
    font-size: 0.6875rem;
    font-weight: 700;
}
.cv-tool-desc {
    font-size: 0.875rem;
    color: var(--text-light);
    line-height: 1.5;
    margin-bottom: 10px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.cv-tool-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}
.cv-tag {
    padding: 2px 8px;
    background: rgba(155, 89, 182, 0.08);
    color: #9b59b6;
    border-radius: 4px;
    font-size: 0.6875rem;
    font-weight: 600;
}
.cv-tool-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}
.cv-tool-id {
    font-size: 0.6875rem;
    color: var(--text-muted);
    background: var(--bg);
    padding: 2px 8px;
    border-radius: 4px;
    max-width: 70%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cv-try-btn {
    padding: 5px 14px;
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition);
}
.cv-try-btn:hover { transform: scale(1.05); box-shadow: 0 2px 8px rgba(155, 89, 182, 0.3); }

/* Tool Detail Modal */
.cv-detail-modal { }
.cv-detail-modal h2 { font-size: 1.5rem; font-weight: 800; color: var(--dark); margin-bottom: 8px; }
.cv-detail-desc { color: var(--text-light); margin-bottom: 16px; line-height: 1.6; }
.cv-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}
.cv-detail-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: var(--bg);
    border-radius: 50px;
    font-size: 0.8125rem;
    color: var(--text);
}
.cv-detail-meta span i { color: #9b59b6; font-size: 0.75rem; }
.cv-detail-id {
    margin-bottom: 20px;
    padding: 12px 16px;
    background: var(--bg);
    border-radius: var(--radius-sm);
}
.cv-detail-id label { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); display: block; margin-bottom: 4px; }
.cv-detail-id code { font-size: 0.875rem; color: #9b59b6; font-weight: 600; }
.cv-detail-modal h3 { font-size: 1rem; font-weight: 700; color: var(--dark); margin: 20px 0 10px; }
.cv-params-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
    margin-bottom: 16px;
}
.cv-params-table th {
    background: var(--bg);
    padding: 8px 10px;
    text-align: left;
    font-weight: 600;
    color: var(--text-light);
    border-bottom: 2px solid var(--border);
}
.cv-params-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}
.cv-params-table code { background: var(--bg); padding: 1px 6px; border-radius: 4px; font-size: 0.8125rem; }
.cv-required { color: var(--danger); font-weight: 600; font-size: 0.75rem; }
.cv-fields { display: flex; flex-wrap: wrap; gap: 6px; }
.cv-fields code {
    padding: 3px 10px;
    background: var(--bg);
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text);
}
.cv-detail-actions { margin-top: 24px; text-align: center; }

/* Loading & Error */
.cv-error {
    text-align: center;
    padding: 32px;
    color: var(--danger);
    background: rgba(231, 76, 60, 0.06);
    border-radius: var(--radius);
}
.cv-empty {
    text-align: center;
    padding: 48px;
    color: var(--text-muted);
    font-size: 0.9375rem;
}
.cv-login-prompt {
    text-align: center;
    padding: 80px 24px;
    color: var(--text-light);
}
.cv-login-prompt p { margin-bottom: 16px; font-size: 1rem; }

/* ---- Playground Tab ---- */
.cv-playground {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 24px;
}
.cv-pg-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
}
.cv-pg-section h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.cv-pg-section h3 i { color: #9b59b6; }
.cv-pg-input-row { display: flex; gap: 12px; margin-bottom: 12px; }
.cv-pg-input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    background: var(--bg);
    transition: var(--transition);
}
.cv-pg-input:focus { outline: none; border-color: #9b59b6; box-shadow: 0 0 0 3px rgba(155, 89, 182, 0.1); }
.cv-pg-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    background: var(--bg);
    resize: vertical;
    min-height: 80px;
    transition: var(--transition);
    margin-bottom: 12px;
}
.cv-pg-textarea:focus { outline: none; border-color: #9b59b6; box-shadow: 0 0 0 3px rgba(155, 89, 182, 0.1); }
.cv-pg-form label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}
.cv-pg-btn { min-width: 100px; }
.cv-pg-result { margin-top: 16px; }

/* Discover result */
.cv-discover-header {
    padding: 12px 16px;
    background: rgba(155, 89, 182, 0.06);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: var(--text);
    margin-bottom: 12px;
}
.cv-discover-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    cursor: pointer;
    transition: var(--transition);
}
.cv-discover-item:hover { border-color: #9b59b6; background: rgba(155, 89, 182, 0.03); }
.cv-discover-rank {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.cv-discover-info { flex: 1; min-width: 0; }
.cv-discover-name {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 8px;
}
.cv-discover-score {
    font-size: 0.6875rem;
    padding: 2px 8px;
    background: rgba(0, 201, 167, 0.12);
    color: var(--accent-dark);
    border-radius: 50px;
    font-weight: 600;
}
.cv-discover-desc { font-size: 0.8125rem; color: var(--text-light); margin-top: 2px; }
.cv-discover-id {
    font-size: 0.6875rem;
    color: var(--text-muted);
    display: block;
    margin-top: 4px;
}

/* Call result */
.cv-call-header {
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 8px;
}
.cv-result-success { background: rgba(39, 174, 96, 0.08); color: #27ae60; }
.cv-result-error { background: rgba(231, 76, 60, 0.08); color: var(--danger); }
.cv-cache-badge {
    display: inline-flex;
    padding: 1px 8px;
    background: rgba(245, 166, 35, 0.15);
    color: var(--gold);
    border-radius: 50px;
    font-size: 0.75rem;
}
.cv-json-result {
    background: #1a1a2e;
    color: #a8d8a8;
    padding: 16px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    font-size: 0.8125rem;
    line-height: 1.6;
    max-height: 400px;
    overflow-y: auto;
}
.cv-json-result code { background: transparent; color: inherit; padding: 0; }

/* Quickstart */
.cv-pg-quickstart { }
.cv-quick-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}
.cv-quick-card {
    padding: 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}
.cv-quick-card:hover {
    border-color: #9b59b6;
    background: rgba(155, 89, 182, 0.05);
    transform: translateY(-1px);
}
.cv-quick-card span { font-size: 1.125rem; }

/* Code Block */
.cv-code-block {
    background: #1a1a2e;
    color: #e0e0e0;
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    font-size: 0.8125rem;
    line-height: 1.7;
}
.cv-code-block code { background: transparent; color: inherit; padding: 0; }

/* ---- Usage Tab ---- */
.cv-usage-layout { }
.cv-usage-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}
.cv-usage-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    transition: var(--transition);
}
.cv-usage-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.cv-usage-card-icon { font-size: 2rem; margin-bottom: 8px; }
.cv-usage-card-value { font-size: 1.75rem; font-weight: 800; color: var(--dark); }
.cv-usage-card-label { font-size: 0.8125rem; color: var(--text-muted); margin-top: 4px; }
.cv-usage-card-sub { font-size: 0.75rem; color: var(--text-light); margin-top: 2px; }

.cv-usage-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
}
.cv-usage-section h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 16px;
}

/* Trend Chart */
.cv-trend-chart {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    height: 160px;
    padding: 0 8px;
}
.cv-trend-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
    position: relative;
}
.cv-trend-bar-fill {
    width: 100%;
    max-width: 48px;
    background: linear-gradient(180deg, #9b59b6, #8e44ad);
    border-radius: 6px 6px 0 0;
    transition: height 0.5s ease;
    min-height: 4px;
}
.cv-trend-bar-label { font-size: 0.6875rem; color: var(--text-muted); margin-top: 8px; }
.cv-trend-bar-value {
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--dark);
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
}

/* Top Tools */
.cv-top-tools { display: flex; flex-direction: column; gap: 8px; }
.cv-top-tool-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--bg);
    border-radius: var(--radius-sm);
}
.cv-top-rank {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #9b59b6;
    color: white;
    font-size: 0.6875rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.cv-top-tool-item:nth-child(1) .cv-top-rank { background: linear-gradient(135deg, #f5a623, #e09100); }
.cv-top-tool-item:nth-child(2) .cv-top-rank { background: linear-gradient(135deg, #bdc3c7, #95a5a6); }
.cv-top-tool-item:nth-child(3) .cv-top-rank { background: linear-gradient(135deg, #cd7f32, #a0522d); }
.cv-top-tool-item code { flex: 1; font-size: 0.8125rem; color: var(--text); }
.cv-top-calls { font-size: 0.8125rem; font-weight: 600; color: var(--dark); white-space: nowrap; }

/* API Keys */
.cv-keys-list { display: flex; flex-direction: column; gap: 8px; }
.cv-key-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    flex-wrap: wrap;
}
.cv-key-main {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    flex-wrap: wrap;
    min-width: 0;
}
.cv-key-value { font-size: 0.8125rem; color: var(--text); min-width: 140px; word-break: break-all; }
.cv-key-name { font-size: 0.8125rem; color: var(--text-light); }
.cv-key-tier {
    padding: 2px 10px;
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: white;
    border-radius: 50px;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
}
.cv-key-status { font-size: 0.8125rem; }
.cv-status-active { color: #00c9a7; }
.cv-status-disabled { color: #e74c3c; }
.cv-key-last-used { font-size: 0.75rem; color: var(--text-muted); }
.cv-key-actions { display: flex; gap: 6px; flex-shrink: 0; }
.cv-action-btn {
    width: 32px; height: 32px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-light);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
    font-size: 0.75rem;
}
.cv-action-btn:hover { background: var(--bg); }
.cv-btn-toggle:hover { color: #f39c12; border-color: #f39c12; }
.cv-btn-regen:hover { color: #3498db; border-color: #3498db; }
.cv-btn-delete:hover { color: #e74c3c; border-color: #e74c3c; }

/* Section Header */
.cv-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.cv-section-header h3 { margin-bottom: 0; }

/* Usage Logs */
.cv-logs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
    margin-top: 8px;
}
.cv-logs-table thead th {
    background: var(--bg);
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-light);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}
.cv-logs-table tbody td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}
.cv-logs-table tbody tr:hover { background: rgba(155, 89, 182, 0.03); }
.cv-log-failed td { opacity: 0.6; }
.cv-log-time { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; }
.cv-log-action {
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.6875rem;
    text-transform: uppercase;
}
.cv-action-call { background: rgba(155, 89, 182, 0.1); color: #9b59b6; }
.cv-action-discover { background: rgba(52, 152, 219, 0.1); color: #3498db; }
.cv-action-inspect { background: rgba(0, 201, 167, 0.1); color: #00c9a7; }
.cv-action-test { background: rgba(243, 156, 18, 0.1); color: #f39c12; }
.cv-log-tool { font-size: 0.75rem; }
.cv-log-ok { color: #00c9a7; font-weight: 700; }
.cv-log-fail { color: #e74c3c; font-weight: 700; }

/* Pagination */
.cv-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}
.cv-page-btn {
    width: 36px; height: 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
}
.cv-page-btn:hover { background: var(--bg); border-color: #9b59b6; color: #9b59b6; }
.cv-page-info { font-size: 0.875rem; color: var(--text-light); }

/* Log Filters */
.cv-log-filters { display: flex; gap: 8px; align-items: center; }
.cv-select-sm {
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text);
    font-size: 0.8125rem;
    cursor: pointer;
}

/* ---- Docs Tab ---- */
.cv-docs { }
.cv-docs-content {
    max-width: 800px;
    margin: 0 auto;
}
.cv-docs-content h2 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 32px;
}
.cv-docs-section {
    margin-bottom: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border);
}
.cv-docs-section:last-child { border-bottom: none; }
.cv-docs-section h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 12px;
}
.cv-docs-section p {
    font-size: 0.9375rem;
    color: var(--text);
    line-height: 1.7;
    margin-bottom: 12px;
}
.cv-docs-section code {
    background: rgba(155, 89, 182, 0.08);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.875rem;
    color: #9b59b6;
}

/* API Flow */
.cv-api-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin: 24px 0;
    flex-wrap: wrap;
}
.cv-flow-step {
    text-align: center;
    padding: 20px 24px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    min-width: 160px;
    transition: var(--transition);
}
.cv-flow-step:hover { border-color: #9b59b6; box-shadow: var(--shadow); }
.cv-flow-num {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: white;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
}
.cv-flow-label { font-size: 1rem; font-weight: 700; color: var(--dark); margin-bottom: 4px; }
.cv-flow-desc { font-size: 0.8125rem; color: var(--text-light); }
.cv-flow-arrow { font-size: 1.5rem; color: var(--text-muted); }

/* Docs Table */
.cv-docs-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 0.875rem;
}
.cv-docs-table th {
    background: var(--bg);
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    color: var(--text-light);
    border-bottom: 2px solid var(--border);
}
.cv-docs-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}
.cv-docs-table tr:hover { background: rgba(155, 89, 182, 0.02); }
.cv-docs-table code {
    background: var(--bg);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8125rem;
}

/* Unique Data Badges */
.cv-unique-data {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}
.cv-unique-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    background: linear-gradient(135deg, rgba(155, 89, 182, 0.08), rgba(0, 201, 167, 0.08));
    border: 1px solid rgba(155, 89, 182, 0.2);
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--dark);
    transition: var(--transition);
}
.cv-unique-badge:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

/* ---- ChinaVeris Responsive ---- */
@media (max-width: 1024px) {
    .cv-playground { grid-template-columns: 1fr; }
    .cv-usage-cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .cv-hero { padding: 100px 16px 40px; }
    .cv-hero-title { font-size: 1.75rem; }
    .cv-hero-stats { gap: 24px; flex-wrap: wrap; }
    .cv-tabs { overflow-x: auto; }
    .cv-tab { padding: 14px 16px; font-size: 0.8125rem; white-space: nowrap; }
    .cv-content { padding: 20px 16px 40px; }
    .cv-tools-grid { grid-template-columns: 1fr; }
    .cv-usage-cards { grid-template-columns: 1fr; }
    .cv-pg-input-row { flex-direction: column; }
    .cv-quick-cards { grid-template-columns: 1fr; }
    .cv-api-flow { flex-direction: column; }
    .cv-flow-arrow { transform: rotate(90deg); }
}
