:root {
  --paper: #f4f0e8;
  --ink: #1c1917;
  --muted: #6b6258;
  --line: #e3dcd0;
  --card: #fffdf8;
  --green: #1f4d3a;
  --green-soft: #e8f1eb;
  --up: #1a7a4c;
  --down: #b42318;
  --warn: #8a5a00;
  --warn-bg: #f8f0d8;
  --dup: #eceaf1;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--paper); color: var(--ink);
  font-family: "Source Han Sans SC", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px; line-height: 1.5; }
.shell { max-width: 1120px; margin: 0 auto; padding: 32px 24px 48px; }
.top { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px;
  border-bottom: 1px solid var(--line); padding-bottom: 20px; margin-bottom: 28px; }
.brand { display: flex; gap: 14px; align-items: center; }
.mark { width: 44px; height: 44px; border-radius: 10px; background: var(--green); color: #f4f0e8;
  display: grid; place-items: center; font-weight: 700; font-size: 18px; }
h1 { font-family: "Source Han Serif SC", "Noto Serif SC", "Songti SC", serif;
  font-size: 28px; margin: 0; letter-spacing: 0.04em; font-weight: 650; }
.tag { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
nav { display: flex; gap: 8px; }
nav a { color: var(--muted); text-decoration: none; padding: 8px 12px; border-radius: 8px; }
nav a.on, nav a:hover { background: #ebe4d8; color: var(--ink); }
.intro { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
h2 { font-family: "Source Han Serif SC", "Noto Serif SC", serif; font-size: 22px; margin: 0 0 4px; }
h3 { font-size: 15px; margin: 0 0 8px; font-weight: 650; }
.muted, .sub, footer { color: var(--muted); }
footer { margin-top: 36px; font-size: 12px; }
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.card, .panel { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.figure { font-variant-numeric: tabular-nums; font-size: 22px; font-weight: 650; margin: 4px 0 6px; }
.sub { font-size: 12px; margin: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.panel { overflow: auto; }
.panel-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 550; }
.r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sym { font-weight: 650; letter-spacing: 0.02em; }
.up { color: var(--up); }
.down { color: var(--down); }
.empty { text-align: center; color: var(--muted); padding: 20px; }
.btn { display: inline-block; border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 8px; padding: 8px 14px; text-decoration: none; cursor: pointer; font: inherit; }
.btn.primary { background: var(--green); color: #f4f0e8; border-color: var(--green); }
.btn.ghost { background: transparent; }
.filters { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; margin-bottom: 14px; }
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
select, input[type=file] { font: inherit; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.type { display: inline-block; padding: 1px 8px; border-radius: 999px; background: #eee; font-size: 12px; }
.t-买入 { background: #e8f1eb; color: var(--green); }
.t-卖出 { background: #f8e8e6; color: var(--down); }
.t-入金 { background: #e7f0f8; color: #1b4f72; }
.t-出金 { background: #f3eee6; color: #6b4f2a; }
.t-股息, .t-利息 { background: #eef6e8; color: #3b6b1e; }
.t-手续费, .t-其他 { background: #f4f0e8; color: #5c564c; }
.flag { color: var(--warn); background: var(--warn-bg); padding: 1px 8px; border-radius: 6px; font-size: 12px; }
.ok-dot { color: var(--up); font-size: 12px; }
.warn-row { background: #fbf7ec; }
.dup-row { background: var(--dup); color: var(--muted); }
.pill { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 8px; }
.desc { max-width: 180px; color: var(--muted); }
.flashes { margin-bottom: 16px; }
.flash { padding: 10px 14px; border-radius: 10px; margin-bottom: 8px; }
.flash.ok { background: var(--green-soft); }
.flash.warn { background: var(--warn-bg); }
.flash.error { background: #f8e8e6; color: var(--down); }
.upload { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.sample-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
table.wide { min-width: 860px; }
@media (max-width: 900px) {
  .cards, .grid-2 { grid-template-columns: 1fr; }
  .top { flex-direction: column; align-items: flex-start; }
}

.sub { white-space: nowrap; }
.file-pick { display: flex; align-items: center; gap: 10px; }
.file-pick input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.file-name { color: var(--muted); font-size: 13px; }

h1 a { color: inherit; text-decoration: none; }
.me { color: var(--muted); font-size: 13px; padding: 8px 4px; }
.hero { margin: 12px 0 28px; max-width: 640px; }
.hero h2 { font-family: "Source Han Serif SC", "Noto Serif SC", serif; font-size: 28px; margin: 0 0 10px; }
.cta { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.home-cards .sub { white-space: normal; }
.auth { max-width: 420px; }
.auth-form { display: flex; flex-direction: column; gap: 12px; margin: 16px 0; }
.auth-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.auth-form input[type=email], .auth-form input[type=password] {
  font: inherit; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink);
}
.auth a { color: var(--green); }
