/* 全球草地深度分析平台 */
html, body { overflow: hidden; font-size: 13.5px; }
body { display: grid; grid-template-columns: 300px minmax(0, 1fr) 452px; grid-template-rows: 52px minmax(0, 1fr); height: 100vh; }
h2, h3, h4, p { margin: 0; }

/* 顶栏 */
.top { grid-column: 1 / -1; display: flex; align-items: center; gap: 18px; padding: 0 16px; background: var(--panel-solid); border-bottom: 1px solid var(--line); z-index: 6; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand svg { width: 26px; height: 26px; color: var(--grass); }
.brand b { font-size: 17px; letter-spacing: .14em; }
.brand span { color: var(--ink-3); font-size: 12.5px; letter-spacing: .08em; }
.search { position: relative; flex: 0 1 380px; margin-left: 10px; }
.search input { width: 100%; height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line); background: rgba(255, 255, 255, .04); color: var(--ink); font: inherit; outline: none; }
.search input:focus { border-color: var(--grass); }
.results { position: absolute; left: 0; right: 0; top: 36px; max-height: 340px; overflow: auto; background: var(--panel-solid); border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: 0 12px 40px rgba(0, 0, 0, .5); z-index: 20; }
.results button { display: flex; justify-content: space-between; gap: 10px; width: 100%; padding: 7px 12px; border: 0; background: none; text-align: left; }
.results button:hover, .results button.on { background: var(--raise); }
.results em { font-style: normal; color: var(--ink-3); font-size: 12px; }
.tools { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.tools button, .tools .btn, .btn { height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line); background: none; color: var(--ink-2); text-decoration: none; display: inline-flex; align-items: center; white-space: nowrap; }
.tools button:hover, .btn:hover { border-color: var(--line-strong); color: var(--ink); }
.tools button.on { background: rgba(95, 208, 168, .16); border-color: var(--grass); color: var(--ink); }
.tools i { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }

/* 左栏 */
.side { grid-row: 2; display: flex; flex-direction: column; min-height: 0; background: var(--panel-solid); border-right: 1px solid var(--line); z-index: 5; }
.side-tabs, .panel-tabs { display: flex; flex: none; border-bottom: 1px solid var(--line); }
.side-tabs button, .panel-tabs button { flex: 1; height: 38px; border: 0; background: none; color: var(--ink-3); font-size: 12.5px; border-bottom: 2px solid transparent; white-space: nowrap; }
.side-tabs button.on, .panel-tabs button.on { color: var(--ink); border-bottom-color: var(--grass); }
.side-body, .panel-body { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 12px 24px; }
.group { margin-bottom: 14px; }
.group > h3 { font-size: 11.5px; font-weight: 500; letter-spacing: .18em; color: var(--ink-3); margin: 4px 4px 6px; }
.layer { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border: 0; border-radius: 7px; background: none; text-align: left; color: var(--ink-2); }
.layer:hover { background: var(--raise); }
.layer.on { background: rgba(95, 208, 168, .14); color: var(--ink); }
.layer i { flex: none; width: 22px; height: 10px; border-radius: 3px; }
.layer span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layer em { font-style: normal; font-size: 10.5px; color: var(--ink-3); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; }

.field { display: grid; grid-template-columns: 84px 1fr; align-items: center; gap: 8px; margin: 8px 4px; color: var(--ink-2); }
.field.wide { grid-template-columns: 1fr; }
.field select, .field input[type=date], .field input[type=text], .field input[type=number], .field input[type=password], textarea, select {
  height: 30px; border-radius: 7px; border: 1px solid var(--line); background: #0f2231; color: var(--ink); font: inherit; padding: 0 8px; min-width: 0; outline: none; }
textarea { height: auto; padding: 8px; resize: vertical; width: 100%; }
input[type=range] { accent-color: var(--grass); width: 100%; }
.check { display: flex; align-items: center; gap: 8px; padding: 5px 6px; color: var(--ink-2); border-radius: 6px; }
.check:hover { background: var(--raise); }
.check input { accent-color: var(--grass); width: 15px; height: 15px; }
.check b { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 4px; }
.chip { padding: 3px 9px; border-radius: 14px; border: 1px solid var(--line); background: none; color: var(--ink-2); font-size: 12px; }
.chip:hover { border-color: var(--line-strong); }
.chip.on { background: rgba(95, 208, 168, .18); border-color: var(--grass); color: var(--ink); }
.hintline { margin: 6px 4px; color: var(--ink-3); font-size: 12px; line-height: 1.6; }

/* 地图与浮层 */
#map { grid-row: 2; grid-column: 2; position: relative; min-width: 0; background: #050d14; }
.hud { grid-row: 2; grid-column: 2; position: relative; pointer-events: none; z-index: 3; }
.hud > * { pointer-events: auto; }
.legend { position: absolute; left: 12px; bottom: 12px; width: 318px; padding: 10px 12px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(10px); }
.legend header { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.legend header b { font-size: 13px; }
.legend header span { color: var(--ink-3); font-size: 11.5px; text-align: right; }
.legend .ctl { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.legend .ctl label { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: var(--ink-3); }
.legend .ctl select { height: 26px; }
.legend .sg-legend-cat { max-height: 190px; overflow: auto; }
.timebar { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; width: min(480px, 46%); padding: 8px 14px; border-radius: 24px; background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(10px); margin-left: 80px; }
.timebar button { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line-strong); background: none; color: var(--grass); flex: none; }
.timebar b { font-size: 18px; min-width: 52px; text-align: right; color: var(--wheat); }
.status { position: absolute; right: 12px; bottom: 12px; padding: 4px 10px; border-radius: 6px; background: var(--panel); border: 1px solid var(--line); color: var(--ink-3); font-size: 12px; }
.drawbar { grid-row: 2; grid-column: 2; align-self: start; justify-self: center; margin-top: 12px; z-index: 4; display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; background: var(--panel); border: 1px solid var(--grass); backdrop-filter: blur(10px); }
.drawbar button, .act { height: 28px; padding: 0 10px; border-radius: 7px; border: 1px solid var(--line-strong); background: none; color: var(--ink-2); }
.drawbar button.primary, .act.primary { background: var(--grass); color: #06231a; border-color: var(--grass); font-weight: 600; }
.act:hover { color: var(--ink); border-color: var(--grass); }
.act.primary:hover { color: #06231a; }

/* 右栏 */
.panel { grid-row: 2; grid-column: 3; display: flex; flex-direction: column; min-height: 0; background: var(--panel-solid); border-left: 1px solid var(--line); z-index: 5; }
.panel-body section > h2 { font-size: 19px; font-weight: 600; line-height: 1.3; }
.sub { color: var(--ink-3); font-size: 12px; margin-top: 3px; line-height: 1.5; }
.block { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.block > h3 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; font-weight: 600; margin-bottom: 9px; }
.block > h3 small { font-weight: 400; color: var(--ink-3); font-size: 11.5px; text-align: right; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.tag { padding: 2px 8px; border-radius: 5px; font-size: 12px; border: 1px solid var(--line); color: var(--ink-2); }
.tag.fill { color: #08141e; border: 0; font-weight: 600; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-top: 12px; }
.stats.c3 { grid-template-columns: repeat(3, 1fr); }
.stat { padding: 8px 6px; border-radius: 8px; background: var(--raise); text-align: center; min-width: 0; }
.stat b { display: block; font-family: var(--num); font-size: 18px; font-weight: 600; line-height: 1.15; white-space: nowrap; }
.stat span { display: block; margin-top: 2px; font-size: 11px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 18px; }
.kv div { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; border-bottom: 1px dashed rgba(150, 190, 215, .1); color: var(--ink-2); }
.kv div b { font-family: var(--num); font-weight: 500; color: var(--ink); white-space: nowrap; }
.chart { height: 170px; }
.chart.short { height: 130px; }
.seg-tabs { display: inline-flex; padding: 2px; border-radius: 8px; background: rgba(255, 255, 255, .05); gap: 2px; flex-wrap: wrap; }
.seg-tabs button { height: 24px; padding: 0 9px; border: 0; border-radius: 6px; background: none; color: var(--ink-3); font-size: 12px; }
.seg-tabs button.on { background: rgba(95, 208, 168, .22); color: var(--ink); }
.score { display: flex; align-items: center; gap: 12px; margin: 10px 0; }
.score .ring { flex: none; width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; position: relative; }
.score .ring::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--panel-solid); }
.score .ring b { position: relative; font-family: var(--num); font-size: 22px; }
.score p { color: var(--ink-2); line-height: 1.55; font-size: 12.5px; }
.score p b { font-size: 15px; }
.advice { margin: 0; padding-left: 18px; color: var(--ink-2); line-height: 1.7; }
.empty { margin-top: 60px; text-align: center; color: var(--ink-3); line-height: 1.9; }
.empty b { display: block; color: var(--ink-2); font-size: 15px; font-weight: 500; margin-bottom: 4px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.scroll { max-height: 420px; overflow: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 12px; }
table.t th { text-align: left; font-weight: 500; color: var(--ink-3); padding: 5px 6px; border-bottom: 1px solid var(--line); }
table.t td { padding: 5px 6px; border-bottom: 1px dashed rgba(150, 190, 215, .1); color: var(--ink-2); vertical-align: top; }
table.t td:first-child { min-width: 96px; }
table.t td input { width: 46px; height: 24px; padding: 0 4px; text-align: right; font-family: var(--num); border-radius: 5px; border: 1px solid var(--line); background: #0f2231; color: var(--ink); }
.station { padding: 10px 12px; border-radius: 9px; background: var(--raise); border: 1px solid var(--line); margin-bottom: 12px; }
.station h4 { font-size: 14px; margin-bottom: 4px; }
.station p { color: var(--ink-2); font-size: 12px; line-height: 1.6; }

/* 助手 */
.chat { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.msg { padding: 9px 11px; border-radius: 10px; line-height: 1.7; white-space: pre-wrap; }
.msg.q { align-self: flex-end; background: rgba(95, 208, 168, .18); max-width: 88%; }
.msg.a { background: var(--raise); border: 1px solid var(--line); }
.msg.a small { display: block; margin-top: 6px; color: var(--ink-3); font-size: 11.5px; }

/* 视频弹窗 */
.modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: rgba(2, 8, 12, .7); backdrop-filter: blur(4px); }
.modal-card { width: min(960px, 92vw); background: var(--panel-solid); border: 1px solid var(--line-strong); border-radius: 12px; overflow: hidden; }
.modal-card header { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.modal-card header button { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); background: none; color: var(--ink-2); }
.live-stage { position: relative; aspect-ratio: 16 / 9; background: #000; }
.live-stage video, .live-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.live-stage p { position: absolute; left: 12px; bottom: 10px; padding: 3px 9px; border-radius: 5px; background: rgba(0, 0, 0, .6); font-size: 12px; }
.live-ctl { display: flex; gap: 16px; padding: 12px 14px; align-items: center; }
.ptz { display: grid; grid-template-columns: repeat(3, 44px); gap: 5px; }
.ptz button { height: 30px; border-radius: 6px; border: 1px solid var(--line-strong); background: none; color: var(--ink-2); font-size: 12px; }
.live-meta { color: var(--ink-3); font-size: 12px; line-height: 1.7; }

.toast { position: fixed; left: 50%; top: 66px; transform: translateX(-50%); z-index: 50; padding: 8px 16px; border-radius: 8px; background: #123246; border: 1px solid var(--grass); box-shadow: 0 8px 30px rgba(0, 0, 0, .5); }
.boot { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: #050d14; color: var(--ink-2); letter-spacing: .12em; transition: opacity .6s; }
.boot.done { opacity: 0; pointer-events: none; }

@media (max-width: 1280px) { body { grid-template-columns: 250px minmax(0, 1fr) 400px; } .brand span { display: none; } }
