/* ==========================================================================
   豆豆春秋 · 新中式古风设计系统
   配色：墨绿主调 + 暗金点缀 + 印章朱红 + 宣纸米白
   布局：桌面端左侧边栏 + 内容整体居中（两边留白）
   ========================================================================== */

:root {
  --ink:        #355c48;   /* 主墨绿 */
  --ink-deep:   #243d30;   /* 深墨绿 */
  --ink-soft:   #5a7a68;   /* 浅墨绿 */
  --gold:       #b8860b;   /* 暗金 */
  --gold-light: #c9a227;   /* 亮金 */
  --paper:      #f5f0e6;   /* 宣纸米白 */
  --paper-deep: #efe7d7;   /* 深宣纸 */
  --card:       #fffdf8;   /* 暖白卡片 */
  --text:       #3a3835;   /* 正文 */
  --text-sub:   #8f8878;   /* 次要文字 */
  --seal:       #a63a2b;   /* 印章朱红 */
  --border:     #e6ddcd;   /* 细边框 */
  --shadow:      0 4px 20px rgba(53, 92, 72, .08);
  --shadow-hover:0 12px 32px rgba(53, 92, 72, .16);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: "Noto Serif SC", "KaiTi", "STKaiti", "楷体", serif;
  background: var(--paper);
  background-image: radial-gradient(circle at 18% 8%, rgba(184,134,11,.05), transparent 42%),
                    radial-gradient(circle at 82% 0%, rgba(53,92,72,.05), transparent 46%);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { text-decoration: none; color: inherit; }

/* ================= 顶部固定条：品牌 + slogan ================= */
.top-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(255, 253, 248, .96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.top-bar-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 20px;
}
.brand-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.brand-divider {
  width: 1px; height: 18px;
  background: var(--border);
  flex-shrink: 0;
}
.brand-slogan {
  font-size: 14px;
  color: var(--text-sub);
  letter-spacing: 2px;
}
.top-subscribe {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.top-subscribe input {
  width: 180px;
  padding: 7px 12px;
  border: 1px solid var(--gold);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink-deep);
  font-size: 13px;
  font-family: inherit;
  outline: none;
}
.top-subscribe input:focus { border-color: var(--ink); }
.top-subscribe button {
  padding: 7px 16px;
  border: none;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  letter-spacing: 2px;
  cursor: pointer;
  font-family: inherit;
}
.top-subscribe button:hover { background: var(--ink-deep); }
.sub-toast {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translate(-50%, -12px);
  background: var(--ink);
  color: #fff;
  padding: 10px 22px;
  border-radius: 999px;
  font-size: 14px;
  letter-spacing: 1px;
  z-index: 2000;
  opacity: 0;
  transition: opacity .3s ease, transform .3s ease;
  box-shadow: 0 4px 16px rgba(36, 61, 48, .28);
  white-space: nowrap;
}
.sub-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ================= 整体布局容器（侧边栏 + 内容整体居中） ================= */
.layout {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  min-height: 100vh;
  padding-top: 52px;
}

/* ================= 左侧边栏导航（随内容一起滚动） ================= */
.site-header {
  width: 220px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
}
.header-inner {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  padding: 40px 0 24px;
}
.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.brand-seal {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: var(--seal);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  border-radius: 5px;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.35);
}
.brand-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink-deep);
  letter-spacing: 5px;
}

/* 桌面端侧边栏导航 */
.desktop-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}
.dnav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  position: relative;
  font-size: 15px;
  color: var(--text-sub);
  letter-spacing: 1px;
  padding: 13px 30px;
  border-left: 3px solid transparent;
  transition: color .2s ease, background .2s ease;
}
.dnav-item i { width: 20px; text-align: center; font-size: 15px; }
.dnav-item:hover { color: var(--ink); }
.dnav-item.active {
  color: var(--ink-deep);
  font-weight: 700;
  background: rgba(53, 92, 72, .07);
  border-left-color: var(--gold);
}
.dnav-item.active i { color: var(--ink); }

/* ================= 主内容区 ================= */
.main {
  flex: 1;
  min-width: 0;
  padding: 40px 44px 24px;
}

/* ================= Hero / 页面标题区 ================= */
.hero {
  position: relative;
  padding: 8px 24px 7px;
  text-align: center;
  overflow: hidden;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 12px;
}
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  width: 90px; height: 90px;
  border: 1px solid var(--border);
  border-radius: 50%;
  opacity: .6;
}
.hero::before { top: 16px; left: 26px; }
.hero::after  { bottom: 10px; right: 22px; width: 64px; height: 64px; }
.hero-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink-deep);
  letter-spacing: 5px;
  margin-bottom: 0;
  text-indent: 5px;
}
.hero-sub {
  font-size: 15px;
  color: var(--text-sub);
  letter-spacing: 3px;
}
.hero-line {
  display: none;
}

/* ================= 通用区块 ================= */
.section {
  padding: 6px 0 24px;
}
/* 内容区首块顶端与侧边栏导航对齐 */
.main > .section:first-child { padding-top: 0; }
.main > .section:first-child .section-head { margin-top: 0; }
.section-head {
  text-align: center;
  margin: 22px 0 18px;
}
.section-title {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 21px;
  font-weight: 700;
  color: var(--ink-deep);
  letter-spacing: 5px;
}
.section-title::before,
.section-title::after {
  content: "";
  width: 26px; height: 1px;
  background: var(--gold);
}
.section-sub {
  margin-top: 7px;
  font-size: 13px;
  color: var(--text-sub);
  letter-spacing: 2px;
}

/* ================= 随笔分类 ================= */
.cate-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.cate-item {
  position: relative;
  display: block;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .25s ease, box-shadow .25s ease;
}
.cate-item:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}
.cate-item img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
  transition: transform .4s ease;
}
.cate-item:hover img { transform: scale(1.06); }
.cate-item .cate-mask {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(36,61,48,.05), rgba(36,61,48,.72));
  color: #fff;
  text-align: center;
}
.cate-item .cate-mask h3 {
  font-size: 22px;
  letter-spacing: 6px;
  font-weight: 700;
}
.cate-item .cate-mask p {
  font-size: 13px;
  opacity: .88;
  letter-spacing: 2px;
  margin-top: 2px;
}

/* ================= 文章列表 ================= */
.article-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.article-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow);
  transition: transform .25s ease, box-shadow .25s ease;
}
.article-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}
.article-item img {
  width: 92px; height: 92px;
  object-fit: cover;
  border-radius: 9px;
  flex-shrink: 0;
}
.article-thumb {
  width: 92px; height: 92px;
  border-radius: 9px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  color: var(--paper);
  font-size: 34px;
  font-weight: 700;
}
.article-info { flex: 1; min-width: 0; }
.article-info h3 {
  font-size: 18px;
  color: var(--ink-deep);
  margin-bottom: 6px;
  letter-spacing: 1px;
}
.article-info p {
  font-size: 14px;
  color: var(--text-sub);
  line-height: 1.55;
}
.article-arrow {
  color: var(--gold);
  font-size: 16px;
  flex-shrink: 0;
}

/* ================= 文章正文页 ================= */
.post {
  max-width: 720px;
  margin: 0 auto;
}
.post-title {
  font-size: 27px;
  font-weight: 700;
  color: var(--ink-deep);
  text-align: center;
  letter-spacing: 3px;
  margin-bottom: 14px;
  line-height: 1.5;
}
.post-meta {
  text-align: center;
  font-size: 13px;
  color: var(--text-sub);
  letter-spacing: 1px;
  margin-bottom: 26px;
}
.post-meta span { margin: 0 10px; }
.post-img {
  width: 100%;
  max-height: 380px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 28px;
  display: block;
  box-shadow: var(--shadow);
}
.post-body {
  font-size: 16px;
  line-height: 2.05;
  color: var(--text);
}
.post-body p {
  margin-bottom: 18px;
  text-indent: 2em;
}
.post-body p.no-indent { text-indent: 0; }
.post-body h2 {
  font-size: 19px;
  color: var(--ink-deep);
  margin: 26px 0 14px;
  letter-spacing: 1px;
}
.post-body h3 {
  font-size: 17px;
  color: var(--ink);
  margin: 20px 0 10px;
  letter-spacing: 1px;
}
.post-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-sub);
  font-size: 14px;
  margin-bottom: 22px;
  letter-spacing: 1px;
  transition: color .2s ease;
}
.post-back:hover { color: var(--ink); }

/* ================= 联系我页面 ================= */
.contact-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 34px 28px;
}
.contact-card h1 {
  font-size: 24px;
  color: var(--ink-deep);
  margin-bottom: 6px;
  letter-spacing: 2px;
}
.contact-card .subtitle {
  color: var(--text-sub);
  margin-bottom: 26px;
  font-size: 14px;
}
.contact-item {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}
.contact-item i {
  width: 34px; height: 34px;
  margin-right: 14px;
  color: var(--ink);
  background: rgba(53,92,72,.08);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.contact-item span,
.contact-item a {
  color: var(--text);
  font-size: 15px;
}
.contact-item a:hover { color: var(--ink); }

.wechat {
  margin: 28px 0 6px;
  text-align: center;
}
.wechat img {
  width: 150px; height: 150px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--border);
}
.wechat p {
  margin-top: 8px;
  color: var(--text-sub);
  font-size: 13px;
}

/* 弱化工作板块（标签云） */
.work-mini {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px dashed var(--border);
}
.work-mini-title {
  font-size: 13px;
  color: var(--text-sub);
  letter-spacing: 2px;
  margin-bottom: 12px;
  text-align: center;
}
.work-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.tag {
  font-size: 13px;
  color: var(--ink);
  background: var(--paper-deep);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 14px;
  letter-spacing: 1px;
}

/* 表单 */
.form-box { margin-top: 22px; }
.form-box input,
.form-box textarea {
  width: 100%;
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 14px;
  font-size: 15px;
  outline: none;
  font-family: inherit;
  background: var(--paper);
  color: var(--text);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.form-box input:focus,
.form-box textarea:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(53,92,72,.1);
}
.form-box button {
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 13px;
  width: 100%;
  font-size: 16px;
  letter-spacing: 3px;
  cursor: pointer;
  font-family: inherit;
  transition: background .2s ease;
}
.form-box button:hover { background: var(--ink-deep); }

/* 弹窗 */
.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.modal-content {
  background: var(--card);
  padding: 30px;
  border-radius: 12px;
  text-align: center;
  box-shadow: var(--shadow-hover);
}
.modal-content p {
  margin-bottom: 20px;
  font-size: 16px;
  color: var(--text);
}
.modal-content button {
  width: auto;
  padding: 10px 28px;
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
  font-family: inherit;
}

/* ================= 底部导航（仅移动端） ================= */
.footer-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 999;
  height: 60px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: rgba(255, 253, 248, .95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
}
.nav-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 12px;
  color: var(--text-sub);
  transition: color .2s ease, transform .2s ease;
  padding-top: 6px;
}
.nav-item i { font-size: 19px; }
.nav-item:hover { transform: translateY(-2px); color: var(--ink-soft); }
.nav-item.active { color: var(--ink-deep); }
.nav-item.active i { color: var(--ink); }
.nav-item.active::before {
  content: "";
  position: absolute;
  top: 0;
  width: 22px; height: 2px;
  background: var(--gold);
  border-radius: 2px;
}

/* ================= 备案/页脚 ================= */
.site-footer {
  padding: 20px 0 8px;
  text-align: center;
  font-size: 13px;
  color: var(--text-sub);
  border-top: 1px solid var(--border);
}
.site-footer .beian { line-height: 2.1; }
.site-footer .beian a { color: var(--text-sub); margin: 0 8px; }
.site-footer .beian a:hover { color: var(--ink); }
.inner-link {
  display: inline-block;
  margin-top: 12px;
  color: #b9b1a3;
  font-size: 15px;
  letter-spacing: 2px;
}
.inner-link:hover { color: var(--ink); }

/* ================= 响应式 ================= */
/* 移动端（<768px）：隐藏侧边栏，顶部固定条 + 底部导航 */
@media (max-width: 767px) {
  .layout { display: block; padding-top: 118px; }
  body { padding-bottom: 76px; }
  .site-header { display: none; }
  .footer-nav { display: flex; }
  .top-bar-inner { flex-direction: column; gap: 8px; padding: 10px 14px; justify-content: center; align-items: center; }
  .brand-group { flex-direction: column; gap: 3px; }
  .brand-divider { display: none; }
  .brand-slogan { display: block; font-size: 12px; letter-spacing: 1px; text-align: center; }
  .brand-name { font-size: 18px; letter-spacing: 4px; }
  .top-subscribe { width: 100%; max-width: 320px; }
  .top-subscribe input { flex: 1; width: auto; }
  .sub-toast { top: 132px; }
  .main { padding: 20px 16px 24px; }
  .hero { padding: 6px 16px 5px; gap: 8px; }
  .hero-title { font-size: 17px; letter-spacing: 2px; text-indent: 0; }
  .hero-sub { font-size: 14px; letter-spacing: 1px; }
  .cate-grid { grid-template-columns: repeat(2, 1fr); }
  .cate-item img { height: 110px; }
  .article-list { grid-template-columns: 1fr; }
  .article-item img { width: 76px; height: 76px; }
  .post-title { font-size: 22px; letter-spacing: 2px; }
  .post-img { max-height: 260px; }
  .post-body { font-size: 15px; }
}

/* 桌面端（≥768px）：底部导航隐藏 */
@media (min-width: 768px) {
  .footer-nav { display: none; }
}
