/* 不如种田去 · 样式层（唯一需要改外观的文件）
   版式参照 daisyUI garden 主题的配色思路 + 8px 栅格 + 卡片式列表；
   没有引第三方 CSS，全部样式在此，体积 ~10KB，改配色只改下面 --x 变量。 */

:root {
  --bg: #f3f6f1;
  --card: #ffffff;
  --card-2: #f7f9f6;
  --ink: #14201a;
  --ink-2: #47554d;
  --muted: #7a887f;
  --line: #e4eae2;
  --brand: #1f6b46;
  --brand-ink: #17543a;
  --brand-soft: #e7f2ea;
  --warn: #c0392b;
  --gutter: 18px;
  --maxw: 940px;
  --r: 16px;
  --r-sm: 11px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-hover: 0 16px 30px -20px rgba(16, 24, 40, .5);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101815;
    --card: #16211c;
    --card-2: #1b2621;
    --ink: #e9f0ea;
    --ink-2: #b6c4bb;
    --muted: #8a988f;
    --line: #26332c;
    --brand: #4ea87a;
    --brand-ink: #6fbf94;
    --brand-soft: #1a2b22;
    --shadow: none;
    --shadow-hover: none;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans SC", "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
button, input { font: inherit; }

.shell { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar .shell { display: flex; align-items: center; gap: 10px; height: 56px; }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; font-weight: 700; font-size: 15.5px; letter-spacing: .01em; }
.brand i {
  display: grid; place-items: center; width: 29px; height: 29px; border-radius: 9px;
  background: var(--brand-soft); font-style: normal; font-size: 15px;
}
.topnav { margin-left: auto; display: none; gap: 2px; }
.tnav { padding: 6px 11px; border-radius: 999px; font-size: 13px; color: var(--muted); text-decoration: none; transition: .15s; }
.tnav:hover { background: var(--brand-soft); color: var(--ink); }
.tnav.on { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }

/* ---------- 头部 ---------- */
.hero { padding: 28px 0 4px; }
.hero h1 { font-size: clamp(22px, 6vw, 32px); line-height: 1.3; font-weight: 800; letter-spacing: -.015em; }
.hero p { margin-top: 10px; font-size: 13.5px; line-height: 1.75; color: var(--ink-2); }

/* ---------- 板块 ---------- */
.sec { margin-top: 28px; }
.sec-h { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.sec-h h2 { font-size: 16px; font-weight: 750; letter-spacing: -.01em; white-space: nowrap; }
.sec-h .note { font-size: 11px; color: var(--muted); white-space: nowrap; }
.sec-h .line { flex: 1; height: 1px; background: var(--line); }

/* ---------- 栅格 ---------- */
.grid { display: grid; gap: 11px; grid-template-columns: 1fr; }
@media (min-width: 620px) { .grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 940px) { .grid { grid-template-columns: repeat(3, 1fr); } }

/* ---------- 内容卡 ---------- */
.pcard {
  display: block; text-decoration: none; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--r); overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
@media (hover: hover) {
  .pcard:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
}
.pcard .ph {
  position: relative; aspect-ratio: 16 / 9; display: grid; place-items: center;
  background: var(--brand-soft);
}
.pcard .ph span { font-size: 28px; line-height: 1; }
.pcard .ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pcard .ph::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 80% at 50% -15%, rgba(255, 255, 255, .45), transparent 60%);
}
.pcard .pb { padding: 11px 13px 12px; }
.pcard h3 { font-size: 14px; font-weight: 680; line-height: 1.45; letter-spacing: -.005em; }
.pcard p {
  margin-top: 5px; font-size: 12px; line-height: 1.6; color: var(--ink-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pcard .pm { margin-top: 9px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tag {
  display: inline-block; padding: 2px 7px; border-radius: 6px; font-size: 10.5px; line-height: 1.6;
  background: var(--brand-soft); color: var(--brand-ink); font-weight: 600;
}
.dim { font-size: 10.5px; color: var(--muted); }

/* 四种封面色调 */
.qtone-a .ph { background: color-mix(in srgb, #2f9e6b 14%, var(--bg)); }
.qtone-b .ph { background: color-mix(in srgb, #3b6fd4 13%, var(--bg)); }
.qtone-c .ph { background: color-mix(in srgb, #d98a2b 14%, var(--bg)); }
.qtone-d .ph { background: color-mix(in srgb, #8a6b3f 15%, var(--bg)); }

/* ---------- 链接行 ---------- */
.rows { display: grid; gap: 7px; }
.row {
  display: flex; align-items: center; gap: 11px; padding: 12px 13px; text-decoration: none;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r); transition: .15s;
}
@media (hover: hover) { .row:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); background: var(--card-2); } }
.row .ri { width: 22px; text-align: center; font-size: 14px; color: var(--muted); }
.row .rt { display: grid; gap: 1px; min-width: 0; }
.row .rn { font-size: 13.5px; font-weight: 620; }
.row .rs { font-size: 11px; color: var(--muted); }
.row .ra { margin-left: auto; color: var(--muted); font-size: 17px; }

/* ---------- 按钮 ---------- */
.dbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px; border-radius: var(--r-sm); border: 1px solid transparent;
  font-size: 13.5px; font-weight: 620; cursor: pointer; text-decoration: none; transition: .15s;
}
.dbtn.primary { background: var(--brand); color: #fff; }
.dbtn.primary:hover { background: var(--brand-ink); }
.dbtn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.dbtn.ghost:hover { background: var(--card-2); }
.dbtn.wide { width: 100%; }

/* ---------- 表单 ---------- */
.panel {
  display: grid; gap: 11px; margin-top: 16px; padding: 17px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
}
.fld { display: grid; gap: 5px; }
.fld span { font-size: 11.5px; color: var(--muted); }
.fld input {
  padding: 11px 12px; font-size: 15px; color: var(--ink); background: var(--card-2);
  border: 1px solid var(--line); border-radius: var(--r-sm); outline: none; transition: .15s;
}
.fld input:focus { border-color: var(--brand); background: var(--card); box-shadow: 0 0 0 3px var(--brand-soft); }
.msg { font-size: 12px; color: var(--muted); min-height: 1em; }
.msg.bad { color: var(--warn); }
.msg.good { color: var(--brand-ink); }
.switch { margin-top: 15px; font-size: 12.5px; color: var(--muted); }
.switch a { color: var(--brand-ink); font-weight: 620; text-decoration: none; }
.acts { display: flex; gap: 9px; flex-wrap: wrap; margin: 15px 0 4px; }
.note-foot { margin-top: 20px; font-size: 11px; line-height: 1.7; color: var(--muted); }
.empty {
  margin-top: 12px; padding: 20px 15px; text-align: center; font-size: 12.5px; color: var(--muted);
  border: 1px dashed var(--line); border-radius: var(--r);
}

/* ---------- 记录 ---------- */
.rec .pb { padding: 13px; }
.rec .del {
  margin-left: auto; padding: 3px 9px; font-size: 10.5px; cursor: pointer;
  color: var(--warn); background: transparent; border: 1px solid color-mix(in srgb, var(--warn) 32%, transparent);
  border-radius: 6px;
}
.rec .del:hover { background: color-mix(in srgb, var(--warn) 9%, transparent); }

/* ---------- 条目详情 ---------- */
.post { padding-top: 20px; }
.post h1 { margin: 9px 0 5px; font-size: 19px; line-height: 1.42; font-weight: 750; letter-spacing: -.01em; }
.post .meta { font-size: 11px; color: var(--muted); }
.post .cover {
  margin: 13px 0; height: 160px; display: grid; place-items: center; border-radius: var(--r);
  font-size: 11px; color: var(--muted); border: 1px dashed var(--line); background: var(--card-2);
}
.post .cover.has-img { height: auto; display: block; padding: 0; border: 0; background: none; }
.post .cover.has-img img { display: block; width: 100%; border-radius: var(--r); }
.post .text {
  padding: 14px 15px; font-size: 14px; line-height: 1.85; white-space: pre-wrap;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
}
.copybar {
  position: sticky; bottom: 0; z-index: 30;
  padding: 9px 0 calc(9px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: blur(12px); border-top: 1px solid var(--line);
}
.copybar .shell { display: flex; gap: 9px; }
.copybar .dbtn { flex: 1; }

/* ---------- 底部导航（手机） ---------- */
.btmnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: color-mix(in srgb, var(--card) 94%, transparent);
  backdrop-filter: saturate(180%) blur(16px); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.btmnav a {
  display: grid; place-items: center; gap: 1px; padding: 7px 0 8px;
  font-size: 10px; text-decoration: none; color: var(--muted);
}
.btmnav a b { font-size: 17px; line-height: 1.15; font-weight: 400; }
.btmnav a.on { color: var(--brand-ink); font-weight: 650; }
body.has-tabbar { padding-bottom: 68px; }
@media (min-width: 720px) {
  .topnav { display: flex; }
  .btmnav { display: none; }
  body.has-tabbar { padding-bottom: 0; }
  .hero { padding-top: 38px; }
}

/* ---------- 页脚 ---------- */
.foot { padding: 26px 0 32px; font-size: 10.5px; color: var(--muted); text-align: center; }
