/* ========== 基础变量 ========== */
:root {
  --bg: #f7f8fa; --card: #fff; --border: #e2e5ea;
  --txt: #1a1a2e; --txt2: #6b7280; --txt3: #9ca3af;
  --blue: #4f7cff; --blue-hover: #3b64db; --blue-bg: #eef3ff;
  --red: #ef4444; --green: #22c55e;
  --shadow: 0 1px 3px rgba(0,0,0,.04), 0 1px 2px rgba(0,0,0,.06);
  --shadow-hover: 0 4px 12px rgba(0,0,0,.08);
  --radius: 8px;
  --sidebar-w: 220px;
  --font: -apple-system, "Microsoft YaHei", "PingFang SC", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin:0; padding:0; }
html { font-size: 14px; }
body {
  font-family: var(--font); background: var(--bg); color: var(--txt);
  min-height: 100vh; -webkit-font-smoothing: antialiased;
}

/* ========== 布局 ========== */
.shell { display:flex; min-height:100vh; }

/* ========== 侧栏折叠 ========== */
.sidebar-toggle {
  position: absolute; top: 50%; right: -12px; transform: translateY(-50%);
  width: 24px; height: 48px; border: 1px solid var(--border); border-left: none;
  border-radius: 0 6px 6px 0; background: var(--card); color: var(--txt3);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 11px; z-index: 10; transition: color .15s;
}
.sidebar-toggle:hover { color: var(--blue); }
.sidebar.collapsed { width: 0 !important; min-width: 0; overflow: visible; border-right-color: transparent; }
.sidebar.collapsed > *:not(.sidebar-toggle) { display: none; }
.sidebar.collapsed > *:not(.sidebar-toggle) { display: none; }

/* ========== 预览缩放控件 ========== */
.preview-zoom-bar {
  display: flex; align-items: center; gap: 4px; padding: 6px 12px;
  background: var(--card); border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
  z-index: 10; user-select: none;
}
.preview-zoom-bar .zoom-btn {
  width: 30px; height: 30px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--card); color: var(--txt); cursor: pointer; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: all .12s; line-height: 1;
}
.preview-zoom-bar .zoom-btn:hover { background: var(--blue-bg); border-color: var(--blue); color: var(--blue); }
.preview-zoom-bar .zoom-pct {
  font-size: .8rem; color: var(--txt2); min-width: 44px; text-align: center; font-variant-numeric: tabular-nums;
}
.preview-zoom-bar .zoom-sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }

/* 预览大图拖拽平移 */
#previewImage.dragging { cursor: grabbing !important; }
#previewImage.zoomed { cursor: grab; }

/* 预览弹窗图片容器 */
.preview-img-container {
  position: relative; display: flex; align-items: center; justify-content: center;
  overflow: hidden; width: 100%; height: 100%; min-height: 300px;
}
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; background: var(--card);
  border-right: 1px solid var(--border); display:flex; flex-direction:column;
  position: sticky; top:0; height:100vh; overflow:hidden; transition: width .25s ease;
}
.sidebar-head { padding:20px 16px 12px; }
.sidebar-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 12px; }
.sidebar-actions { display:flex; gap:6px; }
.icon-btn {
  width: 32px; height: 32px; display:flex; align-items:center; justify-content:center;
  border: 1px solid var(--border); border-radius: 6px; background: var(--card);
  color: var(--txt2); cursor:pointer; transition: all .15s;
}
.icon-btn:hover { color: var(--blue); border-color: var(--blue); background: var(--blue-bg); }

.sidebar-nav { flex:1; overflow-y:auto; padding:0 8px 12px; }
.nav-item {
  display:flex; align-items:center; gap:8px; padding:8px 10px;
  border-radius: 6px; cursor:pointer; font-size: .85rem; color: var(--txt2);
  transition: all .12s;
}
.nav-item:hover { background: var(--bg); color: var(--txt); }
.nav-item.active { background: var(--blue-bg); color: var(--blue); font-weight: 500; }
.nav-dot { width:7px; height:7px; border-radius:50%; background: var(--green); flex-shrink:0; }
.nav-dot.off { background: var(--txt3); }
.nav-name { flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.nav-time { font-size: .78rem; color: var(--txt3); flex-shrink:0; }
.nav-count { font-size: .72rem; color: var(--txt3); background:#f0f1f5; padding:1px 6px; border-radius:10px; }

.sidebar-foot { padding:10px 16px; border-top:1px solid var(--border); font-size:.75rem; color:var(--txt3); }

/* ========== 历史天气查询 ========== */
.sidebar-tool-nav { padding:10px 10px 2px; }
.sidebar-tool-item { width:100%; display:flex; align-items:center; gap:9px; border:1px solid transparent; background:transparent; border-radius:6px; padding:9px 10px; color:var(--txt2); cursor:pointer; font-size:.86rem; text-align:left; }
.sidebar-tool-item:hover, .sidebar-tool-item.active { color:var(--blue); background:var(--blue-bg); border-color:#dbe5ff; }
.weather-history-view { max-width:1800px; margin:0 auto; }
.weather-page-head { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; margin-bottom:20px; }
.weather-layout { display:grid; grid-template-columns:minmax(0, 1fr) 190px; gap:20px; align-items:start; }
.weather-content { min-width:0; }
.weather-city-rail { position:sticky; top:18px; padding:13px; background:var(--card); border:1px solid var(--border); border-radius:var(--radius); box-shadow:var(--shadow); }
.weather-city-rail-head { display:flex; justify-content:space-between; align-items:center; gap:8px; padding-bottom:10px; border-bottom:1px solid var(--border); }
.weather-city-rail-head h3 { margin:0; font-size:.9rem; }
.weather-city-tabs { display:flex; gap:7px; flex-wrap:wrap; }
.weather-city-tabs-rail { display:flex; flex-direction:column; margin-top:12px; }
.weather-city-tabs-rail .weather-city-tab { width:100%; }
.weather-city-tabs-rail .weather-city-select { flex:1; text-align:left; }
.weather-control-panel { margin-bottom:18px; }
.weather-control-head { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.weather-control-head h3 { margin:0 0 3px; font-size:.95rem; }
.weather-control-head p { margin:0; color:var(--txt3); font-size:.76rem; }
.weather-control-body { margin-top:14px; }
.weather-control-panel.collapsed .weather-control-body { display:none; }
.weather-control-panel.collapsed { padding:14px 18px; }
.weather-dashboard-section { margin:0 0 26px; }
.weather-dashboard-head { display:flex; align-items:baseline; gap:12px; padding:0 2px 10px; border-bottom:2px solid #dbe5ff; margin-bottom:14px; }
.weather-dashboard-head h3 { margin:0; font-size:1.08rem; color:var(--txt); }
.weather-dashboard-head p { margin:0; color:var(--txt3); font-size:.77rem; }
.weather-dashboard-grid { margin-bottom:0; }
.weather-city-tab { display:flex; border:1px solid var(--border); border-radius:6px; overflow:hidden; background:var(--card); }
.weather-city-tab.active { border-color:var(--blue); box-shadow:0 0 0 1px var(--blue-bg); }
.weather-city-select, .weather-city-menu { border:0; background:transparent; color:var(--txt2); cursor:pointer; font-size:.8rem; }
.weather-city-select { padding:7px 9px; }
.weather-city-menu { padding:7px 8px; border-left:1px solid var(--border); font-size:1rem; line-height:1; }
.weather-city-tab.active .weather-city-select { color:var(--blue); font-weight:600; background:var(--blue-bg); }
.weather-city-menu:hover { color:var(--blue); background:var(--blue-bg); }
.weather-page-head h2 { font-size:1.2rem; margin:0 0 5px; }
.weather-page-head p { color:var(--txt2); font-size:.86rem; margin:0; }
.weather-source-link { color:var(--blue); text-decoration:none; font-size:.8rem; white-space:nowrap; }
.weather-query-card, .weather-table-card, .weather-chart-card { background:var(--card); border:1px solid var(--border); border-radius:var(--radius); box-shadow:var(--shadow); }
.weather-query-card { padding:18px; }
.weather-form-grid { display:grid; grid-template-columns:repeat(4, minmax(0, 1fr)); gap:14px; align-items:end; }
.weather-form-grid .field { margin:0; }
.weather-form-grid select { width:100%; padding:7px 10px; border:1px solid var(--border); border-radius:6px; background:#fff; color:var(--txt); font-size:.85rem; }
.weather-segmented { display:flex; border:1px solid var(--border); border-radius:6px; overflow:hidden; }
.weather-segmented button { flex:1; border:0; border-right:1px solid var(--border); padding:7px 5px; background:#fff; color:var(--txt2); cursor:pointer; font-size:.78rem; white-space:nowrap; }
.weather-segmented button:last-child { border-right:0; }
.weather-segmented button.active { background:var(--blue-bg); color:var(--blue); font-weight:600; }
.weather-query-action { display:flex; align-items:flex-end; }
.weather-query-action .btn-main { width:100%; min-height:34px; white-space:nowrap; }
.weather-metrics { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:14px; margin-top:16px; padding-top:14px; border-top:1px solid var(--border); }
.weather-metric-panel { border:1px solid var(--border); border-radius:8px; background:#fff; overflow:hidden; }
.weather-metric-panel-head { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:13px 14px; background:#fafbfc; border-bottom:1px solid var(--border); }
.weather-metric-panel-head h3 { font-size:.92rem; margin:0 0 3px; }
.weather-metric-panel-head p { color:var(--txt3); font-size:.73rem; margin:0; }
.weather-metric-panel-head .btn-text { color:var(--blue); font-size:.75rem; padding:4px 6px; white-space:nowrap; }
.weather-metric-groups { padding:10px 12px; }
.weather-metric-group { padding:9px 0; border-bottom:1px solid #f0f1f4; }
.weather-metric-group:last-child { border-bottom:0; }
.weather-metric-title { color:var(--txt); font-weight:600; font-size:.8rem; margin-bottom:8px; }
.weather-metric-options { display:flex; flex-wrap:wrap; gap:7px 14px; }
.weather-check { color:var(--txt2); font-size:.79rem; display:flex; align-items:center; gap:4px; cursor:pointer; white-space:nowrap; }
.weather-check input { accent-color:var(--blue); }
.weather-point { cursor:crosshair; opacity:.78; transition: r .12s, opacity .12s; }
.weather-point:hover, .weather-point.active { r:6; opacity:1; stroke:#fff; stroke-width:2; }
.weather-hit { pointer-events:stroke; cursor:crosshair; }
.weather-crosshair { stroke:#8ba0be; stroke-width:1; stroke-dasharray:4 3; pointer-events:none; }
.weather-svg { cursor:grab; user-select:none; }
.weather-svg.panning { cursor:grabbing; }
.weather-plot { transition: transform .08s ease-out; }
.weather-axis-hit { cursor:zoom-in; user-select:none; pointer-events:stroke; }
.weather-svg text { pointer-events:none; }
.weather-chart-card { position:relative; }
.weather-chart-card { transition:box-shadow .15s ease; }
.weather-chart-card:hover { box-shadow:0 8px 20px rgba(190,87,72,.10); }
.weather-tooltip { position:absolute; z-index:5; min-width:150px; padding:8px 10px; border:1px solid #d5dfec; border-radius:6px; background:rgba(255,255,255,.97); box-shadow:0 4px 14px rgba(49,82,137,.16); color:var(--txt); font-size:.75rem; line-height:1.55; pointer-events:none; transition:opacity .12s ease; }
.weather-tooltip[hidden] { display:none; }
.weather-form-hint { color:var(--txt3); font-size:.75rem; margin-top:12px; }
.weather-result { margin-top:20px; }
.weather-result-meta { background:var(--blue-bg); color:var(--txt2); border-radius:6px; padding:10px 12px; font-size:.82rem; margin-bottom:14px; }
.weather-summary-grid { display:grid; grid-template-columns:repeat(3, 1fr); gap:14px; margin-bottom:14px; }
.weather-summary-card { padding:16px; background:var(--card); border:1px solid var(--border); border-radius:var(--radius); box-shadow:var(--shadow); }
.weather-summary-label { color:var(--txt2); font-size:.78rem; margin-bottom:7px; }
.weather-summary-value { font-size:1.25rem; font-weight:650; color:var(--txt); }
.weather-summary-sub { color:var(--txt3); font-size:.75rem; margin-top:4px; }
.weather-chart-section { margin-bottom:20px; }
.weather-chart-section-head { display:flex; justify-content:space-between; align-items:baseline; gap:16px; padding:0 2px 10px; }
.weather-chart-section-head h3 { font-size:1rem; margin:0; }
.weather-chart-section-head p { margin:0; color:var(--txt3); font-size:.76rem; }
.weather-chart-grid { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:18px; margin-bottom:18px; align-items:stretch; }
/* 选定区间和近五年图表统一双列、同尺寸，便于横向比较。 */
.weather-five-year-grid { grid-template-columns:repeat(2, minmax(0, 1fr)); }
.weather-chart-card, .weather-chart-card-yearly { width:100%; max-width:none; margin:0; min-width:0; min-height:390px; padding:18px 18px 14px; display:flex; flex-direction:column; background:var(--card); border:1px solid var(--border); border-radius:var(--radius); box-shadow:var(--shadow); }
.weather-chart-card h3 { font-size:1.02rem; margin:0 0 5px; text-align:center; color:#4b5563; }
.weather-chart-note { color:var(--txt3); font-size:.76rem; text-align:center; min-height:18px; }
.weather-svg-wrap { margin-top:12px; overflow:hidden; flex:1; min-height:0; }
.weather-svg, .weather-chart-card-yearly .weather-svg { width:100%; min-width:0; height:auto; display:block; overflow:visible; aspect-ratio:2 / 1; }
.weather-axis-hit.weather-axis-y { cursor:ns-resize; }
.weather-axis-hit.weather-axis-x { cursor:ew-resize; }
@media (max-width:1100px) { .weather-layout { grid-template-columns:1fr; } .weather-city-rail { position:static; order:-1; } .weather-city-tabs-rail { flex-direction:row; } .weather-city-tabs-rail .weather-city-tab { width:auto; } .weather-chart-grid, .weather-five-year-grid { grid-template-columns:1fr; } .weather-chart-card, .weather-chart-card-yearly { min-height:360px; } }
.weather-legend { display:flex; justify-content:center; gap:15px; align-items:center; flex-wrap:wrap; margin-top:10px; color:#4b5563; font-size:.82rem; font-weight:600; }
.weather-legend i { display:inline-block; width:11px; height:4px; border-radius:2px; margin-right:5px; vertical-align:middle; }
.weather-table-card { overflow:hidden; }
.weather-table-head { display:flex; justify-content:space-between; align-items:center; padding:14px; border-bottom:1px solid var(--border); }
.weather-table-head h3 { font-size:.9rem; margin:0; }
.weather-table-tabs { display:flex; gap:4px; }
.weather-table-tabs button { border:1px solid var(--border); border-radius:5px; padding:5px 9px; background:#fff; color:var(--txt2); font-size:.77rem; cursor:pointer; }
.weather-table-tabs button.active { color:var(--blue); border-color:var(--blue); background:var(--blue-bg); }
.weather-table-wrap { overflow:auto; max-height:500px; }
.weather-data-table { width:100%; border-collapse:collapse; font-size:.8rem; white-space:nowrap; }
.weather-data-table th { position:sticky; top:0; z-index:1; background:#fafbfc; color:var(--txt2); font-weight:600; }
.weather-data-table th, .weather-data-table td { border-bottom:1px solid #eef0f3; padding:9px 12px; text-align:right; }
.weather-data-table th:first-child, .weather-data-table td:first-child { text-align:left; position:sticky; left:0; background:inherit; }
.weather-data-table td:first-child { background:#fff; color:var(--txt2); }
.weather-empty { border:1px dashed var(--border); border-radius:var(--radius); color:var(--txt3); padding:56px 20px; text-align:center; margin-top:20px; font-size:.86rem; }
.weather-tooltip { pointer-events:none; }

/* ========== 主区 ========== */
.main-area { flex:1; padding:24px 28px; overflow-y:auto; }

/* ========== 模块详情 ========== */
.module-detail-top {
  display:flex; align-items:flex-start; justify-content:space-between;
  padding-bottom:16px; margin-bottom:20px; border-bottom:1px solid var(--border);
  gap:16px;
}
.module-detail-info { flex:1; min-width:0; }
.module-detail-name { font-size:1.25rem; font-weight:700; color:var(--txt); line-height:1.4; }
.module-detail-desc { font-size:.8rem; color:var(--txt3); margin-top:4px; }
.module-detail-actions { display:flex; gap:6px; flex-shrink:0; align-items:center; }

/* 截图大图网格 — 默认单列大图，超宽屏2列 */
.shot-detail-grid { display:grid; grid-template-columns: 1fr; gap:24px; }
@media (min-width: 1800px) { .shot-detail-grid { grid-template-columns: 1fr 1fr; } }
.shot-detail-grid.single-col { grid-template-columns: 1fr; }

/* 单个截图卡片 */
.shot-card {
  background: var(--card); border:1px solid var(--border); border-radius: var(--radius);
  overflow:hidden; transition: box-shadow .15s;
}
.shot-card:hover { box-shadow: var(--shadow-hover); }
.shot-card-header {
  display:flex; align-items:center; justify-content:space-between;
  padding:10px 14px; border-bottom:1px solid var(--border);
  font-size:.85rem; font-weight:500; color:var(--txt); gap:8px;
}
.shot-card-header-left { display:flex; align-items:center; gap:8px; overflow:hidden; }
.shot-card-label { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.shot-card-time { font-size:.75rem; color:var(--txt3); font-weight:400; white-space:nowrap; }
.shot-card-actions { display:flex; gap:2px; flex-shrink:0; }

.shot-card-body {
  padding:0; background:#f8f9fb; display:flex; align-items:center; justify-content:center;
  min-height:200px; position:relative; overflow:hidden;
}
.shot-card-body img {
  width:100%; object-fit:contain; display:block;
  cursor:zoom-in; border-radius:2px; transition: opacity .2s;
}
.shot-card-body .shot-empty {
  color:var(--txt3); font-size:.85rem; padding:40px; text-align:center;
}

/* 图片悬停放大提示 */
.shot-card-img-wrap {
  position:relative; width:100%; display:block; cursor:zoom-in;
}
.shot-card-img-wrap .zoom-hint {
  position:absolute; top:12px; right:12px; width:34px; height:34px;
  border-radius:50%; background:rgba(0,0,0,.5); color:#fff;
  display:flex; align-items:center; justify-content:center;
  font-size:18px; opacity:0; transition: opacity .2s;
  pointer-events:none; z-index:2;
}
.shot-card-body:hover .zoom-hint { opacity:1; }
.shot-card-body:active .zoom-hint { opacity:0; }

.shot-card-foot {
  display:flex; justify-content:space-between; align-items:center;
  padding:6px 14px; border-top:1px solid var(--border);
  font-size:.72rem; color:var(--txt3);
}

/* ========== 空状态 ========== */
.empty-state { text-align:center; padding:60px 20px; }
.empty-text { font-size:1rem; color:var(--txt2); margin-bottom:8px; }
.empty-hint { font-size:.85rem; color:var(--txt3); }

/* ========== 弹窗 ========== */
.modal { display:none; position:fixed; top:0; left:0; width:100%; height:100%; z-index:1000; }
.modal.active { display:flex; align-items:center; justify-content:center; }
.modal-overlay { position:absolute; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,.35); }
.modal-box {
  position:relative; background:var(--card); border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,.15); width:480px; max-width:94vw;
  max-height:85vh; display:flex; flex-direction:column;
}
.modal-wide { width:680px; }
.modal-xwide { width:900px; }
.modal-top {
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 18px; border-bottom:1px solid var(--border); font-weight:600;
}
.modal-top-actions { display:flex; align-items:center; gap:6px; }
.modal-x { border:none; background:none; font-size:1.3rem; color:var(--txt3); cursor:pointer; padding:0 4px; }
.modal-x:hover { color:var(--txt); }
.modal-body { padding:16px 18px; overflow-y:auto; flex:1; }
.modal-body-image { text-align:center; overflow:auto; max-height:80vh; padding:0; position:relative; display:flex; align-items:center; justify-content:center; }
.modal-body-image img { max-width:100%; max-height:78vh; display:block; margin:0 auto; object-fit:contain; transition: transform .15s ease; }
.modal-body-image img.zoomed { max-width:none; max-height:none; }

/* 预览弹窗加宽 */
#previewModal .modal-box { width:90vw; max-width:1400px; }
.modal-bottom { display:flex; justify-content:flex-end; gap:8px; padding:12px 18px; border-top:1px solid var(--border); }

/* ========== 表单 ========== */
.field { margin-bottom:14px; }
.field label { display:block; font-size:.82rem; font-weight:500; color:var(--txt2); margin-bottom:4px; }
.field input[type="text"],
.field input[type="number"] {
  width:100%; padding:7px 10px; border:1px solid var(--border); border-radius:6px;
  font-size:.85rem; font-family:inherit; outline:none; transition: border-color .12s;
}
.field input:focus { border-color: var(--blue); }
.field .req { color:var(--red); }
.field-hint { font-size:.75rem; color:var(--txt3); margin-top:4px; }
.field-hint code { background:#f0f1f5; padding:1px 5px; border-radius:3px; font-size:.72rem; }
.field-row { display:flex; gap:16px; align-items:center; }
.field-half { flex:1; }

.switch-label { display:flex; align-items:center; gap:8px; font-size:.82rem; color:var(--txt2); cursor:pointer; }
.switch { position:relative; display:inline-block; width:36px; height:20px; }
.switch input { display:none; }
.switch-track {
  position:absolute; top:0; left:0; width:100%; height:100%; border-radius:10px;
  background:var(--txt3); transition:.2s; cursor:pointer;
}
.switch-track::after {
  content:''; position:absolute; top:2px; left:2px; width:16px; height:16px;
  background:#fff; border-radius:50%; transition:.2s;
}
.switch input:checked + .switch-track { background:var(--blue); }
.switch input:checked + .switch-track::after { left:18px; }

/* ========== Shot 编辑器 ========== */
.shot-list-header {
  display:flex; align-items:center; justify-content:space-between; margin-bottom:8px;
}
.shot-list-header label { font-size:.82rem; font-weight:500; color:var(--txt2); }
.btn-sm {
  font-size:.78rem; padding:4px 10px; border:1px solid var(--border); border-radius:5px;
  background:var(--card); color:var(--blue); cursor:pointer; transition:all .12s;
}
.btn-sm:hover { background:var(--blue-bg); border-color:var(--blue); }
.btn-sm.danger { color:var(--red); }
.btn-sm.danger:hover { background:#fef2f2; border-color:var(--red); }

.shot-list { margin-bottom:14px; }
.shot-item {
  border:1px solid var(--border); border-radius:6px; padding:10px 12px; margin-bottom:8px;
  position:relative; background:#fafbfc;
}
.shot-item-top { display:flex; align-items:center; gap:8px; margin-bottom:8px; }
.shot-item-label { font-size:.8rem; font-weight:500; color:var(--txt); }
.shot-item-remove {
  margin-left:auto; border:none; background:none; color:var(--txt3); cursor:pointer;
  font-size:1rem; padding:0 2px; line-height:1;
}
.shot-item-remove:hover { color:var(--red); }
.shot-item-row { display:flex; gap:8px; align-items:center; }
.shot-item-row input[type="text"] {
  flex:1; padding:6px 8px; border:1px solid var(--border); border-radius:5px;
  font-size:.8rem; font-family:inherit; outline:none;
}
.shot-item-row input:focus { border-color:var(--blue); }
.shot-item-row .btn-sm { flex-shrink:0; }
.shot-item-row input.select-input { background:#eef3ff; border-color:var(--blue); font-family:monospace; font-size:.75rem; }

/* ========== 按钮 ========== */
.btn-main {
  padding:7px 18px; border:none; border-radius:6px; background:var(--blue);
  color:#fff; font-size:.85rem; cursor:pointer; transition:background .12s;
}
.btn-main:hover { background:var(--blue-hover); }
.btn-text {
  border:none; background:none; color:var(--txt2); font-size:.85rem; cursor:pointer; padding:7px 12px;
}
.btn-text:hover { color:var(--txt); }

/* ========== 选择器选取工具 ========== */
/* 模式切换 */
.picker-mode-toggle {
  display:inline-flex; border:1px solid var(--border); border-radius:6px; overflow:hidden;
  margin-right:8px; background:#fff;
}
.picker-mode-btn {
  display:inline-flex; align-items:center; gap:5px; padding:4px 12px;
  border:none; background:transparent; color:var(--txt2); font-size:.78rem;
  cursor:pointer; transition: all .15s; white-space:nowrap;
}
.picker-mode-btn:hover { background:var(--bg); }
.picker-mode-btn.active { background:var(--blue); color:#fff; }
.picker-mode-btn.active:hover { background:var(--blue-hover); color:#fff; }
.picker-mode-btn:not(:first-child) { border-left:1px solid var(--border); }

.picker-bar { display:flex; gap:8px; align-items:center; margin-bottom:10px; }
.picker-bar input[type="text"] {
  flex:1; padding:7px 10px; border:1px solid var(--border); border-radius:6px;
  font-size:.85rem; font-family:inherit; outline:none;
}
.picker-bar input:focus { border-color:var(--blue); }
.picker-hint { font-size:.78rem; color:var(--txt3); }

.picker-error { color:var(--red); font-size:.8rem; padding:6px 0; }
.picker-viewport { position:relative; min-height:200px; border:1px solid var(--border); border-radius:6px; overflow:auto; max-height:55vh; background:#f0f0f0; }
.picker-loading { display:flex; align-items:center; justify-content:center; gap:10px; padding:40px; color:var(--txt2); }

.picker-canvas-wrap { position:relative; display:inline-block; min-width:100%; cursor:crosshair; user-select:none; }
.picker-canvas-wrap img,
.picker-canvas-wrap canvas { display:block; max-width:none; position:relative; z-index:1; }

/* 拖拽选框 */
.selection-rect {
  position:absolute; top:0; left:0; width:0; height:0;
  border:2px dashed var(--blue); background:rgba(79,124,255,.08);
  pointer-events:none; z-index:10; display:none;
}

/* 图片覆盖层（可视化点击选取） */
.img-overlay {
  position: absolute; top: 0; left: 0;
  border: 1.5px dashed rgba(79,124,255,.45);
  cursor: pointer; z-index: 5;
  transition: border-color .15s, background .15s;
  box-sizing: border-box;
}
.img-overlay:hover {
  border-color: var(--blue);
  border-style: solid;
  background: rgba(79,124,255,.08);
}
.img-overlay.img-selected {
  border: 2px solid var(--green);
  background: rgba(34,197,94,.1);
}
.img-overlay-badge {
  position: absolute; top: 2px; right: 2px;
  background: rgba(0,0,0,.65); color: #fff;
  font-size: 10px; padding: 1px 5px; border-radius: 3px;
  pointer-events: none; white-space: nowrap;
}
.img-overlay:hover .img-overlay-badge {
  background: var(--blue);
}

.picker-result {
  display:flex; align-items:center; gap:8px; margin-top:10px; padding:8px 12px;
  background:#f0f9eb; border-radius:6px; font-size:.82rem;
}
.picker-result code { background:#e0f2d0; padding:2px 8px; border-radius:4px; font-size:.78rem; }
.picker-result-desc { color:var(--txt2); font-size:.78rem; }

/* 全屏模式 */
.selector-modal-fullscreen .modal-overlay { display:none; }
.selector-modal-fullscreen .modal-box {
  width:100vw !important; max-width:100vw !important;
  height:100vh !important; max-height:100vh !important;
  border-radius:0; margin:0;
  display:flex; flex-direction:column;
}
.selector-modal-fullscreen .modal-body { flex:1; overflow:hidden; display:flex; flex-direction:column; }
.selector-modal-fullscreen .picker-viewport { flex:1; max-height:none !important; }
.selector-modal-fullscreen .picker-bar,
.selector-modal-fullscreen .picker-result,
.selector-modal-fullscreen .modal-bottom { flex-shrink:0; }

/* 预览弹窗全屏 */
.preview-modal-fullscreen .modal-overlay { display:none; }
.preview-modal-fullscreen .modal-box {
  width:100vw !important; max-width:100vw !important;
  height:100vh !important; max-height:100vh !important;
  border-radius:0; margin:0;
  display:flex; flex-direction:column;
}
.preview-modal-fullscreen .modal-body-image { flex:1; max-height:none !important; }
.preview-modal-fullscreen .modal-body-image img { max-height:95vh !important; }

/* ========== 历史 ========== */
.history-grid { display:grid; grid-template-columns: repeat(4, 1fr); gap:10px; }
.hist-item { border:1px solid var(--border); border-radius:6px; overflow:hidden; cursor:pointer; transition:border-color .12s; }
.hist-item:hover { border-color:var(--blue); }
.hist-item img { width:100%; height:100px; object-fit:cover; display:block; }
.hist-info { font-size:.7rem; color:var(--txt3); padding:4px 6px; }

/* ========== Toast ========== */
.toast-bar { position:fixed; bottom:20px; right:20px; z-index:2000; display:flex; flex-direction:column; gap:6px; }
.toast {
  background:var(--txt); color:#fff; padding:10px 18px; border-radius:6px;
  font-size:.82rem; box-shadow:0 4px 12px rgba(0,0,0,.2); animation: slideIn .25s;
}
.toast.err { background:var(--red); }

/* ========== 加载 ========== */
.loading { display:none; position:fixed; top:0; left:0; width:100%; height:100%; z-index:3000;
  background:rgba(255,255,255,.7); align-items:center; justify-content:center; flex-direction:column; gap:12px; }
.loading.on { display:flex; }
.loading-spin {
  width:32px; height:32px; border:3px solid var(--border); border-top-color:var(--blue);
  border-radius:50%; animation: spin .7s linear infinite;
}
.loading-txt { font-size:.85rem; color:var(--txt2); }

/* ========== 响应式 ========== */
@media (max-width:1200px) { .sidebar { width:190px; } }
@media (max-width:1100px) { .weather-form-grid { grid-template-columns:repeat(2, minmax(0, 1fr)); } .weather-chart-grid, .weather-metrics { grid-template-columns:1fr; } }
@media (max-width:768px) {
  .shell { flex-direction:column; }
  .sidebar { width:100%; height:auto; position:static; }
  .shot-detail-grid { grid-template-columns:1fr; }
  .weather-page-head { flex-direction:column; gap:8px; }
  .weather-city-bar { align-items:flex-start; flex-direction:column; }
  .weather-form-grid { grid-template-columns:1fr; }
  .weather-summary-grid { grid-template-columns:1fr; }
  .weather-metrics { flex-direction:column; }
  .weather-metric-group { flex-wrap:wrap; }
}

/* ========== 动画 ========== */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes slideIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }
