/* InnerOS · 素白极简主题 */
:root {
  --bg: #f7f7f8;
  --surface: #ffffff;
  --surface2: #f4f4f6;
  --border: #e9eaee;
  --border-hi: #d9dbe2;
  --text: #1c1f26;
  --muted: #6b7280;
  --faint: #a2a8b3;
  --gold: #a87718;
  --gold-fill: rgba(196, 148, 43, 0.1);
  --blue: #3b74d1;
  --green: #2f9e5f;
  --red: #d64545;
  --purple: #7c5cd6;
  --radius: 12px;
  --shadow: 0 6px 24px rgba(20, 24, 34, 0.08);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.65;
  overflow: hidden;
}
::selection { background: rgba(196, 148, 43, 0.18); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #dcdee4; border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

#app { display: grid; grid-template-columns: 224px 1fr; height: 100vh; }

/* ---------- 侧栏 ---------- */
#sidebar {
  border-right: 1px solid var(--border);
  background: #ffffff;
  display: flex; flex-direction: column;
  padding: 20px 12px 14px;
  overflow-y: auto;
}
.brand { padding: 4px 10px 18px; }
.brand h1 { font-size: 17px; font-weight: 650; letter-spacing: 0.3px; }
.brand h1 .g { color: var(--gold); }
.brand p { font-size: 11px; color: var(--faint); letter-spacing: 2px; }
.nav-label { font-size: 10.5px; color: var(--faint); letter-spacing: 1.5px; padding: 14px 10px 5px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 9px;
  color: var(--muted); cursor: pointer; user-select: none;
  margin-bottom: 1px; transition: all 0.15s;
}
.nav-item:hover { color: var(--text); background: var(--surface2); }
.nav-item.active { color: var(--text); background: var(--surface2); font-weight: 600; }
.nav-item.active svg { color: var(--gold); }
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-item .badge { margin-left: auto; font-size: 10.5px; background: var(--red); color: #fff; border-radius: 8px; padding: 0 6px; line-height: 16px; }
.nav-item.active .badge { background: var(--red); color: #fff; font-weight: 400; }
#sidebar .foot { margin-top: auto; padding: 10px; font-size: 11px; color: var(--faint); }

/* ---------- 主区 ---------- */
#main { overflow-y: auto; padding: 34px 40px 64px; position: relative; }
.page-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 6px; }
.page-head h2 { font-size: 22px; font-weight: 650; }
.page-head .sub { color: var(--muted); font-size: 12.5px; }
.page-desc { color: var(--muted); font-size: 12.5px; margin-bottom: 24px; max-width: 720px; }
.section-title { font-size: 12.5px; color: var(--muted); letter-spacing: 1px; margin: 28px 0 12px; display: flex; align-items: center; gap: 8px; font-weight: 600; }
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* ---------- 卡片与网格 ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px;
}
.card.hover { cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s; }
.card.hover:hover { border-color: var(--border-hi); box-shadow: var(--shadow); }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) { .g3, .g4 { grid-template-columns: repeat(2, 1fr); } }

.kpi .k-num { font-size: 26px; font-weight: 650; letter-spacing: -0.5px; }
.kpi .k-num.gold { color: var(--gold); }
.kpi .k-label { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.kpi .k-hint { font-size: 11px; color: var(--faint); margin-top: 6px; }

/* ---------- 表单 ---------- */
input, textarea, select {
  width: 100%; background: #ffffff; color: var(--text);
  border: 1px solid var(--border-hi); border-radius: 9px;
  padding: 8px 12px; font-size: 13.5px; font-family: inherit;
  outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, textarea:focus, select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(196, 148, 43, 0.12); }
textarea { resize: vertical; min-height: 70px; line-height: 1.6; }
label.fl { display: block; font-size: 12px; color: var(--muted); margin: 12px 0 5px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
input[type="range"] { padding: 0; accent-color: var(--gold); background: transparent; border: none; box-shadow: none; }
input[type="checkbox"] { width: auto; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: #ffffff; color: var(--text);
  border: 1px solid var(--border-hi); border-radius: 9px;
  padding: 7px 15px; font-size: 13px; cursor: pointer; font-family: inherit;
  transition: all 0.15s; white-space: nowrap;
}
.btn:hover { border-color: #b9bcc6; background: var(--surface2); }
.btn.primary { background: var(--text); border-color: var(--text); color: #ffffff; font-weight: 600; }
.btn.primary:hover { background: #33383f; border-color: #33383f; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--surface2); }
.btn.danger { color: var(--red); border-color: rgba(214, 69, 69, 0.35); }
.btn.danger:hover { background: rgba(214, 69, 69, 0.06); }
.btn.sm { padding: 4px 10px; font-size: 12px; border-radius: 7px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---------- 列表条目 ---------- */
.row-item {
  display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 15px 18px; margin-bottom: 10px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.row-item:hover { border-color: var(--border-hi); box-shadow: var(--shadow); }
.row-item .ri-main { flex: 1; min-width: 260px; }
.row-item h4 { font-size: 14.5px; font-weight: 600; margin-bottom: 3px; }
.row-item .ri-meta { font-size: 12px; color: var(--muted); }
.row-item .ri-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tag {
  display: inline-block; font-size: 11px; padding: 1px 9px; border-radius: 20px;
  border: 1px solid var(--border-hi); color: var(--muted); margin-right: 6px; background: #fff;
}
.tag.gold { color: var(--gold); border-color: rgba(196, 148, 43, 0.4); background: var(--gold-fill); }
.tag.green { color: var(--green); border-color: rgba(47, 158, 95, 0.35); background: rgba(47, 158, 95, 0.08); }
.tag.red { color: var(--red); border-color: rgba(214, 69, 69, 0.35); background: rgba(214, 69, 69, 0.07); }
.tag.blue { color: var(--blue); border-color: rgba(59, 116, 209, 0.35); background: rgba(59, 116, 209, 0.08); }
.tag.purple { color: var(--purple); border-color: rgba(124, 92, 214, 0.35); background: rgba(124, 92, 214, 0.08); }

/* ---------- 模态框 ---------- */
#modal-mask {
  position: fixed; inset: 0; background: rgba(28, 31, 38, 0.32);
  backdrop-filter: blur(2px); display: none;
  align-items: flex-start; justify-content: center; z-index: 100; overflow-y: auto; padding: 6vh 20px 40px;
}
#modal-mask.open { display: flex; }
#modal {
  background: #ffffff; border: 1px solid var(--border); border-radius: 16px;
  width: 640px; max-width: 100%; padding: 24px 26px; box-shadow: var(--shadow);
}
#modal h3 { font-size: 16px; margin-bottom: 4px; }
#modal .m-sub { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

/* ---------- AI 面板 ---------- */
.ai-output {
  background: var(--surface2); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px 18px; margin-top: 14px; font-size: 13.5px; line-height: 1.75;
}
.ai-output h1, .ai-output h2, .ai-output h3 { margin: 12px 0 6px; font-size: 14.5px; color: var(--text); }
.ai-output h2 { font-size: 14px; }
.ai-output h3 { font-size: 13.5px; }
.ai-output p { margin: 6px 0; }
.ai-output ul, .ai-output ol { margin: 6px 0 6px 20px; }
.ai-output li { margin: 3px 0; }
.ai-output strong { color: var(--text); }
.ai-output blockquote { border-left: 3px solid var(--gold); padding-left: 12px; color: var(--muted); margin: 8px 0; }
.ai-output code { background: #e9eaee; padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }
.ai-output table { border-collapse: collapse; margin: 8px 0; }
.ai-output th, .ai-output td { border: 1px solid var(--border-hi); padding: 4px 10px; font-size: 12.5px; }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid #dcdee4; border-top-color: var(--gold); border-radius: 50%; animation: rot 0.8s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }

/* ---------- 复盘向导 ---------- */
.steps { display: flex; gap: 8px; margin-bottom: 20px; }
.step { flex: 1; text-align: center; font-size: 12px; color: var(--faint); padding-bottom: 8px; border-bottom: 2px solid var(--border); }
.step.on { color: var(--gold); border-bottom-color: var(--gold); font-weight: 600; }
.step.done { color: var(--muted); border-bottom-color: var(--muted); }

/* ---------- 热力格 ---------- */
.heat { display: flex; gap: 3px; flex-wrap: wrap; }
.heat .cell { width: 16px; height: 16px; border-radius: 4px; background: #eef0f3; position: relative; }
.heat .cell.l1 { background: #dcebd7; } .heat .cell.l2 { background: #b6d9ab; }
.heat .cell.l3 { background: #8cc37e; } .heat .cell.l4 { background: #5da54f; }

/* ---------- toast ---------- */
#toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #ffffff; border: 1px solid var(--border-hi); color: var(--text);
  padding: 10px 20px; border-radius: 10px; font-size: 13px; opacity: 0;
  transition: all 0.25s; pointer-events: none; z-index: 200; box-shadow: var(--shadow);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.empty { text-align: center; color: var(--faint); padding: 46px 0; font-size: 13px; }
.empty .big { font-size: 30px; margin-bottom: 8px; opacity: 0.7; }
a { color: var(--blue); text-decoration: none; }
.muted { color: var(--muted); } .faint { color: var(--faint); }
.small { font-size: 12px; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mb8{margin-bottom:8px}
canvas.chart { width: 100%; height: auto; display: block; }
.range-row { display: flex; align-items: center; gap: 12px; }
.range-row output { min-width: 44px; text-align: right; color: var(--gold); font-weight: 650; }
.hr { border: none; border-top: 1px solid var(--border); margin: 18px 0; }
.quick-quote { border-left: 3px solid var(--purple); padding: 4px 12px; color: var(--muted); font-size: 12.5px; margin: 6px 0; background: rgba(124,92,214,0.04); border-radius: 0 8px 8px 0; }
