/* ===== 基础与变量（宣纸 / 水墨） ===== */
:root {
  --bg: #f6f1e4;
  --bg-alt: #ece4d1;
  --text: #211e1a;
  --text-muted: #766c5c;
  --ink: #211e1a;
  --primary: #9a2f2a;        /* 朱砂 */
  --primary-dark: #7d2420;
  --accent: #3f5c5c;         /* 黛青 */
  --card: #fbf7ec;
  --border: #d8ccb0;
  --shadow: 0 10px 30px rgba(33, 30, 26, 0.10);
  --radius: 8px;
  --max-w: 1140px;
  --paper: #fbf7ec;
}

[data-theme="dark"] {
  --bg: #15120e;
  --bg-alt: #1d1913;
  --text: #ece4d1;
  --text-muted: #a89a82;
  --ink: #ece4d1;
  --primary: #d1564a;
  --primary-dark: #b34439;
  --accent: #6f9b9b;
  --card: #1f1b14;
  --border: #3a3327;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --paper: #1f1b14;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "Noto Sans SC", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
  transition: background 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

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

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== 导航 ===== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid transparent;
  transition: all 0.3s ease;
}
.nav.scrolled {
  border-bottom-color: var(--border);
  box-shadow: var(--shadow);
}
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  position: relative;
  display: inline-flex;
  align-items: center;
  font-family: "Ma Shan Zheng", "Noto Serif SC", serif;
  font-size: 26px;
  font-weight: 400;
  letter-spacing: 2px;
  color: var(--ink);
}
.logo-text {
  display: inline-block;
}
.logo-seal {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 30px;
  height: auto;
  transform: translate(-50%, -50%) rotate(-6deg);
  opacity: 0.9;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  mix-blend-mode: multiply;
}
[data-theme="dark"] .logo-seal {
  mix-blend-mode: normal;
  filter: brightness(1.6) saturate(1.05);
}
.nav-links { display: flex; gap: 30px; }
.nav-links a {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--primary); }
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 38px; height: 38px;
  cursor: pointer;
  font-size: 16px;
  transition: transform 0.3s;
}
.theme-toggle:hover { transform: rotate(20deg); }

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding-top: 80px;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-alt) 100%);
}
.mountain {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 55%;
  background-repeat: no-repeat;
  background-position: bottom center;
  background-size: cover;
  opacity: 0.5;
  filter: blur(2px);
}
.mountain-1 {
  background-image: radial-gradient(ellipse 60% 100% at 20% 100%, var(--accent) 0%, transparent 60%),
                    radial-gradient(ellipse 70% 100% at 75% 100%, var(--ink) 0%, transparent 55%);
  opacity: 0.18;
  height: 48%;
}
.mountain-2 {
  background-image: radial-gradient(ellipse 50% 100% at 40% 100%, var(--ink) 0%, transparent 60%),
                    radial-gradient(ellipse 55% 100% at 85% 100%, var(--accent) 0%, transparent 55%);
  opacity: 0.28;
  height: 38%;
}
.mountain-3 {
  background-image: radial-gradient(ellipse 40% 100% at 60% 100%, var(--primary) 0%, transparent 55%);
  opacity: 0.12;
  height: 28%;
  filter: blur(4px);
}
[data-theme="dark"] .mountain-1 { opacity: 0.30; }
[data-theme="dark"] .mountain-2 { opacity: 0.40; }

.hero-content { position: relative; z-index: 1; }
.hero-greeting {
  font-family: "Noto Serif SC", serif;
  font-size: 17px;
  color: var(--primary);
  font-weight: 500;
  letter-spacing: 3px;
  margin-bottom: 8px;
  animation: fadeUp 0.6s ease both;
}
.hero-name {
  font-family: "Ma Shan Zheng", "Noto Serif SC", serif;
  font-size: clamp(64px, 11vw, 128px);
  font-weight: 400;
  letter-spacing: 12px;
  line-height: 1.1;
  color: var(--ink);
  animation: fadeUp 0.6s 0.1s ease both;
}
.hero-title {
  font-family: "Noto Serif SC", serif;
  font-size: clamp(18px, 3vw, 28px);
  font-weight: 500;
  margin: 18px 0;
  color: var(--text);
  animation: fadeUp 0.6s 0.2s ease both;
}
.typed { color: var(--primary); }
.cursor {
  color: var(--primary);
  animation: blink 1s step-end infinite;
}
.hero-desc {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 560px;
  margin-bottom: 32px;
  animation: fadeUp 0.6s 0.3s ease both;
}
.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  animation: fadeUp 0.6s 0.4s ease both;
}
.btn {
  display: inline-block;
  padding: 13px 30px;
  border-radius: 2px;
  font-weight: 500;
  font-size: 15px;
  font-family: "Noto Serif SC", serif;
  letter-spacing: 2px;
  transition: all 0.25s ease;
  cursor: pointer;
}
.btn-primary {
  background: var(--primary);
  color: var(--paper);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--primary) 35%, transparent);
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-3px); }
.btn-ghost {
  border: 1px solid var(--border);
  color: var(--text);
  background: transparent;
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.hero-scroll {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px; height: 40px;
  border: 1.5px solid var(--text-muted);
  border-radius: 12px;
  z-index: 1;
}
.hero-scroll span {
  display: block;
  width: 3px; height: 7px;
  background: var(--text-muted);
  border-radius: 2px;
  margin: 6px auto 0;
  animation: scrollDown 1.6s infinite;
}

/* ===== 通用 Section ===== */
.section { padding: 100px 0; position: relative; }
.section-alt { background: var(--bg-alt); }
.section-head { margin-bottom: 56px; text-align: center; }
.section-tag {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--primary);
  margin-bottom: 12px;
  font-family: "Noto Serif SC", serif;
}
.section-title {
  font-family: "Noto Serif SC", serif;
  font-size: clamp(30px, 5vw, 44px);
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--ink);
}
.section-sub {
  margin-top: 14px;
  font-size: 14px;
  color: var(--text-muted);
}

/* ===== 关于 ===== */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
  align-items: center;
}
.about-text p { color: var(--text-muted); margin-bottom: 18px; font-size: 16px; }
.about-stats {
  display: flex;
  gap: 48px;
  margin-top: 30px;
  list-style: none;
}
.about-stats li { display: flex; flex-direction: column; }
.about-stats strong {
  font-family: "Noto Serif SC", serif;
  font-size: 40px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}
.about-stats span { font-size: 13px; color: var(--text-muted); margin-top: 6px; letter-spacing: 1px; }
.about-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 34px;
  box-shadow: var(--shadow);
}
.about-avatar {
  width: 84px; height: 84px;
  border-radius: 4px;
  background: var(--primary);
  color: var(--paper);
  font-family: "Ma Shan Zheng", serif;
  font-size: 40px;
  font-weight: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 30%, transparent);
}
.about-photo {
  display: block;
  width: 150px;
  height: 150px;
  object-fit: cover;
  object-position: center 22%;
  border-radius: 4px;
  border: 1px solid var(--border);
  margin-bottom: 20px;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 22%, transparent);
}
.about-info h3 {
  font-family: "Noto Serif SC", serif;
  font-size: 22px;
  margin-bottom: 12px;
  letter-spacing: 2px;
  color: var(--ink);
}
.about-info p { color: var(--text-muted); font-size: 14px; margin-bottom: 6px; }
.about-mail { color: var(--primary); text-decoration: none; }
.about-mail:hover { text-decoration: underline; }

/* ===== 技艺 ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 24px;
}
.skill-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 26px;
  transition: transform 0.3s, box-shadow 0.3s;
}
.skill-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
}
.skill-icon { font-size: 34px; margin-bottom: 14px; }
.skill-card h3 {
  font-family: "Noto Serif SC", serif;
  font-size: 19px;
  margin-bottom: 8px;
  letter-spacing: 2px;
  color: var(--ink);
}
.skill-card p { font-size: 14px; color: var(--text-muted); }
.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 40px;
}
.skill-tags span {
  padding: 5px 16px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  color: var(--primary);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent);
}

/* ===== 作品画廊 ===== */
.gallery {
  column-count: 3;
  column-gap: 22px;
}
.painting {
  break-inside: avoid;
  margin-bottom: 22px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
}
.painting:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 36px rgba(33, 30, 26, 0.16);
}
.painting-frame {
  position: relative;
  aspect-ratio: 3 / 4;
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--accent) 22%, transparent) 0%, transparent 55%),
    linear-gradient(200deg, color-mix(in srgb, var(--ink) 18%, transparent) 0%, transparent 50%),
    var(--paper);
  overflow: hidden;
}
.painting.has-image .painting-frame { background: var(--paper); }
.painting-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.painting-ph {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-muted);
}
.painting-ph .ph-seal {
  font-family: "Ma Shan Zheng", serif;
  font-size: 28px;
  color: var(--primary);
  opacity: 0.75;
}
.painting-ph .ph-label {
  font-size: 12px;
  letter-spacing: 2px;
  opacity: 0.7;
}
.painting-meta {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
}
.painting-meta h4 {
  font-family: "Noto Serif SC", serif;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--ink);
}
.painting-meta p {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* 占位色阶变化 */
.painting:nth-child(5n+1) .painting-frame { background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 26%, transparent), transparent 55%), var(--paper); }
.painting:nth-child(5n+2) .painting-frame { background: linear-gradient(160deg, color-mix(in srgb, var(--primary) 16%, transparent), transparent 55%), var(--paper); }
.painting:nth-child(5n+3) .painting-frame { background: linear-gradient(160deg, color-mix(in srgb, var(--ink) 22%, transparent), transparent 55%), var(--paper); }
.painting:nth-child(5n+4) .painting-frame { background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 14%, var(--primary) 10%), transparent 55%), var(--paper); }

/* ===== 灯箱 ===== */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(15, 13, 10, 0.88);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 24px;
}
.lightbox.open { display: flex; }
.lightbox-inner {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.lightbox-close {
  position: absolute;
  top: -44px;
  right: 0;
  background: none;
  border: none;
  color: #f6f1e4;
  font-size: 36px;
  line-height: 1;
  cursor: pointer;
}
.lightbox-stage {
  width: 88vw;
  max-width: 1500px;
  height: 72vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
  cursor: zoom-in;
  user-select: none;
}
.lightbox-stage.zoomed { cursor: grab; }
.lightbox-stage.zoomed.dragging { cursor: grabbing; }
.lightbox-stage img {
  max-width: 100%;
  max-height: 100%;
  display: block;
  transform-origin: center center;
  will-change: transform;
  box-shadow: 0 12px 44px rgba(0, 0, 0, 0.5);
  -webkit-user-drag: none;
}
.lightbox-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}
.lightbox-tools button {
  min-width: 38px;
  height: 34px;
  padding: 0 12px;
  background: rgba(246, 241, 228, 0.12);
  border: 1px solid rgba(246, 241, 228, 0.28);
  border-radius: 4px;
  color: #f6f1e4;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.lightbox-tools button:hover {
  background: rgba(246, 241, 228, 0.24);
  border-color: rgba(246, 241, 228, 0.5);
}
.lb-zoom-label {
  min-width: 52px;
  text-align: center;
  color: #f6f1e4;
  font-size: 13px;
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
}
.lightbox-stage .painting-stage-ph {
  width: 60vw;
  max-width: 560px;
  aspect-ratio: 3 / 4;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-family: "Ma Shan Zheng", serif;
  font-size: 40px;
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--accent) 22%, transparent), transparent 55%),
    var(--paper);
}
.lightbox-title {
  margin-top: 16px;
  color: #f6f1e4;
  font-family: "Noto Serif SC", serif;
  font-size: 16px;
  letter-spacing: 2px;
}

/* ===== 联系 ===== */
.contact-card {
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 56px 40px;
  box-shadow: var(--shadow);
}
.contact-card h3 {
  font-family: "Noto Serif SC", serif;
  font-size: 26px;
  margin-bottom: 12px;
  letter-spacing: 3px;
  color: var(--ink);
}
.contact-card p { color: var(--text-muted); margin-bottom: 32px; }
.contact-channels {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}
.contact-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border: 1px solid var(--border);
  border-radius: 2px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 1px;
  transition: all 0.25s;
  background: var(--paper);
}
a.contact-item:hover {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 8%, transparent);
  transform: translateY(-2px);
  color: var(--primary);
}
.contact-item--text { cursor: default; }
.ci-icon { font-size: 17px; }

/* ===== 页脚 ===== */
.footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 28px 0;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.footer p {
  font-size: 14px;
  color: var(--text-muted);
  letter-spacing: 1px;
}
.back-top {
  font-size: 14px;
  color: var(--primary);
  font-weight: 500;
}

/* ===== 动画 ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes blink { 50% { opacity: 0; } }
@keyframes scrollDown {
  0% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(12px); }
}

/* ===== 滚动揭示 ===== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ===== 响应式 ===== */
@media (max-width: 900px) {
  .gallery { column-count: 2; }
}
@media (max-width: 768px) {
  .nav-links { display: none; }
  .about-grid { grid-template-columns: 1fr; gap: 32px; }
  .about-stats { gap: 28px; }
  .about-stats strong { font-size: 30px; }
  .section { padding: 70px 0; }
  .contact-card { padding: 40px 24px; }
  .gallery { column-count: 1; }
}
