/* ===== 拾光集 · 手账杂志风 ===== */
:root {
  --orange: #e0732f;
  --orange-deep: #b85a1f;
  --orange-soft: #f3d9c4;
  --cream: #faf6ef;
  --cream-2: #f4ecdf;
  --paper: #fffdf8;
  --ink: #3d2f26;
  --ink-soft: #7a6a5d;
  --line: #e8ddcc;
  --shadow: 0 6px 24px rgba(97, 66, 32, .10);
  --shadow-hover: 0 12px 32px rgba(97, 66, 32, .18);
  --radius: 16px;
  --serif: Georgia, "Noto Serif SC", "Songti SC", "SimSun", serif;
  --sans: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.75;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image:
    radial-gradient(circle at 12% 8%, rgba(224,115,47,.06), transparent 34%),
    radial-gradient(circle at 88% 92%, rgba(224,115,47,.05), transparent 30%);
}
a { color: var(--orange-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: 15px; color: var(--ink); }

.container { width: min(1060px, calc(100% - 48px)); margin: 0 auto; flex: 1; }
.loading { text-align: center; padding: 120px 0; color: var(--ink-soft); font-family: var(--serif); letter-spacing: 4px; }

/* ===== 导航 ===== */
.nav {
  background: rgba(250,246,239,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.nav-inner {
  width: min(1060px, calc(100% - 48px)); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 66px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand:hover { text-decoration: none; }
.brand-name {
  font-family: var(--serif); font-size: 24px; font-weight: 700;
  color: var(--ink); letter-spacing: 3px;
}
.brand-sub { font-size: 10px; letter-spacing: 2.5px; color: var(--ink-soft); margin-top: 6px; }
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a:not(.btn), .nav-links button.linklike {
  padding: 8px 14px; border-radius: 999px; color: var(--ink);
  font-size: 14.5px; border: none; background: none;
}
.nav-links a:not(.btn):hover { background: var(--cream-2); text-decoration: none; }
.nav-links a.active:not(.btn) { color: var(--orange-deep); font-weight: 600; }
.nav-links a.btn-primary { padding: 7px 18px; margin-left: 4px; }
.nav-links a.btn-primary:hover { text-decoration: none; }
.nav-user {
  display: flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px;
  border-radius: 999px; background: var(--paper); border: 1px solid var(--line);
}
.nav-user .avatar { width: 30px; height: 30px; font-size: 14px; }
.nav-user span { font-size: 14px; font-weight: 600; }

/* ===== 按钮 ===== */
.btn {
  display: inline-block; padding: 10px 22px; border-radius: 999px;
  border: 1px solid transparent; font-size: 14.5px; transition: all .2s;
}
.btn-primary {
  background: linear-gradient(135deg, #ef8a44, var(--orange));
  color: #fff; box-shadow: 0 4px 14px rgba(224,115,47,.35);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 7px 18px rgba(224,115,47,.45); text-decoration: none; }
.btn-ghost { border-color: var(--line); background: var(--paper); color: var(--ink); }
.btn-ghost:hover { border-color: var(--orange); color: var(--orange-deep); text-decoration: none; }
.btn-danger { background: #fdf0ec; color: #b3402a; border-color: #f2cfc4; }
.btn-danger:hover { background: #f9e2da; }
.btn-sm { padding: 6px 14px; font-size: 13px; }

/* ===== 首字渐变头像 ===== */
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%;
  color: #fff; font-family: var(--serif); font-weight: 700; font-size: 20px;
  background: linear-gradient(135deg, #ef8a44, #b85a1f);
  box-shadow: inset 0 -2px 4px rgba(0,0,0,.15);
  flex-shrink: 0;
}
.avatar.v2 { background: linear-gradient(135deg, #7fa06a, #4c6b44); }
.avatar.v3 { background: linear-gradient(135deg, #6d93ad, #41637c); }

/* ===== Hero ===== */
.hero {
  margin: 34px 0 8px; padding: 52px 48px 44px;
  border-radius: 24px; position: relative; overflow: hidden;
  background:
    radial-gradient(circle at 85% 20%, rgba(255,255,255,.28), transparent 40%),
    linear-gradient(120deg, #f2a05c 0%, #e0732f 55%, #c45e22 100%);
  color: #fff; box-shadow: var(--shadow-hover);
}
.hero::after {
  content: ""; position: absolute; right: -60px; bottom: -90px;
  width: 280px; height: 280px; border-radius: 50%;
  border: 34px solid rgba(255,255,255,.14);
}
.hero::before {
  content: ""; position: absolute; right: 130px; top: -70px;
  width: 150px; height: 150px; border-radius: 50%;
  background: rgba(255,255,255,.10);
}
.hero h1 { font-family: var(--serif); font-size: 42px; letter-spacing: 6px; position: relative; }
.hero .slogan { margin-top: 10px; font-size: 16px; opacity: .95; letter-spacing: 1px; position: relative; }
.hero .hero-meta { margin-top: 26px; display: flex; gap: 26px; position: relative; }
.hero .hero-meta b { font-family: var(--serif); font-size: 26px; display: block; }
.hero .hero-meta span { font-size: 12.5px; opacity: .9; letter-spacing: 1px; }

/* 每日一句 */
.quote-bar {
  display: flex; align-items: center; gap: 12px;
  margin: 18px 0 26px; padding: 14px 20px;
  background: var(--paper); border: 1px solid var(--line);
  border-left: 4px solid var(--orange);
  border-radius: 12px; box-shadow: var(--shadow);
}
.quote-bar .qmark { font-family: var(--serif); font-size: 30px; color: var(--orange); line-height: 1; }
.quote-bar .qtext { font-family: var(--serif); color: var(--ink); flex: 1; }
.quote-bar .qfrom { color: var(--ink-soft); font-size: 13px; white-space: nowrap; }

/* ===== 工具条：分类 + 搜索 ===== */
.toolbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 24px; }
.pills { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; }
.pill {
  padding: 7px 16px; border-radius: 999px; font-size: 13.5px;
  background: var(--paper); border: 1px solid var(--line); color: var(--ink-soft);
  transition: all .18s;
}
.pill:hover { border-color: var(--orange); color: var(--orange-deep); }
.pill.active {
  background: linear-gradient(135deg, #ef8a44, var(--orange));
  color: #fff; border-color: transparent; box-shadow: 0 3px 10px rgba(224,115,47,.3);
}
.pill .cnt { opacity: .7; font-size: 12px; margin-left: 2px; }
.search-box { position: relative; }
.search-box input {
  width: 240px; padding: 9px 16px 9px 38px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--paper); outline: none;
  transition: border .2s, box-shadow .2s;
}
.search-box input:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(224,115,47,.15); }
.search-box svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); opacity: .45; }

/* ===== 文章卡片 ===== */
.post-list { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.card {
  background: var(--paper); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); border: 1px solid rgba(232,221,204,.7);
  transition: transform .22s, box-shadow .22s; cursor: pointer;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.card-cover { height: 128px; position: relative; }
.card-cover .cat-badge {
  position: absolute; left: 14px; bottom: -13px;
  padding: 4px 14px; border-radius: 999px; font-size: 12.5px;
  background: var(--paper); color: var(--orange-deep);
  box-shadow: 0 3px 10px rgba(0,0,0,.12); font-weight: 600; letter-spacing: 1px;
}
.card-body { padding: 24px 22px 18px; flex: 1; display: flex; flex-direction: column; }
.card-title { font-family: var(--serif); font-size: 20px; line-height: 1.4; color: var(--ink); }
.card:hover .card-title { color: var(--orange-deep); }
.card-excerpt {
  margin-top: 8px; font-size: 13.5px; color: var(--ink-soft);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  flex: 1;
}
.card-tags { margin-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 12px; color: var(--orange-deep); background: #fbeadd; padding: 2px 10px; border-radius: 999px; }
.card-foot {
  margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line);
  display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-soft);
}
.card-foot .avatar { width: 24px; height: 24px; font-size: 12px; }
.card-foot .dot::before { content: "·"; margin: 0 4px; }
.card-foot .views { margin-left: auto; display: flex; align-items: center; gap: 4px; }

.empty { text-align: center; padding: 80px 0; color: var(--ink-soft); }
.empty .big { font-size: 44px; font-family: var(--serif); margin-bottom: 8px; }

/* ===== 分页 ===== */
.pager { display: flex; justify-content: center; align-items: center; gap: 10px; margin: 34px 0 10px; }
.pager button {
  min-width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--paper); color: var(--ink); font-size: 14px; padding: 0 12px;
}
.pager button:hover:not(:disabled) { border-color: var(--orange); color: var(--orange-deep); }
.pager button.cur { background: var(--orange); border-color: var(--orange); color: #fff; }
.pager button:disabled { opacity: .4; cursor: default; }

/* ===== 文章详情 ===== */
.detail-wrap { max-width: 820px; margin: 0 auto; }
.detail-cover { height: 200px; border-radius: 20px; margin-top: 30px; box-shadow: var(--shadow-hover); position: relative; }
.detail-cover .cat-badge {
  position: absolute; left: 22px; bottom: -14px; padding: 5px 18px; border-radius: 999px;
  background: var(--paper); color: var(--orange-deep); font-weight: 600; font-size: 13px;
  box-shadow: 0 3px 10px rgba(0,0,0,.12);
}
.detail-head { margin: 34px 0 8px; }
.detail-title { font-family: var(--serif); font-size: 34px; line-height: 1.35; }
.detail-meta { display: flex; align-items: center; gap: 10px; margin-top: 14px; color: var(--ink-soft); font-size: 13.5px; flex-wrap: wrap; }
.detail-actions { margin-left: auto; display: flex; gap: 8px; }
.article {
  background: var(--paper); border: 1px solid rgba(232,221,204,.7);
  border-radius: 20px; padding: 38px 44px; margin-top: 20px; box-shadow: var(--shadow);
}
.markdown { font-size: 15.5px; }
.markdown h2, .markdown h3, .markdown h4 {
  font-family: var(--serif); margin: 30px 0 12px; line-height: 1.4;
}
.markdown h1 { font-family: var(--serif); margin: 26px 0 12px; font-size: 26px; }
.markdown h2 { font-size: 23px; padding-left: 12px; border-left: 4px solid var(--orange); }
.markdown h3 { font-size: 19px; }
.markdown p { margin: 12px 0; }
.markdown ul { margin: 12px 0 12px 24px; }
.markdown li { margin: 5px 0; }
.markdown blockquote {
  margin: 16px 0; padding: 12px 20px; border-left: 4px solid var(--orange);
  background: #fbf1e5; border-radius: 0 12px 12px 0; color: #6b5137; font-family: var(--serif);
}
.markdown code {
  background: #f3ead9; padding: 2px 7px; border-radius: 6px;
  font-family: Consolas, "Courier New", monospace; font-size: 13.5px; color: #a34d17;
}
.markdown pre {
  background: #32281f; color: #f0e4d3; padding: 18px 20px; border-radius: 12px;
  overflow-x: auto; margin: 16px 0; line-height: 1.6;
}
.markdown pre code { background: none; color: inherit; padding: 0; font-size: 13.5px; }
.markdown a { border-bottom: 1px dashed var(--orange); }
.markdown strong { color: #8f4a17; }
.author-card {
  margin-top: 26px; padding: 20px 24px; border-radius: 18px;
  background: linear-gradient(120deg, #fff8ee, #fdf3e4);
  border: 1px solid var(--line); display: flex; gap: 16px; align-items: center;
  box-shadow: var(--shadow);
}
.author-card .avatar { width: 56px; height: 56px; font-size: 26px; }
.author-card .aname { font-family: var(--serif); font-size: 18px; font-weight: 700; }
.author-card .abio { font-size: 13px; color: var(--ink-soft); margin-top: 3px; }

/* ===== 表单页 ===== */
.form-wrap { max-width: 440px; margin: 56px auto; }
.form-card {
  background: var(--paper); border-radius: 22px; padding: 38px 40px 34px;
  box-shadow: var(--shadow-hover); border: 1px solid rgba(232,221,204,.7);
}
.form-card h2 { font-family: var(--serif); font-size: 26px; text-align: center; letter-spacing: 2px; }
.form-card .sub { text-align: center; color: var(--ink-soft); font-size: 13px; margin: 6px 0 24px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13.5px; color: var(--ink-soft); margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 11px 15px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--cream); outline: none;
  transition: border .2s, box-shadow .2s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--orange); box-shadow: 0 0 0 3px rgba(224,115,47,.14); background: #fff;
}
.form-err {
  display: none; background: #fdf0ec; color: #b3402a; border: 1px solid #f2cfc4;
  padding: 10px 14px; border-radius: 10px; font-size: 13.5px; margin-bottom: 16px;
}
.form-err.show { display: block; }
.form-foot { text-align: center; margin-top: 18px; font-size: 13.5px; color: var(--ink-soft); }
.w-100 { width: 100%; }

/* ===== 编辑器 ===== */
.write-head { display: flex; align-items: center; justify-content: space-between; margin: 30px 0 18px; }
.write-head h2 { font-family: var(--serif); font-size: 26px; letter-spacing: 2px; }
.write-form {
  background: var(--paper); border-radius: 20px; padding: 26px 28px;
  box-shadow: var(--shadow); border: 1px solid rgba(232,221,204,.7);
}
.write-row { display: flex; gap: 16px; flex-wrap: wrap; }
.write-row .field { flex: 1; min-width: 180px; }
.cover-pick { display: flex; gap: 10px; flex-wrap: wrap; }
.cover-opt {
  width: 86px; height: 46px; border-radius: 10px; cursor: pointer;
  border: 3px solid transparent; transition: transform .15s; position: relative;
}
.cover-opt:hover { transform: scale(1.06); }
.cover-opt.sel { border-color: var(--ink); box-shadow: 0 4px 10px rgba(0,0,0,.2); }
.editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 6px; }
.editor-grid textarea {
  width: 100%; height: 460px; padding: 18px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--cream);
  font-family: Consolas, "Courier New", monospace; font-size: 14px; line-height: 1.7;
  resize: vertical; outline: none;
}
.editor-grid textarea:focus { border-color: var(--orange); background: #fff; }
.preview-box {
  height: 460px; overflow-y: auto; padding: 18px 22px; border-radius: 14px;
  border: 1px dashed var(--line); background: #fffdf6;
}
.preview-label { font-size: 12px; color: var(--ink-soft); letter-spacing: 2px; margin: 14px 0 6px; }

/* ===== 个人中心 ===== */
.profile-grid { display: grid; grid-template-columns: 320px 1fr; gap: 24px; margin-top: 30px; align-items: start; }
.profile-card {
  background: var(--paper); border-radius: 20px; padding: 30px 26px;
  box-shadow: var(--shadow); border: 1px solid rgba(232,221,204,.7); text-align: center;
}
.profile-card .avatar { width: 84px; height: 84px; font-size: 40px; margin-bottom: 12px; }
.profile-card .pname { font-family: var(--serif); font-size: 23px; font-weight: 700; }
.profile-card .pdate { font-size: 12.5px; color: var(--ink-soft); margin: 4px 0 16px; }
.profile-card .field { text-align: left; }
.stat-row { display: flex; justify-content: space-around; margin: 14px 0 20px; padding: 12px 0; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); }
.stat-row b { font-family: var(--serif); font-size: 21px; display: block; color: var(--orange-deep); }
.stat-row span { font-size: 12px; color: var(--ink-soft); }
.mypost {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px; margin-bottom: 12px;
  background: var(--paper); border-radius: 14px; border: 1px solid rgba(232,221,204,.7);
  box-shadow: var(--shadow); transition: transform .18s;
}
.mypost:hover { transform: translateX(4px); }
.mypost .mp-cover { width: 58px; height: 44px; border-radius: 8px; flex-shrink: 0; }
.mypost .mp-title { font-family: var(--serif); font-size: 16.5px; color: var(--ink); }
.mypost .mp-meta { font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; }
.mypost .mp-body { flex: 1; min-width: 0; }
.mypost .mp-ops { display: flex; gap: 8px; flex-shrink: 0; }
.section-title { font-family: var(--serif); font-size: 20px; margin-bottom: 14px; display: flex; align-items: baseline; gap: 10px; }
.section-title small { color: var(--ink-soft); font-size: 13px; font-family: var(--sans); }

/* ===== Toast ===== */
.toast {
  position: fixed; top: 84px; left: 50%; transform: translateX(-50%) translateY(-16px);
  background: var(--ink); color: #fff; padding: 11px 26px; border-radius: 999px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: all .3s; z-index: 99;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== 页脚 ===== */
.footer { margin-top: 60px; border-top: 1px solid var(--line); background: var(--cream-2); }
.footer-inner { display: flex; justify-content: space-between; padding: 22px 0; color: var(--ink-soft); font-size: 13px; flex-wrap: wrap; gap: 8px; }

@media (max-width: 860px) {
  .post-list, .editor-grid, .profile-grid { grid-template-columns: 1fr; }
  .hero { padding: 36px 28px; }
  .hero h1 { font-size: 32px; }
  .article { padding: 26px 22px; }
}
