/* ============================================================================
   面板层（弹窗）
   ----------------------------------------------------------------------------
   负责：交易弹窗、预埋单、贷款、历史成交、账号与密码 五个面板的外观。
   约束：
     · 颜色一律用 tokens.css 的变量；实底按钮上的文字用 #fff，与 base.css 的
       .btn--primary 保持同一口径（tokens 里没有"实底前景色"这一项）。
     · 不新增阴影/圆角体系：圆角用 --r-*，阴影只借用 --shadow-*。
     · 类名统一 pnl- / tr- / od- / ln- / hs- / ac- 前缀，避免和 layout.css 撞车。
   ========================================================================== */

/* ══════════════════════════════════════════════════════════════
   1. 外壳
   ══════════════════════════════════════════════════════════════ */

.pnl-mask {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s4);
  background: var(--overlay);
  overflow-y: auto;
  animation: pnl-fade var(--dur-fast) var(--ease);
}

@keyframes pnl-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.pnl {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: calc(100vh - 32px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.pnl--sm { max-width: 430px; }
.pnl--md { max-width: 480px; }
.pnl--lg { max-width: 680px; }
.pnl--xl { max-width: 1180px; }

.pnl__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s2);
  padding: var(--s4) var(--s5);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.pnl__title {
  font-size: var(--fs-lg);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.pnl__sub {
  font-size: var(--fs-xs);
  color: var(--text-3);
}

.pnl__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.pnl__body::-webkit-scrollbar { width: 8px; }
.pnl__body::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: var(--r-pill);
  border: 2px solid transparent;
  background-clip: padding-box;
}

.pnl-body-inner {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  padding: var(--s4) var(--s5) var(--s5);
}

.pnl__foot {
  display: flex;
  gap: var(--s2);
  padding: var(--s3) var(--s5);
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}
.pnl__foot .btn {
  flex: 1 1 0;
  padding: 9px 0;
}

/* 实底的「做空」按钮：白字绿底，方向与 A 股下跌色一致 */
.btn.pnl-btn--short {
  background: var(--down);
  border-color: var(--down);
  color: #fff;
}
.btn.pnl-btn--short:hover:not(:disabled) { filter: brightness(0.94); }

/* 倍数标签（预埋单 / 历史成交共用） */
.pnl-levtag {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  padding: 0 5px;
  border: 1px solid var(--warn-border);
  border-radius: var(--r-xs);
  background: var(--warn-soft);
  color: var(--warn);
  font-size: var(--fs-2xs);
  font-weight: 700;
  line-height: 1.6;
  white-space: nowrap;
}
.pnl-levtag.is-hot {
  border-color: var(--up-border);
  background: var(--up-soft);
  color: var(--up);
}

/* 仓位快捷键（全仓 / 1/2 仓 …）：交易与预埋单共用 */
.size-btn {
  min-height: 30px;
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: var(--fs-xs);
  font-weight: 600;
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease);
}
.size-btn:hover:not(:disabled) {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent);
  transform: translateY(-1px);
}
.size-btn:disabled { opacity: 0.5; }

/* ══════════════════════════════════════════════════════════════
   2. 交易弹窗
   ══════════════════════════════════════════════════════════════ */

.tr-stock {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--s2);
}

.tr-name {
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  color: var(--text);
  font-size: var(--fs-md);
  font-weight: 600;
  text-decoration: none;
}
.tr-name:hover {
  background: var(--accent-soft);
  color: var(--accent-strong);
  text-decoration: none;
}

.tr-code {
  font-size: var(--fs-xs);
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.tr-price {
  margin-left: auto;
  font-size: var(--fs-sm);
  font-weight: 600;
}

.tr-limits,
.tr-posinfo {
  font-size: var(--fs-xs);
  line-height: var(--lh);
}

.tr-dirs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  padding: 2px;
  background: var(--surface-3);
  border-radius: var(--r-sm);
}

.dir-btn {
  padding: 7px 0;
  border-radius: var(--r-xs);
  color: var(--text-2);
  font-size: var(--fs-sm);
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.dir-btn:hover { color: var(--text); }
.dir-btn.is-on {
  background: var(--surface);
  font-weight: 600;
  box-shadow: var(--shadow-xs);
}
.tr-dirs > .dir-btn:first-child.is-on { color: var(--up); }
.tr-dirs > .dir-btn:last-child.is-on { color: var(--down); }

.tr-kline {
  padding: var(--s2) var(--s3) var(--s1);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
}

.tr-kline__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
  margin-bottom: var(--s1);
}

.tr-kline__title {
  font-size: var(--fs-xs);
  color: var(--text-2);
  font-weight: 600;
}

.tr-kline__ranges {
  display: flex;
  gap: 3px;
}

.kline-range {
  padding: 2px 7px;
  border: 1px solid transparent;
  border-radius: var(--r-xs);
  color: var(--text-3);
  font-size: 10px;
  font-weight: 600;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.kline-range:hover { color: var(--text); background: var(--surface-3); }
.kline-range.is-on {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent-strong);
}

.tr-kline__canvas {
  display: block;
  width: 100%;
  height: 128px;
  cursor: crosshair;
  /* 触屏按住拖动时把横向手势留给图表（纵向仍可滚动面板），
     否则一拖动就变成页面滚动，指针事件被取消、十字光标跟不住 */
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.tr-kline__info {
  min-height: 16px;
  font-size: 10px;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
}
.tr-kline__info--muted { color: var(--text-3); }

/* 只读成交价：虚线边表示"不可编辑"，与 V1 的视觉约定一致 */
.tr-priceinput {
  background: var(--surface-2);
  border: 1px dashed var(--line-strong);
  font-weight: 600;
  cursor: default;
}
.tr-priceinput:focus { box-shadow: none; border-color: var(--line-strong); }

.tr-levrow {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1);
}

.lev-btn {
  flex: 1 1 0;
  min-width: 46px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: var(--fs-xs);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  transition: background var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease);
}
.lev-btn:hover:not(.is-on) {
  border-color: var(--warn-border);
  background: var(--warn-soft);
  color: var(--warn);
}
.lev-btn.is-risk {
  border-color: var(--up-border);
  color: var(--up);
}
.lev-btn.is-on {
  border-color: var(--warn);
  background: var(--warn);
  color: #fff;
}
.lev-btn.is-risk.is-on {
  border-color: var(--up);
  background: var(--up);
  color: #fff;
}

.tr-levinfo {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--s2) var(--s3);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: var(--fs-2xs);
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
}

.tr-tierrow {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1);
}

.tier-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  min-width: 84px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text-2);
  text-align: left;
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.tier-btn:hover { border-color: var(--accent-border); }
.tier-btn b {
  font-size: var(--fs-sm);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.tier-btn__meta {
  font-size: 10px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.tier-btn.is-on {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}
.tier-btn.is-on .tier-btn__meta { color: var(--accent); }

.tr-shares {
  font-size: var(--fs-md);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.tr-bulk {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s2);
}

.tr-maxhint {
  font-size: var(--fs-xs);
  color: var(--text-2);
}
.tr-maxhint b { color: var(--text); }

.tr-sizing {
  display: flex;
  gap: var(--s1);
}

.tr-estimate {
  padding: var(--s2) var(--s3);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: var(--fs-xs);
  line-height: 1.65;
  font-variant-numeric: tabular-nums;
}

.tr-fees {
  padding: 0 2px;
  color: var(--text-3);
  font-size: var(--fs-2xs);
  line-height: 1.65;
  font-variant-numeric: tabular-nums;
}

.tr-error { margin: 0; }

/* ══════════════════════════════════════════════════════════════
   3. 预埋单
   ══════════════════════════════════════════════════════════════ */

.od-hint { margin: 0; }

.od-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s1);
}

.od-tab {
  padding: 8px 0;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text-2);
  font-size: var(--fs-md);
  transition: background var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease);
}
.od-tab:hover { background: var(--surface-2); }
.od-tabs > .od-tab:first-child.is-on {
  border-color: var(--up-border);
  background: var(--up-soft);
  color: var(--up);
  font-weight: 600;
}
.od-tabs > .od-tab:last-child.is-on {
  border-color: var(--down-border);
  background: var(--down-soft);
  color: var(--down);
  font-weight: 600;
}

.od-search { padding-right: 11px; }

.od-drop {
  margin-top: 2px;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.od-drop__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
  width: 100%;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  transition: background var(--dur-fast) var(--ease);
}
.od-drop__item:last-child { border-bottom: none; }
.od-drop__item:hover { background: var(--surface-2); }
.od-drop__name { font-weight: 600; }
.od-drop__code {
  font-size: var(--fs-2xs);
  font-variant-numeric: tabular-nums;
}
.od-drop__empty {
  padding: 10px;
  font-size: var(--fs-xs);
}

.od-picked {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
  padding: 6px 10px;
  border: 1px solid var(--accent-border);
  border-radius: var(--r-sm);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: var(--fs-xs);
}
.od-picked__code {
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.od-picked__price,
.od-picked__pct { font-variant-numeric: tabular-nums; }
.od-reset {
  margin-left: auto;
  color: var(--accent);
  font-size: var(--fs-2xs);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.od-sellprice {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 5px;
  font-size: var(--fs-xs);
  font-variant-numeric: tabular-nums;
}

.od-select { cursor: pointer; }

.od-row {
  display: flex;
  align-items: flex-end;
  gap: var(--s2);
}

.od-triggerrow {
  display: flex;
  align-items: flex-end;
  gap: var(--s2);
}
.od-triggerop { flex: 0 0 112px; }

.od-bulk {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s2);
}

.od-maxhint {
  font-size: var(--fs-xs);
  color: var(--text-2);
}
.od-maxhint b { color: var(--text); }

.od-sizing {
  display: flex;
  gap: var(--s1);
}

/* 预埋单 · 买入侧杠杆档位（按钮视觉复用 .lev-btn，布局单独一份，别跟交易面板耦合） */
.od-levrow {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1);
}
.od-levinfo {
  margin-top: var(--s1);
  font-size: var(--fs-2xs);
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
}

.od-success,
.od-error { margin: 0; }

.od-lists {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  margin-top: var(--s1);
}

.od-section {
  padding-top: var(--s2);
  border-top: 1px solid var(--line);
}

.od-section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s2);
  margin-bottom: var(--s1);
}

.od-section__title {
  font-size: var(--fs-sm);
  font-weight: 600;
}

.od-section__count {
  font-size: var(--fs-2xs);
}

.od-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 260px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.od-item {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
}
.od-item--active { background: var(--surface-2); }

.od-item__main {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.od-item__side {
  font-size: var(--fs-xs);
  font-weight: 600;
}
.od-item__side.up { color: var(--up); }
.od-item__side.down { color: var(--down); }

.od-item__name { font-size: var(--fs-sm); }

.od-item__code {
  font-size: var(--fs-2xs);
  font-variant-numeric: tabular-nums;
}

.od-item__actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.od-cancel { padding: 2px 10px; }

.od-status {
  padding: 0 6px;
  border-radius: var(--r-xs);
  font-size: var(--fs-2xs);
  font-weight: 600;
  line-height: 1.7;
}
.od-status--success {
  background: var(--success-soft);
  color: var(--success);
}
.od-status--flat {
  background: var(--surface-3);
  color: var(--text-3);
}
.od-status--danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.od-item__meta {
  margin-top: 2px;
  font-size: var(--fs-2xs);
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
}

.od-item__skip {
  margin-top: 2px;
  color: var(--warn);
  font-size: var(--fs-2xs);
  line-height: 1.6;
}

.od-item__fill,
.od-item__reason {
  margin-top: 1px;
  font-size: var(--fs-2xs);
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
}

/* ══════════════════════════════════════════════════════════════
   4. 贷款
   ══════════════════════════════════════════════════════════════ */

.ln-banners {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ln-banner { margin: 0; }

.ln-bankrupt {
  padding: var(--s2) var(--s3);
  border: 1px solid var(--danger-border);
  border-radius: var(--r-sm);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: var(--fs-xs);
  line-height: 1.65;
}

.ln-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s2);
}

.ln-stat {
  padding: var(--s2) var(--s3);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  min-width: 0;
}

.ln-stat__label {
  font-size: var(--fs-2xs);
  color: var(--text-3);
}

.ln-stat__value {
  font-size: var(--fs-lg);
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ln-stat__sub {
  font-size: var(--fs-2xs);
  color: var(--text-3);
  line-height: 1.5;
}

.ln-form {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  padding: var(--s3) var(--s4);
  box-shadow: none;
}

.ln-form__row {
  display: flex;
  align-items: flex-end;
  gap: var(--s2);
}

.ln-shortcuts {
  display: flex;
  gap: var(--s1);
  padding-bottom: 1px;
}

.ln-terms {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 6px;
}

.ln-term {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text-2);
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.ln-term:hover { border-color: var(--accent-border); }
.ln-term b {
  font-size: var(--fs-sm);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.ln-term small {
  font-size: 10px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.ln-term.is-on {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}
.ln-term.is-on small { color: var(--accent); }

.ln-preview {
  padding: var(--s2) var(--s3);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: var(--fs-xs);
  line-height: 1.75;
  font-variant-numeric: tabular-nums;
}

.ln-msg {
  padding: var(--s2) var(--s3);
  border-radius: var(--r-sm);
  font-size: var(--fs-xs);
  line-height: 1.6;
}
.ln-msg--ok {
  background: var(--success-soft);
  border: 1px solid var(--success-border);
  color: var(--success);
}
.ln-msg--error {
  background: var(--danger-soft);
  border: 1px solid var(--danger-border);
  color: var(--danger);
}

.ln-lists {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}

.ln-section {
  padding-top: var(--s2);
  border-top: 1px solid var(--line);
}

.ln-section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s2);
  margin-bottom: var(--s1);
}

.ln-section__title {
  font-size: var(--fs-sm);
  font-weight: 600;
}

.ln-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ln-item {
  padding: var(--s2) var(--s3);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
}

.ln-item__head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.ln-item__principal {
  font-size: var(--fs-md);
  font-variant-numeric: tabular-nums;
}

.ln-tag { font-variant-numeric: tabular-nums; }

.ln-item__right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin-left: auto;
  line-height: 1.4;
}

.ln-item__debt {
  font-size: var(--fs-xs);
  font-weight: 600;
}

.ln-item__rp { font-size: var(--fs-2xs); }

.ln-item__meta {
  margin-top: 2px;
  font-size: var(--fs-2xs);
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
}

.ln-item__actions {
  display: flex;
  align-items: flex-start;
  gap: var(--s2);
  margin-top: var(--s1);
}

.ln-details { flex: 1 1 auto; min-width: 0; }

.ln-details__summary {
  cursor: pointer;
  color: var(--accent);
  font-size: var(--fs-2xs);
  font-variant-numeric: tabular-nums;
}
.ln-details__summary:hover { text-decoration: underline; }

.ln-schedule {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-top: var(--s1);
  max-height: 200px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.ln-schedule__row {
  display: grid;
  grid-template-columns: 56px 84px 1fr auto;
  gap: var(--s2);
  padding: 3px 0;
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-2xs);
  font-variant-numeric: tabular-nums;
}
.ln-schedule__row:last-child { border-bottom: none; }
.ln-schedule__row.is-paid {
  opacity: 0.55;
  text-decoration: line-through;
}
.ln-schedule__row.is-overdue { color: var(--danger); }
.ln-schedule__no { color: var(--text-3); }
.ln-schedule__amount { text-align: right; }

.ln-repay {
  flex: 0 0 auto;
  margin-left: auto;
}

.ln-events {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ln-event {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-2xs);
  font-variant-numeric: tabular-nums;
}

.ln-event__type { flex: 0 0 auto; }
.ln-event__time { flex: 0 0 auto; }
.ln-event__note { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ln-event__amount { flex: 0 0 auto; font-weight: 600; }

.ln-rules {
  margin-top: var(--s1);
  padding-top: var(--s2);
  border-top: 1px dashed var(--line);
  font-size: var(--fs-2xs);
  line-height: 1.75;
}
.ln-rules p + p { margin-top: 4px; }

/* ══════════════════════════════════════════════════════════════
   5. 历史成交
   ══════════════════════════════════════════════════════════════ */

.hs-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s2);
}

.hs-toolbar__left,
.hs-toolbar__right {
  display: flex;
  align-items: center;
  gap: var(--s2);
}

.hs-season { width: auto; min-width: 148px; }

.hs-count { font-size: var(--fs-xs); }

.hs-page {
  min-width: 62px;
  text-align: center;
  font-size: var(--fs-xs);
  color: var(--text-2);
}

.hs-wrap {
  max-height: 62vh;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}

.hs-table {
  min-width: 880px;
  font-size: var(--fs-xs);
}

.hs-table th,
.hs-table td { padding: 7px var(--s2); }

.hs-col--left { text-align: left; }

.hs-code {
  margin-left: 6px;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.hs-row--liq { background: var(--up-soft); }

.hs-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s3);
  padding: var(--s2) var(--s3);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  font-size: var(--fs-xs);
}

.hs-summary__item {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}

.hs-summary__note {
  margin-left: auto;
  font-size: var(--fs-2xs);
}

/* ══════════════════════════════════════════════════════════════
   6. 账号与密码
   ══════════════════════════════════════════════════════════════ */

.ac-account {
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface-2);
}

.ac-account__label {
  font-size: var(--fs-xs);
  color: var(--text-3);
}

.ac-account__name {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.ac-hist {
  padding: var(--s2) var(--s3);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}

.ac-hist__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
}

.ac-hist__title {
  font-size: var(--fs-sm);
  font-weight: 600;
}

.ac-hist__toggle {
  color: var(--accent);
  font-size: var(--fs-xs);
}
.ac-hist__toggle:hover { text-decoration: underline; }

.ac-hist__items {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: var(--s2);
  max-height: 200px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.ac-hist__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
  font-size: var(--fs-xs);
}

.ac-hist__time { font-variant-numeric: tabular-nums; }

.ac-hist__empty {
  padding: var(--s2) 0;
  font-size: var(--fs-xs);
}

.ac-hist__pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  margin-top: var(--s2);
}

.ac-hist__pagelabel {
  font-size: var(--fs-xs);
  color: var(--text-2);
}

.ac-form {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}

.ac-error { margin: 0; }

.ac-success {
  padding: var(--s2) var(--s3);
  border: 1px solid var(--success-border);
  border-radius: var(--r-sm);
  background: var(--success-soft);
  color: var(--success);
  font-size: var(--fs-xs);
  line-height: 1.6;
}

.ac-note {
  font-size: var(--fs-2xs);
  line-height: 1.6;
}

/* ══════════════════════════════════════════════════════════════
   7. 断点
   ══════════════════════════════════════════════════════════════ */

@media (max-width: 900px) {
  .hs-wrap { max-height: 56vh; }
}

@media (max-width: 760px) {
  .pnl-mask { padding: var(--s2); }
  .pnl { max-height: calc(100dvh - 16px); }
  .pnl__head { padding: var(--s3) var(--s4); }
  .pnl__foot { padding: var(--s2) var(--s4); }
  .pnl-body-inner { padding: var(--s3) var(--s4) var(--s4); }
  .ln-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hs-toolbar__right { width: 100%; justify-content: flex-end; }
}

@media (max-width: 560px) {
  .pnl { border-radius: var(--r-md); }
  .pnl__title { font-size: var(--fs-md); }
  .tr-name { font-size: var(--fs-sm); }
  .tr-kline__canvas { height: 112px; }
  .ln-stats { grid-template-columns: 1fr; }
  .ln-form__row { flex-wrap: wrap; }
  .ln-shortcuts { padding-bottom: 0; }
  .od-triggerop { flex: 0 0 96px; }
  .hs-toolbar__left { width: 100%; }
  .hs-season { flex: 1 1 auto; }
  .hs-summary { gap: var(--s2); }
  .hs-summary__note { margin-left: 0; }
  .ln-schedule__row { grid-template-columns: 48px 1fr; }
  .ln-schedule__split,
  .ln-schedule__amount { grid-column: 2; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  .pnl-mask { animation: none; }
  .size-btn:hover:not(:disabled) { transform: none; }
}
/* ══════════════════════════════════════════════════════════════
   8. 赛季结算公告（panels/season-notice.js）
   ------------------------------------------------------------------
   对齐 V1 UI 测绘 §4.10：#season-notice-mask 420px 宽、标题
   「🏁 赛季结算公告」、三段正文（15px/600 → 13px → 12px 虚线分隔）
   + 单个「知道了」按钮。v3 追加的信息块（赛季编号 / 触发条件 /
   前三名 / 你的名次 / 已作废提示）沿用同一套 tokens，不新增色值。
   ══════════════════════════════════════════════════════════════ */

.sn-panel {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}

/* 头部：赛季编号（金色，与赛季栏同一专题色）+ 状态徽章 */
.sn-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
}

.sn-season {
  font-size: var(--fs-lg);
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--season-gold);
}

.sn-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: var(--r-pill);
  font-size: var(--fs-2xs);
  font-weight: 600;
  border: 1px solid var(--line-strong);
  background: var(--surface-3);
  color: var(--text-2);
}
.sn-badge--pending {
  border-color: var(--warn-border);
  background: var(--warn-soft);
  color: var(--warn);
}
.sn-badge--settled {
  border-color: var(--season-gold-border);
  background: var(--season-gold-soft);
  color: var(--season-gold);
}
.sn-badge--current {
  border-color: var(--accent-border);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

/* 三段正文：字号/字重/颜色逐条对齐 V1（#1c2333 → --text） */
.sn-msg {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.7;
  color: var(--text);
}

.sn-detail {
  margin: 0;
  font-size: var(--fs-sm);
  line-height: 1.7;
  color: var(--text-2);
}

.sn-time {
  margin: 0;
  padding-top: var(--s2);
  border-top: 1px dashed var(--line);
  font-size: var(--fs-xs);
  line-height: 1.7;
  color: var(--text-3);
}

/* 事实网格：赛季编号 / 触发条件 / 参与人数 / 起始资金 / 下一季起始资金 */
.sn-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s2) var(--s3);
  padding: var(--s3);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
}

.sn-fact {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.sn-fact__label {
  font-size: var(--fs-2xs);
  color: var(--text-3);
}

.sn-fact__value {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
}

/* ── 下赛季预告（结算公告中间那块，替换原来的 2×2 事实网格） ──
   业主 2026-12 要求：一行一条、左标签右值、标签定宽对齐、值不折行。
   网格列宽固定为 64px，保证每行标签左边界 / 值左边界落在同一个 x 上。 */
.sn-seasonline {
  font-size: var(--fs-2xs);
  line-height: 1.6;
  color: var(--text-3);
}

.sn-next {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  padding: var(--s3);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
}

.sn-next__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s2);
}

.sn-next__title {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-2);
}

.sn-next__list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
}

.sn-next__row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: baseline;
  gap: var(--s2);
  padding: 6px 0;
  border-bottom: 1px dashed var(--line);
}
.sn-next__row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.sn-next__label {
  font-size: var(--fs-2xs);
  color: var(--text-3);
  white-space: nowrap;
}

.sn-next__value {
  display: flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.sn-next__note {
  font-size: var(--fs-2xs);
  font-weight: 400;
  color: var(--text-4);
  white-space: nowrap;
}

@media (max-width: 420px) {
  .sn-next__row { grid-template-columns: 58px minmax(0, 1fr); gap: 6px; }
  .sn-next__note { font-size: 10px; }
}

/* 分区（前三名 / 你的名次） */
.sn-section {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}

.sn-section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s2);
}

.sn-section__title {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-2);
}

.sn-section__note {
  font-size: var(--fs-2xs);
  color: var(--text-4);
}

.sn-rows {
  display: flex;
  flex-direction: column;
  gap: var(--s1);
}

.sn-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: var(--s2);
  padding: var(--s2) var(--s3);
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  font-size: var(--fs-sm);
}
/* 前三名必须是三个"看得出来的色系"，否则冠军和季军会糊成一个颜色。
   金：饱和正金（用 --metal-mid，不用淡金 --season-gold-border）
   银：冷灰
   铜：赭红铜（--scratch 是暖橙，混进灰里才像青铜，不能直接用 --warn 的淡琥珀） */
.sn-row--1 {
  border-color: color-mix(in srgb, var(--metal-mid) 62%, var(--surface));
  background: color-mix(in srgb, var(--metal-mid) 13%, var(--surface));
}
.sn-row--2 {
  border-color: color-mix(in srgb, var(--text-4) 55%, var(--surface));
  background: var(--surface-3);
}
.sn-row--3 {
  border-color: color-mix(in srgb, var(--scratch) 38%, var(--text-3));
  background: color-mix(in srgb, var(--scratch) 9%, var(--surface));
}

.sn-row__rank {
  font-size: var(--fs-md);
  line-height: 1;
}

.sn-row__name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--text);
}

.sn-row__assets {
  color: var(--text-2);
}

.sn-row__pct {
  min-width: 62px;
  text-align: right;
  font-weight: 600;
}

.sn-mine {
  padding: var(--s2) var(--s3);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text);
}

/* 「该赛季被重开 / 已作废」：业主决定只标记、不删数据 */
.sn-voided {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--s2) var(--s3);
  border: 1px solid var(--warn-border);
  border-left: 3px solid var(--warn);
  border-radius: var(--r-sm);
  background: var(--warn-soft);
}

.sn-voided__title {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--warn);
}

.sn-voided__text {
  font-size: var(--fs-xs);
  line-height: 1.65;
  color: var(--text-2);
}

.sn-note {
  font-size: var(--fs-2xs);
  line-height: 1.65;
  color: var(--text-4);
}

/* 手动回看入口（main.js 绑定）：只剩顶栏赛季胶囊 ——
   赛季栏那个大号赛季编号已随冗余区块一起删掉。 */
#season-next.is-clickable { cursor: pointer; }
#season-next.is-clickable:focus-visible {
  outline: 2px solid var(--line-focus);
  outline-offset: 2px;
}

@media (max-width: 560px) {
  .sn-facts { grid-template-columns: 1fr; }
  .sn-row { grid-template-columns: 22px minmax(0, 1fr) auto; }
  .sn-row__pct { grid-column: 2 / -1; text-align: left; }
}