/* 主题统一使用语义变量；两套配色保持相同布局和可读对比度。 */
:root {
  color-scheme: light;
  --page: #f8f7f3;
  --ink: #303530;
  --muted: #62685f;
  --subtle: #686e64;
  --line: #e4e5dc;
  --accent: #798b69;
  --accent-ink: #5d6c50;
  --purple: #9590b9;
  --button: #343c32;
  --button-ink: #fff;
  --card-blog: #eeedf5;
  --card-github: #edf0e7;
  --card-bilibili: #eeedf5;
  --card-voicebank: #f5ebe7;
  --card-tool: #e9eff4;
  --card-icon: #ffffffa6;
  --panel: #fffffff5;
  --note: #f0f0e9;
  --book-cover: #c7c1db;
  --book-pages: #faf9ff;
  --book-lines: #aaa1c3;
  --focus: #697e56;
  --shadow: 0 8px 32px #303a3210;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #191c22;
  --ink: #e7e8e1;
  --muted: #afb4b5;
  --subtle: #a0a8ac;
  --line: #333943;
  --accent: #b5c69f;
  --accent-ink: #b5c69f;
  --purple: #b5abd9;
  --button: #c5d1b8;
  --button-ink: #20271e;
  --card-blog: #302d40;
  --card-github: #29382f;
  --card-bilibili: #302d40;
  --card-voicebank: #3c3035;
  --card-tool: #293440;
  --card-icon: #ffffff0d;
  --panel: #252a33;
  --note: #232a2a;
  --book-cover: #655776;
  --book-pages: #ab9abd;
  --book-lines: #766186;
  --focus: #c6d8ac;
  --shadow: 0 8px 32px #0003;
}

/* 使用系统中英文字体栈，离线可用，无第三方字体阻塞首屏。 */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 30px; scrollbar-gutter: stable; }
body { margin: 0; background: var(--page); color: var(--ink); font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 14px; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { color: inherit; cursor: pointer; }
button, a { -webkit-tap-highlight-color: transparent; }
button { border: 0; }
button:disabled { cursor: wait; }
img, svg { display: block; }
button, a, input { outline-offset: 6px; }
:focus-visible { outline: 2px solid var(--focus); }
::selection { background: #c8c5e7; color: #262731; }
.icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.svg-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.page-shell { width: min(1160px, calc(100% - 112px)); margin: auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.skip-link { position: fixed; top: 12px; left: 16px; padding: 12px 20px; border-radius: 8px; background: var(--button); color: var(--button-ink); z-index: 20; transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }

/* 顶部导航保持轻盈，当前项用短线说明状态，不依赖颜色。 */
.site-header { height: 116px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 21px; font-weight: 700; letter-spacing: 1px; white-space: nowrap; }
.main-nav { display: flex; align-items: center; gap: 33px; }
.nav-link { position: relative; background: none; padding: 13px 2px; color: var(--muted); font-size: 13px; transition: color .2s; }
.nav-link:hover, .nav-link.current { color: var(--ink); }
.nav-link.current::after { content: ""; width: 15px; height: 3px; border-radius: 3px; background: var(--accent); position: absolute; bottom: 4px; left: calc(50% - 7.5px); }
.header-actions { display: flex; align-items: center; gap: 21px; }
.header-note { font-size: 11px; color: var(--subtle); letter-spacing: .5px; }
.icon-button { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 50%; background: transparent; transition: background .2s, transform .2s; }
.icon-button:hover { background: var(--note); transform: rotate(-9deg); }
.icon-button .icon { width: 18px; height: 18px; }
.theme-sun, [data-theme="dark"] .theme-moon { display: none; }
[data-theme="dark"] .theme-sun { display: block; }

/* 首屏采用文字与风景并列；标题下的手绘笔触是可缩放矢量。 */
.hero { display: grid; grid-template-columns: 1fr 1.12fr; align-items: center; gap: 34px; padding: 32px 0 58px; min-height: 500px; }
.hero-copy { position: relative; padding-bottom: 4px; }
.eyebrow { margin: 0; color: var(--muted); font-family: "Segoe UI", sans-serif; font-size: 9px; font-weight: 600; letter-spacing: 2.15px; line-height: 1.8; }
h1 { font-size: clamp(38px, 4.1vw, 57px); letter-spacing: -1.7px; line-height: 1.48; margin: 0 0 22px; font-weight: 650; }
.hello-wave { color: var(--purple); font-size: 42px; display: inline-block; margin-left: 19px; vertical-align: 2px; font-weight: 400; animation: wave-in 1.1s ease-out both; }
.name-mark { position: relative; color: var(--accent); white-space: nowrap; }
.name-underline { position: absolute; width: calc(100% + 12px); height: 14px; left: -4px; bottom: -12px; fill: none; stroke: var(--purple); stroke-width: 2; stroke-linecap: round; opacity: .7; }
.hero-description { font-size: 14px; line-height: 2.15; color: var(--muted); letter-spacing: .65px; margin: 25px 0 25px; }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 20px; min-height: 47px; border-radius: 8px; padding: 0 21px; font-size: 12px; font-weight: 500; letter-spacing: .4px; transition: transform .2s, box-shadow .2s, background .2s; }
.button .icon { width: 17px; height: 17px; }
.button-primary { background: var(--button); color: var(--button-ink); }
.button-primary:hover { transform: translateY(-3px); box-shadow: 0 5px 15px #28312620; }
.hero-art { position: relative; margin-right: 17px; margin-left: 2px; }
.art-frame { height: 400px; position: relative; overflow: hidden; border-radius: 110px 14px 14px 14px; background: #b4cbd8; isolation: isolate; }
.art-frame::after { content: ""; position: absolute; inset: 50% 0 0; background: linear-gradient(transparent, #203c475c); pointer-events: none; }
.landscape { width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; transition: transform 1s ease; }
.hero-art:hover .landscape { transform: scale(1.035); }
.art-caption { position: absolute; left: 26px; bottom: 23px; color: #fff; font-size: 8px; letter-spacing: 1.9px; z-index: 1; }
.art-index { position: absolute; top: 17px; left: 22px; font-size: 9px; letter-spacing: 1px; color: #fff; }
.profile-tag { position: absolute; left: -23px; bottom: -21px; min-width: 284px; display: flex; align-items: center; padding: 12px 0 12px 12px; border: 1px solid var(--line); background: var(--panel); border-radius: 12px; box-shadow: var(--shadow); transform: rotate(-3deg); }
.profile-tag > img { width: 46px; height: 46px; margin-right: 12px; border-radius: 50%; object-fit: cover; }
.profile-tag > div { flex-shrink: 0; }
.profile-name { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 7px; margin-bottom: 5px; }
.profile-handle { font-size: 9px; color: var(--muted); letter-spacing: .25px; }
/* 问候语平分昵称信息末尾到右边框的剩余空间，避免依赖固定外边距定位。 */
.profile-greeting { flex: 1; color: var(--accent-ink); font-size: 10px; text-align: center; white-space: nowrap; }

/* 所有入口共用网格与卡片尺寸；中屏两列、手机单列，博客按顺序排在末尾。 */
.destinations { --card-columns: 4; --card-gap: 17px; --card-height: 218px; padding: 20px 0 0; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 25px; }
.section-eyebrow { color: var(--accent-ink); font-size: 9px; letter-spacing: 2px; margin-bottom: 5px; }
h2 { font-size: 24px; font-weight: 600; letter-spacing: .7px; line-height: 1.5; margin: 0; }
.destination-grid { display: grid; grid-template-columns: repeat(var(--card-columns), minmax(0, 1fr)); gap: var(--card-gap); }
.destination-card { position: relative; min-width: 0; min-height: var(--card-height); padding: 24px; border-radius: 12px; overflow: hidden; isolation: isolate; border: 1px solid transparent; transition: transform .25s, box-shadow .25s, border-color .25s; }
.destination-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: var(--line); }
.card-github { background: var(--card-github); }
.card-blog { background: var(--card-blog); }
.card-bilibili { background: var(--card-bilibili); }
.card-voicebank { background: var(--card-voicebank); }
.card-tool { background: var(--card-tool); }
.card-top { display: flex; align-items: center; gap: 10px; }
.card-icon { display: flex; align-items: center; justify-content: center; height: 34px; width: 34px; border-radius: 9px; background: var(--card-icon); }
.card-icon .icon { width: 19px; height: 19px; }
.card-category { color: var(--muted); font-size: 8px; letter-spacing: 1px; font-weight: 500; }
.card-arrow { margin-left: auto; width: 15px; height: 15px; color: var(--muted); transition: transform .25s; }
.destination-card:hover .card-arrow { transform: translate(2px, -2px); }
.card-content { position: relative; z-index: 1; }
.card-content h3 { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 10px; font-size: 18px; line-height: 1.5; font-weight: 600; margin: 23px 0 7px; letter-spacing: .4px; }
.card-content h3 > span { color: var(--muted); font-size: 8px; font-weight: 500; letter-spacing: 1px; padding-top: 4px; }
.card-content p { margin: 0; color: var(--muted); font-size: 12px; letter-spacing: .2px; line-height: 1.9; }
.card-domain { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 10px; letter-spacing: .2px; margin-top: 23px; }
.card-domain .icon { width: 14px; height: 14px; }
.book-art { position: absolute; right: -16px; bottom: -6px; width: 140px; height: 118px; transform: rotate(-10deg); opacity: .62; pointer-events: none; z-index: -1; }
.code-decoration { position: absolute; right: -6px; bottom: 17px; width: 112px; height: 100px; fill: none; stroke: var(--accent); stroke-width: .8; stroke-linecap: round; stroke-linejoin: round; opacity: .12; transform: rotate(-12deg); pointer-events: none; z-index: -1; }
.bilibili-decoration, .resource-decoration { position: absolute; right: -11px; bottom: 7px; width: 108px; height: 108px; fill: none; stroke: var(--purple); stroke-width: .8; stroke-linecap: round; stroke-linejoin: round; opacity: .23; transform: rotate(10deg); pointer-events: none; z-index: -1; }
.card-voicebank .resource-decoration { stroke: #bf958e; right: 0; }
.card-tool .resource-decoration { stroke: #849bb3; }
/* 友链复用现有主题变量，整张链接保留足够的点击范围和清晰的键盘焦点。 */
.friends { padding: 44px 0 28px; border-bottom: 1px solid var(--line); }
.friends .section-heading { margin-bottom: 17px; }
.friends-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 13px; }
.friend-link { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-width: 0; min-height: 64px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 10px; background: var(--note); color: var(--ink); font-size: 13px; transition: border-color .2s, background .2s; }
.friend-link:hover { border-color: var(--accent); background: var(--card-github); }
.friend-link .icon { width: 17px; height: 17px; color: var(--muted); }
.site-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 29px 0 25px; font-size: 9px; color: var(--subtle); letter-spacing: .3px; }
.footer-info { display: flex; flex-direction: column; gap: 8px; min-width: 0; line-height: 1.9; }
.footer-icp { margin: 0; font-size: 10px; overflow-wrap: anywhere; }
.footer-icp a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.back-to-top { display: flex; align-items: center; gap: 7px; min-height: 32px; }
.back-to-top .icon { width: 13px; height: 13px; transform: rotate(-90deg); }
.back-to-top:hover { color: var(--ink); }

.noscript-note { margin: 12px auto 24px; text-align: center; color: var(--muted); font-size: 12px; }
@keyframes wave-in { from { transform: rotate(-60deg); opacity: 0; } to { transform: rotate(0); opacity: 1; } }

/* 平板保留并列首屏；缩短导航文案与装饰，优先保留正文空间。 */
@media (min-width: 1440px) { .site-header { height: 125px; } .hero { padding-top: 42px; padding-bottom: 67px; } .art-frame { height: 420px; } }
@media (max-width: 1100px) {
  .page-shell { width: calc(100% - 80px); }
  .header-note { display: none; }
  .main-nav { margin-left: 0; }
  .hero { gap: 22px; }
  .art-frame { height: 367px; border-top-left-radius: 88px; }
  .eyebrow { font-size: 8px; letter-spacing: 1.3px; }
  .hello-wave { font-size: 34px; }
  .destination-card { padding: 21px 19px; }
  .card-category { font-size: 7px; letter-spacing: .4px; }
  .card-content h3 { font-size: 18px; }
  .card-content h3 > span { display: none; }
  .destinations { --card-columns: 2; }
}

/* 手机采用单列主视觉、完整宽度导航卡片，触控目标不少于 40px。 */
@media (max-width: 760px) {
  .page-shell { width: calc(100% - 48px); max-width: 560px; }
  .site-header { height: 88px; gap: 12px; }
  .brand { font-size: 18px; gap: 7px; }
  .main-nav { margin-left: auto; gap: 15px; }
  .nav-link { font-size: 11px; padding-inline: 0; }
  .main-nav > a:first-child { display: none; }
  .header-actions { gap: 0; }
  .theme-toggle { width: 34px; height: 34px; }
  .theme-toggle .icon { width: 16px; height: 16px; }
  .hero { grid-template-columns: 1fr; gap: 41px; padding: 25px 0 55px; }
  h1 { font-size: clamp(38px, 8vw, 49px); line-height: 1.46; margin: 0 0 24px; letter-spacing: -1px; }
  .hello-wave { font-size: 35px; vertical-align: 1px; margin-left: 15px; }
  .hero-description { font-size: 12px; line-height: 2; margin: 26px 0 24px; }
  .hero-actions { gap: 11px; }
  .button { min-height: 46px; }
  .hero-art { margin-left: 12px; margin-right: 15px; }
  .art-frame { height: auto; aspect-ratio: 1.37; border-top-left-radius: 75px; }
  .art-caption { font-size: 6px; letter-spacing: 1.25px; bottom: 23px; left: 20px; }
  .profile-tag { left: -12px; min-width: 266px; padding: 10px 0 10px 10px; bottom: -22px; }
  .profile-tag > img { height: 41px; width: 41px; margin-right: 10px; }
  .destinations { --card-columns: 1; --card-gap: 13px; --card-height: 191px; padding-top: 18px; }
  .section-heading { margin-bottom: 20px; }
  h2 { font-size: 22px; }
  .destination-card { padding: 21px 23px; }
  .card-content h3 { font-size: 21px; margin-top: 17px; margin-bottom: 4px; }
  .card-content h3 > span { display: inline; }
  .card-content p { font-size: 11px; }
  .card-category { font-size: 8px; letter-spacing: 1px; }
  .card-domain { margin-top: 17px; }
  .book-art { width: 165px; height: 140px; right: -6px; }
  .code-decoration { width: 128px; height: 112px; right: 15px; bottom: 5px; }
  .bilibili-decoration, .resource-decoration { width: 125px; height: 125px; right: 5px; bottom: 8px; }
  .friends { padding-top: 32px; }
  .site-footer { align-items: flex-start; flex-wrap: wrap; padding: 25px 0; font-size: 8px; gap: 12px; line-height: 2; }
  .footer-info { flex: 1 1 250px; }
  .back-to-top { white-space: nowrap; }
}
@media (max-width: 370px) {
  .page-shell { width: calc(100% - 36px); }
  .brand { font-size: 16px; }
  .main-nav { gap: 12px; }
  .site-header { gap: 9px; }
  h1 { font-size: 36px; }
  .button { font-size: 11px; padding-inline: 17px; gap: 13px; }
  .profile-tag { min-width: 247px; }
}

/* 尊重系统减少动态的选择，移除滚动、首屏旋转和悬停位移。 */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .destination-grid > .destination-card:hover, .button-primary:hover, .hero-art:hover .landscape { transform: none; }
}
