:root {
  --bg: #0f1319;
  --bg-soft: #161c24;
  --card: #1b2330;
  --line: #263041;
  --text: #e6edf6;
  --muted: #8b9bb0;
  --brand: #4c8dff;
  --brand-2: #2f6fe0;
  --ok: #38c172;
  --warn: #f0a92b;
  --err: #f2565f;
  --radius: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Microsoft YaHei", sans-serif;
}

a { color: var(--brand); }
code {
  background: rgba(255,255,255,.07);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
}
pre.json {
  background: #0b0f14;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  overflow: auto;
  max-height: 380px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  white-space: pre-wrap;
  word-break: break-all;
}
.hidden { display: none !important; }

/*
 * 必须放在所有布局规则之前并用 !important：
 * 浏览器默认的 [hidden]{display:none} 属于 UA 样式表，
 * 会被作者样式里的 .overlay{display:flex} / .btn{display:inline-flex} 压过，
 * 导致 element.hidden = true 完全失效（登录遮罩关不掉、未登录也显示「退出」）。
 * 这条规则保证 hidden 属性在任何情况下都是最高优先级。
 */
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.sep { border: 0; border-top: 1px solid var(--line); margin: 26px 0; }

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 20px; background: var(--bg-soft);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand strong { font-size: 15px; letter-spacing: .2px; }
.tag {
  font-size: 11px; color: var(--muted); border: 1px solid var(--line);
  padding: 1px 6px; border-radius: 20px;
}
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--err); display: inline-block; }
.dot.ok { background: var(--ok); }
.topbar-right { display: flex; align-items: center; gap: 10px; }

/* ---------- 标签页 ---------- */
.tabs {
  display: flex; gap: 4px; padding: 10px 20px 0; flex-wrap: wrap;
  background: var(--bg); position: sticky; top: 53px; z-index: 15;
}
.tab {
  background: transparent; border: 1px solid transparent; border-bottom: none;
  color: var(--muted); padding: 8px 14px; border-radius: 8px 8px 0 0; cursor: pointer;
  font-size: 13.5px;
}
.tab:hover { color: var(--text); background: rgba(255,255,255,.03); }
.tab.active { color: var(--text); background: var(--card); border-color: var(--line); }

.panel { display: none; padding: 20px; max-width: 1180px; margin: 0 auto; }
.panel.active { display: block; }
.panel h3 { margin: 18px 0 8px; font-size: 15px; }
.panel h3:first-child { margin-top: 0; }
.panel p { margin: 6px 0 10px; }
.panel ul, .panel ol { margin: 8px 0 12px; padding-left: 22px; }
.panel li { margin: 4px 0; }

/* ---------- 表单 ---------- */
.field { display: block; margin: 10px 0; }
.field > span { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.field.inline { display: inline-flex; flex-direction: column; margin: 0; min-width: 130px; }
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row > .field { flex: 1 1 240px; }
.small-field { max-width: 110px; flex: 0 0 110px; }

input[type=text], input[type=password], input[type=number], input:not([type]), select, textarea {
  width: 100%; background: #0d1218; color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
  font: inherit; font-size: 13px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(76,141,255,.15); }
textarea { resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  background: #23303f; color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 14px; font: inherit; font-size: 13px;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: #2b3a4c; }
.btn.primary { background: var(--brand-2); border-color: var(--brand-2); }
.btn.primary:hover { background: var(--brand); }
.btn.ghost { background: transparent; }
.btn.small { padding: 5px 10px; font-size: 12.5px; }
.check { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; }
.check input { width: auto; }

.toolbar { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin: 12px 0 16px; }

/* ---------- 表格 ---------- */
.table-wrap { border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; max-height: 520px; }
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
table.grid th, table.grid td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.grid thead th { background: #131922; position: sticky; top: 0; color: var(--muted); font-weight: 600; font-size: 12.5px; z-index: 1; }
table.grid tbody tr:hover { background: rgba(255,255,255,.03); }
table.grid td.empty { text-align: center; color: var(--muted); padding: 26px; }
.w-type { width: 110px; } .w-size { width: 110px; } .w-id { width: 190px; } .w-act { width: 170px; }
.fname { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.fname .ico { opacity: .8; }
.fname.dir { color: #7fb1ff; }
.cell-id { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; color: var(--muted); }

.crumbs { margin: 4px 0 10px; font-size: 13px; color: var(--muted); }
.crumb { cursor: pointer; margin-right: 6px; }
.crumb:hover { color: var(--brand); }
.crumb::after { content: '/'; margin-left: 6px; color: var(--line); }
.crumb:last-child::after { content: ''; }

/* ---------- 直链结果 ---------- */
#linkResult { border: 1px solid var(--line); background: var(--card); border-radius: var(--radius); padding: 16px; }
#linkResult h3 { margin-top: 0; }
.kv { display: flex; gap: 10px; font-size: 13px; margin: 3px 0; }
.kv span { color: var(--muted); min-width: 90px; }
.link-block { margin: 14px 0; }
.link-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.copyline { display: flex; gap: 8px; align-items: center; }
.copyline input { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
.details summary { cursor: pointer; color: var(--muted); font-size: 13px; }

.status-box {
  margin-top: 12px; padding: 12px; border: 1px solid var(--line);
  border-radius: var(--radius); background: #131922; font-size: 12.5px;
  white-space: pre-wrap; font-family: ui-monospace, Menlo, Consolas, monospace;
}

#history { display: flex; flex-direction: column; gap: 8px; }
.hist-item {
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
  background: #131922; font-size: 12.5px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.hist-item .nm { flex: 1 1 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 环境自检 ---------- */
.chk { display: flex; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; background: #131922; }
.chk .ico { font-weight: 700; }
.chk.ok .ico { color: var(--ok); }
.chk.bad .ico { color: var(--err); }
.chk .body { flex: 1; }
.chk .name { font-weight: 600; font-size: 13px; }
.chk .value { color: var(--muted); font-size: 12.5px; word-break: break-all; }
.chk .hint { color: var(--warn); font-size: 12.5px; margin-top: 2px; }

/* ---------- 登录 / 提示 ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(6,9,13,.86);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 24px; }
.login-card { width: 100%; max-width: 380px; }
.login-card h1 { font-size: 17px; margin: 0 0 6px; }
.login-card input { margin: 14px 0 12px; }
.login-card .btn { width: 100%; }
.error { color: var(--err); font-size: 12.5px; margin: 10px 0 0; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: #23303f; border: 1px solid var(--line); color: var(--text);
  padding: 10px 18px; border-radius: 8px; z-index: 200; font-size: 13px;
  box-shadow: 0 8px 30px rgba(0,0,0,.5); max-width: 80vw;
}
.toast.err { border-color: var(--err); }
.toast.ok { border-color: var(--ok); }

@media (max-width: 720px) {
  .w-type, .w-id { display: none; }
  table.grid th.w-type, table.grid td.w-type, table.grid th.w-id, table.grid td.w-id { display: none; }
  .copyline { flex-wrap: wrap; }
  .tabs { top: 0; position: static; }
}

/* ==========================================================================
   解析下载页（pan.html）
   ========================================================================== */

.pan-body { background: var(--bg); }

.pan-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 22px 18px 60px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pan-wrap .card { padding: 20px; }
.pan-wrap h3 { margin: 0 0 8px; font-size: 15px; }

/* 输入行：宽屏并排，窄屏自动换行 */
.parse-row { display: flex; gap: 10px; margin: 12px 0 4px; }
.parse-row input {
  flex: 1 1 auto;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 13px;
}
.parse-row .btn { flex: 0 0 auto; padding: 8px 22px; }

/* 结果操作区 */
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0 10px; }
.btn.big { padding: 11px 26px; font-size: 14.5px; font-weight: 600; }

/* 公开模式警示条 */
.warn-banner {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid var(--warn);
  background: rgba(240, 169, 43, .09);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.65;
}
.warn-banner b { color: var(--warn); }

/* 分享文件列表 */
.share-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #131922;
  margin-bottom: 8px;
  font-size: 13px;
}
.share-item .nm {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pan-foot { text-align: center; margin-top: 6px; line-height: 1.8; }

/* 卡片内联提示（比如后端还没配凭据） */
.warn-inline {
  margin: 10px 0 0;
  padding: 9px 12px;
  border: 1px solid var(--warn);
  border-radius: 8px;
  background: rgba(240, 169, 43, .08);
  color: var(--text);
  font-size: 12.5px;
  line-height: 1.7;
}
.warn-inline a { color: var(--brand); }

/* 结果异常时的提示 */
.result-bad {
  margin: 8px 0 0;
  padding: 9px 12px;
  border: 1px solid var(--err);
  border-radius: 8px;
  background: rgba(242, 86, 95, .08);
  font-size: 12.5px;
  line-height: 1.7;
}

/* 管理面板：键值列表 / 等宽文本 */
.kv-list { margin-top: 10px; }
.mono, .kv-list b { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* ==================== 网盘文件提取页（pan.html） ==================== */

.pan-body { padding-bottom: 40px; }

/* MEMBER 卡密卡片：紫色渐变，照着参考图做的 */
.member-card {
  position: relative;
  overflow: hidden;
  margin: 16px 0 14px;
  padding: 16px 18px 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, #2b2a5e 0%, #3a2f6b 45%, #4a3a86 100%);
  border: 1px solid #4d4390;
  box-shadow: 0 10px 30px rgba(30, 20, 80, .45);
}
.member-card::after {
  content: "";
  position: absolute;
  right: -60px; top: -60px;
  width: 220px; height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(150, 170, 255, .28), transparent 70%);
  pointer-events: none;
}
.member-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.member-label {
  font-size: 11px;
  letter-spacing: 1.6px;
  font-weight: 700;
  color: #c9c2ff;
  text-transform: uppercase;
}
.member-badge {
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .22);
  color: #efeaff;
  white-space: nowrap;
}
.member-badge.ok { background: rgba(56, 193, 114, .22); border-color: rgba(56, 193, 114, .55); color: #9ff0bf; }
.member-badge.bad { background: rgba(242, 86, 95, .2); border-color: rgba(242, 86, 95, .5); color: #ffb3b8; }

.member-code {
  margin: 10px 0 12px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .35);
  word-break: break-all;
}
.member-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, .16);
}
.member-stats .stat { min-width: 0; }
.member-stats .stat span {
  display: block;
  font-size: 11.5px;
  color: #bdb4e8;
  margin-bottom: 2px;
}
.member-stats .stat b {
  display: block;
  font-size: 14px;
  color: #fff;
  word-break: break-all;
}
.member-count {
  margin-top: 10px;
  font-size: 12.5px;
  color: #d8d2ff;
  font-variant-numeric: tabular-nums;
}
.member-activate {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.member-activate input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, .28);
  background: rgba(10, 8, 30, .45);
  color: #fff;
  font-size: 14px;
  letter-spacing: 1px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.member-activate input::placeholder { color: #a79ed6; letter-spacing: 0; font-family: inherit; }
.member-activate input:focus { outline: none; border-color: #9f8dff; }
.member-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.member-actions .muted { color: #c2bade; }
.member-tip {
  margin: 10px 0 0;
  padding: 8px 11px;
  border-radius: 8px;
  background: rgba(240, 169, 43, .16);
  border: 1px solid rgba(240, 169, 43, .45);
  color: #ffe6b8;
  font-size: 12.5px;
  line-height: 1.7;
}

/* 步骤说明 */
.steps {
  margin: 4px 0 12px;
  padding-left: 20px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 2;
}
.steps li { padding-left: 2px; }
.steps li::marker { color: var(--brand); font-weight: 700; }

/* 大输入框 / 大按钮 */
.pan-wrap textarea {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0d1219;
  color: var(--text);
  font: 13.5px/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  resize: vertical;
}
.pan-wrap textarea:focus { outline: none; border-color: var(--brand); }
.btn.block {
  display: flex;
  width: 100%;
  margin-top: 12px;
  padding: 13px 16px;
  font-size: 15.5px;
  font-weight: 700;
  justify-content: center;
}

@media (max-width: 560px) {
  .member-code { font-size: 21px; }
  .member-stats { grid-template-columns: 1fr 1fr; }
  .member-activate { flex-direction: column; }
}

@media (max-width: 560px) {
  .parse-row { flex-direction: column; }
  .parse-row .btn { width: 100%; }
  .actions .btn { flex: 1 1 46%; }
}

/* ==================== 提取结果卡片（对齐同行页面的样式） ==================== */
.step-no {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; margin-right: 7px; border-radius: 50%;
  background: #2f6bff; color: #fff; font-size: 12px; font-weight: 700;
  vertical-align: 1px;
}
/* 成功条：✅ 提取成功 · 共 N 个文件，总大小 X · 秒传加速 · 耗时 Ys */
.ok-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  margin: 4px 0 10px; padding: 10px 12px; border-radius: 10px;
  background: linear-gradient(90deg, rgba(30,180,110,.16), rgba(30,180,110,.06));
  border: 1px solid rgba(30,180,110,.45);
  color: #35d08a; font-size: 13.5px;
}
.ok-bar b { color: #43e39b; }
.ok-ico { font-size: 15px; }
.ok-meta { color: #9fd9be; }
.tag.speed {
  background: rgba(255,190,60,.16); color: #ffc84a;
  border: 1px solid rgba(255,190,60,.4);
}
/* 文件夹行：📁 名字 · N 个文件 · 总大小 */
.folder-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 2px 0 10px; padding: 10px 12px; border-radius: 10px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.10);
  font-size: 14px;
}
.folder-ico { font-size: 16px; }
/* 两栏输入（链接 / 提取码） */
.two-col { display: grid; grid-template-columns: 1fr 160px; gap: 10px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 12.5px; color: #9aa4b2; }
.field input {
  width: 100%; padding: 10px 12px; border-radius: 9px;
  background: rgba(0,0,0,.28); border: 1px solid rgba(255,255,255,.13);
  color: inherit; font-size: 13.5px;
}
.field input:focus { outline: none; border-color: #2f6bff; }
/* 次要按钮行弱化一点，避免和三个主按钮抢注意力 */
.sub-actions { margin-top: 8px; }
.sub-actions .btn { font-size: 12.5px; padding: 7px 11px; opacity: .92; }
.ok-inline { color: #35d08a; }
.hidden-title { display: none; }
@media (max-width: 560px) {
  .two-col { grid-template-columns: 1fr; }
}
/* ==================== 提取进度条 ==================== */
.prog-wrap { margin: 2px 0 12px; }
.prog {
  height: 8px; border-radius: 999px; overflow: hidden;
  background: rgba(255,255,255,.10);
}
.prog-fill {
  height: 100%; width: 0%; border-radius: 999px;
  background: linear-gradient(90deg, #2f6bff, #62a5ff);
  transition: width .35s ease;
}
/* 进度不可知时（企业网盘转存中）走"来回滑动"的动画，比空着好看也好懂 */
.prog.indet .prog-fill { width: 38%; animation: progMove 1.15s ease-in-out infinite; }
@keyframes progMove { 0% { margin-left: -38%; } 100% { margin-left: 100%; } }
.prog-text { margin: 7px 0 0; font-size: 12.5px; color: #9aa4b2; }
/* ---- 和同行页面一致的三个主按钮 / 绿色下载按钮 / 底部状态条 ---- */
.btn.green { background: #22c55e; border-color: #22c55e; color: #06210f; font-weight: 700; }
.btn.green:hover { background: #16a34a; border-color: #16a34a; color: #fff; }
.actions-main .btn { flex: 1 1 30%; min-width: 150px; }
.status-bar {
  margin: 10px 0 4px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.45);
  color: #6ee7a8;
  font-size: 13.5px;
  line-height: 1.5;
}
.status-bar.busy { background: rgba(96, 165, 250, 0.12); border-color: rgba(96, 165, 250, 0.45); color: #93c5fd; }
.status-bar.warn { background: rgba(251, 191, 36, 0.12); border-color: rgba(251, 191, 36, 0.45); color: #fcd34d; }

/* 转存期间置灰的主按钮（让用户知道按钮是有的，只是还没就绪） */
.btn.is-busy, .btn[disabled] { opacity: .55; cursor: not-allowed; filter: grayscale(.35); }

/* ---- 入口门槛（必须带 ?card= 才能进）---- */
.gate-box {
  max-width: 620px;
  margin: 48px auto;
  padding: 28px 26px;
  border-radius: 14px;
  background: #141a23;
  border: 1px solid #26303d;
  text-align: center;
  line-height: 1.7;
}
.gate-box h2 { margin: 10px 0 8px; font-size: 19px; }
.gate-ico { font-size: 34px; }
.gate-code {
  margin: 14px 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: #0e1319;
  border: 1px dashed #3b4859;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 13.5px;
  color: #9fd8ff;
  word-break: break-all;
}
.gate-code b { color: #6ee7a8; }
.gate-box code { background: #0e1319; padding: 1px 5px; border-radius: 4px; }

/* 卡密入口页的红色错误条（卡密过期/不存在/已禁用/次数用完） */
.gate-err {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #fca5a5;
  font-size: 13.5px;
  line-height: 1.6;
}
.gate-err b { color: #fecaca; }