:root {
  --glass: rgba(13, 19, 31, 0.62);
  --glass2: rgba(255, 255, 255, 0.08);
  --line: rgba(255, 255, 255, 0.14);
  --text: #eef4ff;
  --muted: #a8b6cc;
  --gold: #e8c47a;
  --teal: #6ee7d2;
  --danger: #ff8a8a;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}
* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}
[hidden] { display: none !important; }
/* ============ 毛玻璃勾选框 / 开关 ============ */
/* 原生 checkbox 完全隐藏，改用伪元素绘制玻璃质感的方框 */
input[type="checkbox"], input[type="radio"] {
  appearance: none; -webkit-appearance: none;
  position: relative;
  width: 17px; height: 17px;
  margin: 0; flex: 0 0 17px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(255,255,255,.14), rgba(255,255,255,.04));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16), 0 2px 6px rgba(0,0,0,.22);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  cursor: pointer; vertical-align: middle;
  transition: background .2s ease, border-color .2s ease, box-shadow .2s ease, transform .16s ease;
}
input[type="radio"] { border-radius: 50%; }
/* 对勾：默认隐藏，勾选时淡入 */
input[type="checkbox"]::after {
  content: ""; position: absolute; left: 50%; top: 47%;
  width: 8px; height: 4.5px;
  border-left: 2px solid #062018; border-bottom: 2px solid #062018;
  transform: translate(-50%, -50%) rotate(-45deg) scale(.4);
  opacity: 0;
  transition: opacity .18s ease, transform .22s cubic-bezier(.34,1.56,.64,1);
}
input[type="radio"]::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 7px; height: 7px; border-radius: 50%;
  background: #062018; transform: translate(-50%, -50%) scale(.4);
  opacity: 0; transition: opacity .18s ease, transform .2s ease;
}
input[type="checkbox"]:hover, input[type="radio"]:hover {
  border-color: rgba(110,231,210,.45);
  background: linear-gradient(160deg, rgba(110,231,210,.18), rgba(255,255,255,.05));
}
input[type="checkbox"]:checked, input[type="radio"]:checked {
  background: linear-gradient(160deg, rgba(110,231,210,.92), rgba(56,199,178,.72));
  border-color: rgba(140,240,220,.6);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 0 0 3px rgba(110,231,210,.14), 0 4px 12px rgba(56,199,178,.28);
}
input[type="checkbox"]:checked::after, input[type="radio"]:checked::after {
  opacity: 1; transform: translate(-50%, -50%) rotate(-45deg) scale(1);
}
input[type="radio"]:checked::after { transform: translate(-50%, -50%) scale(1); }
input[type="checkbox"]:active, input[type="radio"]:active { transform: scale(.92); }
input[type="checkbox"]:focus-visible, input[type="radio"]:focus-visible {
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16), 0 0 0 3px rgba(110,231,210,.32);
}
input[type="checkbox"]:disabled, input[type="radio"]:disabled {
  opacity: .42; cursor: not-allowed; box-shadow: none;
}
/* 开关型（.switch 内）：做成玻璃滑块 */
.switch input[type="checkbox"] {
  width: 40px; height: 22px; flex: 0 0 40px; border-radius: 999px;
  background: linear-gradient(160deg, rgba(255,255,255,.13), rgba(255,255,255,.05));
  border-color: rgba(255,255,255,.2);
}
.switch input[type="checkbox"]::before {
  content: ""; position: absolute; left: 3px; top: 50%;
  width: 16px; height: 16px; border-radius: 50%;
  background: linear-gradient(160deg, rgba(255,255,255,.92), rgba(196,214,238,.72));
  box-shadow: 0 2px 5px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.5);
  transform: translateY(-50%);
  transition: transform .24s cubic-bezier(.34,1.4,.64,1), background .2s ease, box-shadow .2s ease;
}
.switch input[type="checkbox"]::after { display: none; }
.switch input[type="checkbox"]:hover {
  background: linear-gradient(160deg, rgba(255,255,255,.18), rgba(255,255,255,.06));
  border-color: rgba(255,255,255,.3);
}
.switch input[type="checkbox"]:checked {
  background: linear-gradient(160deg, rgba(110,231,210,.9), rgba(56,199,178,.66));
  border-color: rgba(140,240,220,.6);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.28), 0 0 0 3px rgba(110,231,210,.13);
}
.switch input[type="checkbox"]:checked::before {
  transform: translate(17px, -50%);
  background: linear-gradient(160deg, #ffffff, #d9fff6);
  box-shadow: 0 2px 6px rgba(0,0,0,.32), inset 0 1px 0 rgba(255,255,255,.6);
}
/* 礼包卡片内的勾选框：略微放大，点击区域更舒适 */
.gift-picks .pick input[type="checkbox"] {
  width: 19px; height: 19px; flex: 0 0 19px; margin-top: 1px;
}
.gift-picks .pick input[type="checkbox"]::after { width: 9px; height: 5px; }
/* 卡片被勾选时整卡高亮，呼应毛玻璃 */
.gift-picks .pick:has(input[type="checkbox"]:checked) {
  border-color: rgba(110,231,210,.4);
  background: linear-gradient(160deg, rgba(110,231,210,.12), rgba(255,255,255,.04));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 4px 14px rgba(0,0,0,.2);
}
/* 表头全选框：保持小尺寸，避免撑高表头 */
.log-table th input[type="checkbox"], table th input[type="checkbox"] {
  width: 15px; height: 15px; flex: 0 0 15px; border-radius: 5px;
}
.log-table th input[type="checkbox"]::after,
table th input[type="checkbox"]::after { width: 7px; height: 4px; }
/* ============ 毛玻璃勾选框 / 开关 ============ */

html, body {
  margin: 0; height: 100%;
  font-family: "Segoe UI Variable Text", "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
  font-size: 14px;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
/* 底色只能放在 html（画布），放 body 会盖住负 z-index 的背景层 */
html { background: #0b1220; }
::selection { background: rgba(110, 231, 210, 0.3); color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(110, 231, 210, 0.42);
  background-clip: padding-box;
  border: 3px solid transparent;
}
.bg {
  position: fixed; inset: 0; z-index: -3;
  background:
    radial-gradient(1200px 600px at 10% 0%, #2b5f7a 0%, transparent 55%),
    radial-gradient(900px 500px at 90% 20%, #3a2a58 0%, transparent 50%),
    linear-gradient(180deg, #0b1220 0%, #152238 40%, #1a3a42 100%);
}
/* 随机壁纸层：加载完成后淡入，失败时保留下方渐变兜底 */
.bg-photo {
  position: fixed; inset: 0; z-index: -2;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  opacity: 0;
  transition: opacity .9s ease;
  pointer-events: none;
}
.bg-photo.show { opacity: 1; }
.mist {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(130% 100% at 50% 35%, transparent 42%, rgba(6, 10, 18, 0.42) 100%),
    linear-gradient(180deg, rgba(8, 12, 22, 0.48) 0%, rgba(8, 12, 22, 0.58) 55%, rgba(8, 12, 22, 0.7) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='80'%3E%3Cpath d='M0 60 Q40 20 80 50 T160 40 V80 H0Z' fill='rgba(255,255,255,.04)'/%3E%3C/svg%3E");
  background-size: cover, cover, 480px 180px;
  background-position: bottom;
}
.app { max-width: 1280px; margin: 0 auto; padding: 18px 18px 32px; }
.glass {
  background: var(--glass);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  border-radius: 16px;
}
.bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; margin-bottom: 14px; gap: 16px; flex-wrap: wrap;
}
.brand { display: flex; gap: 12px; align-items: center; }
.mark {
  width: 46px; height: 46px; border-radius: 14px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, rgba(110,231,210,.34), rgba(232,196,122,.16) 70%);
  border: 1px solid rgba(255,255,255,.22);
  box-shadow: 0 10px 26px rgba(110,231,210,.22), inset 0 1px 0 rgba(255,255,255,.28);
  color: #eafff9;
}
.mark svg {
  width: 23px; height: 23px; display: block;
  filter: drop-shadow(0 2px 8px rgba(110,231,210,.45));
}
h1 {
  margin: 0; font-size: 17px; letter-spacing: .12em; font-weight: 650;
  background: linear-gradient(100deg, #f2fbff 0%, #a6ecdd 55%, #eed9a6 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: #eef4ff;
}
.brand p { margin: 3px 0 0; color: var(--muted); font-size: 12px; letter-spacing: .04em; }
.tabs { display: flex; gap: 6px; }
.tabs button, button {
  appearance: none; border: 1px solid var(--line);
  background: var(--glass2); color: var(--text);
  padding: 8px 14px; border-radius: 999px; cursor: pointer;
  font-size: 13px; letter-spacing: .02em;
  transition: background .22s ease, border-color .22s ease, color .22s ease, transform .18s ease, filter .18s ease, box-shadow .22s ease;
}
.tabs button.on, button.pri {
  background: linear-gradient(180deg, rgba(110,231,210,.3), rgba(110,231,210,.1));
  border-color: rgba(110,231,210,.45); color: #f4fffc;
}
button.pri {
  background: linear-gradient(180deg, rgba(110,231,210,.4), rgba(110,231,210,.14));
  border-color: rgba(110,231,210,.52);
  box-shadow: 0 8px 20px rgba(110,231,210,.16), inset 0 1px 0 rgba(255,255,255,.14);
}
.tabs button { position: relative; }
.tabs button.on {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(110,231,210,.14), inset 0 1px 0 rgba(255,255,255,.12);
}
button.danger { border-color: rgba(255,138,138,.4); color: var(--danger); }
button.mini { padding: 4px 10px; font-size: 12px; }
button:hover:not(:disabled) { filter: brightness(1.1); transform: translateY(-1px); }
button:active:not(:disabled) { transform: translateY(0) scale(.98); filter: brightness(1.02); }
button:disabled { opacity: .4; cursor: not-allowed; filter: none; transform: none; }
button:focus-visible, input:focus-visible, textarea:focus-visible, .dd-btn:focus-visible {
  outline: 2px solid rgba(110,231,210,.55); outline-offset: 2px;
}
.panel {
  display: none;
  opacity: 0;
  transform: translateY(10px);
}
html:not(.js-ready)[data-tab="settings"] #tab-accounts,
html:not(.js-ready)[data-tab="cards"] #tab-accounts,
html:not(.js-ready)[data-tab="exchanges"] #tab-accounts,
html:not(.js-ready)[data-tab="logs"] #tab-accounts { display: none; }
html:not(.js-ready)[data-tab="settings"] #tab-settings,
html:not(.js-ready)[data-tab="cards"] #tab-cards,
html:not(.js-ready)[data-tab="exchanges"] #tab-exchanges,
html:not(.js-ready)[data-tab="logs"] #tab-logs {
  display: block; opacity: 1; transform: none;
}
html.js-ready .panel.on { animation: panelIn .32s ease forwards; }
html:not(.js-ready)[data-tab="settings"] #tabs [data-tab="accounts"],
html:not(.js-ready)[data-tab="cards"] #tabs [data-tab="accounts"],
html:not(.js-ready)[data-tab="exchanges"] #tabs [data-tab="accounts"],
html:not(.js-ready)[data-tab="claims"] #tabs [data-tab="accounts"],
html:not(.js-ready)[data-tab="recycled"] #tabs [data-tab="accounts"],
html:not(.js-ready)[data-tab="logs"] #tabs [data-tab="accounts"] {
  background: var(--glass2); border-color: var(--line); color: var(--text); transform: none;
}
html:not(.js-ready)[data-tab="settings"] #tabs [data-tab="settings"],
html:not(.js-ready)[data-tab="cards"] #tabs [data-tab="cards"],
html:not(.js-ready)[data-tab="exchanges"] #tabs [data-tab="exchanges"],
html:not(.js-ready)[data-tab="claims"] #tabs [data-tab="claims"],
html:not(.js-ready)[data-tab="recycled"] #tabs [data-tab="recycled"],
html:not(.js-ready)[data-tab="logs"] #tabs [data-tab="logs"] {
  background: linear-gradient(180deg, rgba(110,231,210,.28), rgba(110,231,210,.08));
  border-color: rgba(110,231,210,.45); color: #f4fffc;
}
.panel.on {
  display: block;
}
@keyframes panelIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 12px; margin-bottom: 12px; align-items: center; }
.sep { width: 1px; height: 22px; background: var(--line); }
.grow { flex: 1; }
input, textarea, select {
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14);
  color: var(--text); border-radius: 10px; padding: 8px 10px; font: inherit;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, rgba(238,244,255,.7) 50%),
    linear-gradient(135deg, rgba(238,244,255,.7) 50%, transparent 50%);
  background-position: calc(100% - 16px) 52%, calc(100% - 11px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 28px;
}
select option { background: #131b2b; color: var(--text); }
/* 多选列表：不画单选下拉箭头，避免误导成单选 */
select[multiple] {
  background-image: none;
  background-position: 0 0;
  padding-right: 10px;
  min-height: 96px;
  padding: 6px 8px;
}
select[multiple] option { padding: 7px 10px; border-radius: 6px; margin-bottom: 2px; }
select[multiple] option:checked {
  background: rgba(110,231,210,.22);
  color: var(--text);
}
input:focus, textarea:focus, select:focus {
  border-color: rgba(110,231,210,.55);
  box-shadow: 0 0 0 3px rgba(110,231,210,.15);
  background: rgba(255,255,255,.1);
}
::placeholder { color: rgba(168,182,204,.55); }
#q { min-width: 200px; }
.dd { position: relative; min-width: 176px; max-width: 280px; flex: 0 1 auto; z-index: 5; }
.dd.open { z-index: 30; }
.dd-menu { z-index: 60; }
.dd-btn {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  appearance: none; font: inherit; cursor: pointer; text-align: left;
  color: var(--text);
  background: rgba(255,255,255,.08);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  white-space: nowrap;
}
.dd-btn::after {
  content: "";
  width: 8px; height: 8px; flex: 0 0 auto;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translateY(-2px);
  opacity: .85;
}
.dd.open .dd-btn {
  border-color: rgba(110,231,210,.45);
  background: rgba(110,231,210,.12);
}
.dd-menu {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  max-height: 280px; overflow: auto;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(16, 24, 38, 0.92);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  box-shadow: var(--shadow);
}
.dd-item {
  display: block; width: 100%; text-align: left;
  appearance: none; font: inherit; cursor: pointer;
  color: var(--text);
  background: transparent; border: 0;
  border-radius: 8px;
  padding: 8px 10px;
}
.dd-item:hover { background: rgba(255,255,255,.08); }
.dd-item.on {
  background: rgba(110,231,210,.18);
  color: #f4fffc;
}
.split { display: grid; grid-template-columns: 1.15fr .95fr; gap: 12px; }
.col { display: flex; flex-direction: column; gap: 12px; }
.card {
  padding: 12px 14px;
  /* .glass 用 backdrop-filter，会创建「层叠上下文」——它的 z-index 只在
     自己这层内部生效。账号列表卡片在 DOM 里排在下拉框之后，若不给
     卡片降层，展开的下拉菜单会被卡片整个盖住（点不到选项）。
     这里给 .card 显式降层，并让展开中的下拉框浮到最上层。 */
  position: relative;
  z-index: 1;
}
.card:has(.dd.open) { z-index: 40; }
.card-h {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-weight: 650; font-size: 14px; letter-spacing: .06em;
  margin-bottom: 12px; color: var(--gold);
}
.card-h::before {
  content: ""; flex: 0 0 auto;
  width: 3px; height: 15px; border-radius: 999px;
  background: linear-gradient(180deg, var(--teal), var(--gold));
  box-shadow: 0 0 10px rgba(110,231,210,.35);
}
.table-wrap { overflow: auto; max-height: 560px; }
.table-wrap.short { max-height: 360px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid rgba(255,255,255,.08); }
th {
  font-size: 11px; letter-spacing: .08em; font-weight: 600;
  color: var(--muted); text-transform: uppercase;
  position: sticky; top: 0;
  background: rgba(16, 24, 38, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
tr.sel td { background: rgba(110,231,210,.12); }
tr:hover td { background: rgba(255,255,255,.04); }

/* ---- 可排序表头 ---- */
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable:hover { color: var(--teal); }
th.sortable::after {
  content: "⇅";
  display: inline-block;
  margin-left: 5px;
  opacity: .28;
  font-size: 10px;
}
th.sortable.asc::after { content: "▲"; opacity: .95; color: var(--teal); }
th.sortable.desc::after { content: "▼"; opacity: .95; color: var(--teal); }
th.col-id { width: 52px; }
td.col-id { width: 52px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mini-select {
  appearance: none;
  font: inherit; font-size: 12px;
  color: var(--text);
  background: rgba(255,255,255,.08);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 8px;
  cursor: pointer;
}
.stats { display: grid; grid-template-columns: 1.1fr .9fr .9fr .8fr; gap: 8px; }
.lbl { color: var(--muted); font-size: 12px; }
.num { font-size: 32px; font-weight: 700; color: var(--teal); }
.val { font-size: 16px; margin-top: 6px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.span2 { grid-column: 1 / -1; }
.settings-grid { align-items: stretch; gap: 14px; }
.settings-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 16px;
}
.settings-card .hint { margin: 0 0 4px; }
.settings-card .form { flex: 1; margin: 8px 0 0; align-content: start; }
.settings-card label.grow {
  display: flex;
  flex-direction: column;
  min-height: 132px;
}
.settings-card textarea {
  width: 100%;
  min-height: 108px;
  resize: vertical;
}
.settings-card label.grow textarea {
  flex: 1;
  min-height: 108px;
}
.settings-card .card-foot {
  margin-top: auto;
  padding-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
.form label.full { grid-column: 1 / -1; }
textarea { min-height: 72px; resize: vertical; }
.form label, .dialog label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }
.time-pair { display: flex; align-items: center; gap: 8px; }
.time-pair input { width: 84px; text-align: center; }
.time-pair b { color: var(--muted); font-size: 15px; font-weight: 600; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.switch { display: flex; align-items: center; gap: 8px; margin: 6px 0 10px; }
.switch.tight { margin: 0 0 0 auto; color: var(--text); font-weight: 500; }
.hint { color: var(--muted); font-size: 12px; line-height: 1.5; }
/* 登录错误 / 会话失效提示：需要醒目，避免用户只看到「静默弹回登录框」 */
.hint.warn, .hint.warn:empty { color: #ff9c9c; }
.hint.warn { font-weight: 600; }
.hint.warn:empty { display: none; }
.gift-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.pick {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 10px; border: 1px solid var(--line); border-radius: 12px;
  background: rgba(255,255,255,.04);
}
.pick b { display: block; color: var(--text); }
.pick span { color: var(--muted); font-size: 12px; }
.log-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.log-filters button.on { border-color: rgba(110,231,210,.45); background: rgba(110,231,210,.16); }
.log-wrap { max-height: 64vh; }
.log-table { font-size: 12px; }
.log-table td { vertical-align: top; }
.log-table .t { color: var(--muted); white-space: nowrap; width: 1%; }
.log-table .act { white-space: nowrap; color: var(--gold); width: 1%; }
.log-table .acc { white-space: nowrap; color: var(--teal); max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.log-table tr.lv-error td { color: #ffb4b4; }
.log-table tr.lv-warn td { color: #f3d59a; }
.badge {
  display: inline-block; padding: 1px 7px; border-radius: 8px;
  border: 1px solid var(--line); font-size: 11px;
}
.alive {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 650; letter-spacing: .04em;
}
.alive.ok {
  color: #b7ffe9;
  background: rgba(110,231,210,.18);
  border: 1px solid rgba(110,231,210,.45);
}
.alive.bad {
  color: #ffd0d0;
  background: rgba(255,138,138,.16);
  border: 1px solid rgba(255,138,138,.45);
}
/* 平台订单诊断：成败标记 */
.otag {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 650; white-space: nowrap;
}
.otag.ok {
  color: #b7ffe9;
  background: rgba(110,231,210,.18);
  border: 1px solid rgba(110,231,210,.45);
}
.otag.bad {
  color: #ffd0d0;
  background: rgba(255,138,138,.16);
  border: 1px solid rgba(255,138,138,.45);
}
#kmfOrderBox { margin-top: 12px; }
#kmfOrderBox .table-wrap { max-height: 260px; overflow: auto; }
.modal {
  position: fixed; inset: 0; z-index: 80; background: rgba(6,10,18,.55);
  display: grid; place-items: center; backdrop-filter: blur(8px);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .24s ease, visibility .24s ease;
}
.modal.open { pointer-events: auto; }
.modal.open { opacity: 1; visibility: visible; }
.modal[hidden] { display: none !important; }
.modal.open[hidden] { display: grid !important; }
.dialog {
  width: min(640px, 92vw); padding: 20px; display: flex; flex-direction: column; gap: 12px;
  transform: translateY(12px) scale(.97);
  transition: transform .24s ease;
  border-radius: 18px;
}
.modal.open .dialog { transform: none; }
.dialog.wide { width: min(860px, 94vw); max-height: 88vh; overflow: auto; }

/* 页内确认框（替代浏览器原生 confirm） */
.confirm-dlg { width: min(460px, 92vw); }
.confirm-body { margin: 4px 0 14px; }
.confirm-line {
  margin: 0 0 6px; font-size: 13px; line-height: 1.65; color: var(--text);
  word-break: break-word;
}
.confirm-line:last-child { margin-bottom: 0; }
.act-add {
  display: grid;
  grid-template-columns: 1.4fr .8fr auto;
  gap: 8px;
  margin: 10px 0 8px;
  align-items: center;
}
.act-preview {
  margin: 10px 0 4px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.22);
}
.act-pv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px 14px;
}
.act-pv-grid > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.act-pv-grid span { font-size: 11px; color: var(--muted); }
.act-pv-grid b {
  font-size: 13px; color: var(--text); font-weight: 600;
  overflow-wrap: anywhere; word-break: break-all;
}
.act-pv-warn { margin: 10px 0 0; font-size: 12px; color: var(--gold); line-height: 1.6; }
.act-pv-ok { margin: 10px 0 0; font-size: 12px; color: var(--teal); line-height: 1.6; }
.act-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 8px;
}
.act-card {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.05);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.act-card.off { opacity: .62; }
.act-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.act-top b { color: var(--text); font-size: 14px; }
.act-gid { font-size: 26px; font-weight: 700; color: var(--teal); letter-spacing: .04em; }
.act-meta { color: var(--muted); font-size: 12px; }
.detail-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.detail-avatar {
  width: 48px; height: 48px; border-radius: 14px; object-fit: cover;
  border: 1px solid var(--line); background: rgba(255,255,255,.06);
}
.detail-id { flex: 1; min-width: 160px; }
.detail-id h2 { margin: 0; font-size: 18px; }
.detail-chips { display: flex; gap: 8px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.chip {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--line); font-size: 12px; color: var(--muted);
}
.detail-actions { margin-left: auto; display: flex; gap: 8px; }
.stat {
  padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--line); background: rgba(255,255,255,.04);
}
.val.sm { font-size: 13px; line-height: 1.4; color: var(--muted); }
.rescan-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 10px; border-radius: 12px; border: 1px dashed var(--line);
}
.rescan-bar .dd { min-width: 160px; }
.d-tabs { display: flex; gap: 6px; }
.d-tabs button.on {
  background: linear-gradient(180deg, rgba(110,231,210,.28), rgba(110,231,210,.08));
  border-color: rgba(110,231,210,.45);
}
.d-pane { display: none; }
.d-pane.on { display: block; animation: panelIn .28s ease forwards; }
.head {
  width: 28px; height: 28px; border-radius: 50%; object-fit: cover;
  border: 1px solid var(--line); vertical-align: middle;
}
.ops { white-space: nowrap; }
.ops button { margin-right: 4px; padding: 4px 8px; font-size: 12px; }
.cal {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px;
  margin-bottom: 8px;
}
.cal .wd, .cal .cell {
  text-align: center; font-size: 12px; border-radius: 8px; padding: 6px 2px;
}
.cal .wd { color: var(--muted); }
.cal .cell { border: 1px solid var(--line); background: rgba(255,255,255,.04); min-height: 48px; }
.cal .ok { background: rgba(110,231,210,.22); color: #bff5e8; }
.cal .miss { background: rgba(255,138,138,.18); color: #ffd0d0; }
.cal .today { outline: 2px solid var(--gold); }
.pager {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  margin-top: 10px; color: var(--muted); font-size: 12px;
}
tr.ex-used td { opacity: .72; }
td.code { font-family: Consolas, "Courier New", monospace; letter-spacing: .02em; }
button.code-copy {
  font-family: Consolas, "Courier New", monospace;
  letter-spacing: .02em;
  background: transparent;
  border: 0;
  color: var(--teal);
  padding: 0;
  text-align: left;
  cursor: pointer;
  text-decoration: underline dotted rgba(110,231,210,.45);
}
button.code-copy:hover { color: #f4fffc; filter: none; }
#cdCode { cursor: pointer; }
#cdAdjustBar { margin: 10px 0 12px; }
#cdAdjustBar input {
  background: rgba(255,255,255,.08); border: 1px solid var(--line);
  color: var(--text); border-radius: 10px; padding: 8px 10px; font: inherit;
}
@media (max-width: 960px) {
  .split, .grid2, .form, .stats, .act-add { grid-template-columns: 1fr; }
}

/* login — must beat [hidden] via explicit display rules */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 20px;
}
.login-wrap[hidden],
#adminApp[hidden],
#loginWrap[hidden] {
  display: none !important;
}
body.need-login #adminApp { display: none !important; }
body.need-login #loginWrap { display: grid !important; }
body.logged-in #loginWrap { display: none !important; }
body.logged-in #adminApp { display: block; }
.login-box { width: min(400px, 92vw); padding: 20px; gap: 12px; display: flex; flex-direction: column; }
.login-brand { margin-bottom: 4px; }
a.mini {
  appearance: none; border: 1px solid var(--line);
  background: var(--glass2); color: var(--text);
  padding: 4px 10px; border-radius: 10px; text-decoration: none; font-size: 12px;
  display: inline-flex; align-items: center;
}

/* shop layout */
.shop-body { min-height: 100%; }
.shop-app {
  max-width: 960px;
  padding: 22px 18px 48px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.shop-bar {
  align-items: center;
  margin-bottom: 0;
  padding: 16px 18px;
  position: sticky;
  top: 10px;
  z-index: 40;
}
.shop-tabs { margin-left: auto; }
.shop-tabs button { border-radius: 999px; }
.shop-pane { display: none; }
.shop-pane.on { display: flex; flex-direction: column; gap: 16px; }
.shop-pane[hidden] { display: none !important; }
.shop-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
}
.shop-block {
  padding: 16px 18px 18px;
  margin: 0;
}
.shop-block .card-h {
  margin-bottom: 12px;
  gap: 8px;
}
.shop-block .hint { margin: 0; }
.glass-pill {
  display: flex; flex-direction: column; justify-content: center;
  padding: 10px 16px; border-radius: 14px; border: 1px solid rgba(110,231,210,.35);
  background: linear-gradient(160deg, rgba(110,231,210,.18), rgba(110,231,210,.06));
  min-width: 112px; text-align: right;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
.glass-pill .lbl { font-size: 11px; color: var(--muted); letter-spacing: .04em; white-space: nowrap; }
.glass-pill strong { font-size: 24px; color: var(--teal); line-height: 1.15; margin-top: 2px; }
/* 公告：小字居中 */
.announce { text-align: center; }
.announce .card-h { justify-content: center; margin-bottom: 8px; }
.announce-text {
  white-space: pre-wrap; margin: 0;
  font-size: 13px; line-height: 1.9; letter-spacing: .04em;
  color: rgba(238, 244, 255, 0.88);
  text-align: center;
  padding: 14px 16px; border-radius: 12px;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08);
}
.shop-login {
  display: grid; grid-template-columns: 1fr auto; gap: 10px; margin: 0 0 10px;
}
.shop-login input {
  min-width: 0; width: 100%;
  padding: 11px 14px; font-size: 14px;
}
.shop-login .pri { padding: 11px 18px; white-space: nowrap; }
.btn-group { display: flex; gap: 10px; align-items: center; }
.buy-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 11px 18px; border-radius: 999px;
  background: linear-gradient(135deg, #f6b73c 0%, #f27a3d 55%, #e8567a 100%);
  color: #fff; font-weight: 650; font-size: 13px; letter-spacing: .05em;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  border: 1px solid rgba(255,255,255,.28);
  box-shadow: 0 10px 24px rgba(242,122,61,.32), inset 0 1px 0 rgba(255,255,255,.32);
  transition: transform .18s ease, filter .18s ease, box-shadow .2s ease;
}
.buy-btn:hover {
  filter: brightness(1.08); transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(242,122,61,.42), inset 0 1px 0 rgba(255,255,255,.32);
}
.buy-btn:active { transform: translateY(0) scale(.98); }
.buy-btn[hidden] { display: none !important; }
.claim-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 0 0 14px;
}
.claim-row input {
  width: 96px; text-align: center; padding: 8px 10px;
}
.claim-row .hint { margin: 0; }
.goods-empty {
  grid-column: 1 / -1;
  padding: 28px 12px;
  text-align: center;
  border: 1px dashed rgba(255,255,255,.14);
  border-radius: 14px;
  background: rgba(255,255,255,.03);
}
.goods-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.goods-card {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.14);
  background:
    linear-gradient(180deg, rgba(18,26,42,.62), rgba(18,26,42,.42));
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 168px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: border-color .2s ease, transform .2s ease, background .2s ease, box-shadow .2s ease;
}
.goods-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(110,231,210,.5), rgba(232,196,122,.45), transparent);
  opacity: 0; transition: opacity .25s ease;
}
.goods-card:hover {
  border-color: rgba(110,231,210,.35);
  transform: translateY(-3px);
  background: linear-gradient(180deg, rgba(26,48,58,.66), rgba(18,26,42,.5));
  box-shadow: 0 16px 36px rgba(0,0,0,.28);
}
.goods-card:hover::before { opacity: 1; }
.goods-card.picked {
  border-color: rgba(110,231,210,.6);
  background: linear-gradient(180deg, rgba(26,48,58,.68), rgba(18,26,42,.52));
  box-shadow: 0 0 0 1px rgba(110,231,210,.45), 0 16px 36px rgba(0,0,0,.3);
}
.goods-card.picked::before { opacity: 1; }
.goods-card.claimed,
.goods-card.empty,
.goods-card.poor {
  opacity: .72;
}
.goods-card.claimed:hover,
.goods-card.empty:hover,
.goods-card.poor:hover {
  transform: none;
  border-color: rgba(255,255,255,.14);
}
.shop-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(16px);
  z-index: 120;
  max-width: min(92vw, 420px);
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(16, 24, 38, 0.88);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.shop-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.shop-toast.ok { border-color: rgba(110,231,210,.45); }
.shop-toast.err { border-color: rgba(255,138,138,.5); color: #ffd0d0; }
.shop-toast.warn { border-color: rgba(232,196,122,.45); color: #f3d59a; }
.goods-top {
  display: flex; justify-content: space-between; gap: 10px; align-items: flex-start;
}
.goods-top b {
  color: var(--text); font-size: 15px; line-height: 1.35;
  flex: 1; min-width: 0; word-break: break-word;
}
.goods-meta { color: var(--muted); font-size: 12px; line-height: 1.4; }
.goods-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: auto;
}
.goods-stats span {
  display: flex; flex-direction: column; gap: 2px;
  padding: 8px 10px; border-radius: 10px;
  background: rgba(0,0,0,.3); border: 1px solid rgba(255,255,255,.06);
  font-size: 11px; color: var(--muted);
}
.goods-stats strong { color: var(--gold); font-size: 16px; font-weight: 700; }
.goods-card .ops {
  margin-top: 2px;
  white-space: normal;
}
.goods-card .ops button {
  width: 100%;
  margin: 0;
  padding: 9px 12px;
  font-size: 13px;
  border-radius: 10px;
}
.code-big {
  font-family: Consolas, "Courier New", monospace;
  font-size: 18px; letter-spacing: .06em;
  padding: 18px; border-radius: 12px; border: 1px dashed rgba(110,231,210,.4);
  background: rgba(0,0,0,.26); word-break: break-all; text-align: center;
  color: var(--teal);
}
.code-big[hidden] { display: none !important; }
/* 一次提取多个兑换码：一行一个 */
.code-list {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 46vh; overflow: auto; padding-right: 4px;
}
.code-list[hidden] { display: none !important; }
.code-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 10px;
  border: 1px solid rgba(110,231,210,.28);
  background: rgba(0,0,0,.26);
}
.code-no {
  flex: 0 0 auto; min-width: 24px; height: 24px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; font-size: 12px; font-weight: 700;
  color: var(--teal); border: 1px solid rgba(110,231,210,.4);
  background: rgba(110,231,210,.1);
}
.code-val {
  flex: 1 1 auto; min-width: 0;
  font-family: Consolas, "Courier New", monospace;
  font-size: 14px; letter-spacing: .04em;
  color: var(--teal); word-break: break-all; text-align: left;
}
.code-row .mini { flex: 0 0 auto; margin: 0; }

/* 提取记录：按批次分组展示 */
.rec-batches { display: flex; flex-direction: column; gap: 12px; }
.rec-batch {
  padding: 12px 14px; border-radius: 12px;
  border: 1px solid rgba(110,231,210,.22);
  background: rgba(0,0,0,.2);
}
.rec-batch-h {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding-bottom: 10px; margin-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.rec-time {
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px; color: var(--text); letter-spacing: .03em;
}
.rec-batch-h .hint { flex: 1 1 auto; }
.rec-batch-h .mini { flex: 0 0 auto; margin: 0; }
.rec-list { max-height: none; gap: 7px; }
.rec-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 11px; border-radius: 10px;
  border: 1px solid rgba(110,231,210,.24);
  background: rgba(0,0,0,.26);
}
.rec-row .mini { flex: 0 0 auto; margin: 0; }
.rec-dead {
  border-style: dashed;
  border-color: rgba(255,138,138,.4);
  background: rgba(255,138,138,.06);
}
.rec-dead .code-no { color: var(--danger); border-color: rgba(255,138,138,.4); background: rgba(255,138,138,.1); }
.rec-dead-txt { flex: 1 1 auto; font-size: 13px; color: var(--danger); opacity: .85; }

.result-dlg { max-height: 88vh; overflow: auto; }
.shop-disclaimer {
  margin-top: 4px;
  padding: 16px 18px 20px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(0,0,0,.2);
  text-align: center;
}
.shop-disclaimer[hidden] { display: none !important; }
.disclaimer-title {
  font-size: 11px;
  letter-spacing: .22em;
  color: var(--gold);
  margin-bottom: 10px;
  font-weight: 650;
}
.disclaimer-text {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.85;
  font-size: 12px;
  letter-spacing: .03em;
  color: var(--muted);
}

/* admin gift shop controls */
.shop-pick { align-items: flex-start; }
.pick-auto {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-size: 11px; color: var(--muted); min-width: 36px;
}
.pick-body { flex: 1; min-width: 0; }
.shop-row {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px;
}
.price-lab {
  display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted);
}
.price-lab input { width: 88px; padding: 4px 8px; }
label.inline {
  display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted);
}
label.inline input { width: 72px; }
label.inline.grow { flex: 1; min-width: 120px; }
label.inline.grow input { width: 100%; flex: 1; }

@media (max-width: 720px) {
  .bar { flex-direction: column; align-items: stretch; }
  .tabs { width: 100%; overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .tabs button { flex: 0 0 auto; white-space: nowrap; }
  .toolbar { gap: 6px; }
  .shop-app { padding: 14px 12px 36px; }
  .shop-bar {
    position: static;
    flex-direction: row;
    display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  }
  .shop-bar .brand { order: 1; flex: 1 1 auto; min-width: 0; }
  .shop-bar .shop-bal {
    order: 2; flex: 0 0 auto;
    min-width: 88px; padding: 8px 14px; border-radius: 12px;
  }
  .shop-bal .lbl { font-size: 10px; }
  .shop-bal strong { font-size: 20px; margin-top: 1px; }
  .shop-tabs { order: 3; flex: 1 1 100%; margin-left: 0; width: 100%; }
  .shop-stack { gap: 12px; margin-top: 12px; }
  .shop-block { padding: 14px; }
  .shop-login { grid-template-columns: 1fr; }
  .shop-login .pri { width: 100%; }
  .btn-group { width: 100%; }
  .btn-group .buy-btn { flex: 0 0 auto; padding: 11px 16px; }
  .btn-group .pri { flex: 1; width: auto; }
  .goods-grid { grid-template-columns: 1fr; gap: 12px; }
  .goods-card { min-height: 0; }
  .table-wrap { max-height: none; }
  th, td { font-size: 12px; padding: 6px 4px; }
  .ops { white-space: normal; }
  .ops button { margin-bottom: 4px; }
  .dd { min-width: 140px; max-width: none; flex: 1 1 140px; }
  .shop-row { flex-direction: column; align-items: stretch; }
  .price-lab { width: 100%; justify-content: space-between; }
  .price-lab input { width: 100px; }
  .announce-text { font-size: 12.5px; padding: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
