/* vip88-login-page-split */
    html.boot-dash #authView { display: none !important; }
    html.boot-dash #dashView { display: block !important; }
    html.boot-auth #dashView { display: none !important; }
    * { box-sizing: border-box; }
    :root {
      --main-max: 980px;
      --main-pad-x: 20px;
    }
    html { overflow-y: auto; -webkit-overflow-scrolling: touch; }
    body {
      margin: 0; min-height: 100vh; color: var(--text);
      overflow-x: hidden;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
      font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
      background:
        radial-gradient(900px 520px at 12% -8%, rgba(61, 156, 240, 0.18) 0%, transparent 55%),
        radial-gradient(800px 480px at 92% 4%, rgba(var(--brand-rgb), 0.16) 0%, transparent 50%),
        radial-gradient(600px 400px at 50% 100%, rgba(26, 48, 80, 0.35) 0%, transparent 60%),
        var(--bg);
    }
    main { max-width: var(--main-max); margin: 0 auto; padding: 3px var(--main-pad-x) 80px; }
    h1 {
      font-family: Syne, "Noto Sans SC", sans-serif;
      font-size: clamp(1.55rem, 4vw, 1.95rem);
      font-weight: 800;
      margin: 0 0 6px;
      letter-spacing: -0.03em;
      line-height: 1.15;
    }
    .site-header {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      grid-template-rows: auto;
      align-items: start;
      gap: 10px 14px;
      margin: 0 0 2px;
      overflow: visible;
    }
    .site-brand-stack {
      grid-column: 1;
      grid-row: 1;
      --brand-logo-h: 90px;
      --brand-logo-ar: 624 / 459;
      --brand-logo-gap: 12px;
      --brand-meta-shift-x: -35px;
      display: grid;
      grid-template-columns: auto max-content;
      grid-template-rows: var(--brand-logo-h);
      column-gap: var(--brand-logo-gap);
      align-items: stretch;
      min-width: 0;
      overflow: visible;
    }
    .site-logo-img-link {
      grid-column: 1;
      grid-row: 1;
      align-self: end;
      flex-shrink: 0;
      line-height: 0;
      text-decoration: none;
    }
    .site-brand-meta {
      grid-column: 2;
      grid-row: 1;
      height: var(--brand-logo-h);
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      align-items: flex-start;
      gap: 0;
      min-width: 0;
      position: relative;
      left: var(--brand-meta-shift-x);
      z-index: 1;
    }
    .site-logo-text-link {
      text-decoration: none;
      color: inherit;
      line-height: 1.2;
      flex: 0 0 auto;
      margin-top: 10px;
    }
    .site-logo:hover .site-logo-brand { opacity: 0.92; }
    .site-logo-img {
      --brand-logo-ar: 624 / 459;
      flex-shrink: 0;
      display: block;
      height: var(--brand-logo-h);
      width: auto;
      max-width: calc(var(--brand-logo-h) * var(--brand-logo-ar));
      aspect-ratio: var(--brand-logo-ar);
      object-fit: contain;
      object-position: center center;
    }
    .site-logo-mark {
      flex-shrink: 0;
      width: 48px;
      height: 48px;
      border-radius: 13px;
      display: flex;
      align-items: center;
      justify-content: center;
      overflow: hidden;
      box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.12) inset,
        0 6px 18px rgba(61, 156, 240, 0.28);
    }
    .site-logo-mark img,
    .site-logo-mark svg {
      width: 100%;
      height: 100%;
      display: block;
    }
    .site-logo-text {
      min-width: 0;
      line-height: 1.25;
      padding: 0;
      text-align: left;
      flex: 0 1 auto;
    }
    .site-logo-brand {
      display: block;
      font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
      font-size: clamp(1.28rem, 3.8vw, 1.62rem);
      font-weight: 800;
      letter-spacing: 0.14em;
      line-height: 1.2;
      white-space: nowrap;
      background: linear-gradient(92deg, #d8ecff 0%, #ffffff 38%, #b8f0d4 100%);
      -webkit-background-clip: text;
      background-clip: text;
      color: transparent;
    }
    .site-logo-domain {
      display: inline;
      font-family: Syne, "Noto Sans SC", ui-monospace, monospace;
      font-size: 0.92rem;
      font-weight: 700;
      letter-spacing: -0.01em;
      white-space: nowrap;
    }
    .site-logo-domain .logo-key {
      color: #7ec8ff;
      text-shadow: 0 0 20px rgba(126, 200, 255, 0.35);
    }
    .site-logo-domain .logo-dot { color: #6b7f96; font-weight: 700; }
    .site-logo-domain .logo-host { color: var(--text); }
    .site-logo-title {
      display: flex;
      flex-wrap: wrap;
      align-items: baseline;
      justify-content: flex-start;
      gap: 0 8px;
      margin: 0;
      font-size: 0.72rem;
      font-weight: 600;
      color: var(--muted);
      letter-spacing: 0.01em;
      line-height: 1.2;
    }
    .brand-row {
      grid-column: 2;
      grid-row: 1;
      justify-self: end;
      align-self: start;
      display: flex;
      flex-wrap: nowrap;
      align-items: center;
      gap: 8px 10px;
      margin: 0;
      flex-shrink: 0;
    }
    .brand-row h1 { margin: 0; }
    .brand-version {
      font-size: 0.52em;
      font-style: italic;
      font-weight: 500;
      color: var(--muted);
      letter-spacing: 0.02em;
      vertical-align: baseline;
      margin-left: 0.15em;
    }
    .brand-tagline {
      margin: 0;
      font-size: 0.95rem;
      font-weight: 600;
      color: #9fd4b8;
      letter-spacing: 0.02em;
      line-height: 1.4;
    }
    .brand-intro-row {
      display: flex;
      flex-wrap: nowrap;
      align-items: baseline;
      gap: 6px 14px;
      margin: 0;
      margin-top: auto;
      padding: 0;
      white-space: nowrap;
      flex: 0 0 auto;
      line-height: 1.2;
      transform: translateY(-7px);
    }
    .brand-intro-row .brand-tagline {
      font-size: 0.88rem;
    }
    .brand-intro-row .sub {
      margin: 0;
      font-size: 0.86rem;
    }
    .slogan {
      display: inline-flex; gap: 6px; align-items: center;
      font-size: 0.85rem; font-weight: 650; letter-spacing: 0.04em;
      color: #052a18;
      background: linear-gradient(135deg, #5dffb0, var(--brand));
      border-radius: 999px;
      padding: 4px 12px;
      line-height: 1.3;
    }
    .slogan span { opacity: 0.85; font-weight: 500; }
    .sub { color: var(--muted); margin: 0 0 24px; line-height: 1.55; font-size: 0.92rem; }
    /* —— Auth entrance —— */
    #authView.auth-shell {
      position: relative;
      margin-top: 8px;
      padding: 6px;
      border-radius: 20px;
      background:
        linear-gradient(145deg, rgba(var(--brand-rgb), 0.2), rgba(var(--brand-rgb), 0.1) 45%, rgba(26, 34, 44, 0.4));
      box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.04),
        0 24px 48px rgba(0, 0, 0, 0.35);
      animation: authIn 0.55s ease-out both;
    }
    #authView.auth-shell::before {
      content: "";
      position: absolute;
      inset: 1px;
      border-radius: 19px;
      background: linear-gradient(180deg, #1c2530 0%, #151c24 100%);
      z-index: 0;
      pointer-events: none;
    }
    #authView.auth-shell > * { position: relative; z-index: 1; }
    @keyframes authIn {
      from { opacity: 0; transform: translateY(12px); }
      to { opacity: 1; transform: none; }
    }
    .auth-tabs {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 4px;
      margin: 10px 10px 0;
      padding: 4px;
      background: rgba(0, 0, 0, 0.28);
      border: 1px solid rgba(255, 255, 255, 0.06);
      border-radius: 14px;
    }
    .auth-tabs button {
      margin: 0;
      background: transparent;
      color: var(--muted);
      border-radius: 11px;
      padding: 12px 10px;
      font-size: 0.92rem;
      font-weight: 600;
      letter-spacing: 0.02em;
      transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    }
    .auth-tabs button:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
    .auth-tabs button.active {
      background: linear-gradient(135deg, var(--brand), var(--brand-bright));
      color: #062416;
      box-shadow: 0 8px 20px rgba(var(--brand-rgb), 0.28);
    }
    .auth-panel {
      margin: 2px !important;
      border: 1px solid rgba(255, 255, 255, 0.06) !important;
      background: rgba(18, 24, 32, 0.55) !important;
      border-radius: 16px !important;
      padding: 22px 20px 20px !important;
    }
    .auth-head { margin-bottom: 16px; }
    .auth-head h2 {
      margin: 0 0 6px;
      font-family: Syne, "Noto Sans SC", sans-serif;
      font-size: 1.2rem;
      font-weight: 700;
      letter-spacing: -0.02em;
    }
    .auth-head p {
      margin: 0;
      color: var(--muted);
      font-size: 0.84rem;
      line-height: 1.5;
    }
    .auth-panel input {
      background: rgba(10, 14, 20, 0.85);
      border-color: rgba(255, 255, 255, 0.08);
      transition: border-color 0.15s, box-shadow 0.15s;
    }
    .auth-panel input:focus {
      outline: none;
      border-color: rgba(var(--brand-rgb), 0.65);
      box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.18);
    }
    .auth-panel .row-btns button:not(.secondary),
    .auth-panel button:not(.secondary) {
      min-width: 140px;
      padding: 12px 20px;
      background: linear-gradient(135deg, var(--brand), var(--brand-bright));
      color: #062416;
      box-shadow: 0 10px 22px rgba(var(--brand-rgb), 0.25);
    }
    .auth-panel .row-btns button:not(.secondary):hover,
    .auth-panel button:not(.secondary):hover {
      filter: brightness(1.06);
    }
    .auth-check {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-top: 14px;
      padding: 10px 12px;
      border-radius: 10px;
      background: rgba(255, 255, 255, 0.03);
      border: 1px solid rgba(255, 255, 255, 0.05);
      color: var(--muted);
      font-size: 0.85rem;
      cursor: pointer;
      user-select: none;
    }
    .auth-check input { width: auto; margin: 0; accent-color: var(--ok); }
    .auth-recover {
      margin-top: 18px;
      padding-top: 16px;
      border-top: 1px dashed rgba(255, 255, 255, 0.1);
    }
    .auth-recover summary {
      cursor: pointer;
      color: var(--muted);
      font-size: 0.86rem;
      font-weight: 600;
      list-style: none;
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .auth-recover summary::-webkit-details-marker { display: none; }
    .auth-recover summary::before {
      content: "";
      width: 6px; height: 6px;
      border-right: 2px solid var(--muted);
      border-bottom: 2px solid var(--muted);
      transform: rotate(-45deg);
      transition: transform 0.2s;
    }
    .auth-recover[open] summary::before { transform: rotate(45deg); }
    .auth-recover summary:hover { color: var(--text); }
    .auth-recover-body { margin-top: 12px; }
    .auth-goto-recover {
      margin: 16px 0 0;
      padding-top: 16px;
      border-top: 1px dashed rgba(255, 255, 255, 0.1);
    }
    .auth-goto-recover button {
      margin: 0;
      padding: 0;
      background: none;
      border: none;
      box-shadow: none;
      color: var(--muted);
      font-size: 0.86rem;
      font-weight: 600;
      font-family: inherit;
      cursor: pointer;
      text-align: left;
      display: inline-flex;
      align-items: center;
      gap: 8px;
    }
    .auth-goto-recover button::before {
      content: "";
      width: 6px; height: 6px;
      border-right: 2px solid var(--muted);
      border-bottom: 2px solid var(--muted);
      transform: rotate(-45deg);
      flex-shrink: 0;
    }
    .auth-goto-recover button:hover { color: var(--text); background: none; }
    .redeem-first-tip {
      margin: 8px 0 12px;
      padding: 8px 10px;
      border-radius: 8px;
      border: 1px solid rgba(229, 57, 53, 0.35);
      background: rgba(229, 57, 53, 0.08);
      color: #e57373;
      font-size: 0.82rem;
      font-weight: 600;
      line-height: 1.45;
    }
    html[data-theme="light"] .redeem-first-tip {
      color: #c62828;
      background: rgba(229, 57, 53, 0.06);
    }
    .auth-features {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 8px;
      margin: 0 10px 12px;
    }
    .auth-feature {
      padding: 10px 8px;
      text-align: center;
      border-radius: 12px;
      background: rgba(255, 255, 255, 0.03);
      border: 1px solid rgba(255, 255, 255, 0.05);
    }
    .auth-feature .t {
      font-size: 0.78rem;
      font-weight: 700;
      color: var(--ok);
      margin-bottom: 2px;
    }
    .auth-feature .d {
      font-size: 0.7rem;
      color: var(--muted);
      line-height: 1.35;
    }
    @media (max-width: 560px) {
      /* Keep 3 feature cards on one row on phones */
      .auth-features {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
        margin: 0 8px 10px;
      }
      .auth-feature { padding: 8px 4px; border-radius: 10px; }
      .auth-feature .t { font-size: 0.72rem; }
      .auth-feature .d { font-size: 0.62rem; line-height: 1.3; }
      .auth-tabs button { font-size: 0.86rem; padding: 11px 6px; }
    }
    .card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 22px; margin-bottom: 2px; }
    label { display: block; font-size: 0.85rem; color: var(--muted); margin: 12px 0 6px; }
    label:first-child { margin-top: 0; }
    input, textarea {
      width: 100%; background: var(--input-bg); border: 1px solid var(--border); border-radius: 10px;
      color: var(--text); padding: 11px 12px; font-size: 0.95rem;
    }
    input:focus, textarea:focus { outline: 1px solid var(--accent); }
    textarea { min-height: 100px; font-family: ui-monospace, Consolas, monospace; font-size: 0.85rem; resize: vertical; }
    .row-btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; align-items: center; }
    button {
      background: var(--accent); color: #fff; border: 0; border-radius: 10px;
      padding: 11px 16px; font-size: 0.92rem; font-weight: 600; cursor: pointer;
    }
    button.secondary { background: var(--surface-2); }
    button:disabled { opacity: 0.55; cursor: not-allowed; }
    .tabs { display: flex; gap: 8px; margin-bottom: 14px; }
    .tabs button { background: var(--surface-2); }
    .tabs button.active { background: var(--accent); }
    .err { color: var(--danger); font-size: 0.9rem; margin-top: 10px; display: none; }
    .ok { color: var(--ok); }
    .hint { font-size: 0.8rem; color: var(--muted); margin-top: 8px; line-height: 1.4; }
    .label-tag {
      display: inline-block;
      margin-left: 6px;
      padding: 2px 8px;
      border-radius: 6px;
      background: var(--accent);
      color: #fff;
      font-size: 0.78rem;
      font-weight: 600;
      vertical-align: middle;
      line-height: 1.35;
    }
    .kv { margin-bottom: 10px; }
    .kv .k { font-size: 0.75rem; color: var(--muted); margin-bottom: 4px; }
    .kv .v { display: flex; gap: 8px; }
    .kv code {
      flex: 1; background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
      padding: 10px 12px; font-size: 0.8rem; word-break: break-all; white-space: pre-wrap;
    }
    .kv button { margin: 0; padding: 0 12px; font-size: 0.8rem; }
    button[data-copy] {
      background: var(--accent);
      color: #fff;
      border: 0;
    }
    button[data-copy]:hover { filter: brightness(1.06); }

    .kv.kv-row {
      display: flex;
      align-items: center;
      gap: 8px 10px;
      margin-bottom: 6px;
    }
    .kv.kv-row .k {
      margin: 0;
      flex: 0 0 auto;
      width: auto;
      min-width: 9.5rem;
      max-width: 12.5rem;
      font-size: 0.72rem;
      line-height: 1.25;
      color: var(--muted);
    }
    .mimo-official-tag {
      color: var(--ok);
      font-weight: 800;
      margin-right: 2px;
    }
    .kv.kv-row .v {
      flex: 1;
      min-width: 0;
      align-items: stretch;
    }
    .kv.kv-row code {
      padding: 6px 10px;
      font-size: 0.74rem;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .kv.kv-row button {
      padding: 0 10px;
      font-size: 0.75rem;
      flex-shrink: 0;
    }
    .kv.kv-row .v {
      flex-wrap: wrap;
    }
    .relay-api-panel {
      margin: 0 0 10px;
      border: 1px solid var(--border);
      border-radius: 10px;
      background: var(--surface);
      overflow: hidden;
    }
    .relay-api-hint {
      margin: 0;
      padding: 6px 12px 4px;
      font-size: 0.7rem;
      color: var(--muted);
      line-height: 1.35;
      border-top: 1px solid var(--border);
      background: var(--surface-2);
    }
    /* 中转站：配置教程锚点导航（与官方api渠道key tutorial-inline 同款） */
    .relay-api-panel .tutorial-inline.relay-tutorial-nav {
      margin: 0;
      padding: 8px 10px 10px;
      border: 0;
      border-top: 1px solid var(--border);
      border-radius: 0;
      background: var(--surface-2);
      box-shadow: none;
    }
    .relay-api-panel .tutorial-inline.relay-tutorial-nav > label {
      display: inline-block;
      margin-bottom: 6px;
      padding: 3px 10px;
      border-radius: 6px;
      background: var(--ok);
      color: #fff;
      font-weight: 800;
      font-size: 0.78rem;
      letter-spacing: 0.04em;
    }
    #tutorialTabsRelay {
      gap: 5px;
      margin-bottom: 0;
    }
    #tutorialTabsRelay button {
      background: linear-gradient(180deg, #ffb84d 0%, #ff8a2b 100%);
      color: #2a1400;
      border: 1px solid #ffd27a;
      border-radius: 999px;
      padding: 4px 10px;
      font-size: 0.72rem;
      font-weight: 800;
      line-height: 1.2;
      box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 2px 8px rgba(255, 140, 40, 0.35);
    }
    #tutorialTabsRelay button:hover {
      background: linear-gradient(180deg, #ffd06a 0%, #ff9a3a 100%);
      border-color: #ffe09a;
      filter: brightness(1.05);
    }
    @media (max-width: 560px) {
      #tutorialTabsRelay button { flex: 0 1 auto; }
    }
    .relay-api-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 0.78rem;
      table-layout: auto;
    }
    .relay-api-table th,
    .relay-api-table td {
      border-bottom: 1px solid var(--border);
      padding: 6px 10px;
      vertical-align: middle;
    }
    .relay-api-table thead th {
      background: var(--surface-2);
      font-weight: 700;
      text-align: left;
      font-size: 0.78rem;
      padding: 7px 10px;
    }
    .relay-api-table thead th:first-child,
    .relay-api-table tbody th[scope="row"] {
      width: 72px;
      white-space: nowrap;
      color: var(--muted);
      font-weight: 600;
      font-size: 0.7rem;
    }
    .relay-api-table tbody tr:last-child td,
    .relay-api-table tbody tr:last-child th {
      border-bottom: 0;
    }
    .relay-api-table .relay-api-col-head {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 6px;
    }
    .relay-api-table th.relay-api-col--anthropic {
      background: linear-gradient(135deg, rgba(255, 140, 90, 0.12), var(--surface-2));
    }
    .relay-api-card {
      border: 1px solid var(--border);
      border-radius: 12px;
      background: var(--surface);
      padding: 12px 14px;
    }
    .relay-api-card--featured {
      border-color: rgba(255, 140, 90, 0.45);
      background: linear-gradient(135deg, rgba(255, 140, 90, 0.08), var(--surface));
    }
    .relay-api-card-head {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 8px;
      margin-bottom: 10px;
    }
    .relay-api-tag {
      font-size: 0.8rem;
      font-weight: 700;
      color: var(--text, #111);
      line-height: 1.2;
    }
    html[data-theme="dark"] .relay-api-tag {
      color: #f2f4f7;
    }
    .relay-api-badge {
      font-size: 0.64rem;
      font-weight: 700;
      padding: 1px 7px;
      border-radius: 999px;
      color: #ff9a5a;
      background: rgba(255, 140, 90, 0.16);
      border: 1px solid rgba(255, 140, 90, 0.35);
      line-height: 1.3;
    }
    .relay-api-field + .relay-api-field {
      margin-top: 8px;
    }
    .relay-api-field-label {
      display: block;
      font-size: 0.72rem;
      color: var(--muted);
      margin-bottom: 5px;
      line-height: 1.2;
    }
    .relay-api-field-row {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 6px;
      min-width: 0;
    }
    .relay-api-field-row code {
      display: inline-block;
      flex: 0 1 auto;
      width: auto;
      max-width: 100%;
      min-width: 0;
      margin: 0;
      padding: 2px 8px;
      font-size: 0.72rem;
      line-height: 1.45;
      border-radius: 6px;
      border: 1px solid var(--border);
      background: var(--surface-2);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      word-break: normal;
      cursor: pointer;
      user-select: all;
      transition: border-color 0.15s, color 0.15s, background 0.15s;
    }
    .relay-api-field-row code:hover {
      border-color: var(--accent);
      color: var(--accent);
    }
    .relay-api-field-row code.copied {
      border-color: var(--ok);
      color: var(--ok);
      background: rgba(46, 160, 110, 0.1);
    }
    .relay-api-field-row button {
      display: none;
    }
    .relay-full-path {
      color: var(--muted);
    }
    .copy-toast {
      position: fixed;
      left: 50%;
      bottom: 28px;
      transform: translateX(-50%) translateY(12px);
      z-index: 9999;
      padding: 8px 14px;
      border-radius: 999px;
      font-size: 0.8rem;
      font-weight: 600;
      color: #fff;
      background: rgba(20, 24, 32, 0.92);
      border: 1px solid rgba(255, 255, 255, 0.08);
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.18s ease, transform 0.18s ease;
    }
    .copy-toast.show {
      opacity: 1;
      transform: translateX(-50%) translateY(0);
    }
    .relay-api-models {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
    }
    .relay-api-model-chip {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 4px 6px 4px 12px;
      border-radius: 999px;
      border: 1px solid var(--border);
      background: var(--surface-2);
      max-width: 100%;
    }
    .relay-api-model-chip code {
      flex: 0 1 auto;
      min-width: 0;
      margin: 0;
      padding: 0;
      border: none;
      background: transparent;
      font-size: 0.8rem;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .relay-api-model-chip button {
      flex: 0 0 auto;
      margin: 0;
      padding: 4px 10px;
      font-size: 0.72rem;
      border-radius: 999px;
    }
    @media (max-width: 720px) {
      .relay-api-table thead { display: none; }
      .relay-api-table,
      .relay-api-table tbody,
      .relay-api-table tr,
      .relay-api-table td,
      .relay-api-table th {
        display: block;
        width: 100%;
      }
      .relay-api-table tr {
        border-bottom: 1px solid var(--border);
        padding: 8px 0;
      }
      .relay-api-table tbody tr:last-child { border-bottom: 0; }
      .relay-api-table th[scope="row"] {
        padding: 10px 12px 4px;
        border: 0;
        color: var(--muted);
        font-size: 0.72rem;
        font-weight: 600;
      }
      .relay-api-table td {
        padding: 0 12px 10px;
        border: 0;
      }
      .relay-api-table td::before {
        content: attr(data-col);
        display: block;
        font-size: 0.78rem;
        font-weight: 700;
        margin-bottom: 6px;
        color: var(--text);
      }
      .relay-api-table td[data-col="Anthropic 协议"]::before {
        color: #ff9a5a;
      }
    }
    .support-msg-img, .cs-msg-img {
      max-width: min(240px, 100%);
      max-height: 240px;
      border-radius: 8px;
      display: block;
      margin-top: 4px;
      cursor: zoom-in;
      pointer-events: auto;
    }
    .gift-packet-card {
      width: min(100%, 225px);
      min-width: 168px;
      aspect-ratio: 9 / 6;
      box-sizing: border-box;
      padding: 12px 14px;
      border-radius: 12px;
      background: linear-gradient(145deg, #c43c3c 0%, #e85d4c 55%, #f0a06a 100%);
      color: #fff;
      box-shadow: 0 4px 14px rgba(180, 40, 40, 0.28);
      display: flex;
      flex-direction: column;
      justify-content: space-between;
    }
    .gift-packet-card .gp-title {
      font-size: 0.78rem;
      opacity: 0.92;
      margin-bottom: 4px;
    }
    .gift-packet-card .gp-amt {
      font-size: 1.45rem;
      font-weight: 800;
      letter-spacing: 0.02em;
    }
    .gift-packet-card .gp-amt em {
      font-style: normal;
      font-size: 0.85rem;
      font-weight: 600;
      margin-right: 2px;
    }
    .gift-packet-card .gp-note {
      margin-top: 6px;
      font-size: 0.75rem;
      opacity: 0.9;
      line-height: 1.35;
    }
    .gift-packet-card .gp-status {
      margin-top: 8px;
      font-size: 0.72rem;
      font-weight: 600;
      opacity: 0.95;
    }
    .gift-packet-card.is-claimed {
      background: linear-gradient(145deg, #6b7280 0%, #9ca3af 100%);
      box-shadow: none;
    }
    .gift-claim-btn {
      margin-top: 10px;
      width: 100%;
      border: 0;
      border-radius: 999px;
      padding: 8px 12px;
      font-weight: 700;
      font-size: 0.88rem;
      cursor: pointer;
      color: #b91c1c;
      background: #fff7ed;
    }
    .gift-claim-btn:disabled {
      opacity: 0.7;
      cursor: not-allowed;
    }
    .welfare-subtabs {
      display: flex;
      gap: 8px;
      margin: 0 0 4px;
      flex-wrap: wrap;
    }
    .welfare-subtab {
      margin: 0;
      padding: 7px 14px;
      border-radius: 999px;
      border: 1px solid rgba(255, 255, 255, 0.22);
      background: rgba(15, 23, 42, 0.72);
      color: #fff;
      font-size: 0.82rem;
      cursor: pointer;
    }
    .welfare-subtab:hover {
      background: rgba(15, 23, 42, 0.88);
      color: #fff;
    }
    .welfare-subtab.active {
      color: #fff;
      border-color: rgba(248, 113, 113, 0.65);
      background: rgba(185, 28, 28, 0.92);
    }
    .welfare-subtab .wf-sub-badge {
      display: inline-block;
      min-width: 1.1em;
      margin-left: 4px;
      padding: 0 5px;
      border-radius: 999px;
      font-size: 0.7rem;
      font-weight: 700;
      line-height: 1.35;
      color: #fff;
      background: #dc2626;
      vertical-align: text-top;
    }
    .welfare-subtab .wf-sub-badge.hidden { display: none; }
    .welfare-pane-hint {
      margin: 6px 0 0;
      font-size: 0.82rem;
      color: var(--muted);
    }
    .welfare-placeholder {
      margin-top: 16px;
      padding: 18px 14px;
      border: 1px dashed var(--border);
      border-radius: 12px;
      color: var(--muted);
      font-size: 0.88rem;
      line-height: 1.55;
      text-align: center;
    }
    .welfare-invite-box {
      margin-top: 2px;
    }
    .welfare-invite-rule {
      margin: 0;
      font-size: 0.88rem;
      line-height: 1.55;
      color: var(--muted);
    }
    .welfare-invite-row {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-top: 8px;
      min-width: 0;
    }
    .welfare-invite-lbl {
      flex: 0 0 auto;
      width: 4.2em;
      font-size: 0.82rem;
      color: var(--muted);
      white-space: nowrap;
    }
    .welfare-invite-code {
      display: inline-block;
      flex: 0 1 auto;
      min-width: 0;
      padding: 6px 10px;
      border-radius: 8px;
      border: 1px solid var(--border);
      background: var(--surface);
      font-size: 0.95rem;
      font-weight: 700;
      letter-spacing: 0.04em;
    }
    .welfare-invite-url {
      flex: 1 1 auto;
      min-width: 0;
      margin: 0;
      padding: 6px 8px;
      font-size: 0.82rem;
    }
    .welfare-invite-row .secondary {
      flex: 0 0 auto;
      padding: 6px 10px;
      font-size: 0.8rem;
    }

    .welfare-lottery-card {
      margin-top: 10px;
      padding: 22px 18px 20px;
      border-radius: 14px;
      border: 1px solid rgba(240, 180, 40, 0.45);
      background: linear-gradient(160deg, rgba(240, 180, 40, 0.16), rgba(62, 207, 142, 0.08));
      text-align: center;
    }
    .welfare-lottery-card .wf-lot-prize {
      font-size: 2rem;
      font-weight: 800;
      color: #f0c96a;
      letter-spacing: 0.02em;
      line-height: 1.1;
    }
    .welfare-lottery-card .wf-lot-title {
      margin-top: 6px;
      font-size: 1.05rem;
      font-weight: 700;
    }
    .welfare-lottery-card .wf-lot-sub {
      margin-top: 6px;
      font-size: 0.82rem;
      color: var(--muted);
    }
    .welfare-lottery-card #btnWelfareLottery {
      margin-top: 14px;
      min-width: 160px;
      background: linear-gradient(135deg, #f0b429, #e89b0c);
      border: none;
      color: #1a1200;
      font-weight: 800;
    }
    .welfare-lottery-card #btnWelfareLottery:disabled {
      opacity: 0.55;
      cursor: not-allowed;
    }

    .welfare-checkin-card {
      margin-top: 14px;
      max-width: 320px;
      padding: 22px 18px 18px;
      border-radius: 16px;
      text-align: center;
      color: #fff;
      background: linear-gradient(145deg, #0ea5e9 0%, #0369a1 100%);
      box-shadow: 0 8px 22px rgba(3, 105, 161, 0.28);
    }
    .welfare-checkin-card .wf-checkin-pts {
      font-size: 2rem;
      font-weight: 800;
      letter-spacing: 0.02em;
    }
    .welfare-checkin-card .wf-checkin-title {
      margin-top: 4px;
      font-size: 1.05rem;
      font-weight: 700;
    }
    .welfare-checkin-card .wf-checkin-sub {
      margin-top: 8px;
      font-size: 0.82rem;
      opacity: 0.92;
      line-height: 1.45;
    }
    .welfare-checkin-card #btnWelfareCheckin {
      margin-top: 16px;
      width: 100%;
      border: 0;
      border-radius: 999px;
      padding: 10px 14px;
      font-weight: 700;
      cursor: pointer;
      color: #0369a1;
      background: #fff;
    }
    .welfare-checkin-card #btnWelfareCheckin:disabled {
      opacity: 0.75;
      cursor: default;
      color: #64748b;
      background: rgba(255,255,255,0.85);
    }
    .welfare-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
      gap: 14px;
      margin-top: 12px;
    }
    .welfare-card {
      position: relative;
      border: 0;
      border-radius: 16px;
      padding: 16px 12px 14px;
      text-align: center;
      cursor: pointer;
      color: #fff;
      min-height: 168px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: space-between;
      box-shadow: 0 8px 22px rgba(0,0,0,0.18);
      transition: transform 0.15s ease, box-shadow 0.15s ease;
      overflow: hidden;
    }
    .welfare-card:hover:not(:disabled) {
      transform: translateY(-2px);
      box-shadow: 0 12px 28px rgba(0,0,0,0.22);
    }
    .welfare-card:disabled {
      cursor: default;
      opacity: 0.78;
      filter: grayscale(0.2);
    }
    /* 覆盖全局 button，避免主题色把红包冲成绿色方块 */
    button.welfare-card.kind-red_packet {
      aspect-ratio: 9 / 6;
      min-height: 0;
      width: 100%;
      box-sizing: border-box;
      padding: 0;
      border: 0;
      border-radius: 14px;
      color: #fff7ed !important;
      background:
        radial-gradient(ellipse 80% 55% at 50% -10%, rgba(255, 236, 179, 0.55), transparent 55%),
        linear-gradient(165deg, #b91c1c 0%, #dc2626 42%, #ea580c 100%) !important;
      box-shadow:
        0 10px 24px rgba(153, 27, 27, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
      display: grid;
      grid-template-rows: 1fr auto;
      align-items: stretch;
      justify-items: stretch;
      font-weight: 600;
      overflow: hidden;
    }
    button.welfare-card.kind-red_packet::before {
      content: "";
      position: absolute;
      left: 0;
      right: 0;
      top: 0;
      height: 28%;
      background: linear-gradient(180deg, rgba(127, 29, 29, 0.55), transparent);
      pointer-events: none;
    }
    button.welfare-card.kind-red_packet .wf-body {
      position: relative;
      z-index: 1;
      display: grid;
      grid-template-columns: auto 1fr auto;
      gap: 8px 10px;
      align-items: center;
      padding: 12px 12px 6px;
      min-height: 0;
      width: 100%;
      box-sizing: border-box;
    }
    button.welfare-card.kind-red_packet .wf-seal {
      width: 44px;
      height: 44px;
      margin: 0;
      border-radius: 50%;
      border: 2px solid rgba(253, 230, 138, 0.85);
      background: radial-gradient(circle at 35% 30%, #fde68a, #f59e0b 70%);
      color: #7f1d1d;
      font-size: 1.05rem;
      font-weight: 800;
      box-shadow: 0 2px 8px rgba(0,0,0,0.18);
      display: grid;
      place-items: center;
    }
    button.welfare-card.kind-red_packet .wf-main {
      min-width: 0;
      text-align: left;
    }
    button.welfare-card.kind-red_packet .wf-title {
      font-size: 0.78rem;
      font-weight: 700;
      color: #fff7ed;
      opacity: 0.95;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    button.welfare-card.kind-red_packet .wf-amt {
      margin: 2px 0 0;
      font-size: 1.35rem;
      font-weight: 800;
      letter-spacing: 0.02em;
      color: #fffbeb;
      line-height: 1.15;
    }
    button.welfare-card.kind-red_packet .wf-amt em {
      font-style: normal;
      font-size: 0.78rem;
      margin-right: 2px;
      font-weight: 700;
      opacity: 0.9;
    }
    button.welfare-card.kind-red_packet .wf-cta {
      margin: 0;
      padding: 7px 12px;
      border-radius: 999px;
      border: 0;
      background: #fff7ed;
      color: #b91c1c;
      font-weight: 800;
      font-size: 0.75rem;
      white-space: nowrap;
      box-shadow: 0 2px 8px rgba(0,0,0,0.12);
      pointer-events: none;
    }
    button.welfare-card.kind-red_packet .wf-foot {
      position: relative;
      z-index: 1;
      padding: 6px 12px 10px;
      font-size: 0.7rem;
      line-height: 1.3;
      color: rgba(255, 247, 237, 0.88);
      text-align: left;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      border-top: 1px solid rgba(255, 255, 255, 0.16);
      background: rgba(0, 0, 0, 0.12);
    }
    button.welfare-card.kind-red_packet.is-claimed {
      background:
        linear-gradient(165deg, #78716c 0%, #a8a29e 55%, #d6d3d1 100%) !important;
      box-shadow: none;
      filter: none;
      opacity: 0.9;
    }
    button.welfare-card.kind-red_packet.is-claimed .wf-seal {
      background: radial-gradient(circle at 35% 30%, #e7e5e4, #a8a29e 70%);
      border-color: rgba(255,255,255,0.5);
      color: #44403c;
    }
    button.welfare-card.kind-red_packet.is-claimed .wf-cta {
      background: rgba(255,255,255,0.85);
      color: #57534e;
    }
    button.welfare-card.kind-voucher {
      background:
        radial-gradient(circle at 12% 20%, rgba(255,255,255,0.22), transparent 40%),
        linear-gradient(145deg, #0ea5e9 0%, #2563eb 55%, #1d4ed8 100%) !important;
      border-radius: 14px;
      color: #fff !important;
    }
    .welfare-card.kind-voucher::before,
    .welfare-card.kind-voucher::after {
      content: "";
      position: absolute;
      top: 50%;
      width: 16px;
      height: 16px;
      border-radius: 50%;
      background: var(--bg, #0f1419);
      transform: translateY(-50%);
    }
    .welfare-card.kind-voucher::before { left: -8px; }
    .welfare-card.kind-voucher::after { right: -8px; }
    .welfare-card .wf-seal {
      width: 54px;
      height: 54px;
      border-radius: 50%;
      border: 2px dashed rgba(255,255,255,0.65);
      display: grid;
      place-items: center;
      font-size: 1.35rem;
      font-weight: 800;
      background: rgba(255,255,255,0.12);
      margin-bottom: 8px;
    }
    .welfare-card .wf-title {
      font-size: 0.82rem;
      font-weight: 700;
      opacity: 0.95;
    }
    .welfare-card .wf-amt {
      font-size: 1.55rem;
      font-weight: 800;
      letter-spacing: 0.02em;
      margin: 4px 0;
    }
    .welfare-card .wf-amt em {
      font-style: normal;
      font-size: 0.85rem;
      margin-right: 2px;
    }
    .welfare-card .wf-note {
      font-size: 0.72rem;
      line-height: 1.35;
      opacity: 0.9;
      max-width: 100%;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .welfare-card .wf-cta {
      margin-top: 10px;
      padding: 6px 14px;
      border-radius: 999px;
      border: 0;
      background: #fff7ed;
      color: #b91c1c;
      font-weight: 700;
      font-size: 0.8rem;
      pointer-events: none;
    }
    .welfare-card.kind-voucher .wf-cta {
      color: #1d4ed8;
      background: #eff6ff;
    }
    .welfare-card.is-claimed .wf-cta {
      background: rgba(255,255,255,0.2);
      color: #fff;
    }
    .welfare-empty {
      margin-top: 14px;
      padding: 28px 16px;
      text-align: center;
      color: var(--muted);
      border: 1px dashed var(--border);
      border-radius: 12px;
    }
    .badge-welfare {
      margin-left: 4px;
      min-width: 16px;
      height: 16px;
      padding: 0 5px;
      border-radius: 999px;
      background: #e25555;
      color: #fff;
      font-size: 0.65rem;
      font-weight: 700;
      line-height: 16px;
      display: inline-block;
      text-align: center;
      vertical-align: middle;
    }
    .badge-welfare.hidden { display: none; }
    a.btn-doc-copy {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      margin: 0;
      padding: 0 8px;
      height: auto;
      min-height: 28px;
      box-sizing: border-box;
      border-radius: 8px;
      border: 1px solid rgba(255, 140, 90, 0.55);
      background: rgba(255, 120, 70, 0.16);
      color: #ffc29a;
      font-size: 0.68rem;
      font-weight: 700;
      text-decoration: none;
      white-space: nowrap;
      flex-shrink: 0;
      line-height: 1.2;
    }
    a.btn-doc-copy:hover {
      background: rgba(255, 140, 80, 0.28);
      border-color: #ff9a5a;
      color: #fff;
    }
    .hidden { display: none !important; }
    .topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; gap: 10px; flex-wrap: wrap; }
    .topbar .who { color: var(--muted); font-size: 0.9rem; }
    .topbar .topbar-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
    .topbar .topbar-actions button { margin: 0; }
    #panelOfficialKey .topbar {
      margin-bottom: 6px !important;
      gap: 6px;
    }
    #panelOfficialKey .topbar .who { font-size: 0.8rem; }
    #panelOfficialKey .topbar-actions {
      gap: 5px;
    }
    #panelOfficialKey .topbar-actions button {
      margin: 0;
      padding: 4px 8px;
      font-size: 0.72rem;
      line-height: 1.2;
      height: auto;
      border-radius: 7px;
    }
    table.keys th.key-check, table.keys td.key-check {
      width: 2rem; text-align: center; padding-left: 4px; padding-right: 2px;
    }
    table.keys .key-check input {
      width: auto; margin: 0; accent-color: var(--accent); cursor: pointer;
    }
    .acct-bar {
      display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
      width: 100%;
      box-sizing: border-box;
      margin: 0 0 2px; padding: 6px 10px; background: var(--card);
      border: 1px solid var(--border); border-radius: 10px;
    }
    .acct-bar .lbl { color: var(--muted); font-size: 0.8rem; white-space: nowrap; flex: 0 0 auto; }
    .acct-bar input {
      margin: 0; width: auto; min-width: 0; flex: 1 1 auto;
      padding: 6px 8px; font-size: 0.86rem;
    }
    .acct-bar #whoPass {
      flex: 1 1 140px;
      max-width: none;
      min-width: 120px;
      width: auto;
    }
    .acct-bar button { margin: 0; padding: 6px 12px; font-size: 0.82rem; white-space: nowrap; flex: 0 0 auto; }
    .acct-bar button:not(.secondary) {
      background: var(--ok);
      color: #fff;
      border: 0;
      box-shadow: 0 4px 12px rgba(var(--brand-rgb), 0.22);
    }
    .acct-bar button:not(.secondary):hover {
      background: var(--brand-bright);
      color: #fff;
    }
    .new-account-banner {
      margin: 0 0 14px;
      padding: 14px 16px;
      border-radius: 12px;
      border: 1px solid rgba(34, 197, 94, 0.35);
      background: rgba(34, 197, 94, 0.1);
    }
    .new-account-banner.hidden { display: none; }
    .new-account-banner .nab-title {
      font-weight: 700;
      font-size: 0.95rem;
      margin-bottom: 6px;
    }
    .new-account-banner .nab-msg {
      margin: 0 0 10px;
      color: var(--muted);
      font-size: 0.86rem;
    }
    .new-account-banner .nab-creds {
      display: flex;
      flex-wrap: wrap;
      gap: 10px 18px;
      font-size: 0.88rem;
    }
    .new-account-banner .nab-creds code {
      font-weight: 700;
      margin: 0 4px;
    }
    .new-account-banner .nab-creds button {
      margin: 0;
      padding: 2px 8px;
      font-size: 0.75rem;
    }
    .acct-user-field {
      flex: 1 1 160px;
      max-width: none;
      min-width: 120px;
      display: flex;
      flex-wrap: nowrap;
      align-items: center;
      gap: 8px;
    }
    .acct-user-field input {
      flex: 1 1 auto;
      width: 100%;
      min-width: 0;
      max-width: none;
    }
    .acct-user-hint {
      flex: 0 0 auto;
      margin: 0;
      padding: 5px 10px;
      font-size: 0.78rem;
      font-weight: 600;
      line-height: 1.35;
      color: var(--brand-bright);
      background: rgba(var(--brand-rgb), 0.12);
      border: 1px solid rgba(var(--brand-rgb), 0.38);
      border-radius: 8px;
      white-space: nowrap;
    }
    .notice-bar {
      display: flex; align-items: center; gap: 10px;
      margin: 0 0 8px; padding: 6px 10px;
      background: linear-gradient(90deg, var(--surface-2), var(--surface) 40%, var(--surface-2));
      border: 1px solid var(--border); border-radius: 10px;
      overflow: hidden; min-height: 38px;
    }
    .notice-bar.hidden { display: none; }
    .notice-bar:hover .notice-track.scrolling { animation-play-state: paused; }
    .notice-tag {
      flex: 0 0 auto; font-size: 0.72rem; font-weight: 700;
      color: #fff; background: var(--ok); border-radius: 999px;
      padding: 3px 10px; letter-spacing: 0.04em;
    }
    .notice-track-wrap { flex: 1; overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
    .notice-track {
      display: inline-flex; gap: 48px; white-space: nowrap;
      color: var(--text); font-size: 0.88rem; line-height: 1.4;
      will-change: transform;
    }
    .notice-track.scrolling {
      animation: notice-marquee linear infinite;
    }
    .notice-track .sep { color: var(--muted); margin: 0 4px; }
    @keyframes notice-marquee {
      from { transform: translateX(0); }
      to { transform: translateX(-50%); }
    }
    .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 8px; }
    .stat { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
    .stat .n { font-size: 1.25rem; font-weight: 700; }
    .stat .l { font-size: 0.75rem; color: var(--muted); margin-top: 4px; }
    .buy-row { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
    .buy-row label { flex: 1; min-width: 120px; margin: 0; }


    .master-key-banner {
      border-color: rgba(61, 156, 240, 0.65);
      background: linear-gradient(90deg, rgba(61, 156, 240, 0.28), rgba(var(--brand-rgb), 0.16));
      color: #b7dfff;
      box-shadow: 0 0 0 1px rgba(61, 156, 240, 0.15), 0 4px 14px rgba(61, 156, 240, 0.12);
    }

    .plan-channel-banner {
      border-color: rgba(255, 180, 80, 0.7);
      background: linear-gradient(90deg, rgba(255, 160, 60, 0.22), rgba(var(--brand-rgb), 0.14));
      color: #ffe4b8;
      box-shadow: 0 0 0 1px rgba(255, 180, 80, 0.18), 0 4px 14px rgba(255, 140, 40, 0.1);
    }

    .max-ch-summary {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 10px 14px;
      margin: 12px 0 14px;
      padding: 10px 12px;
      border-radius: 10px;
      border: 1px solid var(--border);
      background: rgba(0, 0, 0, 0.22);
      font-size: 0.88rem;
    }
    .max-ch-summary .title {
      font-weight: 700;
      color: #ffc978;
      letter-spacing: 0.02em;
    }
    .max-ch-summary .stat {
      color: var(--muted);
    }
    .max-ch-summary .stat strong {
      color: var(--ok);
      font-variant-numeric: tabular-nums;
    }
    .max-ch-summary .preview-tag {
      margin-left: auto;
      font-size: 0.75rem;
      padding: 3px 8px;
      border-radius: 999px;
      background: rgba(240, 180, 40, 0.18);
      color: #f0b429;
      border: 1px solid rgba(240, 180, 40, 0.35);
    }

    .max-ch-grid {
      display: grid;
      grid-template-columns: repeat(5, 1fr);
      gap: 8px;
      margin-bottom: 18px;
    }
    @media (max-width: 640px) {
      .max-ch-grid { grid-template-columns: repeat(2, 1fr); }
    }
    .max-ch-card {
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 10px 8px;
      background: var(--surface);
      text-align: center;
      cursor: default;
      transition: border-color 0.15s, box-shadow 0.15s;
    }
    .max-ch-card.selectable {
      cursor: pointer;
    }
    .max-ch-card.selectable:hover {
      border-color: rgba(61, 156, 240, 0.55);
    }
    .max-ch-card.selected {
      border-color: rgba(61, 156, 240, 0.85);
      box-shadow: 0 0 0 2px rgba(61, 156, 240, 0.2);
    }
    .max-ch-card .ch-label {
      font-weight: 700;
      font-size: 0.9rem;
      margin-bottom: 4px;
    }
    .max-ch-card .ch-badge {
      display: inline-block;
      font-size: 0.72rem;
      font-weight: 650;
      padding: 2px 8px;
      border-radius: 999px;
      letter-spacing: 0.02em;
    }
    .max-ch-card .ch-badge.free {
      background: rgba(var(--brand-rgb), 0.18);
      color: var(--brand-bright);
    }
    .max-ch-card .ch-badge.busy {
      background: rgba(255, 123, 123, 0.15);
      color: #ff9a9a;
    }
    .max-ch-card .ch-badge.reserved {
      background: rgba(240, 180, 40, 0.15);
      color: #f0c96a;
    }
    .max-ch-card .ch-meta {
      margin-top: 6px;
      font-size: 0.72rem;
      color: var(--muted);
      line-height: 1.35;
      min-height: 2.6em;
    }

    .max-ch-section {
      margin-top: 18px;
      padding-top: 16px;
      border-top: 1px dashed rgba(255, 255, 255, 0.08);
    }

    .official-master-section {
      margin-top: 22px;
      padding-top: 18px;
      border-top: 1px dashed rgba(255, 255, 255, 0.12);
    }
    .official-master-section h3 {
      margin: 0 0 10px;
      font-size: 0.95rem;
      font-weight: 700;
      color: #b7dfff;
    }

    .max-ch-section h3 {
      margin: 0 0 10px;
      font-size: 0.95rem;
      font-weight: 700;
      color: #e8f0f8;
    }
    .max-ch-reserve-form {
      display: grid;
      gap: 10px;
    }
    .max-ch-reserve-form .row-2 {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
    }
    @media (max-width: 520px) {
      .max-ch-reserve-form .row-2 { grid-template-columns: 1fr; }
    }
    .max-ch-reserve-form label {
      display: block;
      font-size: 0.8rem;
      color: var(--muted);
      margin-bottom: 4px;
    }
    .max-ch-reserve-form input,
    .max-ch-reserve-form select {
      width: 100%;
      padding: 10px 12px;
      border-radius: 8px;
      border: 1px solid var(--border);
      background: var(--surface-deep);
      color: var(--text);
      font-size: 0.88rem;
    }
    .max-ch-session-empty {
      padding: 14px;
      border-radius: 10px;
      border: 1px dashed rgba(255, 255, 255, 0.1);
      color: var(--muted);
      font-size: 0.86rem;
      text-align: center;
      line-height: 1.5;
    }
    .max-ch-res-list {
      border: 1px solid var(--border);
      border-radius: 10px;
      overflow: hidden;
    }
    .max-ch-res-row {
      display: grid;
      grid-template-columns: 4.5rem 1fr auto;
      gap: 8px;
      align-items: center;
      padding: 10px 12px;
      border-bottom: 1px solid var(--border);
      font-size: 0.84rem;
    }
    .max-ch-res-row:last-child { border-bottom: none; }
    .max-ch-res-row .ch {
      font-weight: 700;
      color: #ffc978;
    }
    .max-ch-res-row .time {
      color: var(--muted);
      font-variant-numeric: tabular-nums;
    }
    .max-ch-res-row .st {
      font-size: 0.75rem;
      padding: 2px 8px;
      border-radius: 999px;
      background: rgba(61, 156, 240, 0.15);
      color: #9fd4ff;
    }

    .max-ch-subtabs {
      display: flex;
      gap: 6px;
      margin: 0 0 14px;
      padding: 4px;
      border-radius: 12px;
      background: rgba(0, 0, 0, 0.28);
      border: 1px solid rgba(255, 255, 255, 0.06);
    }
    .max-ch-subtabs button {
      flex: 1;
      margin: 0;
      padding: 10px 8px;
      border-radius: 9px;
      background: transparent;
      color: var(--muted);
      font-size: 0.86rem;
      font-weight: 650;
    }
    .max-ch-subtabs button:hover {
      color: var(--text);
      background: rgba(255, 255, 255, 0.04);
    }
    .max-ch-subtabs button.active {
      background: linear-gradient(135deg, rgba(255, 160, 60, 0.35), rgba(var(--brand-rgb), 0.22));
      color: #ffe8c8;
      box-shadow: 0 4px 14px rgba(255, 140, 40, 0.12);
    }

    .max-ch-value-lead {
      margin: 0 0 12px;
      padding: 12px 14px;
      border-radius: 10px;
      border: 1px solid rgba(255, 180, 80, 0.35);
      background: rgba(255, 140, 40, 0.08);
      font-size: 0.88rem;
      line-height: 1.55;
      color: #f5e6d0;
    }
    .max-ch-value-lead strong { color: #ffc978; }

    .max-ch-value-shot {
      display: block;
      margin: 0 0 14px;
      border-radius: 12px;
      overflow: hidden;
      border: 1px solid var(--border);
      background: #fff;
    }
    .max-ch-value-shot img {
      display: block;
      width: 100%;
      height: auto;
      vertical-align: top;
    }

    .max-ch-calc-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 0.84rem;
      margin: 0 0 14px;
    }
    .max-ch-calc-table th,
    .max-ch-calc-table td {
      padding: 10px 8px;
      border-bottom: 1px solid var(--border);
      text-align: left;
      vertical-align: top;
    }
    .max-ch-calc-table th {
      color: var(--muted);
      font-weight: 600;
      width: 38%;
    }
    .max-ch-calc-table td strong { color: #ffc978; }

    .max-ch-calc-box {
      padding: 14px;
      border-radius: 10px;
      border: 1px solid var(--border);
      background: rgba(0, 0, 0, 0.22);
    }
    .max-ch-calc-box label {
      display: block;
      font-size: 0.8rem;
      color: var(--muted);
      margin-bottom: 6px;
    }
    .max-ch-calc-box input {
      width: 100%;
      padding: 10px 12px;
      border-radius: 8px;
      border: 1px solid var(--border);
      background: var(--surface-deep);
      color: var(--text);
      font-size: 0.9rem;
      margin-bottom: 12px;
    }
    .max-ch-calc-result {
      padding: 12px;
      border-radius: 8px;
      background: rgba(var(--brand-rgb), 0.08);
      border: 1px solid rgba(var(--brand-rgb), 0.25);
      font-size: 0.86rem;
      line-height: 1.55;
      color: #c8f5e0;
    }
    .max-ch-calc-result .big {
      font-size: 1.05rem;
      font-weight: 700;
      color: var(--brand-bright);
      margin-bottom: 6px;
    }

    .official-key-banner {
      margin: 0 0 8px;
      padding: 8px 10px;
      border-radius: 8px;
      border: 1px solid rgba(var(--brand-rgb), 0.65);
      background: linear-gradient(90deg, rgba(var(--brand-rgb), 0.28), rgba(255, 210, 80, 0.18));
      color: #b8ffd6;
      font-size: 0.82rem;
      font-weight: 800;
      letter-spacing: 0.02em;
      line-height: 1.35;
      text-align: center;
      box-shadow: 0 0 0 1px rgba(var(--brand-rgb), 0.15), 0 4px 14px rgba(var(--brand-rgb), 0.12);
    }

    .keys-wrap {
      margin-top: 10px;
      /* 约表头 + 4 行；超出出现滚动条，节省纵向空间 */
      max-height: calc(2.5rem + 4 * 5.6rem);
      overflow: auto;
      -webkit-overflow-scrolling: touch;
      overscroll-behavior: contain;
      border: 1px solid var(--border);
      border-radius: 10px;
      background: var(--surface);
    }
    table.keys thead th {
      position: sticky;
      top: 0;
      z-index: 2;
      background: var(--surface-3);
      box-shadow: 0 1px 0 var(--border);
    }
    table.keys { width: 100%; border-collapse: collapse; font-size: 0.85rem; margin: 0; table-layout: fixed; --key-memo-w: calc(6.8rem - 30px); --key-copy-shrink: 50px; }
    table.keys th, table.keys td {
      text-align: left; padding: 10px 6px; border-bottom: 1px solid var(--border);
      vertical-align: top;
    }
    table.keys th:nth-child(1), table.keys td:nth-child(1) { width: 1.75rem; }
    table.keys th:nth-child(2), table.keys td:nth-child(2),
    table.keys td.key-idx {
      width: 2rem;
      max-width: 2rem;
      padding-left: 4px;
      padding-right: 4px;
      text-align: center;
      font-size: 0.78rem;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    table.keys th:nth-child(3), table.keys td:nth-child(3) { width: 4.2rem; }
    table.keys th:nth-child(5), table.keys td:nth-child(5) { width: 6.5rem; }
    table.keys th:nth-child(5):last-child,
    table.keys td:nth-child(5).key-ops {
      width: auto;
      min-width: 7.5rem;
    }
    table.keys th:nth-child(6), table.keys td:nth-child(6) {
      width: 7.5rem;
      min-width: 7.5rem;
    }
    /* 操作列左移：仅官方 Key 表（含「测试」列） */
    #keysWrap table.keys th:last-child,
    #keysWrap table.keys td.key-ops {
      transform: translateX(-70px);
    }
    /* 中转 / 万家：Key、复制、备忘、有效期各自独立列 */
    #relayKeysWrap table.keys th:nth-child(4),
    #relayKeysWrap table.keys td.key-val,
    #wanjiaKeysWrap table.keys th:nth-child(4),
    #wanjiaKeysWrap table.keys td.key-val {
      width: 7rem;
      max-width: 7rem;
      min-width: 0;
    }
    #relayKeysWrap table.keys th:nth-child(5),
    #relayKeysWrap table.keys td.key-copy-cell,
    #wanjiaKeysWrap table.keys th:nth-child(5),
    #wanjiaKeysWrap table.keys td.key-copy-cell {
      width: 3.6rem;
      min-width: 3.4rem;
      text-align: center;
      vertical-align: middle;
    }
    #relayKeysWrap table.keys th:nth-child(6),
    #relayKeysWrap table.keys td.key-memo-cell,
    #wanjiaKeysWrap table.keys th:nth-child(6),
    #wanjiaKeysWrap table.keys td.key-memo-cell {
      width: 4rem;
      min-width: 3.4rem;
      vertical-align: middle;
    }
    #relayKeysWrap table.keys th:nth-child(7),
    #relayKeysWrap table.keys td.key-expire,
    #wanjiaKeysWrap table.keys th:nth-child(7),
    #wanjiaKeysWrap table.keys td.key-expire {
      width: 4.2rem;
      min-width: 3.8rem;
      font-size: 0.74rem;
      line-height: 1.35;
      white-space: nowrap;
      color: var(--muted);
      vertical-align: middle;
    }
    #relayKeysWrap table.keys td.key-expire.expired,
    #wanjiaKeysWrap table.keys td.key-expire.expired {
      color: var(--danger, #f07178);
      font-weight: 600;
    }
    #relayKeysWrap table.keys th:nth-child(8),
    #relayKeysWrap table.keys td:nth-child(8).key-ops,
    #wanjiaKeysWrap table.keys th:nth-child(8),
    #wanjiaKeysWrap table.keys td:nth-child(8).key-ops {
      width: auto;
      min-width: 7.5rem;
    }
    #relayKeysWrap table.keys td.key-val .key-val-inner,
    #wanjiaKeysWrap table.keys td.key-val .key-val-inner {
      display: flex;
      flex-direction: column;
      gap: 4px;
      min-width: 0;
    }
    #relayKeysWrap table.keys td.key-val code,
    #wanjiaKeysWrap table.keys td.key-val code {
      display: block;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      font-size: 0.78rem;
      line-height: 1.35;
      padding: 6px 8px;
      border: 1px solid var(--border);
      border-radius: 6px;
      background: var(--surface-2);
      cursor: pointer;
    }
    #relayKeysWrap table.keys td.key-memo-cell .relay-key-memo,
    #wanjiaKeysWrap table.keys td.key-memo-cell .relay-key-memo {
      width: 100%;
      max-width: none;
      flex: none;
      box-sizing: border-box;
    }
    table.keys th { color: var(--muted); font-weight: 500; }

    /* exhausted keys fold */
    table.keys tr.keys-exhausted-hidden { display: none; }
    table.keys tr.keys-exhausted-fold td {
      padding: 8px 10px;
      border-top: 1px dashed var(--border);
      background: rgba(var(--brand-rgb), 0.06);
    }
    table.keys .keys-exhausted-toggle {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      margin: 0;
      padding: 4px 2px;
      border: 0;
      background: transparent;
      color: var(--muted);
      font-size: 0.86rem;
      cursor: pointer;
      line-height: 1.35;
    }
    table.keys .keys-exhausted-toggle:hover { color: var(--text); }
    table.keys .keys-exhausted-chevron {
      display: inline-block;
      width: 1em;
      text-align: center;
      font-size: 0.8rem;
    }
    table.keys .keys-exhausted-hint { opacity: 0.75; font-size: 0.8rem; }

    table.keys tr.key-exhausted td { color: #6b7785; }
    table.keys tr.key-exhausted .key-copy code,
    table.keys tr.key-exhausted td.key-val code {
      text-decoration: line-through;
      color: #6b7785;
      opacity: 0.75;
      border-color: #2a3542;
    }
    /* Shared size for 复制 / 测试 / 用完 / 查询 */
    table.keys .row-btn {
      margin: 0;
      padding: 6px 10px;
      font-size: 0.78rem;
      line-height: 1.2;
      height: 32px;
      box-sizing: border-box;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      white-space: nowrap;
    }
    table.keys .key-actions {
      display: flex; flex-wrap: nowrap; gap: 5px; align-items: center;
      min-width: 0;
    }
    table.keys .key-actions button.danger { background: #3a2228; color: var(--danger); }
    table.keys .key-main-row {
      display: flex;
      align-items: center;
      gap: 6px;
      width: 100%;
      min-width: 0;
    }
    table.keys .key-main-row .key-copy {
      flex: 1 1 auto;
      min-width: 0;
      max-width: calc(100% - var(--key-memo-w) - 6px - var(--key-copy-shrink));
    }
    table.keys .key-main-row:has(.key-model-chips) .key-copy {
      max-width: calc(100% - var(--key-memo-w) - 6px - var(--key-copy-shrink) - 5.8rem);
    }
    table.keys .key-memo,
    table.keys .relay-key-memo {
      display: block;
      flex: 0 0 var(--key-memo-w);
      width: var(--key-memo-w);
      max-width: var(--key-memo-w);
      margin-top: 0;
      height: 28px;
      min-height: 28px;
      max-height: 28px;
      resize: none;
      overflow: hidden;
      font-size: 0.7rem;
      line-height: 1.2;
      padding: 3px 6px;
      background: var(--surface-deep);
      border: 1px solid var(--border);
      border-radius: 6px;
      color: var(--text);
      font-family: inherit;
      box-sizing: border-box;
    }
    table.keys .key-memo:focus,
    table.keys .relay-key-memo:focus { outline: 1px solid var(--accent); border-color: var(--accent); }
    table.keys .key-memo.saving,
    table.keys .relay-key-memo.saving { opacity: 0.7; }
    table.keys .key-memo.saved,
    table.keys .relay-key-memo.saved { border-color: #2a5a40; }
    .usage { font-size: 0.8rem; color: var(--muted); white-space: pre-line; line-height: 1.35; max-width: 11rem; }
    .usage.ok { color: var(--ok); }
    .usage.bad { color: var(--danger); }
    .test-cell { width: 3.4rem; min-width: 3.2rem; max-width: 3.8rem; }
    .test-last {
      flex: 1 1 auto;
      min-width: 4.5rem;
      max-width: 12rem;
      font-size: 0.68rem;
      color: var(--muted);
      white-space: nowrap;
      overflow-x: auto;
      overflow-y: hidden;
      line-height: 1.2;
      -webkit-overflow-scrolling: touch;
      scrollbar-width: thin;
    }
    .test-last.ok { color: var(--ok); }
    .test-last.bad { color: var(--danger); }
    .test-last:empty { display: none; }
    .key-copy {
      display: flex; gap: 8px; align-items: center;
      width: 100%; max-width: 100%; min-width: 0;
    }
    .key-copy code {
      flex: 1 1 auto; min-width: 0; cursor: pointer;
      background: var(--surface-deep); border: 1px solid var(--border); border-radius: 8px;
      padding: 6px 10px; font-size: 0.78rem; line-height: 1.2;
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
      word-break: normal; user-select: all;
    }
    .key-copy button { flex: 0 0 auto; }
    .key-copy code:hover { border-color: var(--accent); }
    .key-model-chips {
      display: flex;
      flex: 0 0 auto;
      flex-direction: column;
      flex-wrap: nowrap;
      gap: 3px;
      align-items: stretch;
      justify-content: center;
      width: 5.6rem;
      min-width: 5.6rem;
      max-width: 5.6rem;
      order: 2;
    }
    .key-model-chips .model-chip {
      flex: 0 0 auto;
      width: 100%;
      max-width: none;
      margin: 0;
      padding: 2px 5px;
      font-size: 0.6rem;
      line-height: 1.2;
      font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
      color: #9dffc8;
      background: rgba(var(--brand-rgb), 0.12);
      border: 1px solid rgba(var(--brand-rgb), 0.35);
      border-radius: 5px;
      cursor: pointer;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      text-align: center;
      user-select: none;
      box-sizing: border-box;
    }
    .key-model-chips .model-chip:hover {
      border-color: var(--ok);
      background: rgba(var(--brand-rgb), 0.22);
    }
    .key-model-chips .model-chip.copied {
      color: #062416;
      background: var(--ok);
      border-color: #5dffb0;
    }
    table.keys .key-main-row .key-copy {
      order: 1;
    }
    table.keys .key-main-row .relay-key-memo,
    table.keys .key-main-row .key-memo {
      order: 3;
    }
    .key-copy code.copied {
      border-color: var(--ok);
      color: var(--ok);
    }
    .key-copy button { background: var(--surface-2); }
    .key-copy button.copied {
      background: #1e3a2f;
      color: var(--ok);
    }
    /* Mobile: one PC row → 3-line card (meta / key / memo+test) */
    @media (max-width: 720px) {
      #panelOfficialKey .topbar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
      }
      #panelOfficialKey .topbar-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
      }
      #panelOfficialKey .topbar-actions button {
        flex: 1 1 calc(50% - 5px);
        margin: 0;
        font-size: 0.7rem;
        padding: 5px 6px;
      }
      .keys-wrap {
        /* 移动端卡片更高：仍大约只露出 4 条 */
        max-height: calc(4 * 7.4rem);
        border-radius: 12px;
        overflow-x: hidden;
      }
      table.keys {
        table-layout: auto;
        font-size: 0.82rem;
      }
      table.keys thead { display: none; }
      table.keys tbody { display: block; width: 100%; }
      table.keys tr {
        display: grid;
        grid-template-columns: auto auto 1fr auto;
        grid-template-areas:
          "check idx sku actions"
          "key key key key"
          "test test test test";
        gap: 8px 10px;
        padding: 12px 10px;
        width: 100%;
        box-sizing: border-box;
        border-bottom: 1px solid var(--border);
        align-items: center;
      }
      table.keys tr:last-child { border-bottom: none; }
      table.keys th, table.keys td {
        display: block;
        width: auto !important;
        max-width: none !important;
        min-width: 0;
        padding: 0;
        border-bottom: none;
        vertical-align: middle;
      }
      table.keys td.key-check { grid-area: check; }
      table.keys td.key-idx {
        grid-area: idx;
        font-weight: 700;
        white-space: nowrap;
      }
      table.keys td.key-sku {
        grid-area: sku;
        color: var(--muted);
        font-size: 0.78rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }
      table.keys td.key-main {
        grid-area: key;
        display: block;
        min-width: 0;
      }
      table.keys td.key-main .key-main-row {
        gap: 5px;
      }
      table.keys td.key-main .key-memo,
      table.keys td.key-main .relay-key-memo {
        flex: 0 0 calc(5.2rem - 30px);
        width: calc(5.2rem - 30px);
        max-width: calc(5.2rem - 30px);
        height: 28px;
        min-height: 28px;
        max-height: 28px;
      }
      /* 中转 / 万家：Key、复制、备忘分列的移动端卡片 */
      #relayKeysWrap table.keys tr,
      #wanjiaKeysWrap table.keys tr {
        grid-template-columns: auto auto 1fr auto;
        grid-template-areas:
          "check idx sku actions"
          "key key key key"
          "copy memo expire expire";
      }
      #relayKeysWrap table.keys td.key-val,
      #wanjiaKeysWrap table.keys td.key-val {
        grid-area: key;
        min-width: 0;
      }
      #relayKeysWrap table.keys td.key-val code,
      #wanjiaKeysWrap table.keys td.key-val code {
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
        word-break: break-all;
        overflow-wrap: anywhere;
      }
      #relayKeysWrap table.keys td.key-copy-cell,
      #wanjiaKeysWrap table.keys td.key-copy-cell {
        grid-area: copy;
        width: auto !important;
        text-align: left;
      }
      #relayKeysWrap table.keys td.key-memo-cell,
      #wanjiaKeysWrap table.keys td.key-memo-cell {
        grid-area: memo;
        width: auto !important;
      }
      #relayKeysWrap table.keys td.key-memo-cell .relay-key-memo,
      #wanjiaKeysWrap table.keys td.key-memo-cell .relay-key-memo {
        width: 100%;
        max-width: none;
        height: 28px;
        min-height: 28px;
      }
      #relayKeysWrap table.keys td.key-expire,
      #wanjiaKeysWrap table.keys td.key-expire {
        grid-area: expire;
        width: auto !important;
        white-space: normal;
      }
      #relayKeysWrap table.keys td.key-ops,
      #wanjiaKeysWrap table.keys td.key-ops {
        grid-area: actions;
        justify-self: end;
        transform: none;
      }
      table.keys td.test-cell {
        grid-area: test;
        min-width: 0;
        max-width: none;
      }
      #keysWrap table.keys td.key-ops {
        grid-area: actions;
        justify-self: end;
        transform: translateX(-70px);
      }
      table.keys:not(:has(th:nth-child(6))) td.key-ops {
        grid-area: actions;
        justify-self: end;
      }
      table.keys td.key-ops .key-actions {
        flex-wrap: nowrap;
        gap: 6px;
      }
      .key-copy {
        align-items: flex-start;
        gap: 8px;
      }
      .key-copy code {
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
        word-break: break-all;
        overflow-wrap: anywhere;
        font-size: 0.74rem;
        line-height: 1.4;
        padding: 8px 10px;
      }
      .test-last {
        flex: 1 1 auto;
        min-width: 0;
        max-width: 9.5rem;
        font-size: 0.66rem;
      }
    }
    .qty { max-width: 120px; }
    .buy-sku-tabs {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin: 0 0 10px;
    }
    .buy-sku-tabs button {
      margin: 0;
      width: 70px;
      min-width: 70px;
      max-width: 70px;
      box-sizing: border-box;
      background: var(--surface-2);
      color: var(--text);
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 6px 4px;
      font-size: 0.82rem;
      font-weight: 700;
      line-height: 1.25;
      text-align: center;
      overflow: hidden;
    }
    .buy-sku-tabs button:hover {
      border-color: var(--accent);
      background: rgba(61, 156, 240, 0.16);
    }
    .buy-sku-tabs button.active {
      background: var(--accent);
      border-color: var(--accent);
      color: #fff;
      box-shadow: 0 0 10px rgba(61, 156, 240, 0.22);
    }
    .buy-sku-tabs button .sub {
      display: block;
      margin-top: 2px;
      font-size: 0.68rem;
      font-weight: 500;
      color: var(--muted);
      opacity: 1;
      line-height: 1.2;
      word-break: break-all;
    }
    .buy-sku-tabs button.active .sub,
    .buy-channel-tabs button.active .sub {
      color: rgba(255, 255, 255, 0.94);
      font-weight: 600;
    }
    .buy-channel-tabs button .sub {
      display: block;
      margin-top: 2px;
      font-size: 0.68rem;
      font-weight: 600;
      color: var(--muted);
    }
    .buy-channel-tabs {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 6px;
      margin: 0 0 14px;
    }
    .buy-channel-tabs button {
      margin: 0;
      background: var(--surface-2);
      color: var(--text);
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 10px 6px;
      font-size: 0.78rem;
      font-weight: 700;
      line-height: 1.25;
    }
    .buy-channel-tabs button:hover {
      border-color: var(--ok);
      background: rgba(34, 197, 94, 0.12);
    }
    .buy-channel-tabs button.active {
      background: linear-gradient(135deg, var(--brand-bright), var(--ok));
      border-color: var(--brand-bright);
      color: #fff;
      box-shadow: 0 0 14px rgba(34, 197, 94, 0.28);
    }
    .buy-channel-tabs button:not(.active) {
      opacity: 0.92;
    }
    .buy-channel-hint {
      margin: 0 0 10px;
      font-size: 0.82rem;
      color: var(--muted);
    }
    .key-mode-tabs {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
      margin-bottom: 2px;
    }
    .key-mode-tabs:not(.action-tabs) {
      grid-template-columns: repeat(5, minmax(0, 1fr));
    }
    .action-tabs-scroll-wrap {
      position: relative;
      margin-bottom: 2px;
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 6px 8px;
      background: var(--surface);
      box-sizing: border-box;
    }
    .gift-balance-float {
      position: relative;
      left: auto;
      bottom: auto;
      z-index: 1;
      display: flex;
      align-items: stretch;
      gap: 8px;
      flex: 0 0 auto;
      margin-left: auto;
      max-width: min(260px, 36vw);
      min-width: 0;
      padding: 7px 10px 7px 8px;
      border-radius: 10px;
      background: linear-gradient(135deg, rgba(240, 180, 41, 0.16), rgba(240, 180, 41, 0.08));
      border: 1px solid rgba(240, 180, 41, 0.38);
      box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
      backdrop-filter: blur(6px);
      -webkit-backdrop-filter: blur(6px);
      pointer-events: none;
    }
    .gift-balance-float.hidden { display: none; }
    .gift-balance-float-tag {
      flex: 0 0 auto;
      align-self: center;
      font-size: 0.62rem;
      font-weight: 700;
      line-height: 1;
      color: #1a1408;
      background: #f0b429;
      border-radius: 999px;
      padding: 4px 7px;
      letter-spacing: 0.04em;
    }
    .gift-balance-float-viewport {
      flex: 1;
      min-width: 0;
      height: 1.35em;
      overflow: hidden;
      mask-image: linear-gradient(180deg, transparent 0, #000 18%, #000 82%, transparent 100%);
      -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 18%, #000 82%, transparent 100%);
    }
    .gift-balance-float-track {
      display: flex;
      flex-direction: column;
      will-change: transform;
    }
    .gift-balance-float-line {
      display: block;
      height: 1.35em;
      line-height: 1.35em;
      font-size: 0.74rem;
      color: var(--text);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .gift-balance-float-line strong {
      font-weight: 700;
      color: var(--text);
    }
    .gift-balance-float-line .gift {
      color: #f0b429;
      font-weight: 700;
    }
    .action-tabs {
      display: flex;
      flex-wrap: nowrap;
      align-items: center;
      gap: 4px;
      margin-bottom: 0;
      overflow-x: auto;
      overflow-y: hidden;
      scroll-behavior: smooth;
      -webkit-overflow-scrolling: touch;
      scrollbar-width: none;
      cursor: grab;
      touch-action: pan-x;
      padding: 0;
    }
    .action-tabs::-webkit-scrollbar { display: none; height: 0; }
    .action-tabs.is-dragging {
      cursor: grabbing;
      scroll-behavior: auto;
      user-select: none;
    }
    .action-tabs button {
      flex: 0 0 auto;
      min-width: 2.75rem;
      font-size: 0.68rem;
      padding: 4px 10px;
      border-width: 1px;
      border-radius: 7px;
      line-height: 1.15;
      letter-spacing: 0;
      box-shadow: none;
      position: relative;
      white-space: nowrap;
    }
    .action-tabs .badge-unread {
      position: absolute;
      top: 2px;
      right: 2px;
      min-width: 14px;
      height: 14px;
      padding: 0 3px;
      border-radius: 999px;
      background: #e25555;
      color: #fff;
      font-size: 0.58rem;
      font-weight: 700;
      line-height: 14px;
      text-align: center;
    }
    .card.action-card {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 1px;
      margin-bottom: 2px;
    }
    .action-card {
      position: relative;
    }
    .action-card .action-tabs {
      margin-bottom: 0;
    }
    .action-panels-shell {
      position: relative;
      margin-top: 0;
      box-sizing: border-box;
      padding: 14px 12px;
      overflow: visible;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 10px;
      outline: none;
      box-shadow: none;
    }
    .msg-layout {
      display: grid;
      grid-template-columns: minmax(140px, 34%) 1fr;
      gap: 12px;
      min-height: 360px;
    }
    .msg-list {
      border: 1px solid var(--border);
      border-radius: 10px;
      background: var(--surface);
      max-height: 420px;
      overflow: auto;
    }
    .msg-item {
      display: block;
      width: 100%;
      text-align: left;
      margin: 0;
      border: 0;
      border-bottom: 1px solid var(--border);
      border-radius: 0;
      background: transparent;
      color: var(--text);
      padding: 10px 12px;
      cursor: pointer;
    }
    .msg-item:hover { background: rgba(61, 156, 240, 0.08); }
    .msg-item.active { background: rgba(61, 156, 240, 0.16); }
    .msg-item .t {
      font-size: 0.85rem;
      font-weight: 650;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .msg-item .m {
      margin-top: 3px;
      font-size: 0.72rem;
      color: var(--muted);
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
      align-items: center;
    }
    .msg-item .dot {
      display: inline-block;
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: #e25555;
    }
    .msg-pane {
      border: 1px solid var(--border);
      border-radius: 10px;
      background: var(--surface);
      display: flex;
      flex-direction: column;
      min-height: 360px;
      max-height: 420px;
    }
    .msg-pane-head {
      padding: 10px 12px;
      border-bottom: 1px solid var(--border);
      font-size: 0.88rem;
      font-weight: 650;
    }
    .msg-thread {
      flex: 1;
      overflow: auto;
      padding: 12px;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    .msg-bubble {
      max-width: 88%;
      padding: 8px 10px;
      border-radius: 10px;
      font-size: 0.85rem;
      line-height: 1.45;
      white-space: pre-wrap;
      word-break: break-word;
    }
    .msg-bubble.user {
      align-self: flex-end;
      background: rgba(61, 156, 240, 0.18);
      border: 1px solid rgba(61, 156, 240, 0.35);
    }
    .msg-bubble.admin {
      align-self: flex-start;
      background: rgba(var(--brand-rgb), 0.12);
      border: 1px solid rgba(var(--brand-rgb), 0.35);
    }
    .msg-bubble .who {
      font-size: 0.7rem;
      color: var(--muted);
      margin-bottom: 3px;
    }
    .msg-compose {
      border-top: 1px solid var(--border);
      padding: 10px;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    /* ----- online customer service (drawer + float) ----- */
    .cs-float-btn {
      position: fixed;
      z-index: 80;
      left: calc(50% + min(calc(var(--main-max) / 2), calc(50vw - var(--main-pad-x))) + 12px);
      top: 50%;
      transform: translateY(-50%);
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 10px 14px;
      border-radius: 999px;
      border: 1px solid #b91c1c;
      background: #dc2626;
      color: #ffffff !important;
      font-size: 0.88rem;
      font-weight: 650;
      box-shadow: 0 8px 28px rgba(220, 38, 38, 0.4);
      cursor: pointer;
      transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
      white-space: nowrap;
    }
    .cs-float-btn,
    .cs-float-btn span:not(.cs-float-badge) {
      color: #ffffff !important;
    }
    .cs-float-btn:hover {
      background: #b91c1c;
      transform: translateY(calc(-50% - 2px));
      box-shadow: 0 12px 32px rgba(185, 28, 28, 0.45);
    }
    .cs-float-badge {
      min-width: 18px;
      height: 18px;
      padding: 0 5px;
      border-radius: 999px;
      background: #e25555;
      color: #fff;
      font-size: 0.68rem;
      font-weight: 700;
      line-height: 18px;
      text-align: center;
    }
    .cs-drawer-backdrop {
      position: fixed;
      inset: 0;
      z-index: 890;
      background: rgba(0, 0, 0, 0.45);
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.2s ease;
    }
    .cs-drawer-backdrop.open { opacity: 1; pointer-events: auto; }
    .cs-drawer {
      position: fixed;
      top: 0;
      right: 0;
      z-index: 900;
      width: min(400px, 100vw);
      height: 100%;
      display: flex;
      flex-direction: column;
      overflow: hidden;
      background: var(--surface, #121820);
      border-left: 1px solid var(--border, rgba(255,255,255,0.08));
      box-shadow: -12px 0 40px rgba(0, 0, 0, 0.35);
      transform: translateX(105%);
      transition: transform 0.25s ease;
    }
    .cs-drawer.open { transform: translateX(0); }
    .cs-drawer-head {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 14px 16px;
      border-bottom: 1px solid var(--border, rgba(255,255,255,0.08));
      background: rgba(61, 156, 240, 0.08);
    }
    .cs-drawer-head h3 { margin: 0; font-size: 1rem; flex: 1; }
    .cs-drawer-head .meta { font-size: 0.72rem; color: var(--muted); }
    .cs-drawer-close {
      border: none;
      background: transparent;
      color: var(--muted);
      font-size: 1.25rem;
      cursor: pointer;
      padding: 4px 8px;
      line-height: 1;
    }
    .cs-drawer-thread {
      flex: 1 1 auto;
      min-height: 0;
      overflow-y: auto;
      padding: 12px;
      display: flex;
      flex-direction: column;
      gap: 10px;
    }
    .cs-drawer-compose {
      flex-shrink: 0;
      border-top: 1px solid var(--border, rgba(255,255,255,0.08));
      padding: 10px 12px 14px;
      display: flex;
      flex-direction: column;
      gap: 8px;
      background: var(--surface, #121820);
    }
    .cs-drawer-compose textarea {
      min-height: 72px;
      resize: vertical;
      width: 100%;
      margin: 0;
    }
    @media (max-width: 960px) {
      .cs-float-btn {
        left: auto;
        right: 14px;
        bottom: 18px;
        top: auto;
        transform: none;
      }
      .cs-float-btn:hover { transform: translateY(-2px); }
    }
    .archive-inner-tabs {
      display: flex;
      gap: 8px;
      margin-bottom: 12px;
      flex-wrap: wrap;
    }
    .archive-inner-tab {
      padding: 8px 14px;
      border-radius: 999px;
      border: 1px solid var(--border, rgba(255,255,255,0.12));
      background: transparent;
      color: var(--text);
      cursor: pointer;
      font-size: 0.86rem;
    }
    .archive-inner-tab.active {
      background: rgba(61, 156, 240, 0.18);
      border-color: rgba(61, 156, 240, 0.45);
      color: #7ec4ff;
    }
    .msg-compose textarea {
      min-height: 64px;
      margin: 0;
      width: 100%;
    }
    .msg-compose .row {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      align-items: center;
    }
    .msg-new-kinds {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin: 0 0 12px;
    }
    .msg-new-kinds button { margin: 0; flex: 1 1 30%; }
    @media (max-width: 720px) {
      .msg-layout { grid-template-columns: 1fr; }
      .msg-list { max-height: 180px; }
      .msg-pane { max-height: none; min-height: 300px; }
    }
    .profile-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 10px;
      margin: 12px 0 14px;
    }
    .profile-key-grid {
      grid-template-columns: repeat(3, 1fr);
    }
    @media (max-width: 720px) {
      .profile-key-grid { grid-template-columns: 1fr; }
    }
    .profile-stat {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 14px 12px;
    }
    .profile-stat .n {
      font-size: 1.35rem;
      font-weight: 800;
      color: var(--ok);
      letter-spacing: -0.02em;
    }
    .profile-stat .n.flower { color: #ff6b6b; }
    .profile-stat .l {
      font-size: 0.75rem;
      color: var(--muted);
      margin-top: 4px;
    }
    .profile-inner-tabs {
      display: flex;
      gap: 8px;
      margin-bottom: 12px;
      flex-wrap: wrap;
    }
    .profile-inner-tab {
      margin: 0;
      padding: 7px 14px;
      border-radius: 999px;
      border: 1px solid var(--border);
      background: var(--surface);
      color: var(--muted);
      font-size: 0.82rem;
      cursor: pointer;
    }
    .profile-inner-tab.active {
      color: var(--text);
      border-color: rgba(61, 156, 240, 0.55);
      background: rgba(61, 156, 240, 0.12);
    }
    .profile-orders-wrap {
      overflow-x: auto;
      margin-top: 4px;
    }
    table.profile-orders {
      width: 100%;
      border-collapse: collapse;
      font-size: 0.8rem;
      min-width: 520px;
    }
    table.profile-orders th,
    table.profile-orders td {
      text-align: left;
      padding: 9px 6px;
      border-bottom: 1px solid var(--border);
      vertical-align: top;
    }
    table.profile-orders th {
      color: var(--muted);
      font-weight: 500;
      font-size: 0.74rem;
      white-space: nowrap;
    }
    table.profile-orders .order-kind {
      white-space: nowrap;
      font-size: 0.76rem;
    }
    table.profile-orders .order-keys {
      font-size: 0.74rem;
      line-height: 1.45;
      color: var(--muted);
      word-break: break-all;
    }
    table.profile-orders .order-total {
      font-weight: 600;
      white-space: nowrap;
    }
    .archive-filters {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin-bottom: 10px;
    }
    .archive-chip {
      margin: 0;
      padding: 5px 11px;
      border-radius: 999px;
      border: 1px solid var(--border);
      background: var(--surface);
      color: var(--muted);
      font-size: 0.76rem;
      cursor: pointer;
    }
    .archive-chip.active {
      color: var(--text);
      border-color: rgba(61, 156, 240, 0.55);
      background: rgba(61, 156, 240, 0.12);
    }
    .archive-masonry {
      column-count: 2;
      column-gap: 10px;
    }
    @media (min-width: 900px) {
      .archive-masonry { column-count: 3; }
    }
    .archive-card {
      break-inside: avoid;
      margin: 0 0 10px;
      border: 1px solid var(--border);
      border-radius: 10px;
      overflow: hidden;
      background: var(--surface);
      cursor: pointer;
      transition: border-color 0.15s ease, transform 0.15s ease;
    }
    .archive-card:hover {
      border-color: rgba(61, 156, 240, 0.45);
    }
    .archive-card:focus-visible {
      outline: 2px solid rgba(61, 156, 240, 0.65);
      outline-offset: 2px;
    }
    .archive-detail-modal {
      position: fixed;
      inset: 0;
      z-index: 1100;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 16px;
    }
    .archive-detail-modal.hidden { display: none; }
    .archive-detail-backdrop {
      position: absolute;
      inset: 0;
      border: 0;
      padding: 0;
      margin: 0;
      background: rgba(0, 0, 0, 0.55);
      cursor: pointer;
    }
    .archive-detail-box {
      position: relative;
      z-index: 1;
      width: min(720px, 100%);
      max-height: min(88vh, 900px);
      overflow: auto;
      background: var(--card);
      color: var(--text);
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 16px 16px 18px;
      box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
    }
    .archive-detail-head {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 12px;
      margin-bottom: 8px;
    }
    .archive-detail-head h3 {
      margin: 0;
      font-size: 1.05rem;
      line-height: 1.35;
    }
    .archive-detail-meta {
      margin: 0 0 12px;
      font-size: 0.8rem;
      color: var(--muted);
    }
    .archive-detail-body {
      line-height: 1.65;
      font-size: 0.92rem;
      word-break: break-word;
    }
    .archive-detail-body p {
      margin: 0 0 0.75em;
    }
    .archive-detail-body p:last-child {
      margin-bottom: 0;
    }
    .archive-detail-body img {
      max-width: 100%;
      height: auto;
      border-radius: 8px;
      margin: 8px 0;
      display: block;
    }
    .archive-card img {
      display: block;
      width: 100%;
      height: auto;
      background: #0a0e14;
    }
    .archive-card-body {
      padding: 10px 11px 11px;
    }
    .archive-card-meta {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin-bottom: 6px;
      font-size: 0.68rem;
      color: var(--muted);
    }
    .archive-card-meta .cat {
      color: var(--ok);
      font-weight: 650;
    }
    .archive-card-text {
      font-size: 0.8rem;
      line-height: 1.45;
      white-space: pre-wrap;
      word-break: break-word;
    }
    .archive-tags {
      display: flex;
      flex-wrap: wrap;
      gap: 5px;
      margin-top: 8px;
    }
    .archive-tag {
      font-size: 0.68rem;
      padding: 2px 7px;
      border-radius: 999px;
      background: rgba(61, 156, 240, 0.1);
      color: #7eb8e8;
      border: 1px solid rgba(61, 156, 240, 0.22);
    }

    .share-editor {
      min-height: 220px;
      max-height: 480px;
      overflow: auto;
      padding: 12px 14px;
      border: 1px solid var(--border);
      border-radius: 10px;
      background: var(--input-bg);
      color: var(--text);
      line-height: 1.6;
      font-size: 0.92rem;
      margin-bottom: 10px;
    }
    .share-editor:empty:before {
      content: attr(data-placeholder);
      color: var(--muted);
      pointer-events: none;
    }
    .share-editor:focus {
      outline: 1px solid var(--accent);
      border-color: var(--accent);
    }
    .share-editor img {
      max-width: min(100%, 420px);
      max-height: 320px;
      border-radius: 8px;
      display: block;
      margin: 10px 0;
      object-fit: contain;
      background: var(--surface-2);
    }
    .share-editor-toolbar {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      align-items: center;
      margin: 0 0 8px;
    }
    .share-editor-toolbar button { margin: 0; padding: 7px 12px; font-size: 0.8rem; }
    .archive-card-title {
      font-weight: 700;
      font-size: 0.92rem;
      margin: 0 0 6px;
      line-height: 1.35;
      color: var(--text);
    }
    .archive-share-box {
      border: 1px dashed var(--border);
      border-radius: 10px;
      padding: 12px;
      margin-bottom: 12px;
      background: rgba(255, 255, 255, 0.02);
    }
    .archive-share-preview {
      margin-top: 8px;
      max-height: 160px;
      overflow: hidden;
      border-radius: 8px;
      border: 1px solid var(--border);
    }
    .archive-share-preview img {
      display: block;
      width: 100%;
      height: auto;
      max-height: 160px;
      object-fit: cover;
    }


    .share-my-reject-note {
      margin-top: 8px;
      padding: 8px 10px;
      border-radius: 8px;
      background: rgba(220,53,69,.08);
      color: var(--text);
      font-size: 0.82rem;
      line-height: 1.45;
    }
    .share-my-list { display: flex; flex-direction: column; gap: 10px; }
    .share-my-item {
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 10px 12px;
      background: var(--card-alt, rgba(255,255,255,.02));
    }
    .share-my-item-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
    .share-my-status { font-size: 0.78rem; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
    .share-my-status.pending { background: rgba(255,193,7,.15); color: #b8860b; }
    .share-my-status.published { background: rgba(40,167,69,.12); color: #1e7e34; }
    .share-my-status.rejected { background: rgba(220,53,69,.12); color: #c82333; }
    .share-my-status.ignored { background: rgba(108,117,125,.12); color: #6c757d; }
    .share-my-status.hidden { background: rgba(108,117,125,.15); color: #6c757d; }
    .archive-status-pending {
      font-size: 0.68rem;
      color: #e8b86d;
      margin-top: 4px;
    }
    .bounty-board-wrap {
      margin-top: 2px;
      display: grid;
      gap: 14px;
    }
    .bounty-hero {
      position: relative;
      overflow: hidden;
      padding: 16px 16px 14px;
      border-radius: 14px;
      border: 1px solid rgba(240, 180, 41, 0.28);
      background:
        radial-gradient(120% 80% at 100% 0%, rgba(240, 180, 41, 0.16) 0%, transparent 55%),
        radial-gradient(90% 70% at 0% 100%, rgba(var(--brand-rgb), 0.08) 0%, transparent 50%),
        linear-gradient(145deg, rgba(24, 28, 36, 0.96), rgba(16, 20, 28, 0.98));
      box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
    }
    .bounty-hero::before {
      content: "赏";
      position: absolute;
      top: -8px;
      right: 10px;
      font-size: 4.2rem;
      font-weight: 900;
      line-height: 1;
      color: rgba(240, 180, 41, 0.08);
      pointer-events: none;
      user-select: none;
    }
    .bounty-hero-kicker {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      margin-bottom: 8px;
      padding: 3px 10px;
      border-radius: 999px;
      border: 1px solid rgba(240, 180, 41, 0.35);
      background: rgba(240, 180, 41, 0.1);
      color: #f0b429;
      font-size: 0.68rem;
      font-weight: 700;
      letter-spacing: 0.06em;
    }
    .bounty-intro-title {
      margin: 0 0 8px;
      font-size: 1.12rem;
      font-weight: 800;
      color: var(--text);
      letter-spacing: 0.02em;
      line-height: 1.35;
    }
    .bounty-intro-sub {
      margin: 0 0 10px;
      color: rgba(201, 214, 228, 0.92);
      font-size: 0.84rem;
      line-height: 1.65;
    }
    .bounty-intro-rules {
      margin: 0;
      padding: 10px 12px 10px 14px;
      border-radius: 10px;
      border: 1px solid rgba(255, 255, 255, 0.06);
      border-left: 3px solid rgba(240, 180, 41, 0.65);
      background: rgba(0, 0, 0, 0.18);
      color: var(--muted);
      font-size: 0.78rem;
      line-height: 1.6;
      white-space: pre-wrap;
    }
    .bounty-section-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      margin: 2px 0 2px;
    }
    .bounty-section-title {
      margin: 0;
      font-size: 0.9rem;
      font-weight: 700;
      color: var(--text);
      letter-spacing: 0.02em;
    }
    .bounty-section-count {
      font-size: 0.72rem;
      color: var(--muted);
      padding: 2px 8px;
      border-radius: 999px;
      border: 1px solid var(--border);
      background: var(--surface);
      white-space: nowrap;
    }
    .bounty-feed-list {
      display: grid;
      gap: 10px;
      max-height: min(42vh, 360px);
      overflow: auto;
      padding: 2px 4px 2px 2px;
      scrollbar-width: thin;
    }
    .bounty-feed-item {
      display: grid;
      grid-template-columns: auto 1fr;
      gap: 10px;
      padding: 12px 12px 11px;
      border-radius: 12px;
      border: 1px solid var(--border);
      background:
        linear-gradient(135deg, rgba(240, 180, 41, 0.05) 0%, transparent 42%),
        var(--card);
      transition: border-color 0.18s ease, transform 0.18s ease;
    }
    .bounty-feed-item:hover {
      border-color: rgba(240, 180, 41, 0.28);
      transform: translateY(-1px);
    }
    .bounty-feed-avatar {
      width: 36px;
      height: 36px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 0.82rem;
      font-weight: 800;
      color: #3a2200;
      background: linear-gradient(145deg, #ffe566, #f0b429);
      box-shadow: 0 0 0 2px rgba(240, 180, 41, 0.18);
      flex-shrink: 0;
    }
    .bounty-feed-main {
      min-width: 0;
    }
    .bounty-feed-top {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 6px 8px;
      margin-bottom: 6px;
    }
    .bounty-feed-meta {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 6px;
      font-size: 0.72rem;
      color: var(--muted);
    }
    .bounty-feed-meta .user {
      color: var(--text);
      font-weight: 700;
      font-size: 0.8rem;
    }
    .bounty-cat-pill {
      display: inline-flex;
      align-items: center;
      padding: 2px 8px;
      border-radius: 999px;
      font-size: 0.68rem;
      font-weight: 650;
      line-height: 1.35;
      border: 1px solid transparent;
    }
    .bounty-cat-pill.cat-competitor {
      color: #7eb8e8;
      background: rgba(61, 156, 240, 0.12);
      border-color: rgba(61, 156, 240, 0.28);
    }
    .bounty-cat-pill.cat-supply {
      color: var(--brand-bright);
      background: rgba(var(--brand-rgb), 0.12);
      border-color: rgba(var(--brand-rgb), 0.28);
    }
    .bounty-cat-pill.cat-suggestion {
      color: #f0b429;
      background: rgba(240, 180, 41, 0.12);
      border-color: rgba(240, 180, 41, 0.28);
    }
    .bounty-cat-pill.cat-other {
      color: #c9b8e8;
      background: rgba(168, 140, 220, 0.12);
      border-color: rgba(168, 140, 220, 0.28);
    }
    .bounty-feed-reward {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      margin-left: auto;
      padding: 3px 9px;
      border-radius: 999px;
      color: #3a2200;
      background: linear-gradient(135deg, #ffe566, #f0b429);
      font-size: 0.7rem;
      font-weight: 800;
      white-space: nowrap;
      box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset;
    }
    .bounty-feed-reward::before {
      content: "🎁";
      font-size: 0.72rem;
      line-height: 1;
    }
    .bounty-feed-title {
      margin: 0 0 4px;
      font-size: 0.84rem;
      font-weight: 700;
      color: var(--text);
      line-height: 1.4;
      word-break: break-word;
    }
    .bounty-feed-body {
      margin: 0;
      font-size: 0.8rem;
      color: rgba(201, 214, 228, 0.95);
      line-height: 1.55;
      display: -webkit-box;
      -webkit-line-clamp: 4;
      -webkit-box-orient: vertical;
      overflow: hidden;
      word-break: break-word;
    }
    .bounty-empty {
      padding: 22px 14px;
      border-radius: 12px;
      border: 1px dashed var(--border);
      background: rgba(255, 255, 255, 0.02);
      text-align: center;
      color: var(--muted);
      font-size: 0.82rem;
      line-height: 1.55;
    }
    .bounty-empty strong {
      display: block;
      margin-bottom: 4px;
      color: var(--text);
      font-size: 0.88rem;
    }
    .bounty-submit-panel {
      padding: 14px 14px 12px;
      border-radius: 12px;
      border: 1px dashed rgba(240, 180, 41, 0.28);
      background:
        linear-gradient(180deg, rgba(240, 180, 41, 0.04), transparent 38%),
        var(--surface);
    }
    .bounty-submit-head {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 10px;
      margin-bottom: 10px;
    }
    .bounty-submit-panel h4 {
      margin: 0 0 4px;
      font-size: 0.94rem;
      color: var(--text);
      font-weight: 700;
    }
    .bounty-submit-panel .hint {
      margin: 0;
      font-size: 0.78rem;
      line-height: 1.5;
    }
    .bounty-submit-badge {
      flex-shrink: 0;
      padding: 4px 9px;
      border-radius: 999px;
      font-size: 0.66rem;
      font-weight: 700;
      color: var(--brand-bright);
      border: 1px solid rgba(var(--brand-rgb), 0.35);
      background: rgba(var(--brand-rgb), 0.1);
      white-space: nowrap;
    }
    .bounty-form-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
    }
    @media (max-width: 560px) {
      .bounty-form-grid { grid-template-columns: 1fr; }
      .bounty-feed-reward { margin-left: 0; }
    }
    .bounty-submit-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-top: 10px;
      align-items: center;
    }
    .bounty-submit-actions button { margin: 0; }
    #btnBountySubmit {
      background: linear-gradient(135deg, #f0b429, #d97706);
      color: #2a1800;
      font-weight: 700;
      border: none;
    }
    .bounty-my-section {
      display: grid;
      gap: 8px;
    }
    .bounty-my-head {
      margin: 0;
      font-size: 0.88rem;
      font-weight: 700;
      color: var(--text);
    }
    .bounty-my-list {
      display: grid;
      gap: 8px;
    }
    .bounty-my-item {
      padding: 10px 12px;
      border-radius: 10px;
      border: 1px solid var(--border);
      background: var(--card);
      font-size: 0.78rem;
      line-height: 1.45;
    }
    .bounty-my-top {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 6px;
      margin-bottom: 5px;
    }
    .bounty-status-pill {
      display: inline-flex;
      align-items: center;
      padding: 2px 8px;
      border-radius: 999px;
      font-size: 0.66rem;
      font-weight: 700;
      border: 1px solid transparent;
    }
    .bounty-status-pill.st-pending {
      color: #e8b86d;
      background: rgba(232, 184, 109, 0.12);
      border-color: rgba(232, 184, 109, 0.28);
    }
    .bounty-status-pill.st-accepted {
      color: var(--brand-bright);
      background: rgba(var(--brand-rgb), 0.12);
      border-color: rgba(var(--brand-rgb), 0.28);
    }
    .bounty-status-pill.st-ignored {
      color: #9aa0a6;
      background: rgba(108,117,125,.12);
    }
    .bounty-status-pill.st-rejected {
      color: #ff8f8f;
      background: rgba(255, 107, 107, 0.12);
      border-color: rgba(255, 107, 107, 0.28);
    }
    .bounty-my-meta {
      color: var(--muted);
      font-size: 0.72rem;
    }
    .bounty-my-body {
      color: var(--text);
      font-size: 0.78rem;
      line-height: 1.5;
      word-break: break-word;
    }
    .bounty-my-extra {
      margin-top: 6px;
      padding-top: 6px;
      border-top: 1px dashed var(--border);
      font-size: 0.74rem;
    }
    .bounty-my-extra.ok { color: var(--ok); }
    .bounty-my-extra.muted { color: var(--muted); }
    .flower-row {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      align-items: center;
      margin-top: 8px;
    }
    .flower-dots span {
      display: inline-block;
      width: 18px;
      height: 18px;
      border-radius: 50%;
      margin-right: 4px;
      background: rgba(255, 107, 107, 0.25);
      border: 1px solid rgba(255, 107, 107, 0.5);
    }
    .flower-dots span.on {
      background: #ff6b6b;
      border-color: #ff8f8f;
      box-shadow: 0 0 10px rgba(255, 107, 107, 0.45);
    }
    @media (max-width: 560px) {
      .profile-grid { grid-template-columns: 1fr; }
      .action-tabs button { font-size: 0.65rem; padding: 4px 8px; }
      .site-header {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px 10px;
      }
      .brand-row {
        width: auto;
        max-width: min(46vw, 11rem);
        flex-direction: column;
        align-items: flex-end;
        gap: 6px;
      }
      .brand-row .slogan {
        max-width: 100%;
        font-size: 0.68rem;
        padding: 3px 8px;
        line-height: 1.25;
        text-align: right;
        white-space: normal;
      }
      .brand-row .theme-toggle {
        margin-left: 0 !important;
        padding: 5px 10px !important;
        font-size: 0.72rem !important;
      }
      .site-brand-stack {
        --brand-logo-h: 68px;
        column-gap: 10px;
        grid-template-rows: var(--brand-logo-h);
      }
      .site-brand-meta {
        height: var(--brand-logo-h);
      }
      .brand-intro-row {
        flex-wrap: wrap;
        white-space: normal;
      }
      .brand-intro-row .brand-tagline {
        font-size: 0.8rem;
      }
      .brand-intro-row .sub {
        font-size: 0.78rem;
      }
      .site-logo-img {
        --brand-logo-h: 78px;
        height: var(--brand-logo-h);
        max-width: calc(var(--brand-logo-h) * var(--brand-logo-ar));
      }
      .site-logo-mark { width: 42px; height: 42px; border-radius: 11px; }
      .site-logo-brand { font-size: 1.2rem; letter-spacing: 0.1em; }
      .site-logo-domain { font-size: 0.88rem; line-height: 1.36; }
    }
    .advantage-list {
      margin: 0;
      padding-left: 1.2em;
      color: var(--text);
      font-size: 0.92rem;
      line-height: 1.65;
    }
    .advantage-list li { margin-bottom: 10px; }
    .advantage-list li strong { color: var(--ok); }
    .key-mode-tabs:not(.action-tabs) {
      gap: 8px;
      margin-bottom: 2px;
    }
    .key-mode-tabs button {
      background: rgba(var(--brand-rgb), 0.12);
      color: var(--brand-bright);
      border: 2px solid rgba(var(--brand-rgb), 0.45);
      border-radius: 12px;
      padding: 14px 12px;
      font-size: 1rem;
      font-weight: 700;
      letter-spacing: 0.02em;
      box-shadow: 0 0 0 1px rgba(var(--brand-rgb), 0.08);
    }
    /* mimo中转站 / 官方 key 等主 Tab */
    .key-mode-tabs:not(.action-tabs) button {
      position: relative;
      border-width: 1px;
      border-radius: 10px;
      padding: 10px 4px;
      font-size: 0.92rem;
      font-weight: 700;
      letter-spacing: 0;
      box-shadow: none;
      line-height: 1.3;
      white-space: normal;
      text-align: center;
      word-break: break-word;
      min-height: 3.2rem;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 3px;
    }
    .key-mode-tabs:not(.action-tabs) button .tab-title {
      display: block;
      line-height: 1.25;
      font-size: 0.78rem;
    }
    .free-api-panel {
      border: 1px solid rgba(var(--brand-rgb), 0.35);
      border-radius: 12px;
      padding: 16px 18px;
      background: linear-gradient(165deg, rgba(20, 48, 36, 0.55), rgba(12, 24, 20, 0.85));
      margin-bottom: 2px;
    }
    .free-api-title {
      margin: 0 0 10px;
      font-size: 1.05rem;
      font-weight: 800;
      color: var(--brand-bright);
      letter-spacing: 0.06em;
    }
    .free-api-intro {
      margin: 0 0 12px;
      color: var(--text);
      font-size: 0.9rem;
      line-height: 1.7;
    }
    .free-api-intro code {
      color: #ffe08a;
      background: rgba(255, 224, 138, 0.08);
      padding: 1px 6px;
      border-radius: 4px;
    }
    .free-api-note {
      margin: 0 0 14px;
      padding: 10px 12px;
      border-left: 3px solid rgba(255, 193, 77, 0.75);
      background: rgba(255, 193, 77, 0.08);
      color: #f0d9a0;
      font-size: 0.86rem;
      line-height: 1.65;
      border-radius: 0 8px 8px 0;
    }
    .free-api-eligibility {
      display: flex;
      flex-wrap: wrap;
      gap: 10px 16px;
      align-items: center;
      margin: 0 0 14px;
      font-size: 0.88rem;
    }
    .free-api-eligibility .tag {
      display: inline-block;
      padding: 4px 10px;
      border-radius: 999px;
      font-weight: 700;
      font-size: 0.78rem;
    }
    .free-api-eligibility .tag.ok {
      background: rgba(var(--brand-rgb), 0.2);
      color: var(--brand-bright);
      border: 1px solid rgba(var(--brand-rgb), 0.45);
    }
    .free-api-eligibility .tag.no {
      background: rgba(226, 85, 85, 0.15);
      color: #ffb0b0;
      border: 1px solid rgba(226, 85, 85, 0.35);
    }
    .free-api-eligibility .tag.wait {
      background: rgba(255, 193, 77, 0.12);
      color: #ffe08a;
      border: 1px solid rgba(255, 193, 77, 0.35);
    }
    .free-api-claim-box {
      margin-top: 12px;
      padding-top: 12px;
      border-top: 1px dashed rgba(var(--brand-rgb), 0.25);
    }
    .free-api-claim-box .row-btns { margin-top: 10px; }
    #tabRelayKey,
    #tabWanjiaKey,
    #tabExclusiveKey,
    #tabOfficialKey,
    #tabPlanChannelKey,
    #tabFreeApi {
      min-width: 0;
      overflow: hidden;
      align-items: stretch;
    }
    .key-mode-tabs:not(.action-tabs) button .tab-stock-marquee-wrap {
      display: block;
      width: 100%;
      max-width: 100%;
      min-width: 0;
      overflow: hidden;
      mask-image: linear-gradient(90deg, transparent 0%, #000 8%, #000 92%, transparent 100%);
      -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 8%, #000 92%, transparent 100%);
    }
    .key-mode-tabs:not(.action-tabs) button .tab-stock-marquee {
      display: inline-flex;
      width: max-content;
      white-space: nowrap;
      animation: none;
    }
    .key-mode-tabs:not(.action-tabs) button.tab-stock-can-scroll:hover .tab-stock-marquee,
    .key-mode-tabs:not(.action-tabs) button.tab-stock-can-scroll.active .tab-stock-marquee {
      animation: relay-tab-stock-scroll 24s linear infinite;
    }
    .key-mode-tabs:not(.action-tabs) button .tab-stock-seq {
      display: inline-block;
      padding-right: 2em;
      font-size: inherit;
      font-weight: inherit;
      line-height: inherit;
      letter-spacing: inherit;
      color: inherit;
    }
    .official-reserve-row {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 8px 12px;
      margin: 0 0 10px;
    }
    .official-reserve-row .hint {
      margin: 0;
      flex: 1 1 12rem;
    }
    #btnOfficialKeyReserve {
      margin: 0;
      padding: 6px 14px;
      font-size: 0.82rem;
      background: var(--ok);
      color: #fff;
      border: 0;
      border-radius: 999px;
      box-shadow: 0 4px 12px rgba(var(--brand-rgb), 0.22);
      white-space: nowrap;
    }
    #btnOfficialKeyReserve:hover {
      background: var(--brand-bright);
      color: #fff;
    }
    #btnPlanKeyReserve {
      margin: 0;
      padding: 6px 14px;
      font-size: 0.82rem;
      background: var(--ok);
      color: #fff;
      border: 0;
      border-radius: 999px;
      box-shadow: 0 4px 12px rgba(var(--brand-rgb), 0.22);
      white-space: nowrap;
    }
    table.keys .row-btn.relay-indep-ch {
      background: var(--ok);
      color: #fff;
      border: 0;
      white-space: nowrap;
    }
    table.keys .row-btn.relay-indep-ch:hover {
      background: var(--brand-bright);
      color: #fff;
    }
    #btnPlanKeyReserve:hover {
      background: var(--brand-bright);
      color: #fff;
    }

    @keyframes relay-tab-stock-scroll {
      0% { transform: translateX(0); }
      100% { transform: translateX(-50%); }
    }
    .key-mode-tabs:not(.action-tabs) button .tab-stock {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 100%;
      min-height: 1.25rem;
      margin-top: 1px;
      font-size: 0.67rem;
      font-weight: 600;
      line-height: 1.25;
      letter-spacing: 0.01em;
      font-variant-numeric: tabular-nums;
      color: rgba(168, 232, 198, 0.95);
    }
    .key-mode-tabs:not(.action-tabs) button .tab-stock.hidden {
      display: none;
    }
    .key-mode-tabs:not(.action-tabs) button .tab-stock-line {
      display: inline-block;
      max-width: 100%;
      padding: 2px 8px;
      border-radius: 999px;
      background: rgba(0, 0, 0, 0.16);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      vertical-align: middle;
    }
    .key-mode-tabs:not(.action-tabs) button .tab-stock .stk-num {
      font-weight: 800;
      color: #c9ffe0;
    }
    .key-mode-tabs:not(.action-tabs) button.active .tab-stock {
      color: rgba(6, 36, 22, 0.82);
    }
    .key-mode-tabs:not(.action-tabs) button.active .tab-stock-line {
      background: rgba(6, 36, 22, 0.12);
    }
    .key-mode-tabs:not(.action-tabs) button.active .tab-stock .stk-num {
      color: #003318;
    }
    @media (max-width: 680px) {
      .key-mode-tabs:not(.action-tabs) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
      }
      .key-mode-tabs:not(.action-tabs) button {
        min-height: 3.7rem;
        padding: 10px 6px;
      }
      .key-mode-tabs:not(.action-tabs) button .tab-title {
        font-size: 0.8rem;
      }
      .key-mode-tabs:not(.action-tabs) button .tab-stock {
        font-size: 0.62rem;
      }
    }
    .key-mode-tabs button:hover {
      background: rgba(var(--brand-rgb), 0.22);
      border-color: var(--ok);
    }
    .key-mode-tabs button.active {
      background: var(--ok);
      color: #062416;
      border-color: #5dffb0;
      box-shadow: 0 0 18px rgba(var(--brand-rgb), 0.35);
    }
    .key-mode-tabs:not(.action-tabs) button.active {
      box-shadow: 0 0 10px rgba(var(--brand-rgb), 0.28);
    }
    .key-mode-tabs:not(.action-tabs) button .tab-line {
      display: block;
      line-height: 1.25;
    }
    .key-mode-tabs:not(.action-tabs) button .tab-line-sub {
      font-size: 0.78em;
      font-weight: 600;
      opacity: 0.92;
    }
    .tab-new-badge,
    .tab-key-count-badge {
      position: absolute;
      border-radius: 999px;
      background: #f0b429;
      color: #3a2200;
      font-size: 0.62rem;
      font-weight: 800;
      line-height: 18px;
      text-align: center;
      box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.12);
      text-shadow: none;
      margin: 0;
      white-space: nowrap;
      z-index: 1;
    }
    .tab-new-badge {
      top: 4px;
      left: 4px;
      right: auto;
      min-width: 18px;
      height: 18px;
      padding: 0 4px;
    }
    .tab-key-count-badge {
      left: auto;
      right: 2px;
      top: auto;
      bottom: 2px;
      min-width: 32px;
      min-height: 18px;
      height: auto;
      line-height: 1.15;
      padding: 4px 5px 2px;
      font-size: 0.62rem;
      letter-spacing: 0;
    }
    .key-mode-tabs button.active .tab-new-badge,
    .key-mode-tabs button.active .tab-key-count-badge {
      background: #ffe566;
      color: #062416;
      box-shadow: 0 0 0 2px rgba(6, 36, 22, 0.18);
    }

    .relay-stats {
      margin: 14px 0 4px;
      padding: 12px 14px;
      border-radius: 12px;
      border: 1px solid var(--border);
      background: rgba(12, 16, 22, 0.55);
    }
    .relay-stats-title {
      margin: 0 0 12px;
      font-size: 0.88rem;
      font-weight: 700;
      color: #c9d6e4;
    }
    .relay-stats-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      cursor: pointer;
      user-select: none;
      margin-bottom: 12px;
    }
    .relay-stats.collapsed > .relay-stats-head {
      margin-bottom: 0;
    }
    .relay-stats-head .relay-stats-title {
      margin: 0;
      flex: 1;
    }
    .relay-stats-toggle {
      font-size: 0.72rem;
      font-weight: 700;
      color: #9fd0ff;
      white-space: nowrap;
    }
    .relay-stats.collapsed > .relay-stats-body {
      display: none;
    }
    .relay-stats.collapsed .relay-stats-toggle::after {
      content: "展开";
    }
    .relay-stats:not(.collapsed) .relay-stats-toggle::after {
      content: "收起";
    }
    .relay-usage-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 10px;
    }
    @media (max-width: 720px) {
      .relay-usage-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    }
    .relay-usage-item {
      padding: 10px 12px;
      border-radius: 10px;
      border: 1px solid rgba(42, 53, 66, 0.9);
      background: rgba(8, 12, 18, 0.55);
    }
    .relay-usage-item .lbl {
      display: block;
      font-size: 0.72rem;
      color: var(--muted);
      margin-bottom: 4px;
    }
    .relay-usage-item .val {
      display: block;
      font-size: 0.95rem;
      font-weight: 700;
      color: var(--text);
      font-variant-numeric: tabular-nums;
      word-break: break-all;
    }
    .relay-usage-item.span2 { grid-column: span 2; }
    .relay-usage-item.is-toggle {
      cursor: pointer;
      transition: border-color .15s ease, background .15s ease;
    }
    .relay-usage-item.is-toggle:hover,
    .relay-usage-item.is-toggle.is-open {
      border-color: rgba(94, 160, 255, 0.45);
      background: rgba(14, 22, 34, 0.75);
    }
    .relay-usage-item .lbl-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      margin-bottom: 4px;
    }
    .relay-usage-item .lbl-row .lbl { margin-bottom: 0; }
    .relay-usage-item .bill-chevron {
      font-size: 0.72rem;
      color: #9ec1ff;
      white-space: nowrap;
      font-weight: 700;
    }
    .relay-bill-box {
      margin-top: 12px;
      padding: 16px 16px 14px;
      border-radius: 14px;
      border: 1px solid #c5d4e8;
      background: #ffffff;
      color: #0f172a;
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    }
    .relay-bill-box.hidden { display: none; }
    .relay-bill-title {
      margin: 0 0 14px;
      font-size: 1.02rem;
      font-weight: 800;
      color: #0f172a;
    }
    .relay-bill-steps {
      display: grid;
      gap: 10px;
    }
    .relay-bill-step {
      padding: 12px 12px;
      border-radius: 12px;
      background: #f1f5f9;
      border: 1px solid #dbe3ee;
    }
    .relay-bill-step.result {
      background: #eff6ff;
      border-color: #93c5fd;
    }
    .relay-bill-step .step-h {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      margin-bottom: 6px;
    }
    .relay-bill-step .step-tag {
      font-size: 0.72rem;
      font-weight: 800;
      color: #1d4ed8;
      background: #dbeafe;
      border-radius: 999px;
      padding: 2px 8px;
      white-space: nowrap;
    }
    .relay-bill-step .step-name {
      font-size: 0.9rem;
      font-weight: 800;
      color: #0f172a;
    }
    .relay-bill-step .step-num {
      font-size: 1.12rem;
      font-weight: 900;
      color: #0f172a;
      font-variant-numeric: tabular-nums;
      word-break: break-all;
      text-align: right;
    }
    .relay-bill-sub {
      margin: 8px 0 0;
      padding: 8px 10px;
      border-radius: 10px;
      background: #ffffff;
      border: 1px solid #e2e8f0;
      display: grid;
      gap: 6px;
    }
    .relay-bill-subrow {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      align-items: baseline;
      font-size: 0.86rem;
      font-variant-numeric: tabular-nums;
    }
    .relay-bill-subrow .k { color: #334155; font-weight: 650; }
    .relay-bill-subrow .v { color: #0f172a; font-weight: 800; word-break: break-all; text-align: right; }
    .relay-bill-subrow.hit .k { color: #047857; }
    .relay-bill-subrow.hit .v { color: #065f46; }
    .relay-bill-subrow.miss .k { color: #b45309; }
    .relay-bill-subrow.miss .v { color: #9a3412; }
    .relay-bill-bar {
      margin-top: 8px;
      height: 10px;
      border-radius: 999px;
      background: #e2e8f0;
      overflow: hidden;
      display: flex;
    }
    .relay-bill-bar > i {
      display: block;
      height: 100%;
    }
    .relay-bill-bar .hit { background: #10b981; }
    .relay-bill-bar .miss { background: #f59e0b; }
    .relay-bill-meta {
      margin-top: 6px;
      font-size: 0.78rem;
      color: #475569;
      font-weight: 600;
    }
    .relay-bill-eq {
      margin: 2px 0 0;
      font-size: 0.8rem;
      color: #1e3a8a;
      font-weight: 700;
      font-variant-numeric: tabular-nums;
    }
    .relay-bill-note {
      margin: 12px 0 0;
      font-size: 0.8rem;
      color: #334155;
      line-height: 1.5;
      font-weight: 600;
    }
    .relay-hourly {
      margin-top: 14px;
      padding: 12px 12px 10px;
      border-radius: 10px;
      border: 1px solid var(--border);
      background: var(--surface-2, rgba(255,255,255,0.03));
      overflow: visible;
      position: relative;
      z-index: 2;
    }
    .relay-hourly-head {
      display: flex;
      flex-wrap: wrap;
      align-items: baseline;
      justify-content: space-between;
      gap: 8px;
      margin-bottom: 8px;
    }
    .relay-hourly-title {
      margin: 0;
      font-size: 0.88rem;
      font-weight: 700;
    }
    .relay-hourly-meta {
      font-size: 0.72rem;
      color: var(--muted);
    }
    .relay-hourly-hover {
      min-height: 2.6em;
      margin: 0 0 8px;
      padding: 8px 10px;
      border-radius: 8px;
      border: 1px solid rgba(148, 163, 184, 0.28);
      background: rgba(15, 23, 42, 0.72);
      color: #e2e8f0;
      font-size: 0.74rem;
      line-height: 1.4;
      font-variant-numeric: tabular-nums;
    }
    .relay-hourly-hover.is-empty {
      color: var(--muted);
      background: rgba(0, 0, 0, 0.12);
      border-style: dashed;
    }
    .relay-hourly-scroll {
      width: 100%;
      overflow-x: auto;
      overflow-y: hidden;
      -webkit-overflow-scrolling: touch;
      border-radius: 8px;
      border: 1px solid rgba(148, 163, 184, 0.2);
      background: rgba(0, 0, 0, 0.18);
    }
    .relay-hourly-bars {
      display: flex;
      align-items: flex-end;
      gap: 4px;
      height: 248px;
      min-width: 100%;
      width: max-content;
      padding: 12px 8px 4px;
      box-sizing: border-box;
    }
    .relay-hourly-bar-wrap {
      flex: 0 0 22px;
      width: 22px;
      height: 100%;
      display: flex;
      flex-direction: column;
      justify-content: flex-end;
      align-items: center;
      position: relative;
      cursor: default;
    }
    .relay-hourly-bar-plot {
      flex: 1 1 auto;
      width: 100%;
      display: flex;
      flex-direction: column;
      justify-content: flex-end;
      align-items: center;
      min-height: 0;
    }
    .relay-hourly-bar {
      width: 100%;
      border-radius: 4px 4px 2px 2px;
      background: var(--brand-bright);
      min-height: 2px;
      transition: height 0.2s ease, background 0.15s ease;
      box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.25);
    }
    .relay-hourly-bar.is-zero {
      height: 2px !important;
      background: rgba(148, 163, 184, 0.45);
      box-shadow: none;
    }
    .relay-hourly-bar-wrap:hover .relay-hourly-bar:not(.is-zero),
    .relay-hourly-bar-wrap.is-active .relay-hourly-bar:not(.is-zero) {
      background: var(--brand-bright);
    }
    .relay-hourly-bar-wrap.is-active .relay-hourly-bar-label {
      color: #e2e8f0;
      font-weight: 650;
    }
    .relay-hourly-bar-label {
      flex: 0 0 auto;
      margin-top: 8px;
      height: 44px;
      width: 44px;
      font-size: 0.62rem;
      line-height: 1.15;
      color: var(--muted);
      text-align: center;
      font-variant-numeric: tabular-nums;
      transform: rotate(-58deg);
      transform-origin: top center;
      white-space: pre-line;
      pointer-events: none;
      user-select: none;
    }
    .relay-hourly-axis {
      display: flex;
      justify-content: space-between;
      gap: 8px;
      margin-top: 8px;
      font-size: 0.68rem;
      color: var(--muted);
      font-variant-numeric: tabular-nums;
    }
    .relay-hourly-hint { margin: 8px 0 0; font-size: 0.72rem; }
    .relay-cache-tip-btn {
      margin: 0;
      padding: 4px 10px;
      border-radius: 999px;
      border: 1px solid rgba(var(--brand-rgb), 0.45);
      background: rgba(var(--brand-rgb), 0.1);
      color: #7ddea8;
      font-size: 0.68rem;
      font-weight: 600;
      cursor: pointer;
      white-space: nowrap;
      flex-shrink: 0;
      text-decoration: none;
      display: inline-flex;
      align-items: center;
      box-sizing: border-box;
      line-height: 1.2;
    }
    .relay-cache-tip-btn:hover {
      border-color: rgba(var(--brand-rgb), 0.75);
      background: rgba(var(--brand-rgb), 0.18);
      color: #a8f0c8;
    }
    .relay-stats-head .relay-cache-tip-btn + .relay-cache-tip-btn {
      margin-left: 0;
    }
    .relay-credits-note {
      padding: 10px 12px;
      margin-bottom: 12px;
      border-radius: 10px;
      border: 1px solid rgba(61, 156, 240, 0.45);
      background: rgba(61, 156, 240, 0.12);
      font-size: 0.82rem;
      line-height: 1.58;
      color: var(--text);
    }
    .relay-credits-note strong { color: #5eb8ff; font-weight: 700; }

    .relay-cache-health {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      flex-wrap: wrap;
      padding: 18px 20px;
      margin-top: 14px;
      margin-bottom: 0;
      border-radius: 14px;
      border: 1px solid var(--border);
      background: rgba(8, 12, 18, 0.45);
    }
    .relay-cache-health.healthy {
      border-color: rgba(var(--brand-rgb), 0.55);
      background: rgba(var(--brand-rgb), 0.1);
    }
    .relay-cache-health.unhealthy {
      border-color: rgba(240, 180, 41, 0.7);
      background: linear-gradient(135deg, rgba(240, 180, 41, 0.18), rgba(226, 85, 85, 0.12));
      box-shadow: 0 0 0 1px rgba(240, 180, 41, 0.2), 0 10px 28px rgba(0, 0, 0, 0.25);
    }
    .relay-cache-health.unknown {
      border-color: rgba(255, 255, 255, 0.08);
      background: rgba(8, 12, 18, 0.45);
    }
    .relay-cache-health-main {
      display: flex;
      align-items: center;
      gap: 14px;
      min-width: 0;
      flex: 1;
    }
    .relay-cache-health-badge {
      flex: 0 0 auto;
      padding: 8px 14px;
      border-radius: 999px;
      font-size: 0.95rem;
      font-weight: 800;
      letter-spacing: 0.04em;
      white-space: nowrap;
    }
    .relay-cache-health.healthy .relay-cache-health-badge {
      color: #0f2a1c;
      background: #7ddea8;
    }
    .relay-cache-health.unhealthy .relay-cache-health-badge {
      color: #1a1200;
      background: linear-gradient(135deg, #ffd76a, #f0b429);
      box-shadow: 0 2px 10px rgba(240, 180, 41, 0.35);
    }
    .relay-cache-health.unknown .relay-cache-health-badge {
      color: var(--muted);
      background: rgba(255, 255, 255, 0.08);
      border: 1px solid var(--border);
    }
    .relay-cache-health-title {
      margin: 0;
      font-size: 1.05rem;
      font-weight: 800;
      color: var(--text);
    }
    .relay-cache-health-sub {
      margin: 6px 0 0;
      font-size: 0.95rem;
      line-height: 1.5;
      font-weight: 600;
      color: var(--text);
    }
    .relay-cache-health.unhealthy .relay-cache-health-sub {
      color: #ffe2a0;
      font-size: 1.02rem;
    }
    .relay-cache-health-rate {
      flex: 0 0 auto;
      text-align: right;
      min-width: 96px;
    }
    .relay-cache-health-rate .lbl {
      display: block;
      font-size: 0.85rem;
      color: var(--muted);
      margin-bottom: 4px;
    }
    .relay-cache-health-rate .val {
      display: block;
      font-size: 1.85rem;
      font-weight: 800;
      font-variant-numeric: tabular-nums;
      color: var(--text);
      line-height: 1.1;
    }
    .relay-cache-health.healthy .relay-cache-health-rate .val { color: #7ddea8; }
    .relay-cache-health.unhealthy .relay-cache-health-rate .val { color: #ffd76a; }

    .cache-replace-dialog {
      width: min(540px, 100%);
      border-radius: 18px;
      border: 1px solid rgba(226, 85, 85, 0.55);
      background: linear-gradient(165deg, #1a1010 0%, #121820 55%, #0e141c 100%);
      box-shadow: 0 28px 70px rgba(0, 0, 0, 0.6);
      padding: 28px 26px 22px;
      text-align: center;
    }
    .cache-replace-dialog h3 {
      margin: 0 0 14px;
      font-size: 1.45rem;
      font-weight: 900;
      color: #ffb4b4;
      letter-spacing: 0.02em;
    }
    .cache-replace-lines {
      margin: 0 0 18px;
      padding: 0;
      list-style: none;
      font-size: 1.12rem;
      font-weight: 700;
      line-height: 1.7;
      color: #ffe2e2;
    }
    .cache-replace-rate {
      margin: 0 0 16px;
      font-size: 2.1rem;
      font-weight: 900;
      color: #ffd76a;
      font-variant-numeric: tabular-nums;
    }
    .cache-replace-code-box {
      margin: 0 0 16px;
      padding: 14px 12px;
      border-radius: 12px;
      border: 1px dashed rgba(240, 180, 41, 0.55);
      background: rgba(0, 0, 0, 0.28);
      font-size: 1.25rem;
      font-weight: 800;
      letter-spacing: 0.06em;
      color: #ffd76a;
      word-break: break-all;
    }
    .cache-replace-code-box.hidden { display: none; }
    .cache-replace-msg {
      margin: 0 0 14px;
      font-size: 0.95rem;
      color: var(--muted);
      min-height: 1.2em;
    }
    .cache-replace-actions {
      display: flex;
      gap: 10px;
      justify-content: center;
      flex-wrap: wrap;
    }
    .cache-replace-actions button {
      min-width: 140px;
      padding: 12px 18px;
      font-size: 1rem;
      font-weight: 800;
      border-radius: 10px;
      cursor: pointer;
    }
    .cache-replace-actions .primary-replace {
      border: none;
      background: linear-gradient(135deg, #ff8a8a, #e25555);
      color: #fff;
    }


    .chat-img-preview-modal {
      position: fixed;
      inset: 0;
      z-index: 2100;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 20px;
    }
    .chat-img-preview-modal.hidden { display: none; }
    .chat-img-preview-backdrop {
      position: absolute;
      inset: 0;
      border: 0;
      background: rgba(0, 0, 0, 0.82);
      cursor: zoom-out;
    }
    .chat-img-preview-box {
      position: relative;
      z-index: 1;
      max-width: min(92vw, 960px);
      max-height: min(88vh, 860px);
    }
    .chat-img-preview-box img {
      display: block;
      max-width: min(92vw, 960px);
      max-height: min(88vh, 860px);
      border-radius: 8px;
      box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
      object-fit: contain;
    }
    .chat-img-preview-close {
      position: absolute;
      top: -38px;
      right: 0;
      margin: 0;
      padding: 4px 10px;
      border: 1px solid rgba(255,255,255,0.25);
      border-radius: 8px;
      background: rgba(0,0,0,0.45);
      color: #fff;
      font-size: 1.2rem;
      line-height: 1;
      cursor: pointer;
    }
    .cache-tip-modal {
      position: fixed;
      inset: 0;
      z-index: 1200;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 16px;
      background: rgba(4, 8, 14, 0.72);
      backdrop-filter: blur(4px);
      -webkit-backdrop-filter: blur(4px);
    }
    .cache-tip-modal.hidden { display: none; }
    .cache-tip-dialog {
      width: min(720px, 100%);
      max-height: min(88vh, 820px);
      overflow: auto;
      border-radius: 14px;
      border: 1px solid var(--border);
      background: var(--card);
      box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
      padding: 18px 20px 20px;
    }
    .cache-tip-head {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 12px;
    }
    .cache-tip-head h3 {
      margin: 0;
      font-size: 1rem;
      line-height: 1.35;
    }
    .cache-tip-close {
      margin: 0;
      padding: 6px 10px;
      border-radius: 8px;
      border: 1px solid var(--border);
      background: var(--surface);
      color: var(--muted);
      cursor: pointer;
      font-size: 0.78rem;
      flex-shrink: 0;
    }
    .cache-tip-close:hover { color: var(--text); border-color: rgba(61, 156, 240, 0.45); }
    .cache-tip-lead {
      margin: 0 0 12px;
      font-size: 0.86rem;
      line-height: 1.55;
      color: var(--text);
    }
    .cache-tip-points {
      margin: 0 0 14px;
      padding-left: 1.1rem;
      font-size: 0.84rem;
      line-height: 1.55;
      color: var(--text);
    }
    .cache-tip-points li { margin-bottom: 6px; }
    .cache-tip-points strong { color: #7ddea8; }
    .cache-tip-example {
      margin-bottom: 14px;
      border: 1px solid var(--border);
      border-radius: 10px;
      overflow: hidden;
      background: rgba(8, 12, 18, 0.55);
    }
    .cache-tip-example:last-child { margin-bottom: 0; }
    .cache-tip-example .cap {
      padding: 8px 12px;
      font-size: 0.74rem;
      font-weight: 700;
      border-bottom: 1px solid var(--border);
    }
    .cache-tip-example.good .cap { color: #7ddea8; background: rgba(var(--brand-rgb), 0.08); }
    .cache-tip-example.bad .cap { color: #ff9a9a; background: rgba(226, 85, 85, 0.08); }
    .cache-tip-example pre {
      margin: 0;
      padding: 12px;
      font-size: 0.72rem;
      line-height: 1.45;
      overflow-x: auto;
      white-space: pre-wrap;
      word-break: break-word;
      color: #c9d6e4;
    }

    .usage-compare-dialog {
      width: min(1080px, 96vw);
      height: min(88vh, 900px);
      max-height: 88vh;
      display: flex;
      flex-direction: column;
      border-radius: 14px;
      border: 1px solid var(--border);
      background: var(--card);
      box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
      overflow: hidden;
    }
    .usage-compare-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 12px 16px;
      border-bottom: 1px solid var(--border);
      background: var(--surface);
      flex: 0 0 auto;
    }
    .usage-compare-head h3 {
      margin: 0;
      font-size: 0.95rem;
      line-height: 1.35;
    }
    .usage-compare-head .usage-compare-link {
      font-size: 0.78rem;
      color: var(--accent);
      text-decoration: none;
      white-space: nowrap;
    }
    .usage-compare-head .usage-compare-link:hover { text-decoration: underline; }
    .usage-compare-frame-wrap {
      flex: 1 1 auto;
      min-height: 0;
      background: #0a0e14;
    }
    .usage-compare-frame {
      display: block;
      width: 100%;
      height: 100%;
      border: 0;
      background: #0a0e14;
    }
    .relay-stat {
      margin-bottom: 14px;
    }
    .relay-stat:last-child { margin-bottom: 0; }
    .relay-stat-head {
      display: flex;
      justify-content: space-between;
      align-items: baseline;
      gap: 10px;
      margin-bottom: 6px;
      font-size: 0.78rem;
    }
    .relay-stat-head .lbl { color: var(--muted); }
    .relay-stat-head .val { color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
    .relay-bar {
      height: 10px;
      border-radius: 999px;
      background: var(--surface-2);
      overflow: hidden;
      border: 1px solid rgba(42, 53, 66, 0.9);
    }
    .relay-bar > i {
      display: block;
      height: 100%;
      width: 0%;
      border-radius: inherit;
      background: linear-gradient(90deg, #2f8f6b, var(--brand));
      box-shadow: 0 0 12px rgba(var(--brand-rgb), 0.35);
      transition: width 0.45s ease;
    }
    .relay-bar.token > i {
      background: linear-gradient(90deg, #2a6fb8, #3d9cf0);
      box-shadow: 0 0 12px rgba(61, 156, 240, 0.35);
    }
    .relay-bar.warn > i {
      background: linear-gradient(90deg, #b8841f, #f0b429);
      box-shadow: 0 0 12px rgba(240, 180, 41, 0.3);
    }
    .relay-bar.low > i {
      background: linear-gradient(90deg, #b84a4a, #ff7b7b);
      box-shadow: 0 0 12px rgba(255, 123, 123, 0.28);
    }
    .relay-stats-foot {
      margin: 10px 0 0;
      font-size: 0.72rem;
      color: var(--muted);
    }

    .kv.kv-key-quota .kv-key-head {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-bottom: 4px;
      flex-wrap: wrap;
    }
    .kv.kv-key-quota .kv-key-head .k {
      margin-bottom: 0;
      flex: 0 0 auto;
    }
    .kv.kv-key-quota .relay-key-bar-wrap {
      flex: 1 1 160px;
      min-width: 120px;
      max-width: 420px;
      display: flex;
      flex-direction: column;
      gap: 3px;
    }
    .kv.kv-key-quota .relay-key-bar-wrap .bar-meta {
      display: flex;
      justify-content: space-between;
      gap: 8px;
      font-size: 0.68rem;
      color: var(--muted);
      font-variant-numeric: tabular-nums;
    }
    .kv.kv-key-quota .relay-key-bar-wrap .bar-meta strong {
      color: var(--brand-bright);
      font-weight: 700;
    }
    .kv.kv-key-quota .v {
      flex-wrap: wrap;
      align-items: center;
    }
    .kv.kv-key-quota code {
      flex: 1 1 220px;
      min-width: 0;
    }
    .relay-quota-ops {
      display: inline-flex;
      flex-wrap: wrap;
      gap: 4px;
      align-items: center;
      margin-left: auto;
    }
    .relay-quota-ops button {
      margin: 0;
      padding: 4px 8px;
      font-size: 0.72rem;
      line-height: 1.2;
    }
    #panelRelayKey .relay-msg {
      margin: 6px 0 0;
    }

    .relay-model-tabs {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 6px;
      margin-top: 16px;
      margin-bottom: 8px;
    }
    .relay-model-tabs button {
      appearance: none;
      margin: 0;
      border: 1px solid rgba(var(--brand-rgb), 0.35);
      border-radius: 8px;
      padding: 10px 10px;
      background: rgba(var(--brand-rgb), 0.1);
      color: var(--brand-bright);
      font-size: 0.88rem;
      font-weight: 700;
      cursor: pointer;
    }
    .relay-model-tabs button:hover {
      border-color: rgba(var(--brand-rgb), 0.7);
      background: rgba(var(--brand-rgb), 0.18);
    }
    .relay-model-tabs button.active {
      background: var(--ok);
      color: #fff;
      border-color: #5dffb0;
      box-shadow: 0 0 12px rgba(var(--brand-rgb), 0.28);
    }
    .relay-model-panel {
      padding: 14px 12px 12px;
      border-radius: 12px;
      border: 1px solid var(--border);
      background: rgba(12, 16, 22, 0.55);
    }
    .relay-model-panel .relay-plans-title { margin-top: 0; }

    .relay-plans {
      margin-top: 16px;
      padding: 14px 12px 12px;
      border-radius: 12px;
      border: 1px solid var(--border);
      background: rgba(12, 16, 22, 0.55);
    }
    .relay-plans-title {
      margin: 0 0 4px;
      font-size: 0.88rem;
      font-weight: 700;
      color: #c9d6e4;
    }
    .relay-plans-hint {
      margin: 0 0 12px;
      font-size: 0.72rem;
      color: var(--muted);
    }
    .relay-plan-section {
      margin-top: 12px;
      padding-top: 10px;
      border-top: 1px solid rgba(42, 53, 66, 0.9);
    }
    .relay-plan-section:first-of-type {
      margin-top: 4px;
      padding-top: 0;
      border-top: 0;
    }
    .relay-plan-section-head {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: 8px;
      margin-bottom: 8px;
    }
    .relay-plan-section-head.togglable {
      cursor: pointer;
      user-select: none;
      padding: 8px 10px;
      margin: 0 0 8px;
      border-radius: 8px;
      border: 1px solid rgba(var(--brand-rgb), 0.28);
      background: rgba(var(--brand-rgb), 0.08);
    }
    .relay-plan-section-head.togglable:hover {
      border-color: rgba(var(--brand-rgb), 0.55);
      background: rgba(var(--brand-rgb), 0.14);
    }
    .relay-plan-section-head .sec-title {
      font-size: 0.82rem;
      font-weight: 800;
      color: #c9d6e4;
    }
    .relay-plan-section-head .sec-title.unlimited { color: var(--brand-bright); }
    .relay-plan-section-head .sec-title.limited { color: #f0b429; }
    .relay-plan-section-head .sec-desc {
      font-size: 0.68rem;
      color: var(--muted);
    }
    .relay-plan-section-head-right {
      display: flex;
      flex-direction: column;
      align-items: flex-end;
      gap: 2px;
      text-align: right;
      min-width: 0;
    }
    .relay-plan-section-head .sec-gift-balance {
      font-size: 0.72rem;
      font-weight: 700;
      color: #e8c56a;
      white-space: nowrap;
    }
    .relay-plan-section-head .sec-gift-balance .amt {
      color: #ffd27a;
      font-weight: 800;
    }
    .relay-plan-section-head .sec-toggle {
      font-size: 0.72rem;
      font-weight: 700;
      color: #9fd0ff;
      white-space: nowrap;
    }
    .relay-plan-section.collapsed > .relay-plan-section-body {
      display: none;
    }
    .relay-plan-section.collapsed > .relay-plan-section-head {
      margin-bottom: 0;
    }
    .relay-plan-section.collapsed > .relay-plan-section-head .sec-toggle::after {
      content: "展开";
    }
    .relay-plan-section:not(.collapsed) > .relay-plan-section-head .sec-toggle::after {
      content: "收起";
    }
    .relay-plan-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 8px;
    }
    .relay-plan-grid.cols-2 {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .relay-plan {
      appearance: none;
      margin: 0;
      padding: 12px 8px 10px;
      border-radius: 10px;
      border: 1px solid rgba(61, 156, 240, 0.28);
      background: rgba(26, 34, 44, 0.9);
      color: var(--text);
      text-align: left;
      cursor: pointer;
      transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
    }
    .relay-plan:hover {
      border-color: rgba(var(--brand-rgb), 0.7);
      background: rgba(36, 48, 65, 0.95);
    }
    .relay-plan.active {
      border-color: var(--ok);
      box-shadow: 0 0 0 1px rgba(var(--brand-rgb), 0.35), 0 0 16px rgba(var(--brand-rgb), 0.2);
      background: rgba(24, 52, 40, 0.95);
    }
    .relay-plan:disabled,
    .relay-plan.disabled {
      opacity: 0.55;
      cursor: not-allowed;
      filter: grayscale(0.4);
    }
    .relay-plan:disabled:hover,
    .relay-plan.disabled:hover {
      border-color: rgba(255, 255, 255, 0.08);
      background: rgba(24, 32, 44, 0.9);
    }
    .relay-plan .badge {
      display: inline-block;
      margin-bottom: 4px;
      padding: 1px 6px;
      border-radius: 999px;
      font-size: 0.62rem;
      font-weight: 700;
      letter-spacing: 0.02em;
    }
    .relay-plan .badge.unlimited {
      background: rgba(var(--brand-rgb), 0.18);
      color: var(--brand-bright);
    }
    .relay-plan .badge.limited {
      background: rgba(240, 180, 41, 0.18);
      color: #f0b429;
    }
    .relay-plan .badge.soon {
      background: rgba(148, 163, 184, 0.22);
      color: #cbd5e1;
    }
    .relay-plan .name.plan-quota {
      display: block;
      margin: 0 0 6px;
      font-size: 1.15rem;
      font-weight: 900;
      color: #9fd0ff;
      line-height: 1.15;
      letter-spacing: 0.01em;
    }
    .relay-plan.active .name.plan-quota {
      color: #e8f4ff;
    }
    .relay-plan .plan-type-tags {
      display: flex;
      flex-direction: row;
      align-items: baseline;
      justify-content: flex-start;
      gap: 6px;
      margin: 5px 0 2px;
      line-height: 1.2;
      width: 100%;
    }
    .relay-plan .plan-credits-tag,
    .relay-plan .plan-key-tag {
      display: inline;
      font-size: 0.62rem;
      font-weight: 600;
      color: var(--muted);
      letter-spacing: 0.02em;
    }
    .relay-plan.active .plan-credits-tag,
    .relay-plan.active .plan-key-tag {
      color: rgba(232, 240, 248, 0.82);
    }
    .relay-plan .name:not(.plan-quota) {
      display: block;
      font-size: 0.82rem;
      font-weight: 700;
      color: #9fd0ff;
      margin-bottom: 4px;
    }
    .relay-plan .price {
      display: block;
      font-size: 0.95rem;
      font-weight: 800;
      font-variant-numeric: tabular-nums;
      letter-spacing: -0.02em;
      color: #f0b429;
    }
    .relay-plan .price-row {
      display: flex;
      align-items: baseline;
      flex-wrap: wrap;
      gap: 6px;
    }
    .relay-plan .price-was {
      font-size: 0.72rem;
      font-weight: 600;
      color: var(--muted);
      text-decoration: line-through;
    }
    .relay-plan .price-now {
      font-size: 1rem;
      font-weight: 800;
      color: #f0b429;
      font-variant-numeric: tabular-nums;
    }
    .relay-plan .price-kind {
      display: inline-block;
      font-size: 0.58rem;
      font-weight: 700;
      color: var(--brand-bright);
      margin-right: 3px;
      letter-spacing: 0.03em;
      text-decoration: none;
      vertical-align: baseline;
    }
    .relay-plan.active .price-kind {
      color: #9dffd0;
    }
    .relay-plan.price-after-gift .price-now {
      color: var(--brand-bright);
    }
    .relay-plan.active.price-after-gift .price-now {
      color: #9dffd0;
    }
    .relay-plan.active .price,
    .relay-plan.active .price-now {
      color: #f0b429;
    }
    .relay-plan .price-now em {
      font-style: normal;
      font-size: 0.68rem;
      font-weight: 700;
      margin-right: 3px;
      color: #ffd27a;
    }
    /* 购买 Tab · 中转站 Key：价格加大显示 */
    #panelBuyRelay .relay-plan .price-row {
      margin: 6px 0 4px;
      gap: 8px;
      align-items: center;
    }
    #panelBuyRelay .relay-plan .price,
    #panelBuyRelay .relay-plan .price-now {
      font-size: 1.85rem;
      font-weight: 900;
      line-height: 1.08;
      letter-spacing: -0.03em;
    }
    #panelBuyRelay .relay-plan .price-now em {
      font-size: 1.85rem;
      font-weight: 900;
      margin-right: 0;
      color: inherit;
    }
    #panelBuyRelay .relay-plan .price-was {
      font-size: 0.95rem;
    }
    #panelBuyRelay .relay-plan.active .price,
    #panelBuyRelay .relay-plan.active .price-now,
    #panelBuyRelay .relay-plan.active .price-now em {
      color: #f0b429;
    }
    #panelBuyRelay .relay-plan.price-after-gift .price-now,
    #panelBuyRelay .relay-plan.price-after-gift .price-now em,
    #panelBuyRelay .relay-plan.active.price-after-gift .price-now,
    #panelBuyRelay .relay-plan.active.price-after-gift .price-now em {
      color: var(--brand-bright);
    }
    .relay-plan-grid.cols-4 {
      grid-template-columns: repeat(4, minmax(0, 1fr));
    }
    .relay-plan-grid.cols-3 {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .relay-plan .desc {
      display: block;
      margin-top: 4px;
      font-size: 0.68rem;
      color: var(--muted);
      line-height: 1.35;
    }
    .relay-plan .desc.plan-key-note {
      display: none;
    }
    .relay-plan .desc.plan-value-line {
      margin-top: 4px;
      font-size: 0.67rem;
      font-weight: 600;
      color: #9eb8cc;
      line-height: 1.35;
    }
    .relay-plan .desc.plan-value-line .pct {
      color: var(--brand-bright);
      font-weight: 700;
    }
    .relay-plan.active .desc.plan-value-line {
      color: rgba(232, 240, 248, 0.92);
    }
    .relay-plan.active .desc.plan-value-line .pct {
      color: var(--brand-bright);
    }
    .relay-plan .plan-gift-line {
      margin-top: 5px;
      font-size: 0.7rem;
      font-weight: 700;
      color: #f0b429;
      line-height: 1.3;
    }
    .relay-plan .plan-gift-line .gift {
      color: #ffd27a;
      font-weight: 800;
    }
    .relay-plan-gift-hint {
      margin: 0 0 10px;
      padding: 7px 10px;
      border-radius: 8px;
      font-size: 0.76rem;
      color: #e8c56a;
      background: rgba(240, 180, 41, 0.1);
      border: 1px solid rgba(240, 180, 41, 0.28);
      line-height: 1.45;
    }
    .relay-plan-gift-hint.hidden { display: none; }
    .relay-plan-actions {
      margin-top: 12px;
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      align-items: center;
    }
    .relay-plan-actions .picked {
      font-size: 0.78rem;
      color: var(--muted);
    }
    .relay-recharge-wrap {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      flex-shrink: 0;
    }
    .relay-recharge-wrap.hidden { display: none; }
    .relay-recharge-amt {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      margin: 0;
      font-size: 0.78rem;
      color: var(--muted);
      white-space: nowrap;
    }
    .relay-recharge-amt input.qty {
      max-width: 100px;
      min-width: 72px;
    }
    #btnRelayRecharge {
      background: #1677ff !important;
      color: #fff !important;
      border: 0 !important;
      box-shadow: 0 2px 8px rgba(22, 119, 255, 0.28);
    }
    #btnRelayRecharge:hover {
      background: #4096ff !important;
      color: #fff !important;
    }
    .redeem-batch-row {
      align-items: center;
      gap: 12px;
    }
    .redeem-batch-row .redeem-batch-hint {
      margin: 0;
      flex: 1;
      min-width: 12rem;
      font-size: 0.72rem;
      line-height: 1.45;
      color: var(--muted);
    }
    @media (max-width: 720px) {
      .relay-plan-grid,
      .relay-plan-grid.cols-2,
      .relay-plan-grid.cols-3,
      .relay-plan-grid.cols-4 {
        grid-template-columns: 1fr 1fr;
      }
    }


    .official-home-warn {
      margin: 18px 6px 0;
      padding: 18px 16px 16px;
      border-radius: 16px;
      border: 2px solid rgba(240, 180, 41, 0.55);
      background:
        linear-gradient(180deg, rgba(240, 180, 41, 0.16) 0%, rgba(26, 34, 44, 0.92) 55%);
      box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
    }
    .official-home-warn-title {
      margin: 0 0 10px;
      font-family: Syne, "Noto Sans SC", sans-serif;
      font-size: clamp(1.35rem, 5vw, 1.85rem);
      font-weight: 800;
      letter-spacing: 0.04em;
      line-height: 1.25;
      color: #ffe08a;
      text-align: center;
    }
    .official-home-warn-lines {
      margin: 0;
      padding: 0;
      list-style: none;
      text-align: center;
    }
    .official-home-warn-lines li {
      margin: 0 0 8px;
      font-size: clamp(0.98rem, 3.2vw, 1.12rem);
      font-weight: 700;
      line-height: 1.45;
      color: var(--text);
    }
    .official-home-warn-lines li:last-child { margin-bottom: 0; }
    .official-home-warn-lines .em {
      color: #ff9b9b;
      font-size: 1.05em;
    }
    .official-home-proof {
      margin: 12px 6px 8px;
      padding: 14px;
      border-radius: 14px;
      border: 1px solid rgba(var(--brand-rgb), 0.4);
      background: rgba(var(--brand-rgb), 0.07);
    }
    .official-home-proof .official-proof-head {
      margin-bottom: 4px;
    }

    .official-proof {
      margin-top: 14px;
      padding: 14px;
      border-radius: 12px;
      border: 1px solid rgba(var(--brand-rgb), 0.35);
      background: rgba(var(--brand-rgb), 0.06);
    }
    .official-proof-head {
      display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
    }
    .official-proof-badge {
      font-size: 0.8rem; font-weight: 700; color: var(--brand-bright);
      letter-spacing: 0.02em;
    }
    .official-proof-head a {
      color: var(--accent); font-size: 0.85rem; font-weight: 600; text-decoration: none;
    }
    .official-proof-head a:hover { text-decoration: underline; }
    .official-proof-shot {
      display: block; border-radius: 10px; overflow: hidden;
      border: 1px solid var(--border); background: #0b0f14;
    }
    .official-proof-shot img {
      display: block; width: 100%; height: auto;
    }


    .tutorial-inline {
      margin: 8px 0 2px;
      padding: 8px 10px;
      border-radius: 10px;
      border: 1px solid rgba(255, 196, 64, 0.55);
      background: linear-gradient(135deg, rgba(255, 170, 40, 0.18), rgba(255, 90, 120, 0.12) 55%, rgba(80, 160, 255, 0.1));
      box-shadow: 0 0 0 1px rgba(255, 200, 80, 0.12), 0 6px 16px rgba(0, 0, 0, 0.18);
    }
    .tutorial-inline > label {
      margin-top: 0;
      margin-bottom: 2px;
      color: #ffd56a;
      font-weight: 800;
      font-size: 0.78rem;
      letter-spacing: 0.04em;
    }
    #tutorialTabsInline {
      gap: 5px;
      margin-bottom: 0;
    }
    #tutorialTabsInline button {
      background: linear-gradient(180deg, #ffb84d 0%, #ff8a2b 100%);
      color: #2a1400;
      border: 1px solid #ffd27a;
      border-radius: 999px;
      padding: 4px 10px;
      font-size: 0.72rem;
      font-weight: 800;
      line-height: 1.2;
      box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 2px 8px rgba(255, 140, 40, 0.35);
    }
    #tutorialTabsInline button:hover {
      background: linear-gradient(180deg, #ffd06a 0%, #ff9a3a 100%);
      border-color: #ffe09a;
      filter: brightness(1.05);
    }

    .tutorial-tabs {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-bottom: 14px;
    }
    .tutorial-tabs button {
      background: var(--surface-2);
      color: var(--text);
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 10px 12px;
      font-size: 0.85rem;
      font-weight: 600;
      flex: 0 1 auto;
    }
    .tutorial-tabs button.active {
      background: var(--accent);
      border-color: var(--accent);
      color: #fff;
    }
    .tutorial-body {
      min-height: 160px;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 16px 18px;
      color: var(--text);
      font-size: 0.92rem;
      line-height: 1.65;
      overflow-x: auto;
    }
    .tutorial-body:empty::before {
      content: "暂无教程内容，请稍后再看。";
      color: var(--muted);
    }
    .tutorial-body img {
      max-width: 100%;
      height: auto;
      border-radius: 8px;
      margin: 10px 0;
      display: block;
    }
    .tutorial-body h1, .tutorial-body h2, .tutorial-body h3 {
      margin: 0.6em 0 0.35em;
      line-height: 1.3;
    }
    .tutorial-body p { margin: 0.45em 0; }
    .tutorial-body pre, .tutorial-body code {
      background: var(--surface-deep);
      border-radius: 6px;
      font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
      font-size: 0.82rem;
    }
    .tutorial-body pre {
      padding: 12px; overflow-x: auto; border: 1px solid var(--border);
    }
    .tutorial-body code { padding: 1px 5px; }
    .tutorial-body a { color: var(--accent); }
    .tutorial-body ul, .tutorial-body ol { padding-left: 1.3em; margin: 0.4em 0; }
    @media (max-width: 560px) {
      .tutorial-tabs button { flex: 1 1 calc(50% - 8px); }
      #tutorialTabsInline button { flex: 0 1 auto; }
    }
    .buy-action-bar {
      display: flex;
      flex-wrap: wrap;
      gap: 12px;
      align-items: center;
      margin-top: 14px;
    }
    .buy-balance {
      display: flex;
      flex-direction: column;
      justify-content: center;
      min-width: 140px;
      max-width: 100%;
      padding: 10px 14px;
      background: rgba(var(--brand-rgb), 0.12);
      border: 1px solid rgba(var(--brand-rgb), 0.45);
      border-radius: 10px;
    }
    .buy-balance .amt {
      font-size: 1.05rem;
      font-weight: 800;
      color: var(--ok);
      letter-spacing: -0.02em;
      line-height: 1.35;
      word-break: break-word;
    }
    .buy-balance .amt .gift {
      color: var(--warn);
      font-weight: 700;
    }
    .buy-balance .lbl {
      font-size: 0.75rem;
      color: var(--muted);
      margin-top: 2px;
    }
    .buy-balance.relay-recharge-balance {
      flex-direction: row;
      flex-wrap: nowrap;
      align-items: center;
      gap: 6px;
      min-width: 0;
      max-width: none;
      padding: 6px 10px;
      white-space: nowrap;
    }
    .buy-balance.relay-recharge-balance .lbl {
      margin-top: 0;
      font-size: 0.76rem;
      flex-shrink: 0;
    }
    .buy-balance.relay-recharge-balance .amt {
      font-size: 0.78rem;
      line-height: 1.2;
      font-weight: 700;
      word-break: keep-all;
      white-space: nowrap;
    }
    .stat .n.bal-split { font-size: 0.95rem; line-height: 1.35; font-weight: 700; }
    .stat .n.bal-split .gift { color: var(--warn); }
    .buy-action-bar .qty-wrap { flex: 1; min-width: 120px; margin: 0; }
    .buy-action-bar button#btnGoPay,
    .relay-buy-btn,
    #btnRelayBuyMimo,
    #btnRelayBuyMimoBuy {
      background: var(--ok) !important;
      color: #fff !important;
      box-shadow: 0 4px 12px rgba(var(--brand-rgb), 0.22);
    }
    .buy-action-bar button#btnGoPay:hover,
    .relay-buy-btn:hover,
    #btnRelayBuyMimo:hover,
    #btnRelayBuyMimoBuy:hover {
      background: var(--brand-bright) !important;
      color: #fff !important;
    }
  
    /* CC Switch bind modal */
    .ccswitch-backdrop {
      position: fixed; inset: 0; z-index: 1200;
      background: rgba(6, 16, 12, 0.55);
      display: flex; align-items: center; justify-content: center;
      padding: 16px;
    }
    .ccswitch-backdrop.hidden { display: none; }
    .ccswitch-modal {
      width: min(440px, 100%);
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 14px;
      box-shadow: 0 18px 48px rgba(0,0,0,.35);
      padding: 16px 16px 14px;
    }
    .ccswitch-modal h3 {
      margin: 0 0 6px; font-size: 16px; color: var(--text);
    }
    .ccswitch-modal .cc-sub {
      margin: 0 0 12px; color: var(--muted); font-size: 12px; line-height: 1.45;
    }
    .ccswitch-modal .cc-apps {
      display: flex; gap: 6px; margin-bottom: 12px;
    }
    .ccswitch-modal .cc-apps button {
      flex: 1; min-width: 0; padding: 8px 6px; border-radius: 8px;
      border: 1px solid var(--border); background: transparent;
      color: var(--text); cursor: pointer; font-size: 13px;
    }
    .ccswitch-modal .cc-apps button.active {
      border-color: var(--accent); background: rgba(var(--brand-rgb), 0.12);
      color: var(--accent);
    }
    .ccswitch-modal label {
      display: block; font-size: 12px; color: var(--muted); margin: 8px 0 4px;
    }
    .ccswitch-modal input, .ccswitch-modal select {
      width: 100%; box-sizing: border-box;
      padding: 8px 10px; border-radius: 8px;
      border: 1px solid var(--border); background: var(--bg);
      color: var(--text); font-size: 13px;
    }
    .ccswitch-modal .cc-codex-warn {
      display: none;
      margin: 8px 0 0;
      padding: 8px 10px;
      border-radius: 8px;
      border: 1px solid rgba(0, 0, 0, 0.18);
      background: rgba(0, 0, 0, 0.04);
      color: #000;
      font-size: 0.78rem;
      line-height: 1.45;
    }
    .ccswitch-modal .cc-codex-warn.show { display: block; }
    .ccswitch-modal .cc-codex-warn code {
      background: rgba(0,0,0,0.08);
      color: #000;
      padding: 1px 5px;
      border-radius: 4px;
      font-size: 0.74rem;
    }
    .ccswitch-modal .cc-endpoint {
      font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
      font-size: 11px; word-break: break-all; color: var(--muted);
      margin-top: 8px; line-height: 1.4;
    }
    .ccswitch-modal .cc-actions {
      display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px;
    }
    .ccswitch-modal .cc-actions button { min-width: 110px; }
    .cc-bind-wrap {
      display: inline-flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 2px;
      flex-shrink: 0;
      line-height: 1.1;
    }
    .cc-bind-label {
      font-size: 0.62rem;
      font-weight: 700;
      color: var(--brand);
      white-space: nowrap;
      letter-spacing: 0.02em;
    }
    .row-btn.cc-bind {
      white-space: nowrap;
      background: var(--ok) !important;
      border: 1px solid var(--brand) !important;
      color: #fff !important;
      font-weight: 700;
      text-transform: none;
      min-width: 4.6rem;
      padding: 4px 8px;
      height: 28px;
      font-size: 0.72rem;
    }
    .row-btn.cc-bind:hover {
      background: var(--brand) !important;
      border-color: #166534 !important;
      color: #fff !important;
    }

  
    /* brand tokens — driven by theme.js accent picker */
    html {
      --brand: #16a34a;
      --brand-bright: #22c55e;
      --brand-rgb: 22, 163, 74;
    }
    html[data-theme="dark"] {
      --brand: #3ecf8e;
      --brand-bright: #7dffc0;
      --brand-rgb: 62, 207, 142;
    }
    /* force common brand surfaces to follow --brand */
    .key-mode-tabs:not(.action-tabs) button,
    .key-mode-tabs.action-tabs button,
    .welfare-subtab,
    .buy-channel-tabs button,
    .auth-tabs {
      border-color: rgba(var(--brand-rgb), 0.45) !important;
      background: rgba(var(--brand-rgb), 0.12) !important;
      color: var(--brand-bright) !important;
    }
    .key-mode-tabs:not(.action-tabs) button.active,
    .key-mode-tabs.action-tabs button.active,
    .welfare-subtab.active,
    .buy-channel-tabs button.active,
    .auth-tabs button.active {
      background: rgba(var(--brand-rgb), 0.28) !important;
      border-color: rgba(var(--brand-rgb), 0.75) !important;
      color: var(--brand-bright) !important;
      box-shadow: 0 0 0 1px rgba(var(--brand-rgb), 0.2) !important;
    }
    .acct-bar button:not(.secondary) {
      background: var(--brand) !important;
      box-shadow: 0 4px 12px rgba(var(--brand-rgb), 0.22) !important;
    }
    .acct-bar button:not(.secondary):hover {
      background: var(--brand-bright) !important;
    }
    .advantage-list li strong,
    .brand-tagline {
      color: var(--brand) !important;
    }
    .site-logo-domain .logo-key {
      color: var(--accent) !important;
    }

  
    /* pure black theme */
    html[data-theme="black"] {
      color-scheme: dark;
      --bg: #000000;
      --card: #0a0a0a;
      --text: #f3f3f3;
      --muted: #9a9a9a;
      --border: #222222;
      --surface: #050505;
      --surface-2: #111111;
      --surface-3: #1a1a1a;
      --surface-deep: #000000;
      --input-bg: #0a0a0a;
      --sidebar: #000000;
      --shadow: rgba(0, 0, 0, 0.75);
      --overlay: rgba(255, 255, 255, 0.04);
    }
    html[data-theme="black"] body {
      background: #000000 !important;
    }
    html[data-theme="black"] .site-header,
    html[data-theme="black"] .acct-bar,
    html[data-theme="black"] .card,
    html[data-theme="black"] .action-card {
      background: #0a0a0a;
    }
