/* ==========================================================================
   豆豆的小画室 · style.css
   依据：docs/design-spec.md v1.0（视觉唯一依据）
   约定：只用系统字体、无 @import、无外部资源；手绘感全靠 CSS
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 设计令牌
   -------------------------------------------------------------------------- */

:root {
  /* 色板 */
  --paper: #f7f1e5;
  --card: #fffdf7;
  --band: #efe6d3;
  --ink: #403b30;
  --ink-soft: #6c6455;
  --green: #3f6b46;
  --coral-deep: #a84a2e;
  --coral: #c05b3c;
  --rose: #a6446b;
  --butter: #f2c94c;
  --line: #d8cbad;
  --white: #ffffff;

  /* 字体 */
  --font-body: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-num: ui-monospace, "SF Mono", Menlo, Consolas, "PingFang SC", monospace;

  /* 间距（8pt 基准，只允许这九档） */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 16px;
  --sp-4: 24px;
  --sp-5: 32px;
  --sp-6: 48px;
  --sp-7: 64px;
  --sp-8: 96px;
  --sp-9: 128px;

  /* 版心 */
  --container: 1120px;
  --reading: 42rem;
  --gutter: clamp(16px, 4vw, 32px);

  /* 手绘圆角微扰 */
  --radius-wobble: 18px 14px 20px 12px / 14px 20px 12px 18px;

  /* 卡片投影：只给作品卡与 Hero 画框 */
  --shadow-frame: 0 1px 0 rgba(64, 59, 48, 0.04), 0 8px 20px -14px rgba(64, 59, 48, 0.25);
}

/* --------------------------------------------------------------------------
   2. 基础
   -------------------------------------------------------------------------- */

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

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

body {
  margin: 0;
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 15% 20%, rgba(214, 197, 161, 0.12) 0, transparent 42%),
    radial-gradient(circle at 85% 75%, rgba(214, 197, 161, 0.1) 0, transparent 40%);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.85;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p,
dl,
dd,
figure,
blockquote,
ol,
ul {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

img {
  max-width: 100%;
  transition: opacity 0.45s ease;
}

/* JS 淡入：类只在图片尚未加载完成时由脚本添加，无 JS 时图片始终可见 */
img.is-img-pending {
  opacity: 0;
}

a {
  color: var(--green);
}

strong {
  font-weight: 600;
}

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

h1[tabindex="-1"]:focus {
  outline: none;
}

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

.accent-green {
  color: var(--green);
}

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--gutter);
  z-index: 30;
  padding: var(--sp-3) var(--sp-3);
  background: var(--card);
  color: var(--ink);
  border-radius: var(--sp-2);
  text-decoration: none;
}

.skip-link:focus {
  top: var(--sp-2);
}

/* 手绘短横线 */
.divider-hand {
  display: block;
  flex: none;
  width: 64px;
  height: 4px;
  background: var(--coral);
  border-radius: 4px 2px 4px 3px;
  transform: rotate(-1.2deg);
}

/* --------------------------------------------------------------------------
   3. 页头
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 56px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  max-width: var(--container);
  min-height: 56px;
  margin-inline: auto;
  padding: var(--sp-2) var(--gutter);
}

.site-header__brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
}

.site-header__brand-main {
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.02em;
}

.site-header__brand-sub {
  display: none;
  font-size: 0.8125rem;
  line-height: 1.4;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

/* 首页：wordmark 降为小字号，主视觉交给 Hero H1 */
.page-home .site-header__brand-main {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}

.site-header__nav {
  display: flex;
  gap: var(--sp-2);
}

.site-header__nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--sp-3);
  font-size: 0.9375rem;
  color: var(--ink);
  text-decoration: none;
  border-radius: var(--sp-2);
}

.site-header__nav a:hover {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* --------------------------------------------------------------------------
   4. 首页 · Hero
   -------------------------------------------------------------------------- */

.hero {
  display: grid;
  gap: var(--sp-5);
  padding-block: var(--sp-6) var(--sp-1);
}

.hero__eyebrow {
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: 0.08em;
  color: var(--coral-deep);
}

.hero h1 {
  margin-top: var(--sp-2);
  font-size: clamp(2rem, 1.4rem + 3vw, 3rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.02em;
}

.hero__subtitle {
  margin-top: var(--sp-2);
  font-size: clamp(1.25rem, 1.05rem + 1vw, 1.625rem);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.18em;
  color: var(--green);
}

.hero__intro {
  margin-top: var(--sp-4);
  font-size: 1rem;
  line-height: 1.85;
}

.hero__note {
  display: none;
  margin-top: var(--sp-2);
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--ink-soft);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-top: var(--sp-5);
}

.hero__figure {
  position: relative;
  margin: 0;
  padding: var(--sp-2);
  background: var(--card);
  border-radius: var(--radius-wobble);
  box-shadow: var(--shadow-frame);
}

/* 全页唯一一处装饰贴角 */
.hero__figure::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  z-index: 1;
  width: 96px;
  height: 12px;
  background: rgba(242, 201, 76, 0.6);
  border-radius: 2px;
  transform: translateX(-50%) rotate(-3deg);
}

.hero__figure img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 14px;
}

.hero__figure figcaption {
  margin-top: var(--sp-2);
  font-size: 0.8125rem;
  line-height: 1.6;
  text-align: center;
  color: var(--ink-soft);
}

/* --------------------------------------------------------------------------
   5. 年份导航条
   -------------------------------------------------------------------------- */

.year-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-block: var(--sp-5) var(--sp-6);
}

.year-nav a {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: 44px;
  padding: var(--sp-2) 20px;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 999px 999px 999px 4px;
  font-family: var(--font-num);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.18s, transform 0.18s, background-color 0.18s;
}

.year-nav a:hover {
  border-color: var(--green);
  transform: translateY(-1px);
}

.year-nav a[aria-current="true"] {
  background: var(--green);
  border-color: var(--green);
  color: var(--white);
}

.year-nav__count {
  color: var(--ink-soft);
}

.year-nav a[aria-current="true"] .year-nav__count {
  color: inherit;
}

.year-nav__reset {
  min-height: 44px;
  padding: var(--sp-2) 20px;
  background: transparent;
  border: 1.5px dashed var(--line);
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--ink-soft);
  cursor: pointer;
}

.year-nav__reset:hover {
  border-color: var(--green);
  color: var(--green);
}

/* --------------------------------------------------------------------------
   6. 作品墙
   -------------------------------------------------------------------------- */

.section-head h2 {
  font-size: clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.02em;
}

.section-head__intro {
  margin-top: var(--sp-2);
  font-size: 1rem;
  color: var(--ink-soft);
}

.year-group {
  margin-top: var(--sp-6);
  scroll-margin-top: 80px;
}

.year-group + .year-group {
  margin-top: var(--sp-7);
}

.year-group__head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}

.year-group__title {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0;
}

.year-group__year,
.year-group__count {
  font-family: var(--font-num);
}

.year-group__dot {
  color: var(--ink-soft);
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-3);
}

.gallery__end {
  margin-top: var(--sp-6);
  font-size: 0.9375rem;
  color: var(--ink-soft);
}

/* --------------------------------------------------------------------------
   7. 作品卡
   -------------------------------------------------------------------------- */

.tile {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-2);
  border-radius: var(--radius-wobble);
  color: var(--ink);
  text-decoration: none;
  scroll-margin-top: 80px;
  transition: transform 0.18s ease;
}

.tile__frame {
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-wobble);
  box-shadow: var(--shadow-frame);
  transition: border-color 0.18s ease;
}

.tile__frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border: 0;
}

/* 宽高比 < 0.9 或 > 1.5：完整呈现，留白底色与卡片同值（两类格子只差 object-fit） */
.tile--contain img {
  object-fit: contain;
}

.tile__title {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: 0;
  transition: color 0.18s ease;
}

.tile__title.is-untitled {
  color: var(--ink-soft);
}

.tile__meta {
  font-family: var(--font-num);
  font-size: 0.8125rem;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
}

@media (hover: hover) {
  .tile:hover {
    transform: translateY(-3px);
  }

  .tile:hover .tile__frame {
    border-color: var(--green);
  }

  .tile:hover .tile__title {
    color: var(--green);
  }

  /* 「无题」保持次要色，hover 反馈交给画框描边与整卡上浮 */
  .tile:hover .tile__title.is-untitled {
    color: var(--ink-soft);
  }
}

/* --------------------------------------------------------------------------
   8. 首页页尾区块
   -------------------------------------------------------------------------- */

.latest {
  margin-block: var(--sp-7) 0;
  padding-top: var(--sp-5);
  border-top: 1px solid var(--line);
  font-size: 0.9375rem;
  color: var(--ink-soft);
}

.latest__link {
  margin-top: var(--sp-2);
}

.latest__link a {
  color: var(--green);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.latest__link a:hover {
  border-bottom-color: currentColor;
}

/* --------------------------------------------------------------------------
   9. 按钮
   -------------------------------------------------------------------------- */

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 28px;
  border-radius: 999px 999px 999px 6px;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
  transition: transform 0.18s, box-shadow 0.18s, background-color 0.18s, color 0.18s;
}

.btn-primary {
  background: var(--coral-deep);
  color: var(--white);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px -10px rgba(168, 74, 46, 0.5);
}

.btn-secondary {
  background: transparent;
  border: 1.5px solid var(--green);
  color: var(--green);
}

.btn-secondary:hover {
  background: var(--green);
  color: var(--white);
}

/* --------------------------------------------------------------------------
   10. 详情页
   -------------------------------------------------------------------------- */

.work-page {
  padding-top: var(--sp-5);
}

.work-page__head {
  max-width: var(--reading);
  margin-inline: auto;
  padding-block: var(--sp-4) var(--sp-4);
}

.breadcrumb {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

.breadcrumb a {
  color: var(--green);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.breadcrumb__sep {
  margin-inline: var(--sp-2);
  color: var(--line);
}

.work-eyebrow {
  margin-top: var(--sp-4);
  font-family: var(--font-num);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: 0.12em;
  color: var(--coral-deep);
}

.work-page h1 {
  margin-top: var(--sp-2);
  font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.5rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.02em;
}

.work-meta {
  margin-top: var(--sp-2);
  font-size: 0.9375rem;
  line-height: 1.6;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
}

.work-meta time,
.work-meta .num {
  font-family: var(--font-num);
}

.work-figure {
  max-width: 900px;
  margin: var(--sp-5) auto 0;
}

.work-figure__link {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
}

/* 焦点环画在图片本身，避免框住整列空白 */
.work-figure__link:focus-visible {
  outline: none;
}

.work-figure__link:focus-visible img {
  outline: 3px solid var(--coral-deep);
  outline-offset: 4px;
}

/* 原比例、不裁不框不加投影，只留 8px 衬边与微扰圆角 */
.work-figure img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 85vh;
  margin-inline: auto;
  padding: var(--sp-2);
  background: var(--card);
  border: 0;
  border-radius: var(--radius-wobble);
  box-shadow: none;
}

.work-figure figcaption {
  margin-top: 12px;
  font-size: 0.8125rem;
  line-height: 1.6;
  text-align: center;
  color: var(--ink-soft);
}

.work-pager {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-3);
  max-width: 900px;
  margin: var(--sp-6) auto 0;
}

.work-pager a {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--sp-1);
  min-height: 64px;
  padding: 12px var(--sp-3);
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 14px 10px 14px 10px / 10px 14px 10px 14px;
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.18s, transform 0.18s;
}

.work-pager a:hover {
  border-color: var(--green);
}

.work-pager__next {
  text-align: right;
  align-items: flex-end;
}

.work-pager__label {
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.5;
  color: var(--green);
}

.work-pager__prev .work-pager__label::before {
  content: "← ";
}

.work-pager__next .work-pager__label::after {
  content: " →";
}

.work-pager__title {
  font-size: 1rem;
  line-height: 1.6;
}

.work-copyright {
  max-width: var(--reading);
  margin: var(--sp-6) auto 0;
  font-size: 0.8125rem;
  line-height: 1.6;
  text-align: center;
  color: var(--ink-soft);
}

.work-actions {
  margin-top: var(--sp-4);
  text-align: center;
}

/* --------------------------------------------------------------------------
   11. 关于页
   -------------------------------------------------------------------------- */

.about-page {
  padding-top: var(--sp-5);
}

.page-head {
  max-width: var(--reading);
}

.eyebrow {
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: 0.08em;
  color: var(--coral-deep);
}

.page-head h1 {
  margin-top: var(--sp-2);
  font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.5rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.02em;
}

.page-head__sub {
  margin-top: var(--sp-2);
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--ink-soft);
}

.profile {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-1) var(--sp-3);
  max-width: 720px;
  margin-top: var(--sp-5);
  padding: var(--sp-5);
  background: var(--band);
  border-radius: var(--radius-wobble);
}

.profile dt {
  margin-top: 12px;
  font-weight: 500;
  color: var(--ink-soft);
}

.profile dt:first-child {
  margin-top: 0;
}

.profile dd {
  margin: 0;
}

.prose {
  max-width: var(--reading);
  margin-top: var(--sp-6);
  font-size: 1.0625rem;
  line-height: 1.9;
  letter-spacing: 0.015em;
}

.prose p + p {
  margin-top: var(--sp-4);
}

/* 关于页正文：首行缩进交给 CSS，段落里不得用 &nbsp; */
.prose--body p {
  text-indent: 2em;
}

.prose--tight {
  margin-top: var(--sp-3);
}

/* 豆豆想说 */
.quote {
  position: relative;
  max-width: 640px;
  margin: var(--sp-7) auto;
  padding: var(--sp-6) var(--sp-5) var(--sp-5);
}

.quote::before {
  content: "“";
  position: absolute;
  top: -8px;
  left: -8px;
  font-size: 5rem;
  font-weight: 700;
  line-height: 1;
  color: var(--coral);
  opacity: 0.35;
}

.quote p {
  font-size: clamp(1.1875rem, 1.05rem + 0.7vw, 1.4375rem);
  font-weight: 500;
  line-height: 2;
  letter-spacing: 0.02em;
}

.quote footer {
  margin-top: var(--sp-4);
  font-size: 0.9375rem;
  line-height: 1.6;
  text-align: right;
  color: var(--rose);
}

.about-photos {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-4);
  max-width: 720px;
  margin-top: var(--sp-6);
}

.about-photos figure {
  margin: 0;
}

.about-photos img {
  display: block;
  width: 100%;
  height: auto;
  padding: 6px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-wobble);
}

.about-photos figcaption {
  margin-top: var(--sp-2);
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

.about-block {
  margin-top: var(--sp-7);
}

.about-block h2 {
  font-size: clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.02em;
}

.about-block__lead {
  max-width: var(--reading);
  margin-top: var(--sp-2);
  font-size: 1.0625rem;
  line-height: 1.9;
  color: var(--ink-soft);
}

.prose-en {
  margin-top: var(--sp-3);
  font-family: var(--font-num);
  font-size: 0.8125rem;
  line-height: 1.6;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
}

.howto {
  max-width: var(--reading);
  margin-top: var(--sp-4);
  counter-reset: howto;
}

.howto li {
  position: relative;
  padding-left: var(--sp-5);
  font-size: 1.0625rem;
  line-height: 1.9;
  counter-increment: howto;
}

.howto li + li {
  margin-top: var(--sp-3);
}

.howto li::before {
  content: counter(howto) ".";
  position: absolute;
  top: 0;
  left: 0;
  font-family: var(--font-num);
  font-weight: 500;
  color: var(--coral-deep);
}

.howto__end {
  max-width: var(--reading);
  margin-top: var(--sp-4);
  font-weight: 600;
}

.about-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
  margin-top: var(--sp-7);
}

.about-cta__note {
  font-size: 0.8125rem;
  color: var(--ink-soft);
}

/* --------------------------------------------------------------------------
   12. 页脚
   -------------------------------------------------------------------------- */

.site-footer {
  margin-top: var(--sp-8);
  padding: var(--sp-6) 0 var(--sp-5);
  border-top: 1px solid var(--line);
  text-align: center;
}

.site-footer__slogan {
  font-size: clamp(1.5rem, 1.1rem + 2.2vw, 2.25rem);
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.04em;
}

.site-footer__slogan::after {
  content: "";
  display: block;
  width: 64px;
  height: 4px;
  margin: var(--sp-4) auto 0;
  background: var(--coral);
  border-radius: 4px 2px 4px 3px;
  transform: rotate(-1.2deg);
}

.site-footer__info {
  margin-top: var(--sp-4);
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

.site-footer__nav {
  display: flex;
  justify-content: center;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
}

.site-footer__nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--sp-3);
  font-size: 0.875rem;
  color: var(--green);
  text-decoration: none;
}

.site-footer__nav a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.site-footer__copy {
  margin-top: var(--sp-3);
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

/* ICP 备案号：工信部要求可点击跳转 beian.miit.gov.cn */
.site-footer__beian {
  margin-top: var(--sp-2);
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

.site-footer__beian a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  opacity: 0.75;
  transition: opacity 0.2s ease;
}

.site-footer__beian a:hover {
  opacity: 1;
}

/* --------------------------------------------------------------------------
   13. 返回顶部（由 JS 注入，无 JS 时不存在）
   -------------------------------------------------------------------------- */

.to-top {
  display: none;
  position: fixed;
  right: var(--sp-4);
  bottom: var(--sp-4);
  z-index: 15;
  width: 48px;
  height: 48px;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 50%;
  font-size: 1.125rem;
  line-height: 1;
  color: var(--ink-soft);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s, border-color 0.18s;
}

.to-top:hover {
  border-color: var(--green);
  color: var(--green);
}

.to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* --------------------------------------------------------------------------
   14. 断点：641px 起
   -------------------------------------------------------------------------- */

@media (min-width: 641px) {
  .site-header__brand-sub {
    display: inline;
  }

  .hero {
    grid-template-columns: 1fr 44%;
    align-items: center;
    gap: var(--sp-6);
    padding-block: var(--sp-7) var(--sp-4);
  }

  .hero__note {
    display: block;
  }

  .year-nav {
    margin-block: var(--sp-5) var(--sp-7);
  }

  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--sp-4);
  }

  .work-pager {
    grid-template-columns: 1fr 1fr;
  }

  .profile {
    grid-template-columns: 7em 1fr;
    row-gap: 12px;
  }

  .profile dt,
  .profile dt:first-child {
    margin-top: 0;
    text-align: right;
  }

  .about-photos {
    grid-template-columns: 1fr 1fr;
  }

  .site-footer {
    margin-top: var(--sp-9);
    padding: var(--sp-7) 0 var(--sp-6);
  }

  .to-top {
    display: block;
  }
}

/* --------------------------------------------------------------------------
   15. 断点：1025px 起
   -------------------------------------------------------------------------- */

@media (min-width: 1025px) {
  .hero__figure {
    max-width: 520px;
    justify-self: end;
  }

  .grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* --------------------------------------------------------------------------
   16. 窄屏与减动效
   -------------------------------------------------------------------------- */

@media (max-width: 640px) {
  .work-pager__next {
    text-align: right;
  }

  .quote {
    padding: var(--sp-5) 20px;
  }

  .site-footer {
    padding-top: var(--sp-6);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
