/* ============================================================
   临池 · 现代中式书法博客
   设计系统：宣纸米白 / 墨 / 朱红印章 / 宋体标题 + 黑体正文
   ============================================================ */

:root {
  /* 色彩 */
  --paper: #f7f4ee;        /* 宣纸底 */
  --paper-deep: #f0ebdf;   /* 深一层的纸色，用于卡片底 */
  --ink: #1f1f1f;          /* 墨色 */
  --ink-soft: #4a463f;     /* 淡墨，正文 */
  --gray: #8a857c;         /* 灰墨，注释 */
  --cinnabar: #b03a2e;     /* 朱红 */
  --cinnabar-deep: #963026;
  --line: #e3ddd2;         /* 线条灰 */

  /* 字体 */
  --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --font-sans: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  --font-kai: "Kaiti SC", "STKaiti", "KaiTi", "KaiTi_GB2312", "DFKai-SB", serif;

  /* 布局 */
  --maxw: 1120px;
  --gutter: clamp(20px, 5vw, 48px);
  --radius: 4px;
}

/* ---------- 基础 ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

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

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.35;
  margin: 0 0 .6em;
  color: var(--ink);
}

p { margin: 0 0 1em; color: var(--ink-soft); }

::selection { background: var(--cinnabar); color: var(--paper); }

:focus-visible {
  outline: 2px solid var(--cinnabar);
  outline-offset: 3px;
  border-radius: 2px;
}

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- 印章 ---------- */
.seal {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--cinnabar);
  color: #fdfbf6;
  font-family: var(--font-kai);
  font-size: 18px;
  line-height: 1.1;
  border-radius: 6px;
  box-shadow: inset 0 0 0 2px rgba(253, 251, 246, .35);
  letter-spacing: 0;
  flex: none;
  user-select: none;
}
.seal--sm { width: 34px; height: 34px; font-size: 14px; border-radius: 5px; }

/* ---------- 竖排文字 ---------- */
.vertical {
  writing-mode: vertical-rl;
  letter-spacing: .35em;
  font-family: var(--font-serif);
  color: var(--gray);
  white-space: nowrap;
}

/* ---------- 页眉 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 244, 238, .88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-name {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: .12em;
}
.brand-sub {
  display: block;
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: .28em;
  color: var(--gray);
  margin-top: 1px;
}

.site-nav { display: flex; align-items: center; gap: 6px; }

.site-nav a {
  position: relative;
  padding: 8px 14px;
  font-size: 15px;
  color: var(--ink-soft);
  transition: color .25s;
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 2px;
  height: 2px;
  background: var(--cinnabar);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s ease;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a:hover::after { transform: scaleX(1); }
.site-nav a.is-active { color: var(--cinnabar); font-weight: 600; }
.site-nav a.is-active::after { transform: scaleX(1); }

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
  padding: 10px;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--ink);
  margin: 5px 0;
  transition: transform .3s, opacity .3s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 26px;
  font-size: 15px;
  font-family: var(--font-sans);
  letter-spacing: .08em;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  transition: background .25s, color .25s, border-color .25s, transform .25s;
}
.btn:hover { background: var(--cinnabar); border-color: var(--cinnabar); transform: translateY(-2px); }

.btn--ghost {
  background: transparent;
  color: var(--ink);
}
.btn--ghost:hover { background: var(--cinnabar); border-color: var(--cinnabar); color: #fdfbf6; }

/* ---------- 首页 Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(64px, 10vw, 120px) 0 clamp(56px, 8vw, 96px);
  border-bottom: 1px solid var(--line);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  font-size: 13px;
  letter-spacing: .3em;
  color: var(--gray);
}
.hero-eyebrow::before {
  content: "";
  width: 34px;
  height: 1px;
  background: var(--cinnabar);
}

.hero h1 {
  font-size: clamp(34px, 5.2vw, 58px);
  letter-spacing: .04em;
  margin-bottom: 24px;
}

.hero-lead {
  max-width: 46ch;
  font-size: 17px;
  color: var(--ink-soft);
  margin-bottom: 36px;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }

/* Hero 右侧：永字装裱框 */
.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
}
.hero-frame {
  position: relative;
  width: min(100%, 380px);
  aspect-ratio: 3 / 4;
  background: linear-gradient(160deg, #fbf9f3, var(--paper-deep));
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px -30px rgba(31, 31, 31, .35);
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-frame::before {
  /* 装裱绫边 */
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid var(--line);
  pointer-events: none;
}
.hero-char {
  font-family: var(--font-kai);
  font-size: clamp(150px, 22vw, 230px);
  line-height: 1;
  color: var(--ink);
  opacity: .92;
  user-select: none;
}
.hero-frame .seal {
  position: absolute;
  right: 30px;
  bottom: 30px;
  box-shadow: 0 4px 14px rgba(176, 58, 46, .35);
}
.hero-vertical-note {
  position: absolute;
  top: 8px;
  right: -34px;
  font-size: 14px;
}

/* ---------- 区块通用 ---------- */
.section { padding: clamp(56px, 9vw, 104px) 0; }
.section + .section { border-top: 1px solid var(--line); }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: clamp(32px, 5vw, 56px);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  letter-spacing: .3em;
  color: var(--gray);
  margin-bottom: 10px;
}
.eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--cinnabar);
  border-radius: 2px;
  flex: none;
}

.section-title {
  font-size: clamp(26px, 3.4vw, 36px);
  letter-spacing: .06em;
  margin: 0;
}

.section-more {
  flex: none;
  font-size: 14px;
  letter-spacing: .12em;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--cinnabar);
  padding-bottom: 3px;
  transition: color .25s;
}
.section-more:hover { color: var(--cinnabar); }

/* ---------- 占位图（书法字 + 宣纸纹 + 角落印章） ---------- */
.ph {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 3;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(255, 255, 255, .55), transparent 60%),
    linear-gradient(155deg, #faf7f0, var(--paper-deep));
  border: 1px solid var(--line);
  overflow: hidden;
}
.ph::after {
  content: attr(data-char);
  font-family: var(--font-kai);
  font-size: clamp(72px, 10vw, 120px);
  line-height: 1;
  color: var(--ink);
  opacity: .88;
}
.ph::before {
  /* 角落朱红小印章 */
  content: "";
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 22px;
  height: 22px;
  background: var(--cinnabar);
  border-radius: 4px;
  opacity: .9;
}
.ph--tall { aspect-ratio: 3 / 4; }
.ph--tall::after { font-size: clamp(90px, 12vw, 150px); }
.ph--square { aspect-ratio: 1 / 1; }

/* ---------- 作品卡片 ---------- */
.work-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(20px, 3vw, 32px);
}

.work-card {
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform .35s ease, box-shadow .35s ease;
}
.work-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 44px -22px rgba(31, 31, 31, .3);
}
.work-card .ph { border: 0; border-bottom: 1px solid var(--line); }
.work-card:hover .ph::after { opacity: 1; }

.work-card-body { padding: 20px 22px 22px; }
.work-card-title {
  font-size: 19px;
  margin: 0 0 6px;
  letter-spacing: .04em;
}
.work-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--gray);
}
.tag {
  display: inline-block;
  padding: 2px 10px;
  font-size: 12px;
  letter-spacing: .1em;
  color: var(--cinnabar);
  border: 1px solid currentColor;
  border-radius: 999px;
}

/* ---------- 筛选条 ---------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: clamp(28px, 4vw, 44px);
}
.filter-btn {
  padding: 8px 20px;
  font-size: 14px;
  letter-spacing: .12em;
  font-family: var(--font-sans);
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: all .25s;
}
.filter-btn:hover { border-color: var(--ink); color: var(--ink); }
.filter-btn.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.work-card.is-hidden { display: none; }

/* ---------- 灯箱 ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(24, 22, 19, .88);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}
.lightbox.is-open { opacity: 1; pointer-events: auto; }

.lightbox-panel {
  position: relative;
  width: min(920px, 100%);
  max-height: 88vh;
  overflow: auto;
  background: var(--paper);
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  transform: translateY(16px);
  transition: transform .35s ease;
}
.lightbox.is-open .lightbox-panel { transform: translateY(0); }

.lightbox-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(155deg, #faf7f0, var(--paper-deep));
  border-right: 1px solid var(--line);
  min-height: 320px;
  position: relative;
}
.lightbox-visual::after {
  content: attr(data-char);
  font-family: var(--font-kai);
  font-size: clamp(130px, 20vw, 210px);
  color: var(--ink);
  line-height: 1;
}

.lightbox-body { padding: clamp(24px, 4vw, 44px); }
.lightbox-body h3 { font-size: 26px; letter-spacing: .05em; }
.lightbox-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 13px;
  color: var(--gray);
  margin-bottom: 18px;
}
.lightbox-note { font-size: 15px; }

.lightbox-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  font-size: 18px;
  cursor: pointer;
  transition: all .25s;
}
.lightbox-close:hover { background: var(--cinnabar); border-color: var(--cinnabar); color: #fdfbf6; }

/* ---------- 名家 ---------- */
.master-list { display: grid; gap: clamp(28px, 4vw, 44px); }

.master-card {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: center;
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(22px, 3.5vw, 40px);
}
.master-card:nth-child(even) .master-visual { order: 2; }

.master-visual .ph { width: 100%; }

.master-dynasty {
  font-size: 13px;
  letter-spacing: .3em;
  color: var(--cinnabar);
  margin-bottom: 8px;
}
.master-name {
  font-size: clamp(24px, 3vw, 30px);
  letter-spacing: .08em;
  margin-bottom: 4px;
}
.master-work {
  font-family: var(--font-serif);
  font-size: 16px;
  color: var(--gray);
  margin-bottom: 16px;
}
.master-desc { font-size: 15px; margin-bottom: 18px; }

.master-points {
  margin: 0;
  padding: 16px 20px;
  background: var(--paper);
  border-left: 3px solid var(--cinnabar);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 14px;
  color: var(--ink-soft);
  list-style: none;
}
.master-points li { padding: 3px 0; }
.master-points li::before {
  content: "·";
  color: var(--cinnabar);
  margin-right: 8px;
  font-weight: 700;
}

/* ---------- 好物 ---------- */
.goods-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(20px, 3vw, 32px);
}

.goods-card {
  display: flex;
  flex-direction: column;
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .35s ease, box-shadow .35s ease;
}
.goods-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 44px -22px rgba(31, 31, 31, .3);
}
.goods-card .ph { border: 0; border-bottom: 1px solid var(--line); aspect-ratio: 1 / 1; }

.goods-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 22px 24px 24px;
}
.goods-cat {
  font-size: 12px;
  letter-spacing: .25em;
  color: var(--gray);
  margin-bottom: 6px;
}
.goods-name { font-size: 19px; margin: 0 0 8px; letter-spacing: .04em; }
.goods-reason { font-size: 14px; flex: 1; }

.goods-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.goods-price {
  font-family: var(--font-serif);
  font-size: 17px;
  color: var(--cinnabar);
}
.goods-link {
  font-size: 13px;
  letter-spacing: .1em;
  color: var(--ink);
  border-bottom: 1px solid var(--cinnabar);
  padding-bottom: 2px;
  transition: color .25s;
}
.goods-link:hover { color: var(--cinnabar); }

/* ---------- 关于我 ---------- */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  gap: clamp(32px, 6vw, 72px);
  align-items: start;
}

.about-portrait {
  position: sticky;
  top: 110px;
}
.about-portrait .ph { margin-bottom: 16px; }
.about-quote {
  font-family: var(--font-serif);
  font-size: 15px;
  color: var(--gray);
  text-align: center;
  letter-spacing: .1em;
}

.about-body h2 { font-size: clamp(24px, 3vw, 30px); }

/* 学书历程时间线 */
.timeline {
  position: relative;
  margin: 28px 0 0;
  padding-left: 28px;
  list-style: none;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: var(--line);
}
.timeline li { position: relative; padding-bottom: 26px; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -28px;
  top: 8px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--cinnabar);
}
.timeline-year {
  font-family: var(--font-serif);
  font-size: 15px;
  color: var(--cinnabar);
  letter-spacing: .1em;
  margin-bottom: 2px;
}
.timeline p { margin: 0; font-size: 15px; }

/* 联系 */
.contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 20px;
}

/* ---------- 引言区块 ---------- */
.quote-section {
  text-align: center;
  padding: clamp(64px, 10vw, 110px) 0;
}
.quote-section .vertical { display: none; }
.quote-mark {
  font-family: var(--font-serif);
  font-size: clamp(24px, 3.6vw, 34px);
  letter-spacing: .12em;
  line-height: 2;
  margin-bottom: 18px;
}
.quote-from {
  font-size: 14px;
  letter-spacing: .2em;
  color: var(--gray);
}
.quote-from::before {
  content: "";
  display: block;
  width: 40px;
  height: 1px;
  background: var(--cinnabar);
  margin: 0 auto 16px;
}

/* ---------- 页脚 ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: clamp(40px, 6vw, 64px) 0 32px;
  background: var(--paper-deep);
}
.footer-grid {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 36px;
}
.footer-brand { display: flex; align-items: center; gap: 14px; }
.footer-brand p { margin: 4px 0 0; font-size: 13px; color: var(--gray); }

.footer-nav { display: flex; flex-wrap: wrap; gap: 8px 26px; }
.footer-nav a {
  font-size: 14px;
  color: var(--ink-soft);
  transition: color .25s;
}
.footer-nav a:hover { color: var(--cinnabar); }

.footer-vertical {
  font-size: 15px;
  height: 150px;
}

.footer-copy {
  border-top: 1px solid var(--line);
  padding-top: 22px;
  font-size: 13px;
  color: var(--gray);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------- 页面头部（子页面） ---------- */
.page-head {
  position: relative;
  padding: clamp(48px, 8vw, 88px) 0 clamp(32px, 5vw, 56px);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.page-head h1 {
  font-size: clamp(30px, 4.4vw, 44px);
  letter-spacing: .08em;
  margin-bottom: 10px;
}
.page-head p { max-width: 56ch; margin: 0; }
.page-head .vertical {
  position: absolute;
  right: var(--gutter);
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
}

/* ---------- 滚动渐入（渐进增强：无 JS 时内容始终可见） ---------- */
.reveal {
  transition: opacity .7s ease, transform .7s ease;
}
.reveal--armed {
  opacity: 0;
  transform: translateY(26px);
}
.reveal--armed.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal[data-delay="1"] { transition-delay: .12s; }
.reveal[data-delay="2"] { transition-delay: .24s; }
.reveal[data-delay="3"] { transition-delay: .36s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .reveal--armed { opacity: 1 !important; transform: none !important; transition: none !important; }
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { order: -1; }
  .hero-frame { width: min(100%, 300px); }
  .hero-vertical-note { right: -6px; }
  .work-grid, .goods-grid { grid-template-columns: repeat(2, 1fr); }
  .master-card { grid-template-columns: 1fr; }
  .master-card:nth-child(even) .master-visual { order: 0; }
  .about-grid { grid-template-columns: 1fr; }
  .about-portrait { position: static; max-width: 320px; }
  .lightbox-panel { grid-template-columns: 1fr; }
  .lightbox-visual { min-height: 240px; border-right: 0; border-bottom: 1px solid var(--line); }
  .page-head .vertical { display: none; }
}

@media (max-width: 640px) {
  .nav-toggle { display: block; }
  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 8px var(--gutter) 16px;
    display: none;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 12px 4px; border-bottom: 1px solid var(--line); }
  .site-nav a::after { display: none; }
  .work-grid, .goods-grid { grid-template-columns: 1fr; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .footer-grid { flex-direction: column; }
  .footer-vertical { display: none; }
}
