/* AI 会计师 — 暗黑科幻高对比主题 */
:root {
  --bg: #070912;
  --bg2: #0c1020;
  --panel: rgba(18, 24, 45, 0.75);
  --border: #2a2a58;
  --border-bright: #3d4a8f;
  --text: #dce4f0;
  --text-dim: #8898b0;
  --text-faint: #5a6a85;
  --cyan: #35d6ff;
  --blue: #4f7cff;
  --purple: #a06bff;
  --green: #39e6a0;
  --red: #ff5d7a;
  --amber: #ffb648;
  --glow: 0 0 14px rgba(79, 124, 255, 0.35);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  overflow-x: hidden;
}
#bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: 0.9;
}
.hidden { display: none !important; }

/* ── 玻璃卡片 ── */
.glass {
  background: var(--panel);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  backdrop-filter: blur(14px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.45);
}
.card {
  background: var(--panel);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 18px;
  backdrop-filter: blur(14px);
}
.card-title { font-weight: 700; font-size: 17px; margin-bottom: 14px; color: var(--cyan); letter-spacing: 0.5px; }
.card-title.sub { font-size: 14px; color: var(--purple); margin-top: 18px; }

/* ── 登录页 ── */
.login-screen {
  position: fixed; inset: 0; z-index: 10;
  display: flex; align-items: center; justify-content: center;
}
.login-card { width: 360px; max-width: 92vw; padding: 40px 32px; text-align: center; animation: pop .35s ease; }
.logo { font-size: 28px; font-weight: 800; letter-spacing: 1px;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.logo.small { font-size: 20px; -webkit-text-fill-color: initial; color: var(--text); }
.sub { color: var(--text-dim); font-size: 13px; margin: 8px 0 24px; }
.pin-dots { display: flex; justify-content: center; gap: 12px; margin: 8px 0 18px; }
.pin-dots span {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--border-bright); transition: all .15s;
}
.pin-dots span.on { background: var(--cyan); border-color: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
#pin-input {
  width: 100%; padding: 13px; font-size: 18px; letter-spacing: 6px; text-align: center;
  background: var(--bg2); color: var(--text); border: 1.5px solid var(--border);
  border-radius: 10px; outline: none;
}
#pin-input:focus { border-color: var(--cyan); box-shadow: var(--glow); }
.login-err { color: var(--red); font-size: 13px; min-height: 20px; margin-top: 12px; }
.login-hint { color: var(--text-faint); font-size: 12px; margin-top: 16px; line-height: 1.5; }

/* ── 按钮 ── */
.btn {
  display: inline-block; padding: 11px 22px; border-radius: 10px; cursor: pointer;
  font-size: 15px; font-weight: 600; border: 1.5px solid var(--border-bright);
  color: var(--text); background: var(--bg2); transition: all .18s;
  margin-top: 14px; width: 100%;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--glow); border-color: var(--cyan); }
.btn.primary {
  background: linear-gradient(90deg, #1f6bff, #7b3fff);
  border: none; color: #fff; box-shadow: 0 4px 18px rgba(79,124,255,0.4);
}
.btn.primary:hover { box-shadow: 0 6px 24px rgba(79,124,255,0.6); }
.btn.ghost { background: transparent; border-color: var(--border-bright); color: var(--text-dim); }
.btn.ghost:hover { color: var(--text); border-color: var(--cyan); }

/* ── 布局 ── */
.app { display: flex; min-height: 100vh; position: relative; z-index: 1; }
.sidebar {
  width: 220px; flex-shrink: 0; padding: 20px 14px;
  border-right: 1.5px solid var(--border);
  background: rgba(10, 13, 28, 0.85); backdrop-filter: blur(14px);
  display: flex; flex-direction: column; gap: 6px;
  position: sticky; top: 0; height: 100vh;
}
.sidebar .logo { margin-bottom: 16px; padding-left: 8px; }
.nav-item {
  text-align: left; padding: 12px 14px; border-radius: 10px; cursor: pointer;
  background: transparent; border: 1.5px solid transparent; color: var(--text-dim);
  font-size: 15px; transition: all .15s;
}
.nav-item:hover { color: var(--text); background: rgba(79,124,255,0.08); }
.nav-item.active {
  color: var(--cyan); border-color: var(--border-bright);
  background: rgba(53,214,255,0.08); font-weight: 700;
}
.sidebar .btn { margin-top: auto; }
.main { flex: 1; padding: 24px 28px; max-width: 1100px; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.topbar-title { font-size: 22px; font-weight: 800; }
.topbar-date { color: var(--text-dim); font-size: 14px; }

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fade .25s ease; }

/* ── 统计卡片 ── */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.cards .stat { text-align: center; padding: 20px 16px; }
.stat-label { font-weight: 700; color: var(--text-dim); font-size: 13px; letter-spacing: 0.5px; margin-bottom: 6px; }
.stat-value { font-size: 26px; font-weight: 800; color: var(--cyan); }
.stat-sub { color: var(--text-faint); font-size: 12px; margin-top: 4px; }
.stat-value.warn { color: var(--red); }
.stat-value.good { color: var(--green); }

/* ── 提醒 ── */
.alerts { display: flex; flex-direction: column; gap: 8px; }
.alert {
  padding: 12px 14px; border-radius: 10px; font-size: 14px;
  border: 1.5px solid var(--amber); background: rgba(255,182,72,0.08); color: var(--amber);
}
.alert.ok { border-color: var(--green); background: rgba(57,230,160,0.08); color: var(--green); }
.alert.danger { border-color: var(--red); background: rgba(255,93,122,0.08); color: var(--red); }

/* ── 表单 ── */
.form-row { margin-bottom: 12px; }
.form-row label { display: block; font-weight: 700; font-size: 13px; color: var(--text-dim); margin-bottom: 5px; }
input, select {
  width: 100%; padding: 10px 12px; font-size: 15px;
  background: var(--bg2); color: var(--text); border: 1.5px solid var(--border);
  border-radius: 8px; outline: none;
}
input:focus, select:focus { border-color: var(--cyan); box-shadow: var(--glow); }
select option { background: var(--bg2); color: var(--text); }

/* ── 列表 ── */
.list { display: flex; flex-direction: column; gap: 8px; }
.list-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px;
  border: 1.5px solid var(--border); border-radius: 10px; background: rgba(10,13,28,0.5);
  font-size: 14px;
}
.list-item .li-main { flex: 1; }
.list-item .li-title { font-weight: 700; }
.list-item .li-sub { color: var(--text-faint); font-size: 12px; }
.list-item .li-amt { font-weight: 800; }
.list-item .li-amt.pos { color: var(--green); }
.list-item .li-amt.neg { color: var(--red); }
.list-item .li-del {
  cursor: pointer; color: var(--text-faint); padding: 4px 8px; border-radius: 6px;
  border: 1px solid transparent; font-size: 14px;
}
.list-item .li-del:hover { color: var(--red); border-color: var(--red); }
.tag {
  display: inline-block; padding: 1px 8px; border-radius: 20px; font-size: 11px;
  border: 1px solid var(--border-bright); color: var(--text-dim); margin-left: 6px;
}
.tag.necessary { border-color: var(--green); color: var(--green); }
.tag.optional { border-color: var(--amber); color: var(--amber); }

/* ── 图表/报告 ── */
.chart {
  font-family: "SF Mono", "Menlo", "Consolas", monospace; font-size: 13px;
  color: var(--cyan); background: rgba(10,13,28,0.6); padding: 14px;
  border-radius: 10px; border: 1.5px solid var(--border); line-height: 1.9;
  white-space: pre-wrap; word-break: break-all;
}
.muted { color: var(--text-faint); font-size: 12px; margin-top: 8px; }
.report .rep-line { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed var(--border); }
.report .rep-line b { color: var(--cyan); }
.report .sug { padding: 10px 12px; border-left: 3px solid var(--purple); background: rgba(160,107,255,0.07); margin: 8px 0; border-radius: 0 8px 8px 0; font-size: 14px; }
.reco-list { list-style: none; }
.reco-list li { padding: 8px 4px; border-bottom: 1px dashed var(--border); font-size: 14px; color: var(--text); }
.reco-list li::before { content: "✦ "; color: var(--cyan); }
.rule-list { padding-left: 22px; }
.rule-list li { margin-bottom: 8px; font-size: 14px; }

/* ── 动画 ── */
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: scale(1); } }

/* ── 移动端 ── */
@media (max-width: 768px) {
  .app { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; flex-wrap: wrap; border-right: none; border-bottom: 1.5px solid var(--border); }
  .sidebar .logo { display: none; }
  .nav-item { padding: 9px 10px; font-size: 13px; }
  .sidebar .btn { margin: 0; width: auto; padding: 8px 12px; }
  .main { padding: 16px 14px; }
  .cards { grid-template-columns: repeat(2, 1fr); }
}
