:root {
  --bg: #0e1116;
  --panel: #171b22;
  --panel-2: #1e2530;
  --line: #2a313c;
  --text: #e7ecf3;
  --muted: #97a3b4;
  --accent: #5b8cff;
  --accent-2: #38d39f;
  --good: #38d39f;
  --ok: #5b8cff;
  --warn: #f5b14c;
  --bad: #f06a6a;
  --radius: 14px;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(1200px 600px at 80% -10%, #1b2740 0%, var(--bg) 55%);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
}

.wrap {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

/* topbar */
.topbar {
  border-bottom: 1px solid var(--line);
  background: rgba(14, 17, 22, 0.7);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 14px;
  padding-bottom: 14px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo {
  font-size: 30px;
  line-height: 1;
}
h1 {
  font-size: 20px;
  margin: 0;
  letter-spacing: 0.3px;
}
.tagline {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--muted);
}
.tagline strong {
  color: var(--text);
}
.examples {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ex-label {
  font-size: 12px;
  color: var(--muted);
}
.chip {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* layout */
.layout {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 22px;
  padding-top: 26px;
  padding-bottom: 40px;
  align-items: start;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
h2 {
  font-size: 16px;
  margin: 0;
}
.head-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.hint-line {
  margin: 4px 0 14px;
  font-size: 13px;
  color: var(--muted);
}

/* buttons */
.btn {
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 9px;
  padding: 7px 13px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn:hover {
  border-color: var(--accent);
}
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #07101f;
  font-weight: 600;
}
.btn-primary:hover {
  filter: brightness(1.08);
}
.btn-ghost:hover {
  color: var(--accent);
}
input[type="date"] {
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 9px;
  padding: 6px 10px;
  font-size: 13px;
}

/* items */
.items {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: var(--panel-2);
}
.item-main {
  display: flex;
  gap: 8px;
  align-items: center;
}
.item-title {
  flex: 1;
  min-width: 0;
  background: #11151c;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 14px;
}
.item-title:focus,
.item-type:focus,
.item-capture:focus {
  outline: none;
  border-color: var(--accent);
}
.item-type,
.item-capture {
  background: #11151c;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 8px;
  font-size: 13px;
}
.item-del {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 8px;
  width: 34px;
  height: 34px;
  cursor: pointer;
  flex: 0 0 auto;
}
.item-del:hover {
  color: var(--bad);
  border-color: var(--bad);
}

.dims {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 18px;
  margin: 13px 0 4px;
}
.dim {
  font-size: 12px;
}
.dim-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
}
.dim-label {
  color: var(--text);
}
.dim-label .q {
  color: var(--muted);
  cursor: help;
  margin-left: 3px;
}
.dim-val {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  margin: 4px 0 0;
}

.item-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: 13px;
  color: var(--muted);
}
.item-score-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.item-grade {
  font-size: 12px;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
}
.item-score {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.item-advice {
  margin-top: 10px;
}
.item-action {
  margin: 0;
  font-size: 13px;
  color: var(--text);
  background: #11151c;
  border-left: 3px solid var(--accent);
  padding: 8px 11px;
  border-radius: 0 8px 8px 0;
}
.item-tags {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag {
  font-size: 11px;
  color: var(--muted);
  background: #11151c;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 7px;
}

/* grade tones */
.tone-good {
  color: var(--good);
  border-color: var(--good);
}
.tone-ok {
  color: var(--ok);
  border-color: var(--ok);
}
.tone-warn {
  color: var(--warn);
  border-color: var(--warn);
}
.tone-bad {
  color: var(--bad);
  border-color: var(--bad);
}

.row-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
}
.save-state {
  font-size: 12px;
  color: var(--muted);
}

/* summary */
.summary {
  position: relative;
}
.sum-top {
  display: flex;
  align-items: center;
  gap: 18px;
}
.ring {
  --val: 0;
  --tone: var(--accent);
  flex: 0 0 auto;
  width: 108px;
  height: 108px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--tone) calc(var(--val) * 1%), #232b37 0);
}
.ring-inner {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: var(--panel);
  display: grid;
  place-items: center;
  text-align: center;
}
.ring-num {
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.ring-cap {
  font-size: 11px;
  color: var(--muted);
}
.sum-meta h3 {
  margin: 0 0 4px;
  font-size: 15px;
}
.sum-verdict {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}
.sum-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.stat {
  flex: 1 1 90px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 11px;
  text-align: center;
}
.stat b {
  display: block;
  font-size: 19px;
  font-variant-numeric: tabular-nums;
}
.stat span {
  font-size: 11px;
  color: var(--muted);
}
.block {
  margin-top: 16px;
}
.block h4 {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--muted);
  text-transform: none;
}
.action-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.action-list li {
  font-size: 13px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 11px;
}
.action-list .at {
  color: var(--accent-2);
  font-weight: 600;
}
.asset-pill,
.decay-pill {
  display: inline-block;
  font-size: 12px;
  border-radius: 7px;
  padding: 3px 9px;
  margin: 0 6px 6px 0;
  border: 1px solid var(--line);
}
.asset-pill {
  color: var(--good);
  border-color: rgba(56, 211, 159, 0.4);
}
.decay-pill {
  color: var(--bad);
  border-color: rgba(240, 106, 106, 0.4);
}
.empty {
  color: var(--muted);
  font-size: 13px;
  padding: 8px 0;
}

/* method */
.method summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}
.method ul {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
}
.method li {
  margin-bottom: 5px;
}

/* markdown */
.markdown {
  background: #0b0e13;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  font-size: 12.5px;
  line-height: 1.5;
  color: #c7d0dc;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 360px;
  overflow: auto;
  margin: 6px 0 0;
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}

.footer {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  padding-bottom: 28px;
  color: var(--muted);
  font-size: 12px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  background: var(--accent);
  color: #07101f;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s;
  z-index: 50;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 860px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .topbar .wrap {
    align-items: flex-start;
  }
}
@media (max-width: 520px) {
  .dims {
    grid-template-columns: 1fr;
  }
  h1 {
    font-size: 18px;
  }
}
