/* 个人学习记录与分享 · 共享样式 */
:root {
  --bg: #f6f7fb; --card: #ffffff; --ink: #1c2740; --muted: #68738c;
  --line: #e6e9f2; --brand: #3f63f6; --brand-dark: #2f4fd6; --brand-soft: #eef2ff;
  --warm: #ff8a3d; --warm-soft: #fff3e9; --ok: #1fa977; --ok-soft: #e7f7f0;
  --bad: #e5484d; --bad-soft: #fdebec;
  --radius: 16px; --shadow: 0 8px 28px rgba(28, 39, 64, .08);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 15px; line-height: 1.6;
}
a { color: var(--brand); text-decoration: none; }
img { max-width: 100%; }
.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
@media (min-width: 1240px) { .container { max-width: 1160px; } } /* 宽屏放开容器，首页4列卡片更舒展 */

/* ---- 顶部导航 ---- */
.nav {
  position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.nav-in { display: flex; align-items: center; gap: 20px; height: 60px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; color: var(--ink); }
.logo .mark {
  width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, var(--brand), #7a5cff);
  color: #fff; display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.nav-links { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a {
  padding: 6px 12px; border-radius: 999px; color: var(--muted); white-space: nowrap; font-size: 14px;
}
.nav-links a:hover { background: var(--brand-soft); color: var(--brand); }
.lic-pill {
  border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 12px;
  font-size: 13px; cursor: pointer; color: var(--muted); white-space: nowrap;
}
.lic-pill.on { background: var(--ok-soft); color: var(--ok); border-color: #bfe8d8; }

/* ---- 按钮 ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 12px; padding: 11px 22px; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: .15s; text-decoration: none; font-family: inherit;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-warm { background: var(--warm); color: #fff; }
.btn-warm:hover { filter: brightness(.95); }
.btn-ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-sm { padding: 7px 14px; font-size: 13px; border-radius: 9px; }
.btn-danger { background: var(--bad-soft); color: var(--bad); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---- 卡片 / 区块 ---- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.section { padding: 52px 0; }
.sec-title { font-size: 26px; font-weight: 800; text-align: center; margin: 0 0 8px; }
.sec-sub { color: var(--muted); text-align: center; margin: 0 0 32px; }
.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 860px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

/* ---- 首页 hero ---- */
.hero { text-align: center; padding: 64px 20px 48px; }
.hero h1 { font-size: 40px; margin: 14px 0 10px; letter-spacing: 1px; }
.hero p { color: var(--muted); font-size: 17px; margin: 0 0 28px; }
.hero .badges { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 4px; }
.badge {
  font-size: 13px; color: var(--brand); background: var(--brand-soft);
  border-radius: 999px; padding: 5px 14px;
}
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---- 工具卡 ---- */
.tool-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px; display: flex; flex-direction: column; gap: 6px; position: relative;
  border: 1.5px solid transparent; transition: .15s;
}
.tool-card:hover { border-color: var(--brand); transform: translateY(-2px); }
.tool-card .ico { font-size: 34px; }
.tool-card h3 { margin: 4px 0 2px; font-size: 18px; }
.tool-card p { color: var(--muted); font-size: 13.5px; margin: 0; flex: 1; }
.tool-card .go { margin-top: 12px; color: var(--brand); font-weight: 600; font-size: 14px; }
.tool-card .free-tag {
  position: absolute; top: 14px; right: 14px; font-size: 12px; color: var(--ok);
  background: var(--ok-soft); padding: 3px 10px; border-radius: 999px;
}

/* ---- 工具页布局 ---- */
.tool-layout { display: grid; grid-template-columns: 330px 1fr; gap: 22px; align-items: start; padding: 26px 0 60px; }
@media (max-width: 900px) { .tool-layout { grid-template-columns: 1fr; } }
.cfg { position: sticky; top: 76px; }
@media (max-width: 900px) { .cfg { position: static; } }
.cfg h2 { margin: 0 0 4px; font-size: 19px; display: flex; gap: 8px; align-items: center; }
.cfg .desc { color: var(--muted); font-size: 13px; margin-bottom: 16px; }
.field { margin-bottom: 13px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 5px; }
.field .hint { font-weight: 400; color: var(--muted); }
.field input[type="text"], .field input[type="number"], .field select, .field textarea {
  width: 100%; padding: 9px 11px; border: 1.5px solid var(--line); border-radius: 10px;
  font-size: 14px; font-family: inherit; background: #fff; color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brand); }
.field textarea { resize: vertical; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks label {
  display: inline-flex; align-items: center; gap: 5px; border: 1.5px solid var(--line);
  padding: 6px 12px; border-radius: 999px; font-size: 13.5px; cursor: pointer; background: #fff;
}
.checks label.on { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.cfg-actions { display: flex; gap: 10px; margin-top: 16px; }
.cfg-actions .btn { flex: 1; }

/* ---- 生成预览 ---- */
.preview-wrap { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.preview-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; gap: 10px; }
.preview-bar .tips { color: var(--muted); font-size: 12.5px; }
.paper {
  width: 210mm; max-width: 100%; min-height: 100mm; margin: 0 auto; background: #fff;
  padding: 12mm 11mm; box-shadow: 0 2px 16px rgba(0, 0, 0, .1); position: relative; overflow: hidden;
}
.paper-h { text-align: center; font-weight: 800; font-size: 22px; letter-spacing: 2px; margin-bottom: 4px; }
.paper-info { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; color: #333; margin: 6mm 0 5mm; flex-wrap: wrap; }
.paper-info span { min-width: 90px; }
.paper-foot { margin-top: 8mm; font-size: 12px; color: #999; text-align: center; }

/* 免费版水印 */
.tk-wm {
  position: absolute; inset: 0; pointer-events: none; z-index: 5; overflow: hidden;
}
.tk-wm span {
  position: absolute; transform: rotate(-24deg); font-size: 26px; color: rgba(60, 80, 160, .09);
  font-weight: 800; white-space: nowrap;
}

/* ---- 表格 ---- */
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; background: #fff; }
.tbl th, .tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.tbl th { color: var(--muted); font-weight: 600; background: #fafbfe; white-space: nowrap; }
.tbl tr.flag-row { background: #fff8e6; }

/* ---- 弹窗 ---- */
.mask {
  position: fixed; inset: 0; background: rgba(20, 28, 48, .45); z-index: 100;
  display: none; align-items: center; justify-content: center; padding: 18px;
}
.mask.show { display: flex; }
.modal {
  background: #fff; border-radius: 18px; padding: 26px; width: 100%; max-width: 430px;
  max-height: 88vh; overflow-y: auto; position: relative;
}
.modal h3 { margin: 0 0 14px; font-size: 18px; }
.modal .close {
  position: absolute; top: 14px; right: 16px; border: 0; background: none; font-size: 20px;
  cursor: pointer; color: var(--muted);
}

/* ---- 提示 ---- */
.toast {
  position: fixed; left: 50%; bottom: 36px; transform: translateX(-50%) translateY(20px);
  background: rgba(28, 39, 64, .92); color: #fff; padding: 10px 20px; border-radius: 999px;
  font-size: 14px; opacity: 0; transition: .25s; z-index: 200; pointer-events: none; max-width: 86vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- 页脚 ---- */
.footer { border-top: 1px solid var(--line); background: #fff; padding: 26px 0 34px; margin-top: 30px; }
.footer .f-in { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 13px; align-items: center; }

/* ---- 打印 ---- */
@media print {
  body { background: #fff; }
  .no-print { display: none !important; }
  .nav, .footer, .cfg, .preview-bar, .toast, .mask { display: none !important; }
  .tool-layout, .container { display: block; padding: 0; }
  .preview-wrap { box-shadow: none; padding: 0; background: none; }
  .paper { box-shadow: none; width: auto; min-height: auto; padding: 0; margin: 0; page-break-after: always; }
  .paper:last-child { page-break-after: auto; }
}
@page { size: A4; margin: 11mm; }

/* ---- 小屏适配 ---- */
@media (max-width: 560px) {
  .hero h1 { font-size: 28px; }
  .sec-title { font-size: 21px; }
  .card { padding: 18px; }
}
