/* Number One · 个人博客 — 无外部依赖，单站自洽 */
:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --surface-soft: #f4f2ec;
  --ink: #1c1b19;
  --ink-soft: #45423c;
  --muted: #78736a;
  --faint: #a8a299;
  --line: #e7e3da;
  --accent: #e2542c;
  --accent-soft: #fdeee8;
  --accent-ink: #b83f1c;
  --shadow: 0 1px 2px rgba(28,27,25,.04), 0 12px 32px rgba(28,27,25,.06);
  --shadow-lg: 0 24px 64px rgba(28,27,25,.16);
  --radius: 14px;
}
[data-theme="dark"] {
  --bg: #171716;
  --surface: #22211f;
  --surface-soft: #2b2926;
  --ink: #f3f0e9;
  --ink-soft: #d3cec4;
  --muted: #a49e93;
  --faint: #7c776e;
  --line: #37342f;
  --accent: #ff7043;
  --accent-soft: #3a231c;
  --accent-ink: #ff9b78;
  --shadow: 0 1px 2px rgba(0,0,0,.2), 0 12px 32px rgba(0,0,0,.24);
  --shadow-lg: 0 24px 64px rgba(0,0,0,.5);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  transition: background .25s, color .25s;
}
button, input, textarea { font: inherit; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 28px; }
.wrap.narrow, .content-block.narrow { max-width: 780px; }

/* ---------- Header ---------- */
.site-header {
  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);
}
.header-inner { display: flex; align-items: center; gap: 36px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; flex-shrink: 0; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; flex: 0 0 auto;
  background: var(--accent); color: #fff;
  display: grid; place-items: center;
  font-weight: 800; font-size: 17px; letter-spacing: -.04em;
}
.brand-mark-sm { width: 34px; height: 34px; border-radius: 10px; font-size: 19px; }
.brand-text { font-weight: 800; font-size: 17px; letter-spacing: -.035em; }
.brand-dot { color: var(--accent); }
.brand-sub { color: var(--faint); font-size: 12px; padding-left: 10px; border-left: 1px solid var(--line); margin-left: 2px; }
.main-nav { display: flex; gap: 4px; flex: 1; }
.nav-link { padding: 6px 14px; border-radius: 8px; color: var(--muted); font-size: 14px; font-weight: 600; text-decoration: none; }
.nav-link:hover { background: var(--surface-soft); color: var(--ink); text-decoration: none; }
.nav-link.is-active { color: var(--accent-ink); background: var(--accent-soft); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.user-area { display: flex; align-items: center; gap: 8px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.user-name { font-size: 14px; font-weight: 600; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Buttons ---------- */
.btn { border: 1px solid transparent; border-radius: 9px; padding: 10px 18px; font-size: 14px; font-weight: 650; cursor: pointer; transition: transform .15s, background .15s, border-color .15s, box-shadow .15s; white-space: nowrap; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-sm { padding: 7px 13px; font-size: 13px; border-radius: 8px; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 26%, transparent); }
.btn-primary:hover { background: var(--accent-ink); }
.btn-outline { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent-ink); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-soft); color: var(--ink); }
.btn-text { background: transparent; color: var(--muted); text-decoration: underline; text-underline-offset: 4px; }
.btn-block { width: 100%; padding: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }

/* ---------- Hero ---------- */
.hero { border-bottom: 1px solid var(--line); background: linear-gradient(180deg, var(--surface-soft) 0%, var(--bg) 100%); overflow: hidden; }
.hero-inner { display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; padding-top: 76px; padding-bottom: 80px; }
.eyebrow { display: flex; align-items: center; gap: 10px; font-size: 11px; font-weight: 700; letter-spacing: .18em; color: var(--accent-ink); text-transform: uppercase; margin: 0 0 22px; }
.eyebrow-line { display: inline-block; width: 24px; height: 2px; background: var(--accent); }
.hero h1 { font-size: clamp(36px, 4.6vw, 56px); line-height: 1.24; letter-spacing: -.045em; margin: 0 0 20px; font-weight: 800; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero-desc { color: var(--muted); font-size: 16px; max-width: 500px; margin: 0 0 30px; }
.hero-cta { display: flex; align-items: center; gap: 14px; }
.hero-art { position: relative; height: 300px; }
.art-blob { position: absolute; width: 230px; height: 230px; border-radius: 50%; background: var(--accent); opacity: .10; right: 6%; top: 12%; }
.art-card { position: absolute; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px 26px; }
.art-card-1 { width: 238px; top: 8px; left: 12%; transform: rotate(-5deg); }
.art-num { font-size: 38px; font-weight: 800; color: var(--accent); letter-spacing: -.06em; line-height: 1; display: block; margin-bottom: 14px; }
.art-card-1 p { margin: 0 0 16px; font-size: 19px; font-weight: 700; line-height: 1.5; letter-spacing: -.02em; }
.art-rule { display: block; height: 3px; width: 54px; background: var(--accent); border-radius: 2px; }
.art-card-2 { width: 210px; bottom: 8px; right: 4%; transform: rotate(4deg); background: var(--ink); border-color: var(--ink); color: var(--bg); padding: 20px 22px; }
.art-card-2 p { margin: 10px 0 0; font-size: 14px; font-weight: 600; }
.art-badge { font-size: 22px; color: var(--accent); }

/* ---------- Content ---------- */
.content-block { padding-top: 56px; padding-bottom: 88px; min-height: 52vh; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.section-title { font-size: 22px; font-weight: 800; letter-spacing: -.03em; margin: 0; display: flex; align-items: center; gap: 10px; }
.count-badge { font-size: 12px; font-weight: 700; color: var(--accent-ink); background: var(--accent-soft); border-radius: 20px; padding: 2px 10px; letter-spacing: 0; }
.search-box { display: flex; align-items: center; gap: 9px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 0 13px; color: var(--faint); min-width: 260px; }
.search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-box input { border: 0; outline: 0; background: transparent; color: var(--ink); padding: 10px 0; width: 100%; font-size: 14px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.tag-chip { border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 20px; padding: 5px 14px; font-size: 13px; cursor: pointer; transition: .15s; }
.tag-chip:hover { border-color: var(--accent); color: var(--accent-ink); }
.tag-chip.is-active { background: var(--ink); border-color: var(--ink); color: var(--bg); }

.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.post-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 22px 20px; display: flex; flex-direction: column; cursor: pointer; transition: transform .18s, box-shadow .18s, border-color .18s; position: relative; overflow: hidden; min-height: 234px; }
.post-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--accent); opacity: 0; transition: opacity .18s; }
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.post-card:hover::before { opacity: 1; }
.card-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--faint); margin-bottom: 14px; }
.card-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--faint); }
.post-card h3 { font-size: 19px; line-height: 1.45; letter-spacing: -.025em; margin: 0 0 10px; font-weight: 750; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-card .excerpt { color: var(--muted); font-size: 13.5px; line-height: 1.7; margin: 0 0 18px; flex: 1; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); padding-top: 14px; }
.card-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.mini-tag { font-size: 11px; color: var(--accent-ink); background: var(--accent-soft); padding: 2px 8px; border-radius: 5px; }
.card-stat { font-size: 12px; color: var(--faint); white-space: nowrap; }
.author-line { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.author-badge { width: 20px; height: 20px; border-radius: 50%; background: var(--surface-soft); color: var(--accent-ink); display: grid; place-items: center; font-size: 10px; font-weight: 700; }
.empty-state { text-align: center; padding: 70px 20px; color: var(--muted); }
.empty-icon { font-size: 36px; color: var(--accent); margin-bottom: 12px; }
.empty-state h3 { color: var(--ink); margin: 0 0 6px; }

/* ---------- 页面标题 / 归档 / 关于 ---------- */
.page-title { font-size: clamp(32px, 4vw, 44px); font-weight: 800; letter-spacing: -.045em; margin: 0 0 8px; }
.page-lead { color: var(--muted); font-size: 16px; margin: 0 0 40px; }
.prose { font-size: 15.5px; line-height: 1.9; color: var(--ink-soft); }
.prose h2 { font-size: 20px; margin: 36px 0 12px; letter-spacing: -.02em; color: var(--ink); }
.prose ul { padding-left: 20px; }
.prose li { margin: 6px 0; }
.notice { background: var(--surface-soft); border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0; padding: 18px 22px; margin: 28px 0; }
.notice-title { font-weight: 750; color: var(--accent-ink); margin-bottom: 6px; }
.notice p { margin: 8px 0 0; font-size: 14px; }
.archive-group { margin-bottom: 32px; }
.archive-month { font-size: 13px; font-weight: 750; color: var(--accent-ink); letter-spacing: .04em; padding-bottom: 10px; border-bottom: 1px solid var(--line); margin: 0 0 4px; }
.archive-item { display: flex; align-items: baseline; gap: 16px; padding: 12px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.archive-item:hover .archive-title { color: var(--accent-ink); }
.archive-date { font-size: 12px; color: var(--faint); min-width: 52px; font-variant-numeric: tabular-nums; }
.archive-title { font-weight: 650; transition: color .15s; flex: 1; }
.archive-arrow { color: var(--faint); }

/* ---------- 文章详情 ---------- */
.back-link { background: none; border: 0; padding: 0; color: var(--muted); cursor: pointer; font-size: 14px; margin-bottom: 32px; }
.back-link:hover { color: var(--accent-ink); }
.detail-head { border-bottom: 1px solid var(--line); padding-bottom: 26px; margin-bottom: 30px; }
.detail-head h1 { font-size: clamp(28px, 3.6vw, 40px); line-height: 1.3; letter-spacing: -.04em; margin: 0 0 16px; font-weight: 800; }
.detail-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.detail-body { white-space: pre-wrap; font-size: 16px; line-height: 2; color: var(--ink-soft); }
.detail-actions { display: flex; gap: 10px; align-items: center; margin: 36px 0 0; padding-top: 22px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.act-btn { border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 8px; padding: 7px 14px; font-size: 13px; cursor: pointer; }
.act-btn:hover { border-color: var(--accent); color: var(--accent-ink); }
.act-btn.is-on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
.detail-owner { margin-left: auto; display: flex; gap: 8px; }
.comment-section { margin-top: 56px; }
.comment-section h3 { font-size: 19px; margin: 0 0 18px; }
.comment-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 22px; }
.comment-box textarea { width: 100%; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); color: var(--ink); padding: 12px; resize: vertical; outline: 0; font-size: 14px; }
.comment-box textarea:focus { border-color: var(--accent); }
.comment-box .row { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; gap: 10px; }
.comment-hint { color: var(--faint); font-size: 12.5px; }
.comment-item { display: flex; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.comment-item p { margin: 2px 0 0; color: var(--ink-soft); font-size: 14px; white-space: pre-wrap; }
.comment-meta { display: flex; gap: 10px; align-items: baseline; font-size: 12px; color: var(--faint); }
.comment-meta strong { color: var(--ink); font-size: 13px; }
.comment-del { margin-left: auto; background: none; border: 0; color: var(--faint); cursor: pointer; font-size: 12px; }
.comment-del:hover { color: var(--accent); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--surface-soft); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 30px; padding-bottom: 30px; }
.footer-left { display: flex; align-items: center; gap: 12px; }
.footer-left strong { font-size: 14px; letter-spacing: -.02em; }
.footer-left p { margin: 0; font-size: 12px; color: var(--muted); }
.footer-right { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.theme-toggle { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 12.5px; padding: 0; }
.theme-toggle:hover { color: var(--accent-ink); }
.footer-csb { font-weight: 700; font-size: 13px; }
.footer-copy { font-size: 12px; color: var(--faint); }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(20,18,16,.52); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 20px; animation: fade .18s ease; }
.modal { position: relative; width: 100%; max-width: 420px; max-height: 90vh; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 34px 32px 28px; animation: pop .2s ease; }
.modal-wide { max-width: 620px; }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98) } to { opacity: 1; transform: none } }
.modal-close { position: absolute; top: 14px; right: 16px; background: none; border: 0; font-size: 26px; line-height: 1; color: var(--faint); cursor: pointer; }
.modal-close:hover { color: var(--ink); }
.modal .eyebrow { margin-bottom: 12px; }
.modal-title { font-size: 26px; font-weight: 800; letter-spacing: -.035em; margin: 0 0 6px; }
.modal-desc { color: var(--muted); font-size: 13.5px; margin: 0 0 20px; }
.auth-tabs { display: flex; gap: 4px; background: var(--surface-soft); padding: 4px; border-radius: 10px; margin-bottom: 22px; }
.auth-tab { flex: 1; border: 0; background: transparent; color: var(--muted); padding: 8px; border-radius: 7px; font-size: 13.5px; font-weight: 650; cursor: pointer; }
.auth-tab.is-active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.07); }
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 13px; font-weight: 650; margin-bottom: 7px; }
.field small { font-weight: 400; color: var(--faint); font-size: 12px; margin-left: 6px; }
.field input, .field textarea { width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 11px 13px; color: var(--ink); outline: 0; transition: border-color .15s, box-shadow .15s; font-size: 14px; }
.field input:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field textarea { line-height: 1.7; resize: vertical; }
.form-error { color: var(--accent-ink); background: var(--accent-soft); border-radius: 8px; padding: 9px 12px; font-size: 13px; margin: 0 0 14px; }
.modal-foot { font-size: 12px; color: var(--faint); text-align: center; margin: 18px 0 0; line-height: 1.7; }

/* ---------- Toast ---------- */
.toast-stack { position: fixed; top: 82px; right: 22px; z-index: 200; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { background: var(--ink); color: var(--bg); border-radius: 9px; padding: 11px 16px; font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow-lg); animation: pop .2s ease; max-width: 300px; }
.toast.ok { background: #2f7a52; color: #fff; }
.toast.err { background: var(--accent-ink); color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 0; padding-top: 56px; padding-bottom: 60px; }
  .hero-art { display: none; }
  .post-grid { grid-template-columns: repeat(2, 1fr); }
  .brand-sub { display: none; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 18px; }
  .header-inner { gap: 10px; height: 60px; }
  .main-nav { display: none; }
  .brand-text { font-size: 15px; }
  .header-actions { margin-left: auto; }
  .user-name { display: none; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .search-box { min-width: 0; }
  .post-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 34px; }
  .hero-desc { font-size: 14.5px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .modal { padding: 28px 22px 22px; }
  .detail-owner { margin-left: 0; width: 100%; }
}
