/* beaxonAI 的界面：信标。
   beaxon 取自 beacon（信标）：信号源是一盏亮着的灯，信号一圈一圈往外发，跟随者照着做。
   灰蓝渐变底色、蓝色分层面板、香槟金操作色。网站和后台共用设计变量。

   换配色只改下面 :root 里的值，别处不写死颜色。 */
@font-face {
  font-family: "Space Grotesk";
  src: url("/fonts/space-grotesk-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("/fonts/space-grotesk-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg-a: #2b3f5f;
  --bg-b: #3a5580;
  --bg-c: #41608f;
  --bg-d: #304a70;
  --panel: #344f75;
  --well: #263e61;
  --line: #6b83a7;
  --hair: rgba(203, 220, 245, 0.16);
  --text: #f6f8fc;
  --muted: #c1cfe3;
  --accent: #f4c46c;
  --accent-hover: #ffdda0;
  --on-accent: #243956;
  --link: #ffdda0;
  --gain: #ffafb4;
  --loss: #91edcc;
  --ok: #91edcc;
  --bad: #ffb6bd;
  --warn: #f4c46c;
  --buy: #a4c6f6;
  --focus: #ffdda0;
  --shade: rgba(24, 39, 63, 0.75);
  --font-display: "Space Grotesk", "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Noto Sans CJK SC", "Noto Sans SC", sans-serif;
  --font-num: "Space Grotesk", "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --radius: 14px;
  --radius-s: 8px;
  --wrap: 1328px;
}

* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  background: var(--bg-d);
  scroll-padding-top: 96px;
}
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font: 14px/1.65 var(--font-body);
  background: linear-gradient(165deg, var(--bg-a) 0%, var(--bg-b) 50%, var(--bg-c) 78%, var(--bg-d) 100%);
}
h1,
h2,
h3 {
  font-family: var(--font-display);
  color: var(--text);
  line-height: 1.15;
  margin: 0;
  font-weight: 700;
}
h1 {
  font-size: clamp(2.1rem, 4.4vw, 3.25rem);
}
h2 {
  font-size: 1.5rem;
}
h3 {
  font-size: 1.15rem;
}
p {
  margin: 0;
  max-width: 68ch;
}
a {
  color: var(--link);
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}
.muted {
  color: var(--muted);
}
.num {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
}
.gain {
  color: var(--gain);
}
.loss {
  color: var(--loss);
}
/* 出错的说明文字。和盈亏的颜色分开，不跟着红涨绿跌变 */
.bad {
  color: var(--bad);
}
.ok {
  color: var(--ok);
}
.row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.spread {
  justify-content: space-between;
}
.hidden {
  display: none !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  background: var(--accent);
  color: var(--on-accent);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 9px 22px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  line-height: 1.3;
  white-space: nowrap;
}
.btn:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
  font-weight: 500;
}
.btn--ghost:hover {
  background: var(--hair);
  border-color: var(--text);
}
.btn--ghost[aria-pressed="true"],
.btn--ghost.is-on {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
}
.btn--small {
  min-height: 38px;
  padding: 5px 16px;
  font-size: 0.92rem;
}
.btn--danger {
  background: transparent;
  color: var(--bad);
  border-color: var(--bad);
  font-weight: 500;
}
.btn--danger:hover {
  background: var(--hair);
  border-color: var(--bad);
}
.btn--icon {
  width: 44px;
  padding: 0;
}
.btn--icon svg {
  display: block;
}
.linkbtn {
  background: none;
  border: 0;
  padding: 10px 0;
  color: var(--link);
  text-decoration: underline;
  cursor: pointer;
}

/* ---------- 卡片（以前的"单据"，类名没改） ---------- */
.slip,
.panel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
}
/* 要特别留意的卡片：订阅栏、即将到期 */
.slip--canary {
  border: 2px solid var(--accent);
}
/* 出了状况的卡片：到期收尾中 */
.slip--pink {
  border: 2px solid var(--bad);
}
.slip__title {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text);
  font-size: 1.25rem;
}
.slip__title a {
  color: inherit;
  text-decoration: none;
}
.slip__title a:hover {
  text-decoration: underline;
}
.fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px 20px;
  margin: 0;
}
.fields div {
  min-width: 0;
}
.fields dt {
  font-size: 0.82rem;
  color: var(--muted);
}
.fields dd {
  margin: 0;
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--text);
  overflow-wrap: anywhere;
}

/* ---------- 状态小标签（以前的"章"） ---------- */
.stamp {
  display: inline-block;
  border: 1.5px solid currentColor;
  border-radius: 999px;
  padding: 1px 12px;
  font-weight: 700;
  font-size: 0.85rem;
  line-height: 1.6;
  white-space: nowrap;
  color: var(--text);
}
.stamp--ok {
  color: var(--ok);
}
.stamp--warn {
  color: var(--warn);
}
.stamp--bad {
  color: var(--bad);
}
.stamp--off {
  color: var(--muted);
}

/* ---------- 表格 ---------- */
.ledger-wrap {
  overflow-x: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
table.ledger {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.ledger th {
  text-align: left;
  font-weight: 500;
  color: var(--muted);
  font-size: 0.82rem;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.ledger td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--hair);
  vertical-align: middle;
}
.ledger tr:last-child td {
  border-bottom: 0;
}
.ledger .r {
  text-align: right;
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
}
.ledger .nowrap {
  white-space: nowrap;
}
.ledger tbody tr:hover td {
  background: var(--hair);
}
.ledger small {
  display: block;
  color: var(--muted);
}
.ledger small.bad {
  color: var(--bad);
}
/* 列很多的表（会员中心的跟单记录）：格子收紧，不用横向滚动 */
.ledger--dense th,
.ledger--dense td {
  padding-left: 9px;
  padding-right: 9px;
}
.ledger--dense th:first-child,
.ledger--dense td:first-child {
  padding-left: 16px;
}
.ledger--dense th:last-child,
.ledger--dense td:last-child {
  padding-right: 16px;
}
.empty {
  padding: 28px 22px;
  color: var(--muted);
}

/* ---------- 表单 ---------- */
.form {
  display: grid;
  gap: 16px;
  max-width: 460px;
}
.form--wide {
  max-width: none;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  align-items: end;
}
.field label,
.field .label,
.field legend {
  display: block;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  padding: 0;
}
fieldset.field {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}
.field .hint,
.hint {
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 6px;
}
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="search"],
select,
textarea {
  width: 100%;
  background: var(--well);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: 9px 14px;
  min-height: 44px;
}
textarea {
  min-height: 220px;
  line-height: 1.6;
  resize: vertical;
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 0.85;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--text);
}
select option {
  background: var(--well);
  color: var(--text);
}
input[type="checkbox"],
input[type="radio"] {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
  flex: none;
}
.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 44px;
  cursor: pointer;
}
.check input {
  margin-top: 3px;
}
.choice {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.choice label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 16px;
  background: transparent;
  cursor: pointer;
  font-weight: 500;
  font-size: 1rem;
  margin: 0;
  color: var(--text);
}
.choice label:has(input:checked) {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
  font-weight: 700;
}
/* 一排可以选的按钮：倍数的快捷按钮、时间段 */
.seg {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
/* 几个按钮平分一行 */
.seg--even {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.seg--even .btn {
  padding-left: 4px;
  padding-right: 4px;
}
.msg {
  border: 1px solid var(--line);
  background: var(--well);
  padding: 12px 16px;
  border-radius: var(--radius-s);
  max-width: none;
}
.msg--error {
  border-color: var(--bad);
  color: var(--bad);
}
.msg--ok {
  border-color: var(--ok);
  color: var(--ok);
}
.msg--warn {
  border-color: var(--warn);
  color: var(--warn);
}
code.addr {
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  font-size: 0.92rem;
  background: var(--well);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: 6px 10px;
  overflow-wrap: anywhere;
  display: inline-block;
}

/* ---------- 标签页 ---------- */
.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.tabs a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 18px;
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  border: 1px solid var(--line);
  border-radius: 999px;
}
.tabs a:hover {
  background: var(--hair);
}
.tabs a[aria-current="page"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
}
.tabs .count {
  display: inline-block;
  min-width: 1.5em;
  text-align: center;
  background: var(--well);
  color: var(--text);
  border-radius: 999px;
  font-size: 0.78rem;
  line-height: 1.5;
  padding: 0 6px;
  margin-left: 6px;
}

dialog {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  max-width: min(520px, 92vw);
  width: 100%;
}
dialog::backdrop {
  background: var(--shade);
}

/* 放在最后：让 .stack 的间距不被上面各组件自己的 margin 盖掉 */
.stack > * + * {
  margin-top: 16px;
}

/* Shared feedback and interaction polish, including the administration UI. */
.btn, input, select, textarea, .tabs a { transition: background-color 150ms, border-color 150ms, box-shadow 150ms; }
.btn--ghost:hover { border-color: var(--muted); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 10%, transparent); }
.ledger th { background: var(--well); font-size: 0.75rem; padding-top: 14px; padding-bottom: 14px; }
.ledger td { font-size: 0.85rem; }
.stamp { border-width: 1px; border-radius: 5px; padding: 2px 8px; font-size: 0.73rem; font-weight: 500; background: color-mix(in srgb, currentColor 6%, transparent); }
.tabs a, .choice label { border-radius: 7px; font-size: 0.85rem; }
.notice { position: fixed; right: 24px; bottom: 24px; z-index: 100; width: min(440px, calc(100% - 32px)); box-shadow: 0 12px 48px rgba(0, 0, 0, 0.45); }
.notice .msg { padding-right: 48px; }
.notice__close { position: absolute; right: 4px; top: 4px; width: 40px; height: 40px; border: 0; background: transparent; color: var(--muted); font-size: 1.5rem; cursor: pointer; }
.notice__close:hover { color: var(--text); }
dialog { box-shadow: 0 32px 100px rgba(0, 0, 0, 0.45); }
dialog::backdrop { backdrop-filter: blur(4px); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
