:root {
  --bg: #f3f6fb;
  --card: #ffffff;
  --muted: #6b7280;
  --text: #111827;
  --accent: #2563eb;
  --accent-2: #0ea5e9;
  --border: #dbe4f0;
  --danger: #dc2626;
}
[data-theme="dark"] {
  --bg: #0b1220;
  --card: #0f172a;
  --muted: #94a3b8;
  --text: #e5e7eb;
  --accent: #3b82f6;
  --accent-2: #38bdf8;
  --border: #1e293b;
  --danger: #ef4444;
}
* { box-sizing: border-box; }
body {
  margin: 0; padding: 24px;
  font-family: "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft Yahei", system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(1200px 700px at 8% -25%, #dbeafe 0%, transparent 60%),
    radial-gradient(900px 500px at 95% -20%, #e0f2fe 0%, transparent 58%),
    var(--bg);
  color: var(--text);
}
.container { max-width: 1100px; margin: 0 auto; }
.top-nav {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 12px;
}
.brand-title { display: none; }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 14px 34px rgba(30, 41, 59, .08);
}
.title { font-size: 26px; font-weight: 800; margin: 0 0 10px; letter-spacing: .2px; }
.desc { color: var(--muted); margin-bottom: 14px; }
.row { display: flex; gap: 10px; align-items: center; }
input[type="text"], input[type="number"], input[type="password"] {
  flex: 1; padding: 12px 12px; border: 1px solid var(--border);
  background: var(--card); color: var(--text); border-radius: 10px; font-size: 14px;
}
button, .btn {
  padding: 11px 16px; border: none; border-radius: 10px; background: var(--accent);
  color: #ffffff; font-weight: 700; cursor: pointer; text-decoration: none;
  transition: transform .12s ease, box-shadow .2s ease, opacity .2s ease;
}
.btn:hover, button:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(37, 99, 235, .2); }
.btn.secondary { background: #ffffff; color: #1f2937; border: 1px solid var(--border); }
[data-theme="dark"] .btn.secondary { background: #111827; color: #e5e7eb; }
.error { color: var(--danger); margin-top: 12px; }
.error-banner {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #fee2e2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 42px;
  font-weight: 900;
  letter-spacing: .5px;
  line-height: 1.2;
}
.grid { display: grid; grid-template-columns: 260px 1fr; gap: 6px 14px; }
.label { color: var(--muted); }
.val { color: var(--text); }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { background: #f8fafc; color: #334155; }
.table tbody tr:nth-child(even) { background: #fcfdff; }
[data-theme="dark"] .table th { background: #111827; color: #cbd5e1; }
[data-theme="dark"] .table tbody tr:nth-child(even) { background: #0b1324; }
.muted { color: var(--muted); font-size: 12px; }
.kv { display:flex; gap:10px; flex-wrap: wrap; }
.kv .pill { background: #f8fafc; border:1px solid var(--border); padding:8px 10px; border-radius: 999px; }
.pill { background: #f8fafc; border:1px solid var(--border); padding:6px 10px; border-radius: 999px; font-size: 12px; }
[data-theme="dark"] .pill { background: #111827; }
.toolbar { display:flex; gap:10px; flex-wrap: wrap; margin-bottom: 10px; }
.copy { cursor: pointer; color: var(--accent-2); margin-left: 6px; font-size: 12px; }
.section-title { font-size: 15px; font-weight: 700; margin-bottom: 10px; color: #1f2937; }
.success {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e3a8a;
  padding: 10px 12px;
  border-radius: 10px;
}
.ok-banner {
  padding: 12px 14px;
  border-radius: 12px;
  background: #ecfdf3;
  border: 1px solid #86efac;
  color: #166534;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: .3px;
}
.inline-form { display: inline-flex; margin: 0; }
.btn.accent {
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  color: #ffffff;
}
.hero-card {
  border: 1px solid #bfdbfe;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}
[data-theme="dark"] .hero-card { background: linear-gradient(180deg, #0f172a 0%, #0b1324 100%); }
.helper-check {
  color: #64748b;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}
.helper-entry-row { margin-top: 12px; }
.helper-entry-btn {
  display: block;
  width: 100%;
  text-align: center;
}
.guide-grid { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
.guide-item { display: flex; gap: 10px; align-items: flex-start; background: #f8fafc; border: 1px solid var(--border); padding: 10px; border-radius: 10px; }
.guide-step { width: 24px; height: 24px; border-radius: 999px; background: #2563eb; color: #ffffff; font-size: 12px; display: flex; align-items: center; justify-content: center; font-weight: 700; flex: 0 0 auto; }
.guide-title { font-weight: 700; font-size: 14px; margin-bottom: 2px; }
.hero-metric {
  background: linear-gradient(140deg, rgba(37,99,235,.12), rgba(14,165,233,.10));
  border: 1px solid rgba(37,99,235,.28);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 12px;
  box-shadow: 0 10px 20px rgba(37, 99, 235, .12);
}
.hero-label { color: #1d4ed8; font-size: 13px; margin-bottom: 6px; }
.hero-main-label { font-size: 42px; font-weight: 900; line-height: 1; color: #1d4ed8; letter-spacing: .5px; }
.ratio-note { font-size: 18px; font-weight: 700; color: #334155; vertical-align: middle; }
.hero-value { font-size: 42px; font-weight: 800; line-height: 1.1; color: #0f172a; letter-spacing: .5px; }
.hero-sub { color: #2563eb; margin-top: 8px; font-size: 13px; }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.metric-card { background: #ffffff; border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
[data-theme="dark"] .metric-card { background: #0b1324; }
.metric-label { color: #475569; font-size: 12px; margin-bottom: 6px; }
.metric-value { color: #111827; font-size: 20px; font-weight: 700; word-break: break-word; }
.helper-card { max-width: 900px; margin: 0 auto; }
.tab-row { display:flex; gap:8px; flex-wrap:wrap; margin-top:8px; }
.small-btn { padding:6px 10px; font-size:12px; }
.manage-layout {
  display: grid;
  gap: 12px;
}
.manage-block {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: #fcfdff;
}
[data-theme="dark"] .manage-block { background: #0b1324; }
.manage-subtitle {
  font-size: 14px;
  font-weight: 800;
  color: #1f2937;
  margin-bottom: 8px;
}
[data-theme="dark"] .manage-subtitle { color: #e5e7eb; }
.uid-add-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) auto;
  gap: 10px;
  align-items: center;
}
.uid-combo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
  padding: 6px 8px;
}
[data-theme="dark"] .uid-combo {
  background: #0f172a;
}
.uid-combo-input {
  border: none !important;
  background: transparent !important;
  padding: 10px 8px !important;
  min-width: 0;
}
.uid-combo-input:focus {
  outline: none;
}
.uid-combo-plus {
  color: #2563eb;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  padding: 0 2px;
}
[data-theme="dark"] .uid-combo-plus {
  color: #60a5fa;
}
.uid-list-title {
  margin-top: 2px;
  margin-bottom: 0;
}
.uid-grid {
  display: grid;
  gap: 10px;
  margin-top: 2px;
}
.uid-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #ffffff;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 10px;
  align-items: center;
}
[data-theme="dark"] .uid-card { background: #0f172a; }
.uid-card-main { min-width: 0; }
.uid-card-uid {
  font-size: 22px;
  font-weight: 800;
  color: #111827;
  line-height: 1.1;
}
[data-theme="dark"] .uid-card-uid { color: #e5e7eb; }
.uid-card-remark {
  margin-top: 4px;
  color: #64748b;
  font-size: 13px;
}
.uid-card-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
}
.remark-editor {
  grid-column: 1 / -1;
  display: none;
  gap: 8px;
  align-items: center;
  margin-top: 2px;
}
.remark-input {
  width: 260px;
  max-width: 100%;
  flex: 0 1 auto;
  padding: 6px 8px;
  font-size: 12px;
  border-radius: 8px;
}
.uid-textarea {
  width: 100%;
  min-height: 96px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  resize: vertical;
  font-size: 14px;
}
.invalid-block {
  border-color: #fca5a5;
  background: #fff1f2;
}
.chart-card { border-color: #bfdbfe; }
.ratio-combo-card { border-color: #bfdbfe; }
.ratio-combo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.ratio-combo-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: #ffffff;
}
.ratio-combo-item.total {
  border-color: #93c5fd;
  background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
}
.ratio-combo-label { color: #475569; font-size: 12px; margin-bottom: 4px; }
.ratio-combo-value { color: #0f172a; font-size: 28px; font-weight: 800; }
.chart-switch {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.insight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}
.insight-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}
[data-theme="dark"] .insight-card {
  background: linear-gradient(180deg, #0f172a 0%, #0b1324 100%);
}
.insight-label {
  color: #64748b;
  font-size: 12px;
  margin-bottom: 4px;
}
.insight-value {
  color: #0f172a;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: .2px;
}
[data-theme="dark"] .insight-value { color: #e5e7eb; }
.chart-days-btn.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}
.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.chart-panel {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  background: #ffffff;
}
[data-theme="dark"] .chart-panel { background: #0b1324; }
.trend-svg {
  width: 100%;
  height: 220px;
  display: block;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
  border-radius: 10px;
}
.chart-tip {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  min-width: 120px;
  background: rgba(15, 23, 42, .92);
  color: #ffffff;
  font-size: 12px;
  line-height: 1.35;
  padding: 6px 8px;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .25);
}
.alert-list {
  margin: 0;
  padding-left: 18px;
  color: #b45309;
}
[data-theme="dark"] .alert-list { color: #fbbf24; }
.fold-card {
  border: 1px dashed var(--border);
}
.fold-card summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--text);
}
.priority-card {
  border: 1px solid #93c5fd;
  box-shadow: 0 14px 30px rgba(37, 99, 235, .14);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}
[data-theme="dark"] .priority-card {
  border-color: #1d4ed8;
  background: linear-gradient(180deg, #0f172a 0%, #0b1324 100%);
}
.priority-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.priority-title {
  font-size: 17px;
  font-weight: 800;
  color: #1d4ed8;
}
[data-theme="dark"] .priority-title { color: #60a5fa; }
.priority-badge {
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 999px;
}
.sort-header-btn {
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
}
.sort-arrows {
  display: inline-flex;
  flex-direction: column;
  line-height: 0.9;
  font-size: 10px;
}
.sort-arrow {
  color: #cbd5e1;
  transition: color .15s ease;
}
.sort-arrow.active {
  color: #111827;
}
[data-theme="dark"] .sort-arrow.active {
  color: #e5e7eb;
}
.result-summary-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.share-poster {
  width: 720px;
  max-width: 100%;
  background: #ffffff;
  border-radius: 18px;
  border: 1px solid #dbe4f0;
  padding: 18px;
  color: #0f172a;
}
.share-poster-head { font-size: 26px; font-weight: 900; margin-bottom: 8px; color: #1d4ed8; }
.share-poster-sub { font-size: 13px; color: #475569; margin-bottom: 12px; }
.share-poster-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.share-poster-item {
  border: 1px solid #dbe4f0;
  border-radius: 12px;
  padding: 10px;
  background: #f8fbff;
}
.share-poster-label { font-size: 12px; color: #475569; margin-bottom: 4px; }
.share-poster-value { font-size: 24px; font-weight: 800; color: #0f172a; }
.share-poster-foot {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 12px;
  align-items: center;
}
.share-link-box { font-size: 12px; color: #334155; word-break: break-all; }
.share-qr {
  width: 180px;
  height: 180px;
  border: 1px solid #dbe4f0;
  border-radius: 10px;
}
.share-image-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.share-image-mask {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.62);
}
.share-image-card {
  position: relative;
  width: min(92vw, 460px);
  max-height: 90vh;
  overflow: auto;
  background: #ffffff;
  border: 1px solid #dbe4f0;
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 20px 46px rgba(2, 6, 23, .28);
}
[data-theme="dark"] .share-image-card {
  background: #0f172a;
  border-color: #1e293b;
}
.share-image-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.share-image-title {
  font-size: 16px;
  font-weight: 800;
  color: #1f2937;
}
[data-theme="dark"] .share-image-title { color: #e5e7eb; }
.share-image-preview {
  width: 100%;
  border-radius: 10px;
  border: 1px solid #dbe4f0;
  display: block;
}
[data-theme="dark"] .share-image-preview { border-color: #334155; }
.auto-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(10px);
  z-index: 10000;
  background: rgba(15, 23, 42, .92);
  color: #ffffff;
  border: 1px solid rgba(148, 163, 184, .35);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 700;
  opacity: 0;
  transition: opacity .2s ease, transform .2s ease;
  box-shadow: 0 12px 26px rgba(2, 6, 23, .28);
}
.auto-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.pager {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  margin-top: 10px;
}
.helper-main-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 10px;
  padding: 14px 18px;
  font-size: 17px;
  border-radius: 14px;
  background: linear-gradient(135deg, #1d4ed8, #0ea5e9);
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(37, 99, 235, .22);
}
.helper-main-btn:hover { box-shadow: 0 14px 28px rgba(37, 99, 235, .30); }
@media (max-width: 720px) {
  .grid { grid-template-columns: 1fr; }
  .row { flex-direction: column; align-items: stretch; }
  .guide-grid { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .ratio-combo-grid { grid-template-columns: 1fr; }
  .chart-grid { grid-template-columns: 1fr; }
  .uid-add-grid { grid-template-columns: 1fr; }
  .uid-card { grid-template-columns: 1fr; }
  .uid-card-actions { justify-self: start; flex-wrap: wrap; }
  .remark-editor { align-items: stretch; }
  .remark-input { width: 100%; }
  .hero-value { font-size: 32px; }
  .hero-main-label { font-size: 32px; }
  .ratio-note { font-size: 14px; }
  .error-banner { font-size: 30px; }
  .ok-banner { font-size: 18px; }
  .share-poster-grid { grid-template-columns: 1fr; }
  .share-poster-foot { grid-template-columns: 1fr; }
  .share-qr { width: 150px; height: 150px; }
}
