/* ===== AK47 Blog 样式 ===== */
:root {
  --bg: #fafaf7;
  --bg-card: #ffffff;
  --fg: #1c1c1e;
  --muted: #6e6e73;
  --accent: #b3372f;
  --border: #e4e4df;
  --code-bg: #f0f0ea;
  --shadow: 0 1px 3px rgba(0,0,0,.06);
}
[data-theme="dark"] {
  --bg: #141416;
  --bg-card: #1d1d20;
  --fg: #e8e8ea;
  --muted: #9a9aa0;
  --accent: #e06458;
  --border: #2c2c30;
  --code-bg: #232327;
  --shadow: 0 1px 3px rgba(0,0,0,.4);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141416;
    --bg-card: #1d1d20;
    --fg: #e8e8ea;
    --muted: #9a9aa0;
    --accent: #e06458;
    --border: #2c2c30;
    --code-bg: #232327;
    --shadow: 0 1px 3px rgba(0,0,0,.4);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.75;
  transition: background .25s, color .25s;
}
.container { max-width: 760px; margin: 0 auto; padding: 0 20px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* 头部 */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky; top: 0; z-index: 10;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 58px; }
.logo { font-weight: 700; font-size: 1.15rem; color: var(--fg); }
.logo:hover { text-decoration: none; }
.logo-sub { font-weight: 400; font-size: .85rem; color: var(--muted); margin-left: 4px; }
.site-nav { display: flex; align-items: center; gap: 18px; }
.site-nav a { color: var(--muted); font-size: .95rem; }
.site-nav a.active, .site-nav a:hover { color: var(--fg); text-decoration: none; }
.icon-btn {
  background: none; border: 1px solid var(--border); border-radius: 6px;
  color: var(--fg); font-size: 1rem; padding: 2px 9px; cursor: pointer;
}

/* 首页 hero */
.hero { padding: 48px 0 8px; }
.hero h1 { font-size: 1.9rem; margin: 0 0 6px; letter-spacing: .5px; }
.hero-sub { color: var(--muted); margin: 0; }

/* 搜索 */
.search-box { margin: 22px 0 10px; }
.search-box input {
  width: 100%; padding: 10px 14px; font-size: 1rem;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg-card); color: var(--fg);
}
.search-box input:focus { outline: none; border-color: var(--accent); }

/* 文章卡片 */
.post-list { display: flex; flex-direction: column; gap: 14px; margin: 14px 0 40px; }
.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  transition: transform .12s, border-color .12s;
}
.post-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.post-card a { display: block; padding: 18px 22px; color: inherit; }
.post-card a:hover { text-decoration: none; }
.post-card h2 { margin: 0 0 4px; font-size: 1.15rem; }
.post-meta { color: var(--muted); font-size: .82rem; margin: 0 0 8px; }
.post-excerpt { margin: 0; color: var(--muted); font-size: .93rem; }
.no-result { color: var(--muted); text-align: center; padding: 20px 0; }
.hidden { display: none; }

/* 草稿本 */
.drafts {
  border-top: 1px dashed var(--border);
  padding: 26px 0 50px;
}
.drafts h3 { margin: 0 0 4px; }
.drafts-hint { color: var(--muted); font-size: .85rem; margin: 0 0 12px; }
.draft-editor textarea {
  width: 100%; padding: 10px 12px; font-size: .95rem; font-family: inherit;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg-card); color: var(--fg); resize: vertical;
}
.draft-editor textarea:focus { outline: none; border-color: var(--accent); }
.draft-actions { margin-top: 8px; display: flex; align-items: center; gap: 12px; }
.draft-actions button {
  background: var(--accent); color: #fff; border: none; border-radius: 6px;
  padding: 7px 18px; font-size: .9rem; cursor: pointer;
}
.draft-actions button:hover { filter: brightness(1.1); }
#draft-status { color: var(--muted); font-size: .82rem; }
.draft-list { list-style: none; padding: 0; margin: 14px 0 0; }
.draft-list li {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 14px; margin-bottom: 8px; font-size: .9rem;
  display: flex; justify-content: space-between; gap: 10px; align-items: flex-start;
}
.draft-list .draft-text { white-space: pre-wrap; word-break: break-all; }
.draft-list .draft-time { color: var(--muted); font-size: .75rem; white-space: nowrap; }
.draft-list button { background: none; border: none; color: var(--muted); cursor: pointer; font-size: .8rem; }
.draft-list button:hover { color: var(--accent); }

/* 文章页 */
.post-header { padding: 40px 0 0; }
.post-header h1 { font-size: 1.8rem; line-height: 1.35; margin: 0 0 8px; }
.post-header .post-meta { color: var(--muted); font-size: .85rem; margin: 0; }
.post-content { padding: 26px 0 40px; font-size: 1rem; }
.post-content h2 { font-size: 1.3rem; margin-top: 34px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.post-content h3 { font-size: 1.1rem; margin-top: 24px; }
.post-content p { margin: 14px 0; }
.post-content ul, .post-content ol { padding-left: 22px; }
.post-content code {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: .86em; background: var(--code-bg);
  padding: 2px 6px; border-radius: 4px;
}
.post-content pre {
  background: var(--code-bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 14px 16px; overflow-x: auto;
  font-size: .85rem; line-height: 1.6;
}
.post-content pre code { background: none; padding: 0; }
.post-content blockquote {
  margin: 16px 0; padding: 4px 16px;
  border-left: 3px solid var(--accent); color: var(--muted);
}
.post-content table { border-collapse: collapse; margin: 16px 0; font-size: .9rem; width: 100%; }
.post-content th, .post-content td { border: 1px solid var(--border); padding: 7px 12px; text-align: left; }
.post-content th { background: var(--code-bg); }

/* 文章导航 */
.post-nav {
  display: flex; justify-content: space-between; gap: 14px;
  border-top: 1px solid var(--border);
  padding: 20px 0 50px; font-size: .9rem;
}
.post-nav a { color: var(--muted); }
.post-nav a:hover { color: var(--accent); text-decoration: none; }

/* 页脚 */
.site-footer { border-top: 1px solid var(--border); padding: 22px 0; color: var(--muted); font-size: .85rem; }
.site-footer p { margin: 0; text-align: center; }

@media (max-width: 520px) {
  .hero h1 { font-size: 1.5rem; }
  .post-header h1 { font-size: 1.4rem; }
  .site-nav { gap: 12px; }
}
