/* ===================================================================
   百度企业网盘解析直连 · 样式
   深色玻璃拟态风格，移动端自适应
   =================================================================== */

:root {
  --bg: #0b1020;
  --bg-2: #121935;
  --card: rgba(23, 30, 56, .72);
  --card-line: rgba(120, 145, 220, .18);
  --text: #e8ecfa;
  --muted: #93a0c4;
  --primary: #4f7cff;
  --primary-2: #7a5cff;
  --ok: #34d399;
  --warn: #fbbf24;
  --err: #f87171;
  --radius: 16px;
  --shadow: 0 18px 48px rgba(3, 7, 22, .55);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background: radial-gradient(1200px 700px at 15% -10%, #1b2a63 0%, transparent 60%),
              radial-gradient(900px 600px at 100% 0%, #3a1d63 0%, transparent 55%),
              var(--bg);
  color: var(--text);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(600px 300px at 50% 110%, rgba(79, 124, 255, .18), transparent 70%);
  z-index: 0;
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 22px clamp(16px, 4vw, 48px) 8px;
  max-width: 1180px;
  margin: 0 auto;
}

.brand { display: flex; align-items: center; gap: 14px; }

.logo {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  font-size: 24px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 10px 26px rgba(79, 124, 255, .35);
}

.brand h1 { margin: 0; font-size: 19px; letter-spacing: .3px; }
.brand p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }

.topbar-actions { display: flex; gap: 8px; }

/* ---------- 布局 ---------- */
.wrap {
  position: relative;
  z-index: 2;
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px clamp(16px, 4vw, 48px) 60px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.card {
  background: var(--card);
  border: 1px solid var(--card-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: rise .32s ease both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.card-title { margin: 0 0 6px; font-size: 16.5px; }

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.field.grow { flex: 1 1 220px; margin-bottom: 0; }

.label { font-size: 13px; color: var(--muted); font-weight: 500; }
.label em { font-style: normal; opacity: .7; }

input[type=text], input[type=password], textarea, select {
  width: 100%;
  padding: 11px 13px;
  color: var(--text);
  background: rgba(9, 14, 32, .72);
  border: 1px solid rgba(120, 145, 220, .22);
  border-radius: 11px;
  font: inherit;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
  resize: vertical;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 124, 255, .18);
}

textarea { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13.5px; }

.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row.actions { align-items: center; margin-top: 16px; }

.hint { font-size: 12.5px; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.hidden { display: none !important; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: 11px;
  font: inherit;
  font-weight: 600;
  color: var(--text);
  background: rgba(120, 145, 220, .14);
  cursor: pointer;
  text-decoration: none;
  transition: transform .14s, filter .18s, background .18s;
  white-space: nowrap;
}

.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

.btn.primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 10px 24px rgba(79, 124, 255, .28);
}

.btn.ghost { background: rgba(120, 145, 220, .12); border-color: var(--card-line); }
.btn.sm { padding: 7px 13px; font-size: 13px; }
.btn.grow { flex: 1 1 160px; }
.btn.mini { padding: 6px 11px; font-size: 12.5px; font-weight: 500; }

.icon-btn {
  border: 0; background: transparent; color: var(--muted);
  font-size: 17px; cursor: pointer; padding: 4px 8px; border-radius: 8px;
}
.icon-btn:hover { background: rgba(120, 145, 220, .15); color: var(--text); }

/* ---------- 状态 ---------- */
.status-inner { display: flex; align-items: center; gap: 16px; }
.status-inner h3 { margin: 0 0 3px; font-size: 15.5px; }
.status-inner p { margin: 0; font-size: 13px; }
.card.error { border-color: rgba(248, 113, 113, .45); }
.card.ok { border-color: rgba(52, 211, 153, .4); }

.spinner {
  width: 26px; height: 26px; flex: 0 0 auto;
  border: 3px solid rgba(120, 145, 220, .25);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 结果 ---------- */
.result-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 14px; flex-wrap: wrap; margin-bottom: 14px;
}
.result-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.result-actions input { width: 200px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }

.chip {
  font-size: 12px; padding: 3px 10px; border-radius: 999px;
  background: rgba(120, 145, 220, .16);
  border: 1px solid var(--card-line);
  color: var(--muted);
}
.chip.green { color: #a7f3d0; border-color: rgba(52, 211, 153, .35); background: rgba(52, 211, 153, .12); }
.chip.blue { color: #c7d7ff; border-color: rgba(79, 124, 255, .35); background: rgba(79, 124, 255, .14); }

.table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--card-line); }

table.files { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; }
table.files th {
  text-align: left; font-size: 12.5px; font-weight: 600; color: var(--muted);
  padding: 11px 14px; background: rgba(9, 14, 32, .55);
  border-bottom: 1px solid var(--card-line);
}
table.files td { padding: 11px 14px; border-bottom: 1px solid rgba(120, 145, 220, .1); vertical-align: middle; }
table.files tr:last-child td { border-bottom: 0; }
table.files tr:hover td { background: rgba(120, 145, 220, .07); }

.col-size { width: 110px; }
.col-act { width: 250px; }
td.fname { word-break: break-all; }
td.fname .ico { margin-right: 7px; opacity: .85; }
/* 注意：不要在 td 上直接用 flex（会让 td 失去 table-cell 语义，垂直居中失效），
   而是把 flex 放在内层容器上 */
.cell-acts { display: flex; gap: 7px; flex-wrap: wrap; }
.footnote { margin: 12px 0 0; font-size: 12.5px; }

/* ---------- 调试 / 自检 ---------- */
.debug-log {
  max-height: 420px; overflow: auto; margin: 12px 0 0;
  padding: 14px; border-radius: 12px;
  background: rgba(5, 9, 22, .85);
  border: 1px solid var(--card-line);
  font: 12.3px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #b9c6ea; white-space: pre-wrap; word-break: break-all;
}

.health-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.health-list li {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 13px; border-radius: 11px;
  background: rgba(9, 14, 32, .55); border: 1px solid var(--card-line);
  font-size: 13.5px; word-break: break-all;
}
.health-list .mark { flex: 0 0 auto; }
.health-list .k { color: var(--muted); min-width: 132px; flex: 0 0 auto; }

/* ---------- 弹窗 ---------- */
.modal {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(4, 8, 20, .72);
  display: grid; place-items: center;
  padding: 18px; backdrop-filter: blur(6px);
}
.modal-box {
  width: 100%; max-width: 620px;
  background: var(--bg-2);
  border: 1px solid var(--card-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  animation: rise .24s ease both;
  max-height: 90vh; overflow: auto;
}
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.modal-head h3 { margin: 0; font-size: 15.5px; word-break: break-all; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%);
  z-index: 90; padding: 11px 20px; border-radius: 12px;
  background: rgba(20, 28, 54, .96);
  border: 1px solid var(--card-line);
  box-shadow: var(--shadow); font-size: 13.5px;
  animation: rise .22s ease both;
}

.foot { text-align: center; font-size: 12px; color: var(--muted); padding: 6px 0 0; }

@media (max-width: 640px) {
  .card { padding: 17px; }
  .result-actions input { width: 100%; }
  .col-act { width: auto; }
  .health-list .k { min-width: 100px; }
  /* iOS Safari：font-size < 16px 的输入框一聚焦就放大整页 */
  input[type=text], input[type=password], textarea, select { font-size: 16px; }
  .btn.mini { padding: 8px 13px; }
  .icon-btn { padding: 9px 13px; }
}
