/* ============================================================
   黑小帅 · 暖调小站 —— 全套暖调设计 token（方案二 P1）
   同风格原创：暖米白底 / 珊瑚橙主色 / 1px 细描边 / 4px 小圆角 / 近零阴影 / 系统字体
   ============================================================ */
:root {
  --bg: #fff8f3;        /* 页面底 · 暖米白 */
  --card: #fffdfb;      /* 卡片 · 暖白 */
  --card-2: #f5ebe1;    /* 次级面板 · 浅暖咖 */
  --card-3: #f0e4d7;   /* 三级面板 · 暖咖 */
  --ink: #2d221e;       /* 正文 · 深咖近黑 */
  --ink-soft: #6b5d54;  /* 次文字 · 咏叹调 */
  --accent: #ff6b4a;    /* 主色 · 珊瑚橙 */
  --accent-deep: #e2542f;
  --accent-bg: #fff1ec; /* 主色浅底 */
  --line: #ead8c7;      /* 描边 · 沙色 */
  --line-soft: #f2e6d9;
  --green: #059669;     /* 辅助 · 翠绿（成功态） */
  --amber: #b45309;     /* 警示 · 琥珀 */
  --radius: 4px;        /* 小圆角 · 工具感 */
  --mono: Consolas, Menlo, "Cascadia Mono", "Courier New", monospace;
  --sans: -apple-system, "Segoe UI", "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
  min-height: 100vh;
}
a { color: var(--accent-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
::selection { background: #ffd6c9; }

/* ============ 布局骨架：左固定侧栏 + 右流式主内容 ============ */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px;
  flex: none;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--bg);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 28px 18px 18px;
}
.brand { display: block; margin-bottom: 26px; }
.brand .logo {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 19px; font-weight: 800; letter-spacing: 1px; color: var(--ink);
}
.brand .logo .logo-mark {
  width: 26px; height: 26px; border-radius: var(--radius);
  background: var(--accent); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800;
}
.brand .tagline { margin-top: 6px; font-size: 12px; color: var(--ink-soft); }

.nav-group { margin-bottom: 18px; }
.nav-group .nav-group-label {
  font-size: 11px; letter-spacing: 2px; color: var(--ink-soft);
  text-transform: uppercase; margin: 0 0 8px 10px; font-weight: 700;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius);
  color: var(--ink-soft); font-size: 14px;
  border: 1px solid transparent;
}
.nav-item:hover { color: var(--accent-deep); background: var(--accent-bg); text-decoration: none; }
.nav-item.current { color: var(--accent-deep); border: 1px solid var(--accent); background: #ffe4da; font-weight: 700; }
.nav-item svg { width: 16px; height: 16px; flex: none; }

.sidebar-foot {
  margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line);
  font-size: 11.5px; color: var(--ink-soft); line-height: 1.8;
}
.sidebar-foot a { color: var(--ink-soft); border-bottom: 1px dashed var(--line); }
.sidebar-foot a:hover { color: var(--accent-deep); text-decoration: none; }

.main { flex: 1; min-width: 0; padding: 36px 32px 64px; max-width: 900px; }

/* ============ 模块化大标题（2x.nz 式：超大加粗 + 编号） ============ */
.mod-title {
  display: flex; align-items: baseline; gap: 10px;
  font-size: 25px; font-weight: 800; letter-spacing: 0.5px; color: var(--ink);
  margin: 34px 0 14px;
}
.mod-title:first-child { margin-top: 0; }
.mod-title .mod-num {
  font-family: var(--mono); font-size: 14px; font-weight: 700; color: var(--accent);
}
.mod-title .mod-more {
  margin-left: auto; font-size: 13px; font-weight: 600; color: var(--ink-soft);
}
.mod-title .mod-more:hover { color: var(--accent-deep); text-decoration: none; }
.mod-title .mod-more .arr { display: inline-block; transition: transform .15s; }
.mod-title .mod-more:hover .arr { transform: translateX(3px); }

.mod-sub { font-size: 13px; color: var(--ink-soft); margin: -8px 0 16px; }

/* ============ 卡片与阵列 ============ */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

/* ============ Hero ============ */
.hero {
  padding: 34px 26px 30px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.hero .hero-kicker {
  font-size: 12px; letter-spacing: 3px; font-weight: 700;
  color: var(--accent-deep); text-transform: uppercase; margin-bottom: 10px;
}
.hero h1 { font-size: 30px; font-weight: 800; letter-spacing: 1px; line-height: 1.3; margin-bottom: 10px; }
.hero .hero-desc { font-size: 14.5px; color: var(--ink-soft); max-width: 560px; }
.hero .hero-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px; border-radius: var(--radius);
  font-size: 14px; font-weight: 600; font-family: var(--sans);
  border: 1px solid transparent; cursor: pointer;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-deep); text-decoration: none; }
.btn-outline { background: transparent; border-color: var(--line); color: var(--ink-soft); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent-deep); text-decoration: none; }
.btn .arr { display: inline-block; transition: transform .15s; }
.btn:hover .arr { transform: translateX(3px); }

/* ============ 公告横幅 ============ */
.notice {
  display: flex; align-items: baseline; gap: 10px;
  background: var(--accent-bg);
  border: 1px solid #ffc9b8;
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 10px 14px; margin: 14px 0 0;
  font-size: 13.5px;
}
.notice .notice-badge {
  flex: none; font-size: 11px; font-weight: 800; letter-spacing: 1px;
  color: #fff; background: var(--accent);
  border-radius: var(--radius); padding: 1px 7px;
}
.notice .notice-text { flex: 1; min-width: 0; color: var(--ink); }
.notice .notice-close {
  flex: none; border: none; background: none; cursor: pointer;
  color: var(--ink-soft); font-size: 16px; line-height: 1; padding: 0 2px;
}
.notice .notice-close:hover { color: var(--accent-deep); }

/* ============ 2×2 入口卡 ============ */
.entry-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.entry-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px;
  color: var(--ink);
}
.entry-card:hover { border-color: var(--accent); text-decoration: none; }
.entry-card .entry-icon {
  width: 34px; height: 34px; flex: none; border-radius: var(--radius);
  background: var(--card-2); color: var(--accent-deep);
  display: inline-flex; align-items: center; justify-content: center;
}
.entry-card .entry-icon svg { width: 18px; height: 18px; }
.entry-card .entry-name { font-weight: 700; font-size: 14.5px; }
.entry-card .entry-desc { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.entry-card .entry-arr {
  margin-left: auto; color: var(--ink-soft); font-size: 15px;
  transition: transform .15s;
}
.entry-card:hover .entry-arr { transform: translateX(3px); color: var(--accent-deep); }

/* ============ 博客列表页 ============ */
.blog-toolbar { margin-bottom: 14px; }
.search-input {
  width: 100%; max-width: 420px;
  padding: 9px 14px;
  font-size: 14px; font-family: var(--sans); color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius);
  outline: none;
}
.search-input:focus { border-color: var(--accent); }
.search-input::placeholder { color: #a89a8e; }

.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 18px; }
.tag-pill {
  font-family: var(--sans); font-size: 12.5px; font-weight: 600;
  padding: 3px 12px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--card-2); color: var(--ink-soft);
  cursor: pointer;
}
.tag-pill:hover { color: var(--accent-deep); border-color: #ffc9b8; }
.tag-pill.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.tag-pill .cnt { opacity: .75; font-size: 11px; margin-left: 2px; }

.post-list { display: flex; flex-direction: column; gap: 10px; }
.post-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 18px;
}
.post-card:hover { border-color: #ffc9b8; }
.post-card .pc-date { font-size: 12px; color: var(--ink-soft); font-family: var(--mono); }
.post-card .pc-title { font-size: 16.5px; font-weight: 700; margin: 2px 0 4px; }
.post-card .pc-title a { color: var(--ink); }
.post-card .pc-title a:hover { color: var(--accent-deep); text-decoration: none; }
.post-card .pc-summary { font-size: 13px; color: var(--ink-soft); margin-bottom: 8px; }
.post-card .pc-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag-mini {
  font-size: 11px; padding: 1px 8px; border-radius: var(--radius);
  background: var(--card-2); color: var(--ink-soft); border: 1px solid var(--line);
}
.empty-tip {
  text-align: center; color: var(--ink-soft); font-size: 13.5px;
  padding: 34px 0; border: 1px dashed var(--line); border-radius: var(--radius);
}

/* ============ 文章页 ============ */
.crumbs { font-size: 12.5px; color: var(--ink-soft); margin-bottom: 14px; }
.crumbs a { color: var(--ink-soft); }
.crumbs a:hover { color: var(--accent-deep); }
.crumbs .sep { margin: 0 6px; opacity: .6; }

.post-head { border-bottom: 1px solid var(--line); padding-bottom: 16px; margin-bottom: 22px; }
.post-head h1 { font-size: 26px; font-weight: 800; line-height: 1.4; margin-bottom: 10px; }
.post-head .post-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  font-size: 12.5px; color: var(--ink-soft);
}
.post-head .post-meta .dot { opacity: .5; }
.post-head .pc-tags { display: inline-flex; gap: 6px; }

.post-body { font-size: 15px; line-height: 1.9; }
.post-body p { margin: 13px 0; }
.post-body .md-h2 { font-size: 20px; font-weight: 800; margin: 28px 0 12px; padding-left: 10px; border-left: 3px solid var(--accent); }
.post-body .md-h3 { font-size: 17px; font-weight: 700; margin: 22px 0 10px; }
.post-body .md-h4 { font-size: 15.5px; font-weight: 700; margin: 18px 0 8px; }
.post-body .md-h5, .post-body .md-h6 { font-size: 15px; font-weight: 700; margin: 16px 0 8px; }
.post-body .md-quote {
  background: var(--card-2); border-left: 3px solid var(--accent);
  border-radius: var(--radius); padding: 10px 16px; margin: 14px 0;
  color: var(--ink-soft); font-size: 14px;
}
.post-body .md-list { padding-left: 24px; margin: 12px 0; }
.post-body .md-list li { margin: 6px 0; }
.post-body .md-list li::marker { color: var(--accent); }
.post-body code {
  font-family: var(--mono); font-size: 13px;
  background: var(--card-2); border: 1px solid var(--line);
  border-radius: 3px; padding: 1px 6px;
}
.post-body .code-block {
  background: #f7ece2; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 13px 16px;
  margin: 15px 0; overflow-x: auto;
  position: relative;
}
.post-body .code-block code {
  background: none; border: none; padding: 0;
  font-size: 13px; line-height: 1.65; color: #4a3a30;
  display: block; min-width: max-content;
}
.post-body .code-block[data-lang]::before {
  content: attr(data-lang);
  position: absolute; top: 6px; right: 10px;
  font-size: 10px; font-family: var(--mono); letter-spacing: 1px;
  color: #b09c8c; text-transform: uppercase;
}
.post-body .table-scroll { overflow-x: auto; margin: 15px 0; }
.post-body .md-table {
  width: 100%; border-collapse: collapse; font-size: 13.5px;
  background: var(--card); border: 1px solid var(--line);
}
.post-body .md-table th {
  background: var(--card-2); font-weight: 700; text-align: left;
  padding: 8px 12px; border: 1px solid var(--line); white-space: nowrap;
}
.post-body .md-table td { padding: 8px 12px; border: 1px solid var(--line); vertical-align: top; }
.post-body .md-hr { border: none; border-top: 1px solid var(--line); margin: 22px 0; }
.post-body img { border-radius: var(--radius); border: 1px solid var(--line); margin: 6px 0; }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 30px; }
.post-nav .pn-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 16px; color: var(--ink);
}
.post-nav .pn-card:hover { border-color: #ffc9b8; text-decoration: none; }
.post-nav .pn-label { font-size: 11px; letter-spacing: 1px; color: var(--ink-soft); font-weight: 700; }
.post-nav .pn-title { font-size: 14.5px; font-weight: 700; margin-top: 4px; }
.post-nav .pn-card.next { text-align: right; }

/* ============ 关于 / 友链页 ============ */
.prose { font-size: 15px; line-height: 1.9; }
.prose p { margin: 12px 0; }
.link-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.link-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; color: var(--ink);
}
.link-card:hover { border-color: #ffc9b8; text-decoration: none; }
.link-card .link-avatar {
  width: 36px; height: 36px; flex: none; border-radius: var(--radius);
  background: var(--card-2); color: var(--accent-deep); font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; font-size: 15px;
}
.link-card .link-name { font-weight: 700; font-size: 14.5px; }
.link-card .link-desc { font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; }

/* ============ 404 ============ */
.page-404 { text-align: center; padding: 70px 0; }
.page-404 .code-404 { font-family: var(--mono); font-size: 52px; font-weight: 800; color: var(--accent); }
.page-404 p { color: var(--ink-soft); margin: 8px 0 20px; }

/* ============ 移动端（侧栏抽屉） ============ */
.topbar { display: none; }
.drawer-overlay {
  display: none; position: fixed; inset: 0; z-index: 40;
  background: rgba(45, 34, 30, 0.35);
}
@media (max-width: 760px) {
  .topbar {
    display: flex; align-items: center; gap: 12px;
    position: sticky; top: 0; z-index: 50;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 10px 16px;
  }
  .topbar .topbar-burger {
    border: 1px solid var(--line); background: var(--card);
    border-radius: var(--radius); width: 32px; height: 32px;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--ink); font-size: 15px; line-height: 1;
    font-family: var(--sans);
  }
  .topbar .topbar-brand { font-weight: 800; font-size: 15px; letter-spacing: 1px; }
  .sidebar {
    position: fixed; left: 0; top: 0; z-index: 45;
    transform: translateX(-100%);
    transition: transform .22s ease;
    width: min(240px, 72vw);
    background: var(--bg);
  }
  .sidebar.open { transform: translateX(0); }
  .drawer-overlay.show { display: block; }
  .main { padding: 20px 16px 48px; }
  .grid-3 { grid-template-columns: 1fr; }
  .hero h1 { font-size: 25px; }
  .mod-title { font-size: 21px; }
  .post-nav { grid-template-columns: 1fr; }
  .link-grid, .entry-grid, .grid-2 { grid-template-columns: 1fr; }
}

/* ============ 打印 ============ */
@media print {
  .sidebar, .topbar, .notice .notice-close { display: none !important; }
  body { background: #fff; }
  .main { padding: 0; max-width: none; }
  .card, .post-card, .hero { border: 1px solid #ddd; box-shadow: none; }
}
