:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --line: #e6e8ec;
  --text: #1f2430;
  --muted: #7a8290;
  --up: #e0483f;
  --down: #14946a;
  --accent: #3b6ef5;
  --accent-soft: #eaf0ff;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 18px rgba(16, 24, 40, .05);
}

* { box-sizing: border-box; }
.hidden { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.app { display: flex; min-height: 100vh; }

/* 侧栏 */
.side {
  width: 224px;
  flex: 0 0 224px;
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand { display: flex; gap: 10px; align-items: center; margin-bottom: 26px; }
.brand .paw { font-size: 26px; }
.brand b { display: block; font-size: 15px; letter-spacing: .3px; }
.brand small { color: var(--muted); font-size: 11px; }

nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  color: var(--muted);
  text-decoration: none;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 14px;
  transition: .15s;
}
.nav-item:hover { background: #f1f3f7; color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 500; }

#admin-nav { display: flex; flex-direction: column; gap: 4px; }
.nav-label {
  font-size: 11px; color: #a8afbb; letter-spacing: 1px;
  padding: 18px 12px 6px; text-transform: uppercase;
}
.dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--up); margin-right: 6px; vertical-align: middle;
}

.side-foot { margin-top: auto; font-size: 13px; }
.clock { font-size: 24px; font-weight: 600; letter-spacing: .5px; color: var(--text); }

.user-box {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 10px; margin: 10px 0 8px;
  background: #f7f8fa; border: 1px solid #eef0f4; border-radius: 10px;
}
.avatar {
  width: 30px; height: 30px; flex: 0 0 30px;
  border-radius: 50%; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600;
}
.uinfo { display: flex; flex-direction: column; line-height: 1.25; overflow: hidden; }
.uinfo b { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uinfo small { color: var(--muted); font-size: 11px; }

.logout-btn {
  width: 100%; padding: 9px 0; margin-bottom: 12px;
  background: #fff; border: 1px solid #e3e6ec; border-radius: 9px;
  color: #5b6472; font-size: 13px; cursor: pointer; transition: .15s;
}
.logout-btn:hover { border-color: #f0c9c5; color: var(--up); background: #fff8f7; }

.mini-todo { list-style: none; margin: 0; padding: 0; font-size: 14px; line-height: 2; }
.mini-todo li { color: var(--text); }
.mini-todo li.muted { color: var(--muted); }

/* 房贷 */
select {
  width: 100%; background: #fbfcfd; border: 1px solid var(--line);
  border-radius: 8px; padding: 10px 12px; color: var(--text);
  font: 13px/1.6 "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; outline: none;
}
select:focus { border-color: var(--accent); }

.big { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.table-wrap { max-height: 470px; overflow: auto; margin-bottom: 10px; border: 1px solid #f2f4f7; border-radius: 10px; }
.loan-table { padding: 0 10px; }
.loan-table thead th { position: sticky; top: 0; background: #fff; padding-top: 10px; z-index: 1; }

/* 技术面 */
.upd { font-size: 11px; color: var(--muted); font-weight: 400; margin-left: 6px; }
.ana-row { padding: 12px 0; border-bottom: 1px dashed var(--line); }
.ana-row:last-child { border-bottom: 0; padding-bottom: 0; }
.ana-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.ana-head b { font-size: 15px; }
.trend { font-size: 12px; padding: 2px 9px; border-radius: 20px; background: #f3f5f9; }
.ana-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 6px 16px; font-size: 13px; color: var(--muted);
}
.ana-grid b { color: var(--text); }

.comment-item { padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.comment-item:last-child { border-bottom: 0; padding-bottom: 0; }
.comment-item p { margin: 4px 0 0; color: #3a4353; line-height: 1.8; white-space: pre-wrap; }
.status { color: var(--muted); font-size: 11px; }

/* 主区 */
.main { flex: 1; padding: 34px 40px 60px; max-width: 1080px; }
.view { display: none; }
.view.active { display: block; animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; } }

h1 { font-size: 23px; margin: 0 0 6px; font-weight: 600; }
.sub { color: var(--muted); margin: 0 0 24px; font-size: 13px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-bottom: 18px; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.card h3 { margin: 0 0 6px; font-size: 15px; font-weight: 600; }
.card p { margin: 0; color: var(--muted); font-size: 13px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.panel h3 { margin: 0 0 12px; font-size: 13px; color: var(--muted); font-weight: 500; }
.hint { color: var(--muted); font-size: 12px; margin: 8px 0 0; }

/* 股票卡 */
.stock-card .nm { font-size: 15px; font-weight: 600; }
.stock-card .cd { color: var(--muted); font-size: 11px; margin-left: 6px; }
.stock-card .px { font-size: 26px; font-weight: 600; margin: 8px 0 2px; font-variant-numeric: tabular-nums; }
.stock-card .chg { font-size: 13px; font-variant-numeric: tabular-nums; }
.stock-card .pl { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 13px; color: var(--muted); line-height: 1.8; }
.stock-card .pl b { font-size: 15px; }
.up { color: var(--up); }
.down { color: var(--down); }

.total { font-size: 15px; font-weight: 500; font-variant-numeric: tabular-nums; line-height: 2; }

textarea, input[type="text"], input[type="password"], input:not([type]) {
  width: 100%;
  background: #fbfcfd;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
  font: 13px/1.6 ui-monospace, Menlo, Consolas, monospace;
  outline: none;
}
textarea:focus, input:focus { border-color: var(--accent); background: #fff; }

.btn {
  margin-top: 10px;
  background: var(--accent);
  color: #fff;
  border: 0;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: .15s;
}
.btn:hover { filter: brightness(1.06); }
.btn.full { width: 100%; margin-top: 16px; }

.row { display: flex; gap: 10px; }
.row .btn { margin-top: 0; flex: 0 0 auto; }

/* 访问日志 */
input[type="date"] {
  background: #fbfcfd; border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 12px; color: var(--text); font: 13px/1.6 inherit; outline: none;
}
.log-stats { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 14px; font-size: 13px; color: var(--muted); }
.log-stats b { color: var(--text); font-size: 16px; margin: 0 2px; }
.log-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.log-table th {
  text-align: left; font-weight: 500; color: var(--muted); font-size: 12px;
  padding: 0 10px 10px; border-bottom: 1px solid var(--line);
}
.log-table td { padding: 9px 10px; border-bottom: 1px solid #f0f2f5; }
.log-table tr:last-child td { border-bottom: 0; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
.muted { color: var(--muted); }

.todo-list { list-style: none; padding: 0; margin: 16px 0 0; }
.todo-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 4px; border-bottom: 1px solid var(--line); font-size: 14px;
}
.todo-list li:last-child { border-bottom: 0; }
.todo-list li.done span { color: var(--muted); text-decoration: line-through; }
.todo-list li span { flex: 1; }
.todo-list li button { background: transparent; border: 0; color: var(--muted); cursor: pointer; font-size: 13px; }
.todo-list li button:hover { color: var(--up); }

.tool-card { position: relative; }
.tag {
  position: absolute; top: 14px; right: 14px;
  font-size: 11px; color: var(--muted);
  background: #f3f5f9; border-radius: 20px; padding: 2px 9px;
}
.tool-card.add { border-style: dashed; box-shadow: none; background: transparent; }

.switch { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-top: 8px; }
.switch input { width: auto; }

.btn.ghost { background: #fff; color: var(--accent); border: 1px solid #cddbfb; }
.btn.ghost:hover { background: var(--accent-soft); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin-bottom: 12px; }
.form-grid label { font-size: 12px; color: var(--muted); }
.form-grid input { margin-top: 5px; }
#auth-form .row { gap: 8px; }
#auth-form .row .btn { margin-top: 6px; padding: 10px 14px; }

/* 用户管理 */
.user-list { display: flex; flex-direction: column; }
.user-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 2px; border-bottom: 1px solid #f0f2f5; font-size: 14px;
}
.user-row:last-child { border-bottom: 0; }
.user-row > span:first-child { flex: 1; font-weight: 500; }
.user-row.pending { background: #fffdf4; }
.btn.tiny {
  margin: 0; padding: 5px 11px; font-size: 12px; border-radius: 6px;
}
.btn.tiny.ghost { border: 1px solid #e3e6ec; color: var(--muted); background: #fff; }
.btn.tiny.ghost:hover { color: var(--up); border-color: #f3c9c6; background: #fff7f6; }
.btn.tiny.danger { background: var(--up); color: #fff; border: 1px solid var(--up); }
.btn:disabled { opacity: .5; cursor: default; }

/* 登录页 */
.auth {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(1200px 600px at 50% -10%, #e8efff 0%, var(--bg) 60%);
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 360px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 30px 28px 26px;
  box-shadow: 0 12px 40px rgba(16, 24, 40, .08);
}
.auth-brand { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 600; }
.auth-brand .paw { font-size: 26px; }
.auth-sub { color: var(--muted); font-size: 13px; margin: 6px 0 20px; }

.tabs { display: flex; gap: 6px; background: #f2f4f8; border-radius: 9px; padding: 4px; margin-bottom: 18px; }
.tab {
  flex: 1; border: 0; background: transparent; padding: 8px 0;
  border-radius: 7px; font-size: 13px; color: var(--muted); cursor: pointer;
}
.tab.active { background: #fff; color: var(--text); font-weight: 500; box-shadow: 0 1px 3px rgba(16,24,40,.08); }

#auth-form label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
#auth-form input { margin-top: 6px; font-family: inherit; font-size: 14px; }
.auth-error { color: var(--up); font-size: 12px; min-height: 18px; }
.auth-note { color: var(--muted); font-size: 12px; margin: 12px 0 0; text-align: center; }

@media (max-width: 720px) {
  .app { flex-direction: column; }
  .side { width: 100%; flex: none; height: auto; position: static; flex-direction: row; align-items: center; gap: 16px; overflow-x: auto; padding: 14px; }
  .brand { margin: 0; }
  .brand small { display: none; }
  nav { flex-direction: row; }
  .side-foot { display: none; }
  .main { padding: 22px 18px 50px; }
}
