:root {
  --bg: #f5f7fa;
  --card: #ffffff;
  --text: #1f2329;
  --muted: #8a9099;
  --line: #e8ebf0;
  --brand: #2f6bff;
  --brand-dark: #1f50d0;
  --danger: #e34d59;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2 { margin: 0 0 8px; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }

.muted { color: var(--muted); font-size: 13px; margin: 0 0 16px; }

.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; }
.brand-dot {
  width: 10px; height: 10px; border-radius: 4px;
  background: linear-gradient(135deg, #2f6bff, #58a6ff);
  display: inline-block;
}

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; background: var(--card); border-bottom: 1px solid var(--line);
}
.topbar.light { background: transparent; border: none; justify-content: center; padding: 28px 16px 8px; }

.container { max-width: 880px; margin: 24px auto 64px; padding: 0 16px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: 0 1px 3px rgba(16, 24, 40, .04);
}

/* ---------- 表单 ---------- */
.input {
  width: 100%; padding: 11px 14px; font-size: 14px;
  border: 1px solid var(--line); border-radius: 10px;
  background: #fbfcfe; color: var(--text); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47, 107, 255, .12); background: #fff; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; font-size: 14px; font-weight: 500;
  border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--text); cursor: pointer;
  text-decoration: none; transition: all .15s; white-space: nowrap;
}
.btn:hover { border-color: #c9d2e0; background: #f7f9fc; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn.block { width: 100%; margin-top: 10px; }
.btn.tiny { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.btn.danger { color: var(--danger); border-color: #f3d4d7; }
.btn.danger:hover { background: #fdf2f3; }

/* ---------- 提示 ---------- */
.alert {
  padding: 11px 14px; border-radius: 10px; font-size: 13.5px; margin-bottom: 16px;
  border: 1px solid transparent;
}
.alert.error { background: #fdf2f3; border-color: #f7dade; color: #b93b45; }
.alert.success { background: #f0f9f2; border-color: #d5ecdb; color: #237a3c; }

/* ---------- 登录页 ---------- */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-wrap { width: 100%; max-width: 380px; padding: 20px; }
.login-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 28px 26px; box-shadow: 0 8px 30px rgba(16, 24, 40, .06);
}
.login-card .brand { margin-bottom: 22px; }
.login-card p { margin: 4px 0 18px; }

/* ---------- 上传 ---------- */
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 30px 16px; margin-bottom: 12px;
  border: 1.5px dashed #ccd4e0; border-radius: 12px;
  background: #fbfcfe; cursor: pointer; transition: all .15s; text-align: center;
}
.dropzone:hover, .dropzone.drag { border-color: var(--brand); background: #f4f8ff; }
.dropzone.has-file { border-style: solid; border-color: #b9d4ff; background: #f4f8ff; }
.dz-icon { font-size: 22px; color: var(--brand); line-height: 1; }
.dz-text { font-size: 13.5px; color: var(--muted); word-break: break-all; }

/* ---------- 生成成功 ---------- */
.done-box {
  background: linear-gradient(180deg, #f4f8ff, #ffffff);
  border: 1px solid #d9e6ff; border-radius: var(--radius);
  padding: 16px 18px; margin-bottom: 18px;
}
.done-title { font-weight: 600; font-size: 14px; margin-bottom: 10px; color: var(--brand-dark); }
.copy-row { display: flex; gap: 8px; margin-bottom: 10px; }
.copy-row .input { font-size: 13px; }

/* ---------- 列表 ---------- */
.list { margin-top: 6px; }
.item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px dashed var(--line);
}
.item:last-child { border-bottom: none; }
.item-icon {
  width: 40px; height: 40px; flex: 0 0 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px; background: #eef3ff; color: var(--brand);
  font-size: 11px; font-weight: 700; letter-spacing: .02em;
}
.item-main { flex: 1; min-width: 0; }
.item-title {
  display: block; font-size: 14.5px; font-weight: 500; color: var(--text);
  text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.item-title:hover { color: var(--brand); }
.item-meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.item-ops { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.item-ops form { margin: 0; }
.empty-small { padding: 24px 0; text-align: center; color: var(--muted); font-size: 13.5px; }

/* ---------- 分享页 ---------- */
.share-page { background: #f2f4f7; }
.share-wrap { max-width: 860px; margin: 0 auto 60px; padding: 0 16px; }
.share-card { padding: 26px; }
.share-title { font-size: 21px; line-height: 1.4; margin-bottom: 6px; word-break: break-word; }
.share-meta { color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.share-actions { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.preview { border-top: 1px solid var(--line); padding-top: 20px; }
.pdf-frame { width: 100%; height: 640px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.img-wrap { text-align: center; }
.img-wrap img { max-width: 100%; border-radius: 10px; border: 1px solid var(--line); }
.no-preview { text-align: center; padding: 36px 16px; }
.file-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 72px; height: 72px; padding: 0 12px; margin-bottom: 12px;
  border-radius: 14px; background: #eef3ff; color: var(--brand);
  font-weight: 700; font-size: 15px; letter-spacing: .04em;
}
.footnote { text-align: center; color: #9aa1ab; font-size: 12.5px; margin-top: 18px; }

/* ---------- 空状态 ---------- */
.empty { text-align: center; padding: 48px 24px; }
.empty-icon { font-size: 34px; margin-bottom: 10px; }

@media (max-width: 640px) {
  .topbar { padding: 14px 16px; }
  .card { padding: 18px; }
  .item { flex-wrap: wrap; }
  .item-ops { width: 100%; justify-content: flex-end; }
  .pdf-frame { height: 460px; }
  .share-card { padding: 20px; }
}
