@import url("./xys-fonts.css");

:root {
  color-scheme: light;
  --paper: #f4eee3;
  --paper-2: #fffaf1;
  --ink: #211d18;
  --muted: #756d63;
  --line: rgba(45, 38, 29, 0.16);
  --accent: #b8863e;
  --accent-dark: #8b6914;
  --sage: #557568;
  --gold: #b48137;
  --blue: #3e6680;
  --shadow: 0 24px 70px rgba(68, 48, 25, 0.14);
  --radius: 8px;
  --serif: "Noto Serif SC", "Songti SC", SimSun, serif;
  --brush: "Liu Jian Mao Cao", "STXingkai", "华文行楷", "FZKai-Z03", "KaiTi", "楷体", "Noto Serif SC", cursive;
  --title: "ZCOOL QingKe HuangYou", "Noto Sans SC", sans-serif;
  --sans: "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

:root[data-theme="night"] {
  color-scheme: dark;
  --paper: #17130f;
  --paper-2: #211a14;
  --ink: #f4eadc;
  --muted: #b9aa99;
  --line: rgba(244, 234, 220, 0.14);
  --accent: #d6a04d;
  --accent-dark: #f0bd6b;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: linear-gradient(180deg, var(--paper-2), var(--paper) 42rem, color-mix(in srgb, var(--paper), var(--ink) 6%));
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.75;
  letter-spacing: 0;
  transition: background 420ms ease, color 420ms ease;
}

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

button,
input,
textarea,
select {
  font: inherit;
}

.site-shell {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  padding: 14px 0;
  background: transparent;
  border-bottom: 1px solid transparent;
  animation: fadeIn 400ms ease both;
  transition: padding 360ms cubic-bezier(0.2, 0.8, 0.2, 1), transform 360ms ease, background 360ms ease;
}

.topbar-inner {
  width: min(1180px, calc(100% - 72px));
  min-height: 60px;
  margin: 0 auto;
  padding: 0 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: blur(0);
  transition: width 360ms cubic-bezier(0.2, 0.8, 0.2, 1), min-height 360ms ease, border-radius 360ms ease, background 360ms ease, box-shadow 360ms ease, transform 360ms ease;
}

.topbar.is-scrolled {
  padding: 10px 0;
}

.topbar.is-scrolled .topbar-inner {
  width: min(1120px, calc(100% - 112px));
  min-height: 60px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--paper-2), transparent 7%);
  box-shadow: 0 16px 40px rgba(45, 35, 22, 0.12);
  backdrop-filter: blur(18px);
  transform: translateY(2px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--brush);
  font-size: 26px;
  font-weight: 400;
  color: var(--accent-dark);
  white-space: nowrap;
  padding-top: 3px;
  transition: transform 260ms ease, color 260ms ease;
}

.brand:hover,
.brand:focus-visible {
  transform: translateY(-1px) rotate(-1deg);
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ink);
  transform: rotate(-4deg);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
  color: var(--muted);
  font-size: 15px;
  letter-spacing: 0.1em;
}

.nav-links a {
  position: relative;
  padding: 6px 0;
  transition: color 300ms ease, transform 300ms ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--ink);
  transform: translateY(-2px);
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown-button {
  padding: 6px 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  letter-spacing: inherit;
}

.nav-dropdown-button::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 9px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: translateY(-3px) rotate(45deg);
}

.nav-dropdown-menu {
  position: absolute;
  left: 50%;
  top: calc(100% + 16px);
  width: 180px;
  padding: 10px;
  display: grid;
  gap: 4px;
  background: color-mix(in srgb, var(--paper-2), transparent 4%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -6px) scale(0.95);
  transform-origin: 50% 0;
  transition: opacity 220ms ease, transform 280ms cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 220ms ease;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0) scale(1);
  box-shadow: 0 24px 48px rgba(68, 48, 25, 0.18);
}

.nav-dropdown-menu a {
  padding: 8px 10px;
  border-radius: 6px;
  letter-spacing: 0;
  transition: background 180ms ease, color 180ms ease, transform 200ms ease;
}

.nav-dropdown-menu a:hover,
.nav-dropdown-menu a:focus-visible {
  background: color-mix(in srgb, var(--accent), transparent 86%);
  transform: translateX(4px);
}

.nav-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-button {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border: none;
  background: color-mix(in srgb, var(--paper-2), transparent 34%);
  color: var(--muted);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(48, 35, 20, 0.06);
  transition: background 220ms ease, color 220ms ease, transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 220ms ease;
}

.icon-button:hover,
.icon-button:focus-visible {
  background: color-mix(in srgb, var(--accent), transparent 86%);
  color: var(--ink);
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 14px 28px rgba(48, 35, 20, 0.1);
  outline: none;
}

.icon-button:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 6px 16px rgba(48, 35, 20, 0.08);
}

:root[data-theme="night"] .icon-button {
  background: rgba(33, 27, 20, 0.6);
  color: #b9aa99;
}

:root[data-theme="night"] .icon-button:hover,
:root[data-theme="night"] .icon-button:focus-visible {
  background: rgba(214, 160, 77, 0.25);
  color: #f4eadc;
}

.sun-icon {
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 50%;
  box-shadow: 0 -8px 0 -6px currentColor, 0 8px 0 -6px currentColor, 8px 0 0 -6px currentColor, -8px 0 0 -6px currentColor, 6px 6px 0 -6px currentColor, -6px -6px 0 -6px currentColor, -6px 6px 0 -6px currentColor, 6px -6px 0 -6px currentColor;
}

.search-icon {
  width: 17px;
  height: 17px;
  position: relative;
  border: 1.9px solid currentColor;
  border-radius: 50%;
  opacity: 0.92;
}

.search-icon::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 1.9px;
  right: -6px;
  bottom: -3px;
  background: currentColor;
  transform: rotate(45deg);
  transform-origin: left center;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 220ms ease;
}

.nav-links a:hover::after,
.nav-links a:focus-visible::after {
  transform: scaleX(1);
  transform-origin: left;
}

.hero {
  min-height: 100vh;
  display: grid;
  align-items: center;
  padding: 150px 0 70px;
  position: relative;
  overflow: hidden;
  --pointer-x: 0;
  --pointer-y: 0;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(1px);
}

.hero::before {
  width: min(56vw, 680px);
  height: min(56vw, 680px);
  left: -18vw;
  top: 12vh;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent), transparent 88%), transparent 70%);
  transform: translate(calc(var(--pointer-x) * 28px), calc(var(--pointer-y) * 18px));
  animation: inkBreathe 9s ease-in-out infinite alternate;
}

.hero::after {
  width: min(44vw, 520px);
  height: min(44vw, 520px);
  right: -12vw;
  bottom: 2vh;
  background: radial-gradient(circle, color-mix(in srgb, var(--gold), transparent 88%), transparent 70%);
  transform: translate(calc(var(--pointer-x) * -22px), calc(var(--pointer-y) * -16px));
  animation: inkBreathe 11s ease-in-out infinite alternate-reverse;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(430px, 1.1fr);
  gap: clamp(34px, 6vw, 76px);
  align-items: center;
}

.hero-grid-single {
  grid-template-columns: minmax(0, 1fr);
  min-height: calc(100vh - 240px);
  position: relative;
  z-index: 1;
  place-items: center;
}

.hero-brand {
  position: relative;
  max-width: 900px;
  padding: 0;
  text-align: center;
  animation: heroEnter 500ms ease both;
}

@keyframes heroEnter {
  from { opacity: 0; }
  to { opacity: 1; }
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--accent-dark);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  font-weight: 800;
  animation: fadeIn 500ms ease 150ms both;
}

.hero h1:not(.brush-logo),
.article-hero h1 {
  margin: 0;
  max-width: 12ch;
  font-family: var(--serif);
  font-size: clamp(56px, 8vw, 132px);
  line-height: 0.94;
  letter-spacing: 0;
  text-wrap: balance;
  animation: fadeIn 500ms ease 250ms both;
  position: relative;
}

.hero h1:not(.brush-logo)::after,
.article-hero h1::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.15em;
  width: 2.2em;
  height: 0.06em;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  transform-origin: left center;
  animation: fadeIn 400ms ease 300ms both;
}

.brush-logo {
  position: relative;
  display: inline-block;
  max-width: none;
  font-family: var(--brush);
  font-size: clamp(116px, 15vw, 210px);
  line-height: 0.9;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--accent-dark);
  text-shadow:
    0 2px 0 rgba(255, 250, 241, 0.7),
    0 22px 44px rgba(41, 32, 22, 0.14);
  animation: fadeIn 500ms ease 100ms both;
}

.brush-logo::after {
  content: "";
  position: absolute;
  left: 24%;
  right: 22%;
  bottom: -0.04em;
  height: 0.12em;
  background: linear-gradient(90deg, transparent, rgba(231, 111, 69, 0.92) 12%, rgba(231, 111, 69, 0.42) 72%, transparent);
  transform: rotate(-2deg);
  filter: blur(0.5px);
  z-index: -1;
  transform-origin: left center;
  animation: fadeIn 400ms ease 250ms both;
}

.hero-motto {
  margin: 20px 0 0;
  color: var(--accent-dark);
  font-family: var(--title);
  font-size: clamp(16px, 1.7vw, 24px);
  letter-spacing: 0.5em;
  text-indent: 0.5em;
  font-weight: 400;
  animation: fadeIn 500ms ease 200ms both;
}

.hero-copy {
  display: none;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
  justify-content: center;
  animation: fadeIn 500ms ease 300ms both;
}

.hero-actions .btn {
  animation: fadeIn 400ms ease both;
  animation-delay: calc(300ms + var(--btn-index, 0) * 80ms);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper-2);
  box-shadow: 0 10px 24px rgba(33, 29, 24, 0.15);
  position: relative;
  overflow: hidden;
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 220ms ease, background 220ms ease, color 220ms ease;
}

.btn::after {
  content: "";
  position: absolute;
  inset: -40%;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.32), transparent 65%);
  transform: translateX(-70%) rotate(8deg);
  transition: transform 520ms ease;
}

.btn:hover::after,
.btn:focus-visible::after {
  transform: translateX(70%) rotate(8deg);
}

.btn.secondary {
  background: transparent;
  color: var(--ink);
  box-shadow: none;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 20px 40px rgba(33, 29, 24, 0.22);
}

.btn:active {
  transform: translateY(-1px) scale(0.98);
  transition-duration: 100ms;
}

.map-panel {
  position: relative;
  padding: clamp(28px, 5vw, 56px);
  min-height: 560px;
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
  background:
    linear-gradient(135deg, rgba(255, 250, 241, 0.9), rgba(244, 238, 227, 0.72)),
    radial-gradient(circle at 50% 0%, rgba(231, 111, 69, 0.08), transparent 24rem);
  border: 1px solid rgba(64, 48, 32, 0.12);
  border-radius: var(--radius);
  box-shadow: 0 36px 90px rgba(68, 48, 25, 0.17);
  overflow: hidden;
}

.map-panel::before {
  content: "";
  position: absolute;
  inset: 16px;
  border: 1px solid rgba(64, 48, 32, 0.08);
  pointer-events: none;
}

.hero-map {
  transform: rotate(0.3deg);
}

.map-kicker {
  color: #8b8277;
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: 0.6em;
}

.map-kicker strong {
  color: var(--accent);
  letter-spacing: 0;
}

.map-title {
  margin: 18px 0 34px;
  font-family: var(--serif);
  font-size: clamp(42px, 5.7vw, 88px);
  font-weight: 900;
  line-height: 1.05;
}

.map-title span {
  color: var(--accent);
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px 16px;
  max-width: 860px;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 9px 24px;
  border: 1px solid rgba(63, 51, 38, 0.17);
  border-left: 3px solid var(--accent);
  border-radius: 999px;
  background: rgba(255, 250, 241, 0.76);
  box-shadow: 0 12px 24px rgba(69, 50, 27, 0.09);
  font-family: var(--serif);
  font-size: clamp(17px, 1.7vw, 25px);
  transition: transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1), background 260ms ease, border-color 260ms ease, box-shadow 260ms ease;
}

.tag-pill::before {
  content: "+";
  color: var(--accent);
  font-family: var(--sans);
  font-weight: 800;
}

.tag-pill:hover,
.tag-pill:focus-visible {
  transform: translateY(-6px) rotate(-1.5deg) scale(1.05);
  background: #fff6e9;
  border-color: rgba(231, 111, 69, 0.6);
  box-shadow: 0 16px 32px rgba(69, 50, 27, 0.15);
}

:root[data-theme="night"] .tag-pill {
  background: rgba(45, 36, 26, 0.85);
  border-color: rgba(184, 134, 62, 0.3);
  color: #e0d4c0;
}

:root[data-theme="night"] .tag-pill:hover,
:root[data-theme="night"] .tag-pill:focus-visible {
  background: rgba(55, 45, 32, 0.95);
  border-color: rgba(214, 160, 77, 0.6);
  color: #f4eadc;
}

.map-footer {
  margin: 36px 0 0;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 18px;
}

.section {
  padding: 76px 0;
  border-top: 1px solid var(--line);
}

.columns-section {
  border-top: 0;
  padding-top: 28px;
}

.section-head {
  display: block;
  margin-bottom: 30px;
  animation: fadeIn 400ms ease both;
}

.section-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(34px, 4vw, 64px);
  line-height: 1.04;
}

.section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.column-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-content: start;
}

.column-card {
  position: relative;
  padding: clamp(28px, 4vw, 46px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border: 1px solid rgba(64, 48, 32, 0.13);
  border-radius: var(--radius);
  margin-bottom: 20px;
  background:
    linear-gradient(180deg, rgba(255, 250, 241, 0.86), rgba(244, 238, 227, 0.72)),
    radial-gradient(circle at 12% 10%, rgba(231, 111, 69, 0.07), transparent 18rem);
  box-shadow: 0 18px 54px rgba(68, 48, 25, 0.11);
  overflow: hidden;
  transform-style: preserve-3d;
  transition: transform 360ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 360ms ease, border-color 360ms ease, background 360ms ease;
}

:root[data-theme="night"] .column-card {
  background:
    linear-gradient(180deg, rgba(45, 36, 26, 0.92), rgba(33, 27, 20, 0.88)),
    radial-gradient(circle at 12% 10%, rgba(184, 134, 62, 0.12), transparent 18rem);
  border-color: rgba(184, 134, 62, 0.25);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.35);
}

:root[data-theme="night"] .column-card::before {
  border-color: rgba(184, 134, 62, 0.15);
}

:root[data-theme="night"] .column-card::after {
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.08), transparent 32%);
}

:root[data-theme="night"] .column-card:hover,
:root[data-theme="night"] .column-card:focus-within {
  background:
    linear-gradient(180deg, rgba(55, 45, 32, 0.95), rgba(43, 35, 25, 0.92)),
    radial-gradient(circle at 12% 10%, rgba(214, 160, 77, 0.15), transparent 18rem);
  border-color: rgba(214, 160, 77, 0.5);
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.45);
}

/* 统一夜间模式卡片样式 */
:root[data-theme="night"] .card {
  background: rgba(33, 27, 20, 0.75);
  border-color: rgba(184, 134, 62, 0.2);
}

:root[data-theme="night"] .card:hover,
:root[data-theme="night"] .card:focus-within {
  background: rgba(43, 35, 25, 0.85);
  border-color: rgba(214, 160, 77, 0.45);
}

:root[data-theme="night"] .metric {
  background: rgba(33, 27, 20, 0.65);
  border-color: rgba(184, 134, 62, 0.2);
}

:root[data-theme="night"] .metric:hover {
  background: rgba(43, 35, 25, 0.8);
  border-color: rgba(214, 160, 77, 0.4);
}

:root[data-theme="night"] .repo,
:root[data-theme="night"] .post-card {
  background: rgba(33, 27, 20, 0.7);
  border-color: rgba(184, 134, 62, 0.2);
}

:root[data-theme="night"] .repo:hover,
:root[data-theme="night"] .repo:focus-within,
:root[data-theme="night"] .post-card:hover,
:root[data-theme="night"] .post-card:focus-within {
  background: rgba(43, 35, 25, 0.85);
  border-color: rgba(214, 160, 77, 0.45);
}

:root[data-theme="night"] .mini-chip {
  background: rgba(45, 36, 26, 0.7);
  border-color: rgba(184, 134, 62, 0.25);
  color: #c4b89e;
}

.column-card::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(64, 48, 32, 0.08);
  pointer-events: none;
  transition: inset 360ms ease, border-color 360ms ease;
}

.column-card::after {
  content: "";
  position: absolute;
  inset: -35%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.36), transparent 32%);
  opacity: 0;
  transform: translate(-18%, -18%) rotate(12deg);
  transition: opacity 360ms ease, transform 520ms ease;
  pointer-events: none;
}

.column-card:hover,
.column-card:focus-within {
  transform: translateY(-4px) rotate(-0.3deg) scale(1.01);
  border-color: rgba(231, 111, 69, 0.5);
  box-shadow: 0 28px 64px rgba(68, 48, 25, 0.18);
  transition: transform 400ms cubic-bezier(0.16, 1, 0.3, 1),
              border-color 300ms ease,
              box-shadow 400ms cubic-bezier(0.16, 1, 0.3, 1);
}

.column-card:hover::before,
.column-card:focus-within::before {
  inset: 10px;
  border-color: rgba(184, 134, 62, 0.2);
}

.column-card:hover::after,
.column-card:focus-within::after {
  opacity: 1;
  transform: translate(0, 0) rotate(12deg);
}

.column-card h3 {
  margin: 18px 0 0;
  font-family: var(--serif);
  font-size: clamp(36px, 4.6vw, 66px);
  line-height: 1.03;
}

.column-card h3 span {
  display: inline-block;
  color: var(--accent);
  font-size: calc(1em * var(--accent-scale, 0.68));
  line-height: 1.04;
}

.column-card p {
  max-width: 560px;
  margin: 24px 0;
  color: #5f574e;
  font-size: 17px;
}

:root[data-theme="night"] .column-card p {
  color: #c4b89e;
}

:root[data-theme="night"] .column-card .map-kicker {
  color: #a89880;
}

:root[data-theme="night"] .column-card .map-kicker strong {
  color: var(--accent);
}

.tag-cloud.compact {
  max-width: 560px;
  gap: 10px 12px;
  margin-top: 24px;
}

.tag-cloud.compact .tag-pill {
  min-height: 42px;
  padding: 7px 17px;
  font-size: 17px;
}

.card {
  min-height: 210px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 250, 241, 0.62);
  transition: transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 260ms ease, border-color 260ms ease;
}

.card:hover,
.card:focus-within {
  transform: translateY(-4px);
  border-color: rgba(231, 111, 69, 0.45);
  box-shadow: 0 18px 46px rgba(58, 43, 28, 0.12);
}

.card h3 {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-size: 28px;
}

.card p {
  margin: 0;
  color: var(--muted);
}

.card-meta {
  margin-top: 28px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.metric-grid,
.repo-grid,
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.metric {
  padding: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 250, 241, 0.52);
  border-radius: var(--radius);
  transition: transform 280ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 280ms ease, border-color 280ms ease, background 280ms ease;
}

.metric:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: rgba(184, 134, 62, 0.4);
  box-shadow: 0 16px 44px rgba(68, 48, 25, 0.12);
  background: rgba(255, 250, 241, 0.75);
}

.metric strong {
  display: block;
  font-family: var(--serif);
  font-size: 42px;
  line-height: 1;
  transition: transform 280ms ease;
}

.metric:hover strong {
  transform: scale(1.05);
}

.metric span,
.metric p {
  color: var(--muted);
}

.repo,
.post-card {
  padding: 24px;
  min-height: 230px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 250, 241, 0.67);
  transition: transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 260ms ease, border-color 260ms ease, background 260ms ease;
}

.repo:hover,
.repo:focus-within,
.post-card:hover,
.post-card:focus-within {
  transform: translateY(-6px) rotate(-0.3deg);
  border-color: rgba(231, 111, 69, 0.45);
  box-shadow: 0 20px 50px rgba(58, 43, 28, 0.14);
  background: rgba(255, 250, 241, 0.85);
}

.repo h3,
.post-card h3 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: 26px;
  line-height: 1.2;
}

.repo p,
.post-card p {
  color: var(--muted);
}

.mini-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.mini-chip {
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
}

.blog-hero,
.article-hero {
  padding: 84px 0 50px;
}

.blog-hero h1,
.article-hero h1 {
  animation: fadeIn 500ms ease 200ms both;
}

.blog-hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(48px, 7vw, 104px);
  line-height: 0.98;
}

.blog-hero p,
.article-hero p {
  max-width: 760px;
  color: var(--muted);
  font-size: 20px;
}

.article-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 760px);
  gap: 56px;
  align-items: start;
  padding-bottom: 90px;
}

.article-aside {
  position: sticky;
  top: 96px;
  color: var(--muted);
  font-size: 14px;
}

.article-body {
  font-family: var(--serif);
  font-size: 21px;
  line-height: 2;
}

.article-body p {
  margin: 0 0 1.35em;
}

.footer {
  padding: 36px 0 50px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  animation: fadeIn 400ms ease 150ms both;
}

.footer .site-shell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.footer-beian {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 13px;
}

.footer-beian a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: inherit;
  transition: color 220ms ease;
}

.footer-beian a:hover,
.footer-beian a:focus-visible {
  color: var(--accent-dark);
}

.footer-beian img {
  width: 14px;
  height: 14px;
}

.footer-beian .separator {
  color: var(--line);
  user-select: none;
}

.back-to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: color-mix(in srgb, var(--paper-2), transparent 12%);
  color: var(--muted);
  font-size: 22px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.9);
  box-shadow: 0 12px 32px rgba(68, 48, 25, 0.12);
  backdrop-filter: blur(12px);
  transition: opacity 300ms ease, visibility 300ms ease, transform 300ms cubic-bezier(0.16, 1, 0.3, 1), background 220ms ease, color 220ms ease, border-color 220ms ease;
  z-index: 20;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.back-to-top:hover,
.back-to-top:focus-visible {
  background: var(--accent);
  color: var(--paper-2);
  border-color: var(--accent);
  transform: translateY(-4px) scale(1.05);
}

.back-to-top:active {
  transform: translateY(-2px) scale(0.98);
}

.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  place-items: start center;
  padding: 120px 18px 18px;
  background: rgba(20, 16, 12, 0.26);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 220ms ease;
}

.search-overlay.is-open {
  display: grid;
  opacity: 1;
}

.search-dialog {
  width: min(720px, 100%);
  max-height: min(680px, calc(100vh - 150px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--paper-2), transparent 2%);
  box-shadow: 0 34px 100px rgba(24, 18, 10, 0.24);
  animation: searchRise 260ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.search-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.search-head input {
  min-height: 48px;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font-size: 18px;
  transition: letter-spacing 300ms ease;
}

.search-head input:focus {
  letter-spacing: 0.02em;
}

.search-head input::placeholder {
  transition: opacity 220ms ease, transform 220ms ease;
}

.search-head input:focus::placeholder {
  opacity: 0.5;
  transform: translateX(6px);
}

.search-results {
  max-height: 520px;
  overflow: auto;
  padding: 10px;
}

.search-result {
  display: block;
  padding: 14px;
  border-radius: 8px;
  transition: background 180ms ease, transform 200ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 200ms ease;
}

.search-result:hover,
.search-result:focus-visible {
  background: color-mix(in srgb, var(--accent), transparent 88%);
  transform: translateX(6px);
  box-shadow: -6px 0 20px rgba(69, 50, 27, 0.08);
}

.search-result span {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.search-result strong {
  display: block;
  margin: 4px 0;
  font-family: var(--serif);
  font-size: 22px;
}

.search-result p,
.search-empty {
  margin: 0;
  color: var(--muted);
}

.notice {
  padding: 12px 14px;
  border: 1px solid rgba(184, 134, 62, 0.35);
  background: rgba(184, 134, 62, 0.08);
  border-radius: var(--radius);
  color: var(--accent-dark);
  font-size: 14px;
}

.notice.is-error {
  border-color: rgba(160, 40, 24, 0.5);
  background: rgba(160, 40, 24, 0.08);
  color: #a02818;
}

.fade-in {
  animation: fadeIn 700ms ease both;
}

.motion-item {
  opacity: 0;
  transition: opacity 350ms ease;
}

.motion-item.is-visible {
  opacity: 1;
  transform: none;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes searchRise {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 940px) {
  .hero-grid,
  .section-head,
  .article-layout {
    grid-template-columns: 1fr;
  }

  .card-grid,
  .column-grid,
  .metric-grid,
  .repo-grid,
  .post-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .map-panel {
    min-height: 0;
  }

  .article-aside {
    position: static;
  }
}

@media (max-width: 640px) {
  .site-shell {
    width: min(100% - 24px, 1180px);
  }

  .topbar-inner {
    width: min(100% - 24px, 1180px);
    min-height: 64px;
    padding: 0 16px;
    gap: 12px;
  }

  .icon-button {
    width: 40px;
    height: 40px;
  }

  .topbar.is-scrolled .topbar-inner {
    width: min(100% - 24px, 1180px);
  }

  .nav-links {
    display: none;
  }

  .back-to-top {
    bottom: 18px;
    right: 18px;
    width: 42px;
    height: 42px;
  }

  .hero {
    padding-top: 110px;
  }

  .hero h1:not(.brush-logo),
  .blog-hero h1,
  .article-hero h1 {
    font-size: 48px;
  }

  .brush-logo {
    font-size: clamp(78px, 24vw, 116px);
  }

  .hero-motto {
    font-size: 14px;
    letter-spacing: 0.32em;
    text-indent: 0.32em;
  }

  .card-grid,
  .column-grid,
  .metric-grid,
  .repo-grid,
  .post-grid {
    grid-template-columns: 1fr;
  }

  .tag-pill {
    width: 100%;
    justify-content: center;
  }

  .column-card,
  .column-card:hover {
    transform: none;
  }

  .tag-cloud.compact {
    margin-top: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
  }
}
