:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f9fafc;
  --text: #17202d;
  --muted: #748096;
  --line: #e6eaf0;
  --blue: #3266e8;
  --blue-soft: #edf2ff;
  --green: #158b67;
  --green-soft: #e9f8f2;
  --red: #d65c5c;
  --red-soft: #fff0f0;
  --orange: #bd7419;
  --shadow: 0 8px 28px rgba(38, 52, 76, .06);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); min-width: 320px; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small-text { font-size: 12px; }
.eyebrow { margin: 0 0 8px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .14em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: 30px; letter-spacing: -.02em; }
h2 { margin-bottom: 0; font-size: 17px; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(145deg, #f7f9ff 0%, #f3f7f6 100%); }
.login-card { width: min(100%, 420px); padding: 42px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.brand-mark { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--blue); color: white; font-weight: 800; font-size: 21px; box-shadow: 0 8px 16px rgba(50,102,232,.22); }
.brand-mark.small { width: 32px; height: 32px; border-radius: 9px; font-size: 15px; }
.login-card .brand-mark { margin-bottom: 32px; }
.login-card h1 { font-size: 27px; }
.stack-form { display: grid; gap: 15px; }
label { display: grid; gap: 7px; font-size: 12px; font-weight: 700; color: #435069; }
input, textarea, select { width: 100%; border: 1px solid #dce2eb; border-radius: 8px; padding: 11px 12px; color: var(--text); background: white; outline: none; transition: border .15s, box-shadow .15s; }
textarea { resize: vertical; line-height: 1.55; }
input:focus, textarea:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
button { border: 0; }
.primary-button, .secondary-button { min-height: 38px; padding: 0 15px; border-radius: 8px; font-weight: 700; font-size: 13px; }
.primary-button { color: white; background: var(--blue); box-shadow: 0 5px 12px rgba(50,102,232,.18); }
.primary-button:hover { background: #2859d0; }
.secondary-button { color: #3c4d69; background: #f0f3f8; }
.secondary-button:hover { background: #e5eaf2; }
.icon-button { width: 34px; height: 34px; border-radius: 8px; color: var(--muted); background: transparent; font-size: 20px; }
.icon-button:hover { color: var(--text); background: #edf0f5; }
.app-shell { min-height: 100vh; }
.topbar { height: 68px; padding: 0 clamp(18px, 4vw, 60px); display: flex; align-items: center; gap: 42px; background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; backdrop-filter: blur(12px); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.brand strong, .brand small { display: block; line-height: 1.05; }.brand strong { font-size: 13px; letter-spacing: .1em; }.brand small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.main-nav { display: flex; gap: 6px; height: 100%; }.nav-item { padding: 0 14px; color: var(--muted); background: none; font-size: 13px; font-weight: 700; border-bottom: 2px solid transparent; }.nav-item:hover, .nav-item.active { color: var(--blue); border-bottom-color: var(--blue); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }.status-pill { padding: 6px 9px; border-radius: 999px; background: var(--orange); color: white; font-size: 11px; font-weight: 700; }
.notice-bar { padding: 10px clamp(18px, 4vw, 60px); color: #805615; background: #fff7e8; border-bottom: 1px solid #f5dfb6; font-size: 12px; }
main { width: min(1260px, calc(100% - 40px)); margin: 0 auto; padding: 42px 0 70px; }.view { display: none; }.view.active-view { display: block; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 28px; }.page-heading .muted { margin-bottom: 0; font-size: 13px; }.heading-actions { display: flex; align-items: center; gap: 14px; }
.metric-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 16px; margin-bottom: 18px; }.metric-card { min-height: 140px; padding: 22px; display: flex; flex-direction: column; justify-content: space-between; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }.metric-card.accent { background: #f2f5ff; border-color: #dbe4ff; }.metric-label { color: var(--muted); font-size: 12px; font-weight: 700; }.metric-card strong { font-size: 32px; letter-spacing: -.03em; }.metric-foot { color: var(--muted); font-size: 11px; }
.content-grid { display: grid; gap: 18px; margin-bottom: 18px; }.two-columns { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }.panel { padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 20px; }.select-compact { width: auto; padding: 8px 10px; font-size: 12px; }
.chart-wrap { min-height: 230px; display: grid; place-items: center; }.chart-svg { width: 100%; height: 220px; overflow: visible; }.chart-line { fill: none; stroke: var(--blue); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }.chart-area { fill: url(#chart-fill); }.chart-grid-line { stroke: #edf0f5; stroke-width: 1; }.chart-label { fill: var(--muted); font-size: 10px; }
.allocation-list, .account-list, .group-list, .health-list, .sources-grid { display: grid; gap: 10px; }.allocation-row { display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 12px; }.coin-badge { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: #30415e; background: #e9eef7; font-size: 10px; font-weight: 800; }.allocation-name { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; font-size: 12px; font-weight: 700; }.bar-track { height: 6px; overflow: hidden; border-radius: 99px; background: #edf0f5; }.bar-fill { height: 100%; border-radius: inherit; background: var(--blue); }.allocation-value { font-size: 12px; font-weight: 700; }
.account-row { display: grid; grid-template-columns: minmax(180px, 1.5fr) .8fr .65fr auto; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid #eef1f5; }.account-row:last-child { border-bottom: 0; }.account-title { display: flex; align-items: center; gap: 10px; }.account-title strong { font-size: 13px; }.account-title small, .account-meta { display: block; color: var(--muted); font-size: 11px; }.account-meta small { margin-top: 4px; }.pnl-positive { color: var(--green); }.pnl-negative { color: var(--red); }.type-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); }.type-dot.exchange { background: #df8851; }.type-dot.manual { background: #9c6ad6; }.account-value { font-weight: 800; font-size: 13px; }.row-actions { display: flex; justify-content: flex-end; gap: 3px; }.row-actions button { padding: 7px; border-radius: 6px; color: var(--muted); background: transparent; }.row-actions button:hover { color: var(--blue); background: var(--blue-soft); }.group-row { display: flex; align-items: center; justify-content: space-between; padding: 13px 0; border-bottom: 1px solid #eef1f5; }.group-row:last-child { border-bottom: 0; }.group-row strong { font-size: 14px; }.group-row .muted { font-size: 11px; }.health-item { padding: 12px; border-radius: 8px; background: var(--surface-soft); }.health-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }.health-name { font-size: 12px; font-weight: 700; }.health-status { font-size: 11px; font-weight: 700; }.health-status.ok { color: var(--green); }.health-status.error { color: var(--red); }.health-item p { margin: 6px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.empty-state { width: 100%; padding: 28px 12px; text-align: center; color: var(--muted); font-size: 12px; }
.large-chart { min-height: 340px; display: grid; place-items: center; }.large-chart .chart-svg { height: 320px; }
.history-table { overflow-x: auto; }.history-row { min-width: 620px; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid #eef1f5; font-size: 12px; }.history-row.header { color: var(--muted); font-size: 11px; font-weight: 700; }.history-row strong { font-size: 13px; }
.sources-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }.source-card { padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }.source-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }.source-head h2 { font-size: 16px; }.source-type { color: var(--muted); font-size: 11px; }.source-total { margin: 23px 0 20px; font-size: 25px; font-weight: 800; }.source-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 18px; }.tag { padding: 5px 8px; color: #54617a; background: #f0f3f7; border-radius: 5px; font-size: 11px; }.source-foot { display: flex; align-items: center; justify-content: space-between; padding-top: 14px; border-top: 1px solid #eef1f5; }.source-foot small { color: var(--muted); font-size: 10px; }.source-actions { display: flex; gap: 4px; }.source-actions button { padding: 6px 8px; color: var(--muted); background: transparent; border-radius: 6px; font-size: 11px; }.source-actions button:hover { background: var(--blue-soft); color: var(--blue); }
.settings-panel { min-height: 220px; }.setting-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 14px 0; border-bottom: 1px solid #eef1f5; font-size: 12px; }.setting-row:last-child { border-bottom: 0; }.setting-row strong { color: var(--green); font-size: 12px; }.form-hint { color: var(--muted); font-size: 11px; }
.modal { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 18px; background: rgba(20, 29, 44, .34); }.modal-card { width: min(100%, 560px); max-height: calc(100vh - 36px); overflow: auto; padding: 24px; background: white; border-radius: 14px; box-shadow: 0 20px 60px rgba(22,31,47,.18); }.modal-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 22px; }.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }.conditional-fields { display: grid; gap: 13px; }.label-hint { color: var(--muted); font-size: 10px; font-weight: 400; }.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 8px; }.form-error { min-height: 17px; margin: 0; color: var(--red); font-size: 12px; }.toast { position: fixed; right: 22px; bottom: 22px; z-index: 50; max-width: 330px; padding: 11px 14px; color: white; background: #25334a; border-radius: 8px; box-shadow: var(--shadow); font-size: 12px; opacity: 0; transform: translateY(8px); pointer-events: none; transition: .2s; }.toast.show { opacity: 1; transform: translateY(0); }
@media (max-width: 800px) { .topbar { height: auto; min-height: 62px; padding: 12px 18px; flex-wrap: wrap; gap: 12px; }.main-nav { order: 3; width: 100%; height: 38px; overflow-x: auto; }.nav-item { padding: 0 11px; white-space: nowrap; }.top-actions { margin-left: auto; }.page-heading { align-items: flex-start; flex-direction: column; }.heading-actions { width: 100%; justify-content: space-between; }.metric-grid { grid-template-columns: 1fr 1fr; }.metric-card.accent { grid-column: 1 / -1; }.two-columns, .sources-grid { grid-template-columns: 1fr; }.account-row { grid-template-columns: minmax(150px, 1.4fr) 1fr auto; }.account-row .account-meta { display: none; }.account-row .row-actions { grid-column: 3; grid-row: 1; }.account-row > .account-value { grid-column: 2; grid-row: 1; }.account-row .account-title { grid-column: 1; grid-row: 1; } main { width: min(100% - 28px, 680px); padding-top: 28px; } }
@media (max-width: 460px) { .login-card { padding: 30px 22px; }.metric-card { padding: 17px; min-height: 125px; }.metric-card strong { font-size: 25px; }.panel { padding: 17px; }.form-grid { grid-template-columns: 1fr; }.source-total { font-size: 22px; }.heading-actions .small-text { max-width: 135px; }.page-heading h1 { font-size: 26px; } }
