:root {
  --bg: #070a0f;
  --panel: rgba(16, 22, 32, 0.86);
  --panel-2: #0f1520;
  --line: rgba(120, 200, 255, 0.14);
  --text: #e6eefc;
  --muted: #8595ad;
  --accent: #35e0c0;
  --accent-2: #3aa0ff;
  --danger: #ff6b81;
  --warn: #ffc46b;
  --ok: #35e0c0;
  --radius: 16px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  overflow-x: hidden;
}
.glow {
  position: fixed; inset: -20% -10% auto -10%; height: 55vh;
  background:
    radial-gradient(40% 60% at 20% 20%, rgba(53, 224, 192, 0.16), transparent 70%),
    radial-gradient(45% 60% at 80% 0%, rgba(58, 160, 255, 0.15), transparent 70%);
  filter: blur(30px); pointer-events: none; z-index: 0;
}

.topbar {
  position: relative; z-index: 3; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; max-width: 980px; margin: 0 auto;
  padding: 16px 24px 12px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  display: grid; place-items: center;
  width: 46px; height: 46px; border-radius: 13px;
  background: linear-gradient(140deg, rgba(53,224,192,.22), rgba(58,160,255,.18));
  border: 1px solid var(--line);
  color: var(--accent); font-weight: 800; letter-spacing: .5px; font-size: 14px;
}
.brand-text b { display: block; font-size: 17px; letter-spacing: .5px; }
.brand-text small { color: var(--muted); font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; }

.account { display: flex; align-items: center; gap: 12px; }
.mask {
  font-family: ui-monospace, Consolas, monospace; font-size: 13px;
  color: var(--accent); background: rgba(53,224,192,.08);
  border: 1px solid var(--line); padding: 6px 12px; border-radius: 999px;
}

main {
  position: relative; z-index: 1;
  flex: 1 1 auto; min-height: 0; width: 100%;
  overflow-y: auto; overflow-x: hidden;
  padding: 10px 20px 24px;
  display: flex; flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: rgba(120, 200, 255, 0.22) transparent;
}
main::-webkit-scrollbar { width: 8px; }
main::-webkit-scrollbar-thumb { background: rgba(120, 200, 255, 0.18); border-radius: 8px; }
main::-webkit-scrollbar-track { background: transparent; }

.view { margin: auto; width: 100%; max-width: 980px; }
[hidden] { display: none !important; }

/* 登录 */
.login-card {
  max-width: 440px; margin: 0 auto;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 22px; padding: 30px 28px;
  box-shadow: 0 30px 80px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.04);
  backdrop-filter: blur(12px);
}
.login-card h1 { margin: 0 0 6px; font-size: 22px; }
.sub { color: var(--muted); margin: 0 0 14px; font-size: 13.5px; }
.sub b { color: var(--accent); }

.trustline { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 8px; }
.login-card .trustline {
  display: grid; grid-template-columns: repeat(2, max-content);
  gap: 8px; justify-content: start;
}
.trust-chip {
  font-size: 11.5px; color: #9fe9d9; white-space: nowrap;
  border: 1px solid rgba(53, 224, 192, 0.28);
  background: rgba(53, 224, 192, 0.07);
  padding: 4px 10px; border-radius: 999px;
}
.trust-note { color: var(--muted); font-size: 12px; line-height: 1.65; margin: 0 0 18px; }
.app-trust { margin: 0 0 12px; }
.field { display: block; margin-bottom: 16px; }
.field span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 8px; letter-spacing: 1px; }
input[type=text] {
  width: 100%; padding: 14px 16px; border-radius: 12px;
  background: #0a0f17; border: 1px solid #223047; color: var(--text);
  font: 600 15px/1.2 ui-monospace, Consolas, monospace; letter-spacing: 1px;
  outline: none; transition: border-color .2s, box-shadow .2s;
}
input[type=text]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(53,224,192,.12); }
.hint { color: var(--muted); font-size: 12px; margin: 14px 0 0; }

button { font-family: inherit; cursor: pointer; border: 0; }
.primary {
  width: 100%; padding: 13px 18px; border-radius: 12px;
  background: linear-gradient(135deg, #35e0c0, #2fb6ff);
  color: #04121a; font-weight: 800; font-size: 15px; letter-spacing: .5px;
  transition: transform .15s, filter .2s, opacity .2s;
}
.primary:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-1px); }
.primary:disabled { opacity: .45; cursor: not-allowed; }
.ghost {
  background: transparent; color: var(--muted); border: 1px solid var(--line);
  padding: 7px 12px; border-radius: 10px; font-size: 12.5px;
}
.ghost:hover { color: var(--text); border-color: rgba(120,200,255,.32); }
.secondary {
  padding: 11px 16px; border-radius: 11px; background: #142032; color: var(--text);
  border: 1px solid var(--line); font-weight: 600;
}
.secondary:hover { border-color: var(--accent); }

/* 额度条 */
.quota-bar {
  display: flex; gap: 12px; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px;
  backdrop-filter: blur(10px);
}
.quota-item { flex: 1 1 120px; display: flex; flex-direction: column; gap: 2px; }
.quota-item.wide { flex: 2 1 260px; }
.quota-item span { font-size: 11.5px; color: var(--muted); letter-spacing: 1px; }
.quota-item b { font-size: 22px; color: var(--accent); font-variant-numeric: tabular-nums; }
.quota-item b.small { font-size: 12.5px; color: #aabbd4; font-weight: 500; line-height: 1.5; }

/* 卡片 */
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; margin-bottom: 16px;
  backdrop-filter: blur(10px);
}
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card-head h2 { margin: 0; font-size: 15.5px; letter-spacing: .4px; }
.tag { font-size: 11.5px; color: var(--muted); border: 1px solid var(--line); padding: 3px 9px; border-radius: 999px; }

.dropzone {
  border: 1.5px dashed rgba(120,200,255,.28); border-radius: 14px;
  padding: 30px 18px; text-align: center; cursor: pointer;
  background: rgba(10,15,23,.6); transition: border-color .2s, background .2s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: rgba(53,224,192,.06); }
.dz-icon { font-size: 26px; color: var(--accent); margin-bottom: 6px; }
.dz-main { font-weight: 600; }
.dz-sub { color: var(--muted); font-size: 12px; margin-top: 4px; }
.upload-actions { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.upload-actions .primary { width: auto; flex: 0 0 180px; }
.muted { color: var(--muted); font-size: 12px; }

/* 状态 */
.status {
  font-size: 12px; padding: 4px 12px; border-radius: 999px; font-weight: 700;
  border: 1px solid var(--line); color: var(--muted);
}
.status.queued { color: var(--warn); border-color: rgba(255,196,107,.35); background: rgba(255,196,107,.08); }
.status.running { color: var(--accent-2); border-color: rgba(58,160,255,.4); background: rgba(58,160,255,.09); }
.status.success { color: var(--ok); border-color: rgba(53,224,192,.4); background: rgba(53,224,192,.09); }
.status.failed { color: var(--danger); border-color: rgba(255,107,129,.4); background: rgba(255,107,129,.08); }

.active-body { display: flex; flex-direction: column; gap: 10px; }
.file-line { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.file-name { font-weight: 600; word-break: break-all; }
.progress { height: 9px; border-radius: 999px; background: #0a1119; border: 1px solid var(--line); overflow: hidden; }
.bar { height: 100%; width: 0%; border-radius: 999px; background: linear-gradient(90deg, #2fb6ff, #35e0c0); transition: width .6s ease; }
.progress-line { display: flex; justify-content: space-between; color: var(--muted); font-size: 12.5px; }
.queue-line { color: var(--warn); font-size: 13px; min-height: 0; }

.result { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 4px; }
.link-btn { width: auto; display: inline-block; text-decoration: none; text-align: center; padding: 11px 18px; }

/* 历史 */
.history { display: flex; flex-direction: column; gap: 8px; }
.empty { color: var(--muted); font-size: 13px; padding: 8px 2px; }
.h-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 12px; background: rgba(10,15,23,.66);
  border: 1px solid rgba(120,200,255,.09);
}
.h-main { flex: 1; min-width: 0; }
.h-name { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-meta { color: var(--muted); font-size: 11.5px; }
.h-actions { display: flex; gap: 8px; align-items: center; }
.h-actions a {
  font-size: 12px; color: var(--accent); text-decoration: none;
  border: 1px solid rgba(53,224,192,.3); padding: 5px 10px; border-radius: 8px;
}
.h-actions a:hover { background: rgba(53,224,192,.08); }

/* 吸底栏 */
.bottombar {
  flex: 0 0 auto; z-index: 3;
  border-top: 1px solid var(--line);
  background: rgba(8, 12, 18, 0.94);
  backdrop-filter: blur(14px);
  padding: 11px 20px calc(11px + env(safe-area-inset-bottom, 0px));
  text-align: center;
}
.contacts {
  display: flex; align-items: center; justify-content: center;
  gap: 14px; flex-wrap: wrap;
  font-size: 13px; color: var(--muted);
}
.contact-item b { color: var(--accent); font-weight: 700; }
#wechatId { cursor: pointer; border-bottom: 1px dashed rgba(53, 224, 192, 0.5); }
#wechatId:hover { color: #7ff5dd; }
.dot { width: 4px; height: 4px; border-radius: 50%; background: rgba(120, 200, 255, 0.3); }
.tip { margin-top: 5px; font-size: 11.5px; color: #6f8098; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 20px);
  background: #101a26; border: 1px solid var(--line); color: var(--text);
  padding: 12px 18px; border-radius: 12px; font-size: 13.5px;
  box-shadow: 0 18px 50px rgba(0,0,0,.5); opacity: 0; pointer-events: none;
  transition: opacity .22s, transform .22s; max-width: min(90vw, 560px); z-index: 99;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { border-color: rgba(255,107,129,.5); color: #ffd7dd; }
.toast.ok { border-color: rgba(53,224,192,.5); color: #c8fff4; }

@media (max-width: 560px) {
  .topbar { padding: 12px 16px 8px; gap: 8px; flex-wrap: wrap; row-gap: 6px; }
  .brand { gap: 8px; min-width: 0; }
  .brand-text { min-width: 0; }
  .brand-text b { font-size: 13.5px; letter-spacing: 0; white-space: nowrap; }
  .brand-text small { display: none; }
  .account { width: 100%; justify-content: space-between; gap: 8px; }
  .account .mask {
    display: inline-block; font-size: 11px; letter-spacing: 0.3px; padding: 4px 8px;
  }
  .ghost { padding: 6px 10px; font-size: 12px; }
  .logo { width: 38px; height: 38px; font-size: 12px; border-radius: 11px; }
  main { padding: 6px 14px 18px; }
  .bottombar { padding: 9px 14px calc(9px + env(safe-area-inset-bottom, 0px)); }
  .contacts { gap: 10px; font-size: 12px; }
  .tip { font-size: 11px; }
  .tag { font-size: 10.5px; padding: 3px 8px; }
  .upload-actions { flex-direction: column; align-items: stretch; }
  .upload-actions .primary { flex: 1; width: 100%; }
  .quota-item b { font-size: 19px; }
}
