:root {
    --canvas: #f5f6f8; --surface: #fff; --ink: #222d3a; --muted: #687583;
    --line: #e3e7ec; --accent: #365e85; --accent-soft: #edf3f8;
    --font: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; padding: 0 36px 80px; background: var(--canvas); color: var(--ink); font-family: var(--font); font-size: 14px; line-height: 1.6; }
body > .container, body > .header, body > h1, body > .page-heading, body > .cards-container,
body > .charts-container, body > .labels-section, body > .section-index { width: 100%; max-width: 1440px; margin-left: auto; margin-right: auto; }
body > .container { padding: 0; }
body h1 { margin: 30px 0 20px; text-align: left; font-size: 26px; font-weight: 600; line-height: 1.45; letter-spacing: -.6px; color: var(--ink); overflow-wrap: anywhere; }
body h2 { font-size: 17px; font-weight: 600; color: var(--ink); }
body h3 { font-size: 15px; font-weight: 600; color: var(--ink); }
a { color: var(--accent); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; }
button, summary, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
button { cursor: pointer; }
.workspace-nav { max-width: 1440px; min-height: 76px; margin: 0 auto 28px; display: flex; align-items: center; gap: 32px; border-bottom: 1px solid var(--line); }
.workspace-nav a { text-decoration: none; }
.workspace-brand { display: flex; align-items: center; flex-shrink: 0; gap: 10px; color: var(--ink); font-size: 17px; font-weight: 600; letter-spacing: .2px; }
.brand-mark { width: 28px; height: 28px; display: inline-grid; place-items: center; border-radius: 7px; background: var(--ink); color: #fff; font-size: 16px; font-family: Georgia, serif; }
.brand-caption { color: var(--muted); font-size: 11px; font-weight: 400; border-left: 1px solid var(--line); padding-left: 10px; margin-left: 2px; }
.workspace-links { display: flex; gap: 6px; }
.workspace-links a { color: var(--muted); padding: 8px 13px; border-radius: 6px; white-space: nowrap; }
.workspace-links a:hover { background: #eaf0f5; color: var(--ink); }
.workspace-links a[aria-current] { color: var(--accent); background: #e8eef4; font-weight: 600; }
.workspace-account { margin-left: auto; display: flex; align-items: center; gap: 14px; white-space: nowrap; font-size: 12px; }
.workspace-account a { color: var(--muted); }
.nav-divider { height: 12px; width: 1px; background: #d6dde5; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 24px; }
.page-heading h1 { margin: 0 0 5px; }
.page-heading p, .page-subtitle { margin: 0; color: var(--muted); font-size: 13px; }
.updated-at { color: var(--muted); font-size: 12px; white-space: nowrap; }
body .cards-container, body .stats-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0; padding: 0; margin-bottom: 28px; background: white; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
body .card, body .stat-card { background: white; border-radius: 0; border: 0; box-shadow: none; padding: 22px 24px; text-align: left; min-width: 0; }
body .cards-container > .card + .card, body .stats-cards > .stat-card + .stat-card { border-left: 1px solid var(--line); }
body .card h2, body .stat-card h2 { font-size: 12px; color: var(--muted); font-weight: 400; margin: 0 0 7px; }
body .card p, body .stat-card p { font-size: 29px; font-weight: 600; letter-spacing: -.7px; color: var(--ink); line-height: 1.3; margin: 0; font-variant-numeric: tabular-nums; }
body #statsCards.cards-container { grid-template-columns: repeat(4, minmax(0, 1fr)); }
body #statsCards.cards-container > .card { border-bottom: 1px solid var(--line); }
body #statsCards.cards-container > .card:nth-child(4n+1) { border-left: 0; }
.metric-unit { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 4px; }
body .charts-container, body .label-categories { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 0 0 28px; align-items: start; }
body .chart, body .label-category, body .details-card, body .section, body .filter-container, body .results-container, body .tours-container { border: 1px solid var(--line); box-shadow: none; border-radius: 9px; background: white; min-width: 0; }
body .chart { padding: 12px; overflow: hidden; min-height: 350px; }
body > .charts-container { margin-left: auto; margin-right: auto; }
body .labels-section { padding: 0; background: transparent; box-shadow: none; border-radius: 0; margin-top: 30px; scroll-margin-top: 24px; }
body .labels-section > h2 { margin: 0 0 14px; }
body .label-category { padding: 18px 20px 10px; }
body .label-category h3, body .details-card h3 { border: 0; font-size: 14px; margin: 0 0 8px; padding: 0; color: var(--ink); }
body .label-chart { min-height: 320px; }
.section-index { display: flex; gap: 24px; margin-bottom: 22px; border-bottom: 1px solid var(--line); padding-bottom: 12px; overflow-x: auto; }
.section-index a { color: var(--muted); text-decoration: none; white-space: nowrap; font-size: 13px; }
.section-index a:hover { color: var(--accent); }
body .chart-controls { text-align: right; padding: 4px 8px 10px; border-bottom: 0; margin: 0; }
body .sort-btn { border: 0; border-radius: 4px; background: transparent; margin: 0; padding: 5px 9px; font-size: 11px; color: var(--muted); }
body .sort-btn.active { background: var(--accent-soft); color: var(--accent); }
body .filter-container { padding: 22px 24px 16px; margin-bottom: 20px; }
body .filter-row { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
body .filter-group { min-width: 0; }
body .filter-group label { font-size: 12px; color: var(--muted); margin-bottom: 6px; font-weight: 400; }
body .filter-group input, body .filter-group select, body #pageSize { min-width: 0; max-width: 100%; background: #fff; border: 1px solid #d9e0e7; border-radius: 5px; color: var(--ink); padding: 8px 10px; font-size: 13px; height: 37px; }
body .filter-group input[type=checkbox] { height: 15px; width: 15px; accent-color: var(--accent); }
body .filter-group input:focus, body .filter-group select:focus { outline: 2px solid #d7e5f2; border-color: var(--accent); }
.search-primary { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.advanced-filters { margin: 4px 0 0; }
.advanced-filters summary { padding: 8px 0 12px; color: var(--accent); font-size: 12px; cursor: pointer; width: fit-content; }
.advanced-count { color: var(--muted); margin-left: 8px; }
.advanced-filters[open] summary { margin-bottom: 8px; }
body .filter-actions { justify-content: flex-start; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.monitor-control { margin-left: 12px; display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.monitor-control input { accent-color: var(--accent); }
.filter-feedback { color: var(--muted); font-size: 12px; margin-top: 10px; }
.filter-feedback:empty { display: none; }
body .btn, body .table-btn, body .pagination button { padding: 7px 13px; border: 1px solid var(--line); border-radius: 5px; background: white; color: #4f5d6c; font-size: 12px; font-weight: 500; min-height: 34px; }
body .btn-primary { color: white; border-color: var(--accent); background: var(--accent); }
body .btn:hover, body .table-btn:hover { opacity: 1; filter: brightness(.97); }
.export-actions { margin-left: auto; display: flex; gap: 8px; }
body .results-header { background: white; padding: 16px 20px; border-bottom: 1px solid var(--line); font-size: 12px; }
body .results-count { color: var(--ink); font-weight: 600; }
body .table-container { overflow-x: auto; }
body table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
body th { background: #f9fafb; color: #647283; font-size: 11px; font-weight: 500; white-space: nowrap; }
body th, body td { padding: 13px 14px; border-bottom: 1px solid #edf0f3; }
body td { font-size: 12px; color: #435163; line-height: 1.6; }
body tbody tr:hover { background: #f8fafc; }
body .project-name, body .project-link { color: var(--ink); font-weight: 500; }
body .project-name:hover, body .project-link:hover { color: var(--accent); }
#resultsTable { min-width: 1130px; }
#resultsTable td:first-child { min-width: 220px; max-width: 300px; }
#resultsTable td:nth-child(2) { white-space: nowrap; }
#resultsTable td:nth-child(3) { min-width: 130px; max-width: 190px; }
#resultsTable :is(td, th):nth-child(n+4):nth-child(-n+10) { text-align: right; white-space: nowrap; }
body .status { min-width: 42px; padding: 2px 7px; font-size: 11px; border-radius: 4px; }
body .status-on_sale { background: #edf4f0; color: #426c56; }
body .status-sold_out { background: #f7f0e8; color: #8a683e; }
body .status-停售 { background: #f0f2f5; color: #78838d; }
body .pagination { justify-content: flex-end; padding: 14px 18px; gap: 10px; font-size: 12px; }
body .header { background: transparent; padding: 0; color: var(--ink); }
body .details-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 22px; }
body .details-card { padding: 20px; }
body .detail-item { border-bottom: 1px solid #f0f2f5; gap: 12px; padding: 10px 0; font-size: 12px; align-items: baseline; }
body .detail-label { color: var(--muted); min-width: 78px; font-weight: 400; }
body .detail-value { overflow-wrap: anywhere; }
body .highlight-value { color: var(--ink); font-weight: 500; }
body .tag-value { background: #f0f3f6; color: #526477; padding: 2px 8px; border-radius: 4px; font-size: 11px; }
.breadcrumb { color: var(--muted); font-size: 12px; margin-bottom: 12px; }
.breadcrumb a { text-decoration: none; }
.project-metrics { margin-top: 24px; }
body .tours-header { background: #fafbfc; color: var(--muted); padding: 16px 22px; font-size: 12px; font-weight: 400; }
body .tour-item { padding: 19px 22px; border-bottom: 1px solid #edf0f3; }
body .tour-item:hover { background: #fafbfc; transform: none; box-shadow: none; }
body .tour-name { font-size: 15px; color: var(--ink); font-weight: 500; margin-bottom: 6px; }
body .tour-meta { color: var(--muted); font-size: 12px; gap: 24px; }
body .tour-meta strong { color: #4d6073; }
body .section { padding: 22px; }
body .table-btn.active { background: var(--accent-soft); border-color: #d2e0ec; color: var(--accent); }
body .sql-editor { background: #fafbfc; border: 1px solid var(--line); border-radius: 6px; padding: 16px; font-size: 13px; color: var(--ink); }
body #debugInfo { display: none; }
body .ai-button { width: auto; height: 38px; padding: 0 16px; bottom: 22px; right: 26px; border-radius: 6px; background: white; border: 1px solid #d6dfe8; color: var(--accent); font-size: 12px; font-weight: 500; box-shadow: 0 2px 8px #22334a0a; transition: background .15s; }
body .ai-button:hover { transform: none; box-shadow: none; background: var(--accent-soft); }
body .ai-modal { background: #18233155; }
body .ai-modal-content { border-radius: 10px; box-shadow: 0 16px 60px #18233126; }
body .ai-modal-header h2 { font-size: 17px; }
body .ai-send-btn { background: var(--accent); border-radius: 5px; }
body .ai-send-btn:hover { transform: none; box-shadow: none; }
body .ai-input { border-width: 1px; min-width: 0; }
body .ai-input:focus { border-color: var(--accent); }
body .ai-example-tag { border-radius: 4px; font-size: 12px; }
body .ai-result { border-radius: 6px; background: #f7f9fb; }
body .ai-loading-spinner { width: 24px; height: 24px; border-width: 2px; border-top-color: var(--accent); }
body.auth-page { min-height: 100vh; padding: 24px; display: grid; place-items: center; }
body.auth-page .login-card, body.auth-page > .card { width: min(400px, 100%); padding: 36px; border: 1px solid var(--line); border-radius: 10px; box-shadow: none; }
body.auth-page h1 { font-size: 23px; margin: 24px 0 22px; }
body.auth-page button { background: var(--accent); color: white; }
body.auth-page input { border-color: #d6dfe8; }
@media (max-width: 1100px) {
    .brand-caption { display: none; }
    .workspace-nav { gap: 22px; }
    body .cards-container { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    body .cards-container > .card { border-bottom: 1px solid var(--line); }
    body .cards-container > .card:nth-child(3n+1) { border-left: 0; }
    body .details-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    body { padding: 0 16px 76px; }
    .workspace-nav { flex-wrap: wrap; gap: 10px; padding: 16px 0 12px; margin-bottom: 22px; }
    .workspace-brand { font-size: 16px; }
    .workspace-account { order: 1; }
    .workspace-links { order: 2; width: 100%; overflow-x: auto; }
    .workspace-links a { font-size: 12px; padding: 7px 12px; }
    .page-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
    body h1, body .header h1 { font-size: 22px; }
    body .charts-container, body .label-categories, body .details-grid { grid-template-columns: 1fr; }
    body .cards-container, body .stats-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    body #statsCards.cards-container { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    body .card, body .stat-card { padding: 17px; }
    body .card p, body .stat-card p { font-size: 25px; }
    body .cards-container > .card:nth-child(n), body .stats-cards > .stat-card { border-left: 0; border-bottom: 1px solid var(--line); }
    body .cards-container > .card:nth-child(even), body .stats-cards > .stat-card:nth-child(even) { border-left: 1px solid var(--line); }
    body .filter-row, .search-primary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .search-primary > :first-child { grid-column: 1 / -1; }
    body .filter-container { padding: 16px; }
    body .filter-actions { flex-direction: row; }
    body .filter-actions .btn { width: auto; }
    .export-actions { width: 100%; margin: 8px 0 0; }
    .monitor-control { margin-left: auto; }
    body .label-category { padding: 14px 10px; }
    body .chart { padding: 6px; }
    body .section { padding: 16px; }
    .section-index { gap: 18px; }
    body .ai-button { right: 16px; bottom: 16px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition: none !important; } }
