/* ============================================
   仲夏PDF「ZX_PDF」主界面样式
   液态玻璃 UI · 红色主题 #dc2626 · 仅简体中文
   布局：顶部标题栏 + 左侧导航 + 右侧内容区
   ============================================ */

:root {
  --accent: #dc2626;
  --accent-deep: #b91c1c;
  --accent-soft: #fef2f2;
  --accent-light: #fca5a5;
  --grad: linear-gradient(135deg, #ef4444 0%, #dc2626 55%, #b91c1c 100%);
  --bg: #f4f5f8;
  --ink: #1e293b;
  --ink-2: #64748b;
  --ok: #10b981;
  --err: #ef4444;
  --titlebar-h: 36px;
  --sidebar-w: 216px;
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  /* 液态玻璃 */
  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-bg-strong: rgba(255, 255, 255, 0.72);
  --glass-bg-soft: rgba(255, 255, 255, 0.4);
  --glass-border: rgba(255, 255, 255, 0.7);
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.85), inset 0 -1px 0 rgba(255, 255, 255, 0.35);
  --glass-shadow: 0 10px 34px rgba(185, 28, 28, 0.10), 0 2px 8px rgba(30, 41, 59, 0.06);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
  font-family: var(--font);
  font-size: 15px;
  color: var(--ink);
  user-select: none;
  -webkit-user-select: none;
}

/* 背景：柔和渐变 + 红色光斑（供液态玻璃产生通透层次） */
body {
  background:
    radial-gradient(680px 460px at 82% -6%, rgba(252, 165, 165, 0.5), transparent 62%),
    radial-gradient(560px 420px at -8% 108%, rgba(239, 68, 68, 0.28), transparent 60%),
    linear-gradient(160deg, #fbfbfd 0%, #f4f5f8 100%);
  background-attachment: fixed;
}

/* 滚动条自绘（禁止原生） */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(100, 116, 139, 0.35); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(220, 38, 38, 0.6); }
::-webkit-scrollbar-track { background: transparent; }

.hidden { display: none !important; }

/* ================= 液态玻璃通用 ================= */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(26px) saturate(170%);
  -webkit-backdrop-filter: blur(26px) saturate(170%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-highlight), var(--glass-shadow);
  border-radius: var(--radius);
}
.glass-deep { background: var(--glass-bg-strong); }
.glass-soft { background: var(--glass-bg-soft); }

/* ================= 按钮（统一组件，随主题色） ================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 20px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  background: var(--grad);
  color: #fff;
  transition: all .18s;
  line-height: 1.4;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.28);
}
.btn:hover { opacity: .92; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(220, 38, 38, 0.35); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.gray {
  background: rgba(255, 255, 255, 0.6);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 2px 8px rgba(30,41,59,.06);
}
.btn.gray:hover { background: rgba(255, 255, 255, 0.85); box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 4px 12px rgba(30,41,59,.1); }
.btn.sm { padding: 6px 14px; font-size: 13px; border-radius: 8px; }
.btn.block { display: flex; width: 100%; }
.btn.danger { background: linear-gradient(135deg, #f87171, #dc2626); }

/* ================= 输入框（自绘） ================= */
input[type="text"], input[type="password"], input[type="email"], input[type="number"] {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 9px;
  padding: 9px 12px;
  font-size: 14px;
  font-family: var(--font);
  color: var(--ink);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12); }
input::placeholder { color: #94a3b8; }

/* ================= 标题栏 ================= */
#titlebar {
  height: var(--titlebar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(30px) saturate(170%);
  -webkit-backdrop-filter: blur(30px) saturate(170%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.55);
  color: var(--ink);
  -webkit-app-region: drag;
  z-index: 10000;
  position: relative;
}
#titlebar button { -webkit-app-region: no-drag; }
.tb-back {
  -webkit-app-region: no-drag;
  display: inline-flex; align-items: center;
  height: 100%; padding: 0 14px;
  font-size: 13px; font-weight: 600; color: var(--ink-2);
  text-decoration: none; cursor: pointer;
  border-right: 1px solid rgba(255, 255, 255, 0.6);
  transition: color .15s, background .15s;
}
.tb-back:hover { color: var(--accent); background: rgba(220, 38, 38, 0.05); }
.tb-brand { display: flex; align-items: center; gap: 9px; padding-left: 14px; }
.tb-logo {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--grad);
  border-radius: 7px;
  font-size: 12px; font-weight: 800;
  color: #fff;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.4);
}
.tb-name { font-size: 14px; font-weight: 700; letter-spacing: .4px; }
.tb-ver { font-size: 11px; color: var(--ink-2); margin-left: 2px; }
.tb-win { display: flex; height: 100%; }
.tb-btn {
  width: 44px; height: 100%;
  border: none; background: transparent; color: var(--ink-2);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .15s;
}
.tb-btn svg { width: 12px; height: 12px; }
.tb-btn:hover { background: rgba(30, 41, 59, 0.08); color: var(--ink); }
.tb-close:hover { background: #dc2626; color: #fff; }

/* ================= 整体布局 ================= */
#layout { display: flex; height: calc(100% - var(--titlebar-h)); }

/* ================= 左侧导航 ================= */
#sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  margin: 12px;
  margin-right: 0;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
}
.side-account {
  display: flex; align-items: center; gap: 10px;
  padding: 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: background .15s;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.6);
}
.side-account:hover { background: rgba(255, 255, 255, 0.65); }
.sa-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(220, 38, 38, 0.35);
}
.sa-info { min-width: 0; flex: 1; }
.sa-name { font-weight: 700; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sa-sub { font-size: 11px; color: var(--ink-2); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.side-nav { display: flex; flex-direction: column; gap: 5px; }
.snav {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 13px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 11px;
  font-size: 14px; font-weight: 600; font-family: var(--font);
  color: var(--ink-2);
  cursor: pointer;
  transition: all .18s;
  text-align: left;
  position: relative;
}
.snav:hover { background: rgba(255, 255, 255, 0.6); color: var(--accent-deep); }
.snav.active {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.10), rgba(220, 38, 38, 0.16));
  color: var(--accent-deep);
  border-color: rgba(220, 38, 38, 0.22);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85), 0 4px 14px rgba(185, 28, 28, 0.10);
}
.snav.active::before {
  content: '';
  position: absolute; left: -1px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, #ef4444, #b91c1c);
}
.snav-ic {
  width: 21px; height: 21px;
  display: inline-flex; justify-content: center; align-items: center;
  flex-shrink: 0;
  opacity: .8;
  transition: opacity .18s;
}
.snav.active .snav-ic { opacity: 1; }
.snav-ic svg { width: 19px; height: 19px; }
.snav-soon { margin-left: auto; font-size: 10px; color: var(--ink-2); background: rgba(100,116,139,.12); padding: 2px 7px; border-radius: 8px; white-space: nowrap; }

.side-foot {
  margin-top: auto;
  font-size: 11px;
  color: var(--ink-2);
  text-align: center;
  padding: 8px 0 2px;
}
.side-foot a { color: var(--accent-deep); text-decoration: none; }
.side-foot a:hover { text-decoration: underline; }

/* ================= 右侧内容区 ================= */
#content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 22px 22px;
  min-width: 0;
}
.pane { display: none; }
.pane.active { display: block; animation: fadeIn .22s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.pane-head { margin-bottom: 16px; }
.pane-head h2 { font-size: 21px; color: var(--ink); }
.pane-head p { font-size: 13px; color: var(--ink-2); margin-top: 3px; }

/* ================= 通用卡片 ================= */
.card {
  background: var(--glass-bg);
  backdrop-filter: blur(26px) saturate(170%);
  -webkit-backdrop-filter: blur(26px) saturate(170%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-highlight), var(--glass-shadow);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 14px;
}
.card-title { font-weight: 700; font-size: 15px; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.card-title .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--grad); }
.card-sub { font-size: 12.5px; color: var(--ink-2); margin-bottom: 12px; }

/* ================= 文件拖放区 ================= */
.drop-zone {
  border: 2px dashed rgba(220, 38, 38, 0.35);
  border-radius: var(--radius);
  padding: 34px 20px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  background: rgba(255, 255, 255, 0.3);
}
.drop-zone:hover, .drop-zone.drag { border-color: var(--accent); background: rgba(254, 242, 242, 0.7); }
.dz-icon { font-size: 30px; color: var(--accent); margin-bottom: 8px; line-height: 1; }
.dz-title { font-weight: 700; font-size: 15px; }
.dz-sub { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; }

/* ================= 文件列表 ================= */
.file-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.file-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 10px;
}
.fi-ic {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--grad);
  color: #fff; font-size: 12px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.fi-info { flex: 1; min-width: 0; }
.fi-name { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fi-meta { font-size: 11.5px; color: var(--ink-2); margin-top: 1px; }
.fi-ops { display: flex; gap: 6px; }
.fi-op {
  width: 28px; height: 28px;
  border: none; background: rgba(30, 41, 59, 0.06);
  border-radius: 8px;
  font-size: 12px; font-weight: 700; color: var(--ink-2);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.fi-op:hover { background: var(--accent); color: #fff; }
.fi-op.del:hover { background: var(--err); }

/* ================= 阅读器 ================= */
.reader-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 12px;
}
.rt-info { font-size: 13px; color: var(--ink-2); margin-left: auto; }
.reader-body {
  display: flex; gap: 14px; align-items: flex-start;
}
.reader-canvas-box {
  flex: 1; min-width: 0;
  background: rgba(30, 41, 59, 0.5);
  border-radius: 10px;
  padding: 14px;
  display: flex; justify-content: center;
}
.reader-canvas-box canvas {
  max-width: 100%;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}
.reader-text-box {
  width: 280px; flex-shrink: 0;
  background: var(--glass-bg-strong);
  backdrop-filter: blur(26px) saturate(170%);
  -webkit-backdrop-filter: blur(26px) saturate(170%);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 12px;
  max-height: 620px;
  overflow-y: auto;
}
.rtb-title { font-size: 12px; font-weight: 700; color: var(--accent-deep); margin-bottom: 8px; }
.rtb-text { font-size: 12.5px; color: var(--ink); line-height: 1.7; white-space: pre-wrap; word-break: break-all; }

/* ================= 账号 ================= */
.ac-card {
  background: var(--glass-bg);
  backdrop-filter: blur(26px) saturate(170%);
  -webkit-backdrop-filter: blur(26px) saturate(170%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 14px;
  max-width: 460px;
}
.ac-me { display: flex; align-items: center; gap: 14px; }
.ac-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 2px 12px rgba(220, 38, 38, 0.35);
}
.ac-username { font-weight: 700; font-size: 16px; }
.ac-email { font-size: 12px; color: var(--ink-2); margin-top: 2px; }
.ac-me .btn { margin-left: auto; }
.ac-title { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.ac-sub { font-size: 12.5px; color: var(--ink-2); margin-bottom: 12px; }
.ac-row { display: flex; gap: 10px; }
.ac-row input { flex: 1; }
.ac-row .btn { flex-shrink: 0; }
.ac-result { margin-top: 10px; font-size: 13px; line-height: 1.6; }
.ac-result.ok { color: var(--ok); }
.ac-result.err { color: var(--err); }
.ac-tabs { display: flex; gap: 4px; margin-bottom: 16px; background: rgba(255,255,255,.6); border: 1px solid rgba(255,255,255,.7); border-radius: 12px; padding: 4px; width: fit-content; }
.actab {
  padding: 8px 22px;
  border: none; background: transparent;
  border-radius: 9px;
  font-size: 14px; font-weight: 600; font-family: var(--font);
  color: var(--ink-2);
  cursor: pointer;
  transition: all .15s;
}
.actab.active { background: var(--grad); color: #fff; box-shadow: 0 2px 8px rgba(220,38,38,.3); }
.ac-form label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 12px 0 6px; }
.ac-form label:first-child { margin-top: 0; }
.ac-form .btn { margin-top: 14px; }
.ac-err { margin-top: 10px; font-size: 13px; color: var(--err); min-height: 18px; }

/* ================= 关于 ================= */
.about-logo {
  width: 64px; height: 64px;
  border-radius: 16px;
  background: var(--grad);
  color: #fff;
  font-size: 26px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
  box-shadow: 0 6px 22px rgba(220, 38, 38, 0.4);
}
.ab-ver { font-size: 15px; font-weight: 700; }
.ab-line { font-size: 12.5px; color: var(--ink-2); margin-top: 3px; }
.about-meta { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.am-row { display: flex; font-size: 13px; }
.am-row .k { width: 90px; color: var(--ink-2); flex-shrink: 0; }
.am-row .v { color: var(--ink); }

/* ================= 通知条 ================= */
#toast {
  position: fixed;
  top: 52px; left: 50%;
  transform: translateX(-50%) translateY(-16px);
  background: rgba(30, 41, 59, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #fff;
  font-size: 13.5px;
  padding: 10px 22px;
  border-radius: 12px;
  z-index: 10002;
  opacity: 0;
  pointer-events: none;
  transition: all .25s;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  max-width: 70vw;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { background: rgba(220, 38, 38, 0.92); }

/* ================= 状态提示 ================= */
.status-line { font-size: 13px; color: var(--ink-2); margin-top: 10px; min-height: 18px; }
.status-line.ok { color: var(--ok); }
.status-line.err { color: var(--err); }

/* ================= 响应式 ================= */
@media (max-width: 760px) {
  #sidebar { width: 64px; margin: 8px; padding: 10px 6px; }
  .snav { justify-content: center; padding: 12px; }
  .snav span:not(.snav-ic) { display: none; }
  .snav-soon { display: none; }
  .sa-info { display: none; }
  .side-account { justify-content: center; }
  .side-foot { display: none; }
  #content { padding: 12px 12px 18px; }
  .reader-text-box { display: none; }
}
