:root {
  --paper: #f6f1e9;
  --paper-2: #efe8dc;
  --ink: #1a1612;
  --ink-2: #5c554c;
  --ink-3: #9a9186;
  --accent: #e8572a;
  --line: #ddd4c6;
  --serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "STSong", "SimSun", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { font-family: var(--sans); background: var(--paper); color: var(--ink); line-height: 1.75; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
img { display: block; }

.container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 20px; }
section[id] { scroll-margin-top: 72px; }

/* 顶栏 */
.site-header { position: sticky; top: 0; z-index: 40; background: rgba(246, 241, 233, .86); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.site-header.scrolled { border-bottom-color: var(--line); }
.header-inner { height: 60px; display: flex; align-items: center; justify-content: space-between; }
.logo { font-family: var(--serif); font-size: 22px; font-weight: 700; display: flex; align-items: center; gap: 4px; }
.logo-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 8px; }
.nav { display: flex; gap: 22px; font-size: 15px; color: var(--ink-2); }
.nav a:hover { color: var(--accent); }

/* 首屏 */
.hero { padding-top: 56px; padding-bottom: 56px; }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); border: 1px solid var(--line); border-radius: 999px; padding: 5px 14px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #3dae6b; box-shadow: 0 0 0 0 rgba(61, 174, 107, .5); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(61, 174, 107, 0); } 100% { box-shadow: 0 0 0 0 rgba(61, 174, 107, 0); } }
.hero-title { font-family: var(--serif); font-weight: 700; font-size: 40px; line-height: 1.3; margin: 28px 0 32px; letter-spacing: -.01em; }
.hero-title .line { display: block; opacity: 0; transform: translateY(24px); animation: rise .9s cubic-bezier(.2, .7, .2, 1) forwards; }
.hero-title .line:nth-child(2) { animation-delay: .12s; }
.hero-title em { font-style: normal; color: var(--accent); position: relative; }
.hero-title em::after { content: ""; position: absolute; left: 0; right: 0; bottom: .06em; height: .12em; background: var(--accent); opacity: .25; }
@keyframes rise { to { opacity: 1; transform: none; } }
.hero-meta { display: flex; flex-direction: column; gap: 22px; max-width: 520px; color: var(--ink-2); font-size: 16px; }
.link-arrow { align-self: flex-start; font-weight: 600; color: var(--ink); border-bottom: 2px solid var(--ink); padding-bottom: 2px; transition: color .2s, border-color .2s; }
.link-arrow:hover { color: var(--accent); border-color: var(--accent); }

/* 滚动标签带 */
.marquee { overflow: hidden; background: var(--ink); color: var(--paper); padding: 14px 0; }
.marquee-track { display: flex; width: max-content; gap: 28px; font-family: var(--serif); font-size: 20px; white-space: nowrap; animation: scroll 26s linear infinite; }
.marquee-track span:nth-child(even) { color: var(--accent); }
@keyframes scroll { to { transform: translateX(-50%); } }

/* 区块 */
.section { padding-top: 72px; padding-bottom: 72px; }
.section-head { display: flex; flex-direction: column; gap: 18px; margin-bottom: 28px; }
h2 { font-family: var(--serif); font-size: 30px; font-weight: 700; line-height: 1.3; }

/* 筛选 */
.filters { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -20px; padding: 0 20px; }
.filters::-webkit-scrollbar { display: none; }
.filter { flex: none; padding: 7px 16px; border-radius: 999px; border: 1px solid var(--line); font-size: 14px; color: var(--ink-2); transition: all .2s; }
.filter:hover { border-color: var(--ink); color: var(--ink); }
.filter.active { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* 作品网格 */
.work-grid { display: grid; grid-template-columns: 1fr; gap: 28px; }
.work { display: block; width: 100%; text-align: left; transition: opacity .35s, transform .35s; }
.work.hidden { display: none; }
.cover { border-radius: 14px; overflow: hidden; aspect-ratio: 4 / 3; background: var(--paper-2); }
.cover img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.work:hover .cover img, .work:focus-visible .cover img { transform: scale(1.04); }
.work:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; border-radius: 14px; }
.work-info { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-top: 14px; }
.work-info h3 { font-size: 17px; font-weight: 600; }
.work-info span { flex: none; font-size: 13px; color: var(--ink-3); }

/* 关于 */
.section-dark { background: var(--ink); color: var(--paper); }
.about { display: grid; gap: 44px; }
.about-left p { color: #c9c0b3; margin-top: 14px; font-size: 15px; }
.about-left .about-lead { font-family: var(--serif); font-size: 21px; line-height: 1.6; color: var(--paper); margin-top: 18px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; border-top: 1px solid #3a342d; border-bottom: 1px solid #3a342d; padding: 22px 0; margin-bottom: 30px; }
.stats strong { display: block; font-family: var(--serif); font-size: 38px; line-height: 1.1; color: var(--accent); }
.stats strong::after { content: "+"; font-size: .55em; margin-left: 2px; vertical-align: top; }
.stats span { font-size: 13px; color: #a79e91; }
.about-right h3 { font-size: 14px; font-weight: 600; color: #a79e91; letter-spacing: .1em; margin-bottom: 14px; }
.skills { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.skills li { font-size: 14px; padding: 6px 14px; border-radius: 999px; border: 1px solid #3a342d; color: var(--paper); }

/* 评价 */
.quote { max-width: 780px; margin: 0 auto; text-align: center; }
.quote blockquote { font-family: var(--serif); font-size: 22px; line-height: 1.7; }
.quote figcaption { margin-top: 20px; font-size: 14px; color: var(--ink-3); }

/* 联系 */
.contact { text-align: center; border-top: 1px solid var(--line); }
.contact-title { font-size: 34px; }
.contact-mail { display: inline-block; margin-top: 18px; font-family: var(--serif); font-size: 26px; font-weight: 700; color: var(--accent); border-bottom: 2px solid currentColor; word-break: break-all; transition: opacity .2s; }
.contact-mail:hover { opacity: .75; }
.contact-note { margin-top: 12px; font-size: 14px; color: var(--ink-3); }

/* 页脚 */
.site-footer { display: flex; flex-direction: column; gap: 6px; align-items: center; text-align: center; padding-top: 28px; padding-bottom: 36px; font-size: 13px; color: var(--ink-3); border-top: 1px solid var(--line); }
.demo-note { font-size: 12px; }

/* 弹窗 */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; visibility: hidden; }
.modal.open { visibility: visible; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(26, 22, 18, .55); opacity: 0; transition: opacity .3s; }
.modal.open .modal-backdrop { opacity: 1; }
.modal-panel { position: relative; width: 100%; max-height: 92vh; overflow-y: auto; background: var(--paper); border-radius: 20px 20px 0 0; transform: translateY(100%); transition: transform .35s cubic-bezier(.2, .7, .2, 1); }
.modal.open .modal-panel { transform: none; }
.modal-close { position: absolute; top: 12px; right: 12px; z-index: 2; width: 36px; height: 36px; border-radius: 50%; background: rgba(246, 241, 233, .92); font-size: 22px; line-height: 1; box-shadow: 0 2px 8px rgba(0, 0, 0, .12); }
.modal-cover { aspect-ratio: 4 / 3; }
.modal-cover img { width: 100%; height: 100%; object-fit: cover; }
.modal-body { padding: 22px 22px 32px; }
.modal-tag { font-size: 13px; color: var(--accent); font-weight: 600; }
.modal-body h3 { font-family: var(--serif); font-size: 24px; margin: 6px 0 12px; line-height: 1.35; }
.modal-body p { color: var(--ink-2); font-size: 15px; }
.modal-facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 14px; }
.modal-facts dt { color: var(--ink-3); }
body.modal-open { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-title .line { animation: none; opacity: 1; transform: none; }
  .marquee-track, .status-dot { animation: none; }
  .cover img, .modal-panel, .modal-backdrop { transition: none; }
}

@media (min-width: 720px) {
  .container { padding: 0 40px; }
  .hero { padding-top: 96px; padding-bottom: 96px; }
  .hero-title { font-size: 68px; }
  .hero-meta { flex-direction: row; align-items: flex-end; max-width: none; justify-content: space-between; gap: 40px; font-size: 17px; }
  .hero-meta p { max-width: 520px; }
  .link-arrow { align-self: auto; flex: none; }
  .section { padding-top: 110px; padding-bottom: 110px; }
  h2 { font-size: 40px; }
  .section-head { flex-direction: row; align-items: flex-end; justify-content: space-between; margin-bottom: 40px; }
  .filters { margin: 0; padding: 0; }
  .work-grid { grid-template-columns: repeat(2, 1fr); gap: 44px 32px; }
  .work:nth-child(even) { margin-top: 64px; }
  .work-grid.filtered .work { margin-top: 0; }
  .quote blockquote { font-size: 30px; }
  .contact-title { font-size: 48px; }
  .contact-mail { font-size: 40px; }
  .site-footer { flex-direction: row; justify-content: space-between; }

  .modal { align-items: center; padding: 24px; }
  .modal-panel { max-width: 860px; border-radius: 20px; transform: translateY(24px) scale(.97); opacity: 0; transition: transform .3s, opacity .3s; display: grid; grid-template-columns: 1.1fr 1fr; }
  .modal.open .modal-panel { transform: none; opacity: 1; }
  .modal-cover { aspect-ratio: auto; height: 100%; min-height: 360px; }
  .modal-cover img { height: 100%; }
  .modal-body { padding: 44px 36px 36px; align-self: center; }
}

@media (min-width: 1000px) {
  .about { grid-template-columns: 1fr 1fr; gap: 80px; align-items: start; }
}
