:root {
    color-scheme: dark;
    --bg: #020611;
    --surface: rgba(6, 14, 28, .88);
    --surface-2: #081321;
    --line: rgba(255, 255, 255, .065);
    --text: #e6edf7;
    --muted: #64748b;
    --cyan: #22d3ee;
    --blue: #3b82f6;
    --violet: #a78bfa;
    --green: #34d399;
    --amber: #fbbf24;
    font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); }
body {
    margin: 0;
    min-width: 320px;
    background:
        radial-gradient(circle at 78% -12%, rgba(37, 99, 235, .18), transparent 34%),
        radial-gradient(circle at 35% 15%, rgba(6, 182, 212, .08), transparent 28%),
        var(--bg);
    color: var(--text);
}
body::before {
    position: fixed;
    inset: 0;
    z-index: -1;
    content: "";
    pointer-events: none;
    background-image:
        linear-gradient(rgba(56, 189, 248, .024) 1px, transparent 1px),
        linear-gradient(90deg, rgba(56, 189, 248, .024) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: linear-gradient(to bottom, #000, transparent 85%);
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }

.topbar {
    position: fixed;
    inset: 0 0 auto;
    z-index: 50;
    display: flex;
    height: 64px;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
    padding: 0 24px;
    background: rgba(2, 6, 17, .88);
    backdrop-filter: blur(18px);
}
.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    color: white;
    text-decoration: none;
}
.brand-mark {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid rgba(34, 211, 238, .55);
    border-radius: 9px;
    background: linear-gradient(145deg, rgba(34, 211, 238, .2), rgba(59, 130, 246, .05));
    box-shadow: inset 0 0 18px rgba(34, 211, 238, .08), 0 0 24px rgba(34, 211, 238, .12);
    color: #67e8f9;
    font: 800 17px Consolas, monospace;
}
.brand > span:nth-child(2) { display: flex; flex-direction: column; }
.brand strong { font-size: 16px; letter-spacing: .04em; }
.brand small { margin-top: 2px; color: #475569; font-size: 10px; }
.brand em {
    border: 1px solid rgba(34, 211, 238, .18);
    border-radius: 4px;
    padding: 2px 6px;
    background: rgba(34, 211, 238, .07);
    color: #67e8f9;
    font: normal 9px Consolas, monospace;
    letter-spacing: .08em;
}
.service-status {
    display: flex;
    align-items: center;
    gap: 7px;
    border: 1px solid rgba(52, 211, 153, .16);
    border-radius: 999px;
    padding: 6px 10px;
    background: rgba(52, 211, 153, .055);
    color: #6ee7b7;
    font-size: 11px;
}
.service-status i {
    width: 6px; height: 6px; border-radius: 50%;
    background: currentColor; box-shadow: 0 0 9px currentColor;
}
.service-status.checking { border-color: rgba(251, 191, 36, .15); color: var(--amber); }
.service-status.offline { border-color: rgba(251, 113, 133, .18); color: #fb7185; }

.sidebar {
    position: fixed;
    inset: 64px auto 0 0;
    z-index: 30;
    display: flex;
    width: 238px;
    flex-direction: column;
    border-right: 1px solid rgba(255, 255, 255, .05);
    padding: 24px 16px;
    background: rgba(3, 8, 19, .78);
    backdrop-filter: blur(18px);
}
.side-label {
    margin: 0 10px 9px;
    color: #334155;
    font: 10px Consolas, monospace;
    letter-spacing: .14em;
    text-transform: uppercase;
}
.section-gap { margin-top: 28px; }
.side-link {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(34, 211, 238, .12);
    border-radius: 8px;
    padding: 10px 11px;
    background: linear-gradient(90deg, rgba(34, 211, 238, .11), rgba(34, 211, 238, .025));
    box-shadow: inset 2px 0 0 var(--cyan);
    color: #cffafe;
    font-size: 13px;
    text-decoration: none;
}
.side-link span { color: var(--cyan); font-size: 19px; }
.dimension-list { margin: 0; padding: 0 9px; list-style: none; }
.dimension-list li {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 6px 0;
    color: #64748b;
    font-size: 11px;
}
.dimension-list i { width: 5px; height: 5px; border-radius: 50%; box-shadow: 0 0 8px currentColor; }
.dimension-list .cyan { color: var(--cyan); background: var(--cyan); }
.dimension-list .blue { color: var(--blue); background: var(--blue); }
.dimension-list .violet { color: var(--violet); background: var(--violet); }
.dimension-list .green { color: var(--green); background: var(--green); }
.source-card {
    margin-top: 30px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 13px;
    background: rgba(8, 17, 32, .72);
}
.source-title { display: flex; align-items: center; gap: 9px; }
.source-title b {
    display: grid; width: 28px; height: 28px; place-items: center;
    border-radius: 50%; background: #fc3f1d; color: white; font-size: 15px;
}
.source-title span { display: flex; flex-direction: column; color: white; font-size: 12px; }
.source-title small { margin-top: 2px; color: #475569; font-size: 9px; }
.source-state {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 12px; border-top: 1px solid rgba(255,255,255,.05);
    padding-top: 11px; color: #475569; font-size: 10px;
}
.source-state strong { color: var(--green); font-weight: 500; }
.source-state strong.offline, .negative { color: #fb7185 !important; }
.quota-note {
    margin-top: auto; border-top: 1px solid rgba(255,255,255,.05);
    padding: 16px 4px 0; color: #475569; font-size: 10px;
}

.main {
    width: calc(100% - 238px);
    max-width: 1640px;
    margin-left: 238px;
    padding: 94px 28px 0;
}
.page-head {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 20px; margin-bottom: 18px;
}
.eyebrow {
    display: flex; align-items: center; gap: 10px; margin: 0;
    color: var(--cyan); font: 9px Consolas, monospace; letter-spacing: .16em;
}
.eyebrow i { width: 32px; height: 1px; background: rgba(34,211,238,.5); }
.page-head h1 { margin: 8px 0 3px; color: white; font-size: 30px; letter-spacing: -.04em; }
.page-head > div > p:last-child { margin: 0; color: #94a3b8; font-size: 13px; }
.public-badge {
    border: 1px solid rgba(52,211,153,.15); border-radius: 7px; padding: 8px 11px;
    background: rgba(52,211,153,.055); color: #6ee7b7; font-size: 11px;
}

.search-console, .results, .metric {
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.025), 0 18px 70px rgba(0,0,0,.13);
}
.search-console {
    position: relative; overflow: hidden; border-radius: 12px; padding: 18px;
}
.search-console::before {
    position: absolute; inset: 0 auto 0 0; width: 2px; content: "";
    background: linear-gradient(transparent, var(--cyan), transparent);
}
.search-console form {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 210px 170px auto;
    align-items: end;
    gap: 15px;
}
.field label { display: block; margin-bottom: 8px; color: #64748b; font-size: 11px; }
.input-shell {
    display: flex; height: 44px; align-items: center; gap: 9px;
    border: 1px solid rgba(34,211,238,.18); border-radius: 8px;
    padding: 0 11px; background: rgba(0,0,0,.22);
}
.input-shell:focus-within { border-color: rgba(34,211,238,.55); box-shadow: 0 0 0 3px rgba(34,211,238,.055); }
.search-icon { color: var(--cyan); font-size: 20px; }
.input-shell input {
    width: 100%; height: 42px; border: 0; outline: 0;
    background: transparent; color: white; font-size: 14px;
}
.clear-button { border: 0; background: transparent; color: #475569; font-size: 20px; }
.clear-button:hover { color: white; }
.field select, .filters select, .filters input {
    width: 100%; height: 44px; border: 1px solid rgba(255,255,255,.075);
    border-radius: 8px; outline: 0; padding: 0 11px;
    background: #050b16; color: #cbd5e1; font-size: 12px;
}
.primary-button {
    display: inline-flex; min-height: 44px; align-items: center; justify-content: center;
    gap: 8px; border: 1px solid rgba(103,232,249,.25); border-radius: 8px;
    padding: 0 20px; background: linear-gradient(135deg, #06b6d4, #2563eb);
    box-shadow: 0 9px 24px rgba(37,99,235,.18), inset 0 1px 0 rgba(255,255,255,.2);
    color: white; text-decoration: none;
}
.primary-button:hover { filter: brightness(1.08); }
.primary-button:disabled { cursor: not-allowed; filter: grayscale(.7); opacity: .55; }
.operator-row {
    display: flex; flex-wrap: wrap; align-items: center; gap: 18px;
    margin-top: 12px; color: #475569; font-size: 10px;
}
.operator-row button { border: 0; padding: 0; background: transparent; color: #64748b; font-size: 10px; }
.operator-row button:hover { color: var(--cyan); }
.operator-row small { margin-left: auto; color: #334155; }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 16px; }
.metric {
    position: relative; overflow: hidden; min-height: 116px; border-radius: 10px; padding: 15px 17px;
}
.metric::after {
    position: absolute; right: 0; bottom: 0; left: 0; height: 1px; content: "";
    background: linear-gradient(90deg, transparent, var(--accent), transparent); opacity: .55;
}
.metric span { color: #64748b; font-size: 11px; }
.metric > i {
    position: absolute; top: 14px; right: 16px; display: grid; width: 28px; height: 28px;
    place-items: center; border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
    border-radius: 7px; background: color-mix(in srgb, var(--accent) 8%, transparent);
    color: var(--accent); font-style: normal;
}
.metric strong {
    display: block; margin-top: 11px; color: white;
    font: 600 27px Consolas, monospace; letter-spacing: -.04em;
}
.metric small { display: block; margin-top: 2px; color: #334155; font-size: 9px; }
.metric.cyan { --accent: var(--cyan); }
.metric.violet { --accent: var(--violet); }
.metric.blue { --accent: #60a5fa; }
.metric.green { --accent: var(--green); }

.visual-board {
    position: relative; overflow: hidden; margin-top: 16px; border: 1px solid var(--line);
    border-radius: 12px; padding: 18px; background:
        linear-gradient(145deg, rgba(8,19,33,.94), rgba(3,9,20,.92));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.025), 0 18px 70px rgba(0,0,0,.13);
}
.visual-board::before {
    position: absolute; top: -180px; right: -90px; width: 430px; height: 430px;
    border-radius: 50%; content: ""; pointer-events: none;
    background: radial-gradient(circle, rgba(37,99,235,.12), transparent 68%);
}
.visual-board-head {
    position: relative; display: flex; align-items: flex-end; justify-content: space-between;
    gap: 18px; margin-bottom: 14px;
}
.visual-board-head h2 { margin: 7px 0 3px; color: white; font-size: 18px; letter-spacing: -.025em; }
.visual-board-head > div > p:last-child { margin: 0; color: #64748b; font-size: 10px; }
.visual-status {
    border: 1px solid rgba(100,116,139,.18); border-radius: 999px; padding: 6px 10px;
    background: rgba(100,116,139,.06); color: #64748b; font: 9px Consolas, monospace;
}
.visual-status.loading { border-color: rgba(251,191,36,.18); color: var(--amber); }
.visual-status.ready { border-color: rgba(52,211,153,.18); color: var(--green); }
.visual-status.error { border-color: rgba(251,113,133,.2); color: #fb7185; }
.visual-context {
    position: relative; display: grid; grid-template-columns: 1.35fr 1fr 1fr 1.35fr;
    gap: 8px; margin-bottom: 10px;
}
.context-chip {
    position: relative; overflow: hidden; min-width: 0; border: 1px solid rgba(255,255,255,.055);
    border-radius: 8px; padding: 10px 12px; background: rgba(2,6,17,.36);
}
.context-chip::before {
    position: absolute; inset: 0 auto 0 0; width: 2px; content: ""; background: var(--chip-color);
}
.context-chip.keyword { --chip-color: var(--cyan); }
.context-chip.region { --chip-color: var(--violet); }
.context-chip.device { --chip-color: var(--green); }
.context-chip.filter { --chip-color: var(--blue); }
.context-chip span { display: block; color: #475569; font-size: 8px; letter-spacing: .05em; }
.context-chip strong {
    display: block; overflow: hidden; margin-top: 5px; color: #cbd5e1; font-size: 10px;
    font-weight: 500; text-overflow: ellipsis; white-space: nowrap;
}
.visual-grid { position: relative; display: grid; grid-template-columns: repeat(12, 1fr); gap: 10px; }
.visual-card {
    min-width: 0; border: 1px solid rgba(255,255,255,.06); border-radius: 10px;
    padding: 14px; background: rgba(2,6,17,.38);
}
.visual-trend-card { grid-column: span 8; }
.visual-device-card { grid-column: span 4; }
.visual-keyword-card, .visual-region-card { grid-column: span 6; }
.visual-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.visual-card-head > div { display: flex; align-items: center; gap: 8px; }
.visual-card-head > div > span {
    display: grid; width: 23px; height: 23px; place-items: center;
    border: 1px solid rgba(34,211,238,.15); border-radius: 6px;
    background: rgba(34,211,238,.045); color: var(--cyan); font: 8px Consolas, monospace;
}
.visual-device-card .visual-card-head > div > span { border-color: rgba(52,211,153,.16); background: rgba(52,211,153,.045); color: var(--green); }
.visual-keyword-card .visual-card-head > div > span { border-color: rgba(59,130,246,.16); background: rgba(59,130,246,.045); color: #60a5fa; }
.visual-region-card .visual-card-head > div > span { border-color: rgba(167,139,250,.16); background: rgba(167,139,250,.045); color: var(--violet); }
.visual-card-head strong { color: #e2e8f0; font-size: 11px; }
.visual-card-head small { color: #334155; font: 8px Consolas, monospace; text-align: right; }
.visual-empty {
    display: flex; min-height: 270px; flex-direction: column; align-items: center;
    justify-content: center; color: #64748b; text-align: center;
}
.visual-empty.compact { min-height: 270px; }
.visual-empty > span {
    display: grid; width: 46px; height: 46px; margin-bottom: 11px; place-items: center;
    border: 1px solid rgba(34,211,238,.11); border-radius: 50%;
    background: rgba(34,211,238,.03); color: #38bdf8; font-size: 20px;
}
.visual-empty strong { color: #64748b; font-size: 10px; }
.visual-empty small { margin-top: 5px; color: #334155; font-size: 8px; }
.overview-trend-svg { width: 100%; height: 270px; margin-top: 10px; overflow: visible; }
.overview-trend-area { fill: url(#overviewTrendGradient); }
.visual-list { display: grid; gap: 9px; min-height: 270px; align-content: center; padding-top: 12px; }
.visual-list-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(150px, .8fr); align-items: center; gap: 12px; }
.visual-list-label { display: flex; min-width: 0; align-items: center; gap: 8px; }
.visual-list-rank { width: 20px; flex: 0 0 auto; color: #334155; font: 8px Consolas, monospace; }
.visual-list-label span:last-child {
    overflow: hidden; color: #94a3b8; font-size: 9px; text-overflow: ellipsis; white-space: nowrap;
}
.visual-list-value { display: flex; align-items: center; gap: 8px; }
.visual-list-value strong { width: 62px; color: #cbd5e1; font: 9px Consolas, monospace; text-align: right; }
progress.visual-progress {
    width: 100%; height: 4px; border: 0; border-radius: 99px;
    appearance: none; -webkit-appearance: none; background: transparent;
}
progress.visual-progress::-webkit-progress-bar { border-radius: 99px; background: rgba(255,255,255,.055); }
progress.visual-progress::-webkit-progress-value {
    border-radius: 99px; background: linear-gradient(90deg, #2563eb, #22d3ee);
    box-shadow: 0 0 8px rgba(34,211,238,.26);
}
progress.visual-progress::-moz-progress-bar {
    border-radius: 99px; background: linear-gradient(90deg, #2563eb, #22d3ee);
}
.visual-region-card progress.visual-progress::-webkit-progress-value { background: linear-gradient(90deg, #7c3aed, #a78bfa); }
.visual-region-card progress.visual-progress::-moz-progress-bar { background: linear-gradient(90deg, #7c3aed, #a78bfa); }
.device-chart {
    display: grid; min-height: 270px; grid-template-columns: minmax(150px, .9fr) minmax(120px, 1.1fr);
    align-items: center; gap: 8px; padding-top: 8px;
}
.device-donut { width: 100%; max-width: 210px; margin: 0 auto; overflow: visible; }
.donut-track { fill: none; stroke: rgba(255,255,255,.055); stroke-width: 18; }
.donut-segment { fill: none; stroke-width: 18; stroke-linecap: butt; }
.donut-total { fill: white; font: 600 18px Consolas, monospace; text-anchor: middle; }
.donut-caption { fill: #475569; font: 8px "PingFang SC", sans-serif; text-anchor: middle; }
.device-legend { display: grid; gap: 10px; }
.device-legend-row {
    display: grid; grid-template-columns: 7px minmax(0,1fr) auto; align-items: center;
    gap: 8px; border-bottom: 1px solid rgba(255,255,255,.04); padding-bottom: 9px;
}
.device-legend-row:last-child { border-bottom: 0; padding-bottom: 0; }
.device-legend-row i { width: 7px; height: 7px; border-radius: 50%; background: #22d3ee; box-shadow: 0 0 8px currentColor; }
.device-legend-row i.device-desktop { color: #22d3ee; background: #22d3ee; }
.device-legend-row i.device-phone { color: #34d399; background: #34d399; }
.device-legend-row i.device-tablet { color: #a78bfa; background: #a78bfa; }
.device-legend-row span { color: #64748b; font-size: 9px; }
.device-legend-row strong { color: #cbd5e1; font: 9px Consolas, monospace; }
.visual-loading {
    display: grid; min-height: 270px; place-items: center; color: #64748b;
    font-size: 10px;
}
.visual-loading::before {
    width: 26px; height: 26px; border: 2px solid rgba(34,211,238,.12);
    border-top-color: var(--cyan); border-radius: 50%; content: "";
    animation: visual-spin .8s linear infinite;
}
@keyframes visual-spin { to { transform: rotate(360deg); } }

.results { overflow: hidden; margin-top: 16px; border-radius: 12px; }
.tabs {
    display: flex; min-height: 55px; align-items: center; gap: 4px;
    border-bottom: 1px solid var(--line); padding: 0 17px;
}
.tab {
    align-self: stretch; border: 0; border-bottom: 2px solid transparent;
    padding: 0 15px; background: transparent; color: #64748b; font-size: 12px;
}
.tab.active { border-bottom-color: var(--cyan); color: #cffafe; }
.cache-badge {
    margin-left: auto; border: 1px solid rgba(52,211,153,.15); border-radius: 4px;
    padding: 3px 7px; background: rgba(52,211,153,.05); color: #6ee7b7; font-size: 9px;
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.filters {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
    border-bottom: 1px solid rgba(255,255,255,.045); padding: 12px 17px;
    background: rgba(2,6,17,.22);
}
.filter-title { color: #94a3b8; font-size: 11px; }
.filters input { width: 140px; height: 32px; border-radius: 6px; font-size: 10px; }
.filters select { width: 170px; height: 32px; border-radius: 6px; font-size: 10px; }
.filter-actions { display: flex; gap: 7px; margin-left: auto; }
.filter-actions button {
    height: 32px; border: 1px solid rgba(255,255,255,.08); border-radius: 6px;
    padding: 0 11px; background: rgba(255,255,255,.025); color: #94a3b8; font-size: 10px;
}
.filter-actions button:hover { border-color: rgba(34,211,238,.2); color: #cffafe; }
.table-scroll { min-height: 410px; overflow-x: auto; }
table { width: 100%; min-width: 720px; border-collapse: collapse; }
th {
    height: 42px; border-bottom: 1px solid rgba(255,255,255,.05);
    padding: 0 16px; color: #475569; font-size: 10px; font-weight: 500; text-align: left;
}
th:nth-child(3), th:nth-child(4) { text-align: right; }
td { height: 54px; border-bottom: 1px solid rgba(255,255,255,.045); padding: 0 16px; color: #cbd5e1; font-size: 12px; }
tbody tr:hover { background: rgba(34,211,238,.024); }
.check-cell { width: 48px; text-align: center; }
.rank { margin-right: 13px; color: #334155; font: 9px Consolas, monospace; }
.count-cell { color: white; font: 12px Consolas, monospace; text-align: right; }
.share-cell { text-align: right; }
.share-wrap { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.bar-track { width: 110px; height: 3px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.06); }
.bar-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--cyan)); box-shadow: 0 0 8px rgba(34,211,238,.35); }
progress.bar-track { display: block; border: 0; appearance: none; -webkit-appearance: none; }
progress.bar-track::-webkit-progress-bar { border-radius: 99px; background: rgba(255,255,255,.06); }
progress.bar-track::-webkit-progress-value {
    border-radius: 99px; background: linear-gradient(90deg, var(--blue), var(--cyan));
    box-shadow: 0 0 8px rgba(34,211,238,.35);
}
progress.bar-track::-moz-progress-bar {
    border-radius: 99px; background: linear-gradient(90deg, var(--blue), var(--cyan));
    box-shadow: 0 0 8px rgba(34,211,238,.35);
}
.share-value { width: 46px; color: #64748b; font: 10px Consolas, monospace; }
.empty-row:hover { background: transparent; }
.empty-row td { height: 310px; border: 0; text-align: center; }
.empty-row td span, .analysis-empty > span, .chart-empty > span {
    display: grid; width: 58px; height: 58px; margin: 0 auto 13px; place-items: center;
    border: 1px solid rgba(34,211,238,.13); border-radius: 50%;
    background: rgba(34,211,238,.035); color: var(--cyan); font-size: 27px;
}
.empty-row strong, .empty-row small { display: block; }
.empty-row small { margin-top: 5px; color: #475569; font-size: 10px; }
.result-footer {
    display: flex; min-height: 42px; align-items: center; gap: 22px;
    border-top: 1px solid rgba(255,255,255,.045); padding: 0 18px;
    color: #475569; font-size: 9px;
}
.result-footer span:last-child { margin-left: auto; }

#trendPanel, #regionsPanel { min-height: 455px; padding: 24px; }
.panel-headline { display: flex; align-items: center; justify-content: space-between; }
.panel-headline div { display: flex; flex-direction: column; }
.panel-headline strong { color: white; font-size: 13px; }
.panel-headline small { margin-top: 5px; color: #475569; font-size: 9px; }
#trendSummary { border-radius: 6px; padding: 6px 9px; color: var(--green); font: 10px Consolas, monospace; }
.chart-empty, .analysis-empty {
    display: flex; min-height: 350px; flex-direction: column; align-items: center;
    justify-content: center; color: #94a3b8; text-align: center;
}
.chart-empty small, .analysis-empty small { margin-top: 6px; color: #475569; font-size: 10px; }
.analysis-empty .primary-button { margin-top: 18px; }
.trend-svg { width: 100%; height: 340px; margin-top: 18px; overflow: visible; }
.trend-grid { stroke: rgba(255,255,255,.055); stroke-width: 1; }
.trend-line { fill: none; stroke: var(--cyan); stroke-width: 2.2; }
.trend-area { fill: url(#trendGradient); }
.trend-dot { fill: var(--cyan); stroke: #07111f; stroke-width: 2; }
.trend-label { fill: #475569; font: 9px Consolas, monospace; }
.region-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.region-row {
    display: flex; align-items: center; gap: 12px; border: 1px solid var(--line);
    border-radius: 9px; padding: 12px; background: rgba(2,6,17,.25);
}
.region-rank {
    display: grid; width: 26px; height: 26px; flex: 0 0 auto; place-items: center;
    border: 1px solid rgba(167,139,250,.16); border-radius: 7px;
    background: rgba(167,139,250,.055); color: var(--violet); font: 9px Consolas, monospace;
}
.region-body { min-width: 0; flex: 1; }
.region-title, .region-stats { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.region-title span { overflow: hidden; color: #cbd5e1; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.region-title strong { color: white; font: 11px Consolas, monospace; }
.region-stats { margin-top: 8px; }
.region-stats .bar-track { flex: 1; width: auto; }
.region-stats small { width: 92px; color: #475569; font-size: 9px; text-align: right; }

footer {
    display: flex; justify-content: space-between; gap: 20px;
    margin-top: 20px; border-top: 1px solid rgba(255,255,255,.045);
    padding: 18px 0 22px; color: #334155; font-size: 9px;
}
.toast {
    position: fixed; top: 78px; right: 20px; z-index: 100;
    max-width: 360px; transform: translateY(-12px); border: 1px solid rgba(34,211,238,.22);
    border-radius: 9px; padding: 11px 14px; background: #07111f; box-shadow: 0 16px 50px rgba(0,0,0,.38);
    color: #dbeafe; font-size: 12px; opacity: 0; pointer-events: none; transition: .2s ease;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.error { border-color: rgba(251,113,133,.28); color: #fecdd3; }
.clipboard-helper { position: fixed; left: -9999px; opacity: 0; pointer-events: none; }
.loading { opacity: .65; pointer-events: none; }

@media (max-width: 1100px) {
    .search-console form { grid-template-columns: 1fr 1fr 1fr; }
    .keyword-field { grid-column: 1 / -1; }
    .search-console .primary-button { width: 100%; }
    .metrics { grid-template-columns: 1fr 1fr; }
    .visual-trend-card { grid-column: span 7; }
    .visual-device-card { grid-column: span 5; }
}
@media (max-width: 820px) {
    .sidebar { display: none; }
    .main { width: 100%; margin-left: 0; padding: 84px 14px 0; }
    .topbar { padding: 0 14px; }
    .page-head { align-items: flex-start; flex-direction: column; }
    .visual-context { grid-template-columns: 1fr 1fr; }
    .visual-trend-card, .visual-device-card, .visual-keyword-card, .visual-region-card { grid-column: span 12; }
}
@media (max-width: 600px) {
    .brand em, .brand small { display: none; }
    .service-status span { display: none; }
    .search-console form { grid-template-columns: 1fr; }
    .keyword-field { grid-column: auto; }
    .operator-row small { width: 100%; margin-left: 0; }
    .metrics { grid-template-columns: 1fr 1fr; gap: 8px; }
    .metric { min-height: 104px; padding: 13px; }
    .metric strong { font-size: 22px; }
    .visual-board { padding: 13px; }
    .visual-board-head { align-items: flex-start; flex-direction: column; }
    .visual-context { grid-template-columns: 1fr; }
    .device-chart { grid-template-columns: 1fr; }
    .device-donut { max-width: 185px; }
    .visual-list-row { grid-template-columns: minmax(0,1fr) minmax(112px,.8fr); }
    .tab { padding: 0 10px; }
    .filters input, .filters select { width: calc(50% - 4px); }
    .filter-actions { width: 100%; margin-left: 0; }
    .filter-actions button { flex: 1; }
    .result-footer span:last-child { display: none; }
    #trendPanel, #regionsPanel { padding: 16px 12px; }
    .region-grid { grid-template-columns: 1fr; }
    footer { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { animation: none !important; transition: none !important; }
}
