:root {
  --bg: #f1f2f0;
  --surface: #ffffff;
  --surface-2: #e8eae7;
  --text: #1c1e1d;
  --muted: #636764;
  --line: #d3d6d2;
  --accent: #a83245;
  --accent-ink: #862432;
  --ok: #276b4b;
  --warn: #9a5a12;
  --danger: #a32a2a;
  --radius: 8px;
  color-scheme: light;
}
html.dark {
  --bg: #131514;
  --surface: #1b1e1c;
  --surface-2: #232724;
  --text: #e8e6e0;
  --muted: #9a9d97;
  --line: #333833;
  --accent: #e07986;
  --accent-ink: #f0a0aa;
  --ok: #7fc39f;
  --warn: #d7a45c;
  --danger: #e58b8b;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body.account-body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Microsoft YaHei", "Noto Sans SC", "PingFang SC", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
.account-top {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.account-top-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.account-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-right: auto;
}
.account-brand img { width: 24px; height: 24px; border-radius: 5px; }
.account-nav { display: flex; align-items: center; gap: 20px; }
.account-nav a {
  text-decoration: none;
  color: var(--muted);
  font-size: 13px;
  padding: 18px 0;
  border-bottom: 2px solid transparent;
}
.account-nav a:hover { color: var(--text); }
.account-nav a.active { color: var(--text); border-bottom-color: var(--accent); }
.account-theme {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  min-width: 46px;
  height: 32px;
  padding: 0 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
}
.account-main {
  max-width: 1040px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}
.account-intro { max-width: 560px; margin-bottom: 28px; }
.account-intro h1 {
  font-size: 26px;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}
.account-intro p { margin: 0; color: var(--muted); }
.auth-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.auth-panel, .account-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.auth-panel h2, .account-panel h2 {
  margin: 0 0 4px;
  font-size: 17px;
  letter-spacing: -0.01em;
}
.auth-panel .panel-note { margin: 0 0 18px; color: var(--muted); font-size: 13px; }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; margin-bottom: 5px; font-size: 12px; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
html.dark .btn.primary { color: #161817; }
.btn.primary:hover { filter: brightness(1.04); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.form-error {
  margin: 12px 0 0;
  padding: 9px 11px;
  border: 1px solid color-mix(in srgb, var(--danger) 35%, var(--line));
  border-radius: 6px;
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 6%, var(--surface));
  font-size: 13px;
}
.auth-foot {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
.auth-foot a { color: var(--accent-ink); }
.account-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}
.account-head h1 { margin: 0 0 4px; font-size: 24px; letter-spacing: -0.02em; }
.account-head p { margin: 0; color: var(--muted); }
.account-head-actions { display: flex; gap: 8px; }
.summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: 24px;
  overflow: hidden;
}
.summary-item { padding: 16px 18px; border-right: 1px solid var(--line); }
.summary-item:last-child { border-right: 0; }
.summary-item label { display: block; color: var(--muted); font-size: 12px; }
.summary-item b { display: block; margin-top: 2px; font-size: 19px; font-variant-numeric: tabular-nums; }
.account-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}
.account-tabs button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.account-tabs button.active { color: var(--text); border-bottom-color: var(--accent); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }
.table-scroll { overflow-x: auto; }
table.account-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.account-table th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.account-table td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table.account-table tr:last-child td { border-bottom: 0; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.muted { color: var(--muted); }
.pill {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  line-height: 1.7;
  white-space: nowrap;
}
.pill.paid, .pill.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }
.pill.pending { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); }
.pill.cancelled, .pill.rejected { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.secret-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
}
.secret-box code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 3px 6px;
  word-break: break-all;
}
.empty { padding: 28px 10px; text-align: center; color: var(--muted); }
.recharge-form { display: flex; gap: 10px; align-items: flex-end; max-width: 420px; margin-bottom: 18px; }
.recharge-form .field { flex: 1; margin-bottom: 0; }
.account-foot {
  max-width: 1040px;
  margin: 0 auto;
  padding: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
@media (max-width: 760px) {
  .account-top-inner { gap: 12px; padding: 0 16px; }
  .account-nav { gap: 12px; }
  .account-nav a { font-size: 12px; }
  .account-main { padding: 28px 16px 60px; }
  .auth-grid { grid-template-columns: 1fr; }
  .summary { grid-template-columns: 1fr 1fr; }
  .summary-item:nth-child(2) { border-right: 0; }
  .summary-item:nth-child(3) { border-top: 1px solid var(--line); }
  .summary-item:nth-child(4) { border-top: 1px solid var(--line); }
  .account-head { flex-direction: column; }
  .field-row { grid-template-columns: 1fr; }
}
/* 窄屏顶部导航：链接不换行，极窄屏只留图标，避免「商品」「订单查询」竖排断字。 */
@media (max-width: 480px) {
  .account-top-inner { gap: 8px; padding: 0 12px; }
  .account-nav { gap: 10px; }
  .account-nav a { white-space: nowrap; }
  .account-brand { flex: 0 0 auto; }
  .account-theme { flex: 0 0 auto; white-space: nowrap; }
}
@media (max-width: 439px) {
  .account-brand span { display: none; }
}
/* 窄屏表格保持横向滑动，但在表格上方明确提示，避免以为列被裁掉。 */
.table-scroll-hint { display: none; }
@media (max-width: 760px) {
  .table-scroll-hint { display: block; margin: 0 0 10px; font-size: 12px; line-height: 1.6; color: var(--muted); }
  table.account-table td { white-space: nowrap; }
}