/* ==========================================================================
   小熊的个人空间 · Personal Hub — 设计系统
   依据需求文档 §11：
   - 总体：Minimal · Clean · Warm · Modern · Personal · Functional
   - Work Mode：Black/White/Grey、Grid、Data、Structured、Industrial
   - Life Mode：Warm Beige、Soft UI、Photos、Personal、Playful
   - Color Theme 独立于 Work/Life：System / Light / Dark
   ========================================================================== */

:root {
  /* —— 语义色板（Work Mode 默认，黑白灰）—— */
  --bg: #fafafa;
  --bg-soft: #f4f4f4;
  --surface: #ffffff;
  --ink: #1f1f1f;
  --ink-soft: #555555;
  --ink-faint: #8a8a8a;
  --line: #dedede;
  --line-strong: #bdbdbd;
  --accent: #1f1f1f;
  --accent-ink: #ffffff;
  --warn: #8a6b18;
  --warn-bg: #fff9e8;
  --danger: #8c2525;
  --danger-bg: #fbefef;
  --ok: #35663d;

  /* Life Mode 暖色覆写（由 .mode-life 触发） */
  --life-bg: #f7f1e8;
  --life-bg-soft: #f2ebdf;
  --life-surface: #fffdf8;
  --life-ink: #3a322a;
  --life-ink-soft: #6b5e50;
  --life-line: #e6dccb;
  --life-accent: #7a5c3e;
  --life-accent-ink: #ffffff;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.08);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue",
          "Segoe UI", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --maxw: 1120px;
}

/* —— Color Theme: Dark —— */
html[data-theme="dark"] {
  --bg: #16161a;
  --bg-soft: #1e1e23;
  --surface: #232329;
  --ink: #ededf0;
  --ink-soft: #b9b9c0;
  --ink-faint: #85858d;
  --line: #33333a;
  --line-strong: #47474f;
  --accent: #ededf0;
  --accent-ink: #16161a;
  --warn: #e0b64f;
  --warn-bg: #2b2415;
  --danger: #e07a7a;
  --danger-bg: #2b1a1a;
  --ok: #7fb98a;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* —— Life Mode 覆写（叠加在主题之上）—— */
body.mode-life {
  --bg: var(--life-bg);
  --bg-soft: var(--life-bg-soft);
  --surface: var(--life-surface);
  --ink: var(--life-ink);
  --ink-soft: var(--life-ink-soft);
  --line: var(--life-line);
  --line-strong: #d5c8b4;
  --accent: var(--life-accent);
  --accent-ink: var(--life-accent-ink);
  --radius: 14px;
}

html[data-theme="dark"] body.mode-life {
  --bg: #201a15;
  --bg-soft: #282119;
  --surface: #2c241d;
  --ink: #f0e7dc;
  --ink-soft: #c9bca9;
  --line: #40362b;
  --line-strong: #5a4d3e;
  --accent: #d9bc94;
  --accent-ink: #201a15;
}

/* —— Reset —— */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3 { line-height: 1.2; margin: 0; font-weight: 700; }
a { color: inherit; }
img { max-width: 100%; height: auto; }

/* —— 无障碍工具类 —— */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: var(--accent-ink); padding: 10px 16px;
  border-radius: 0 0 var(--radius-sm) 0; text-decoration: none; font-weight: 600;
}
.skip:focus { left: 0; }

/* —— 布局 —— */
.site { display: flex; flex-direction: column; min-height: 100vh; }
.main { flex: 1; }
.main:focus { outline: none; }
.section__inner, .page-head, .hero__inner, .masthead__inner, .footer__inner {
  max-width: var(--maxw); margin: 0 auto; padding-left: 24px; padding-right: 24px;
}

/* ==========================================================================
   Masthead / 导航
   ========================================================================== */
.masthead {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.masthead__inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 60px; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 700; }
.brand__mark { font-size: 22px; line-height: 1; }
.brand__name { font-size: 16px; letter-spacing: 0.2px; }
.brand__dot { color: var(--ink-faint); font-weight: 500; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  padding: 7px 12px; border-radius: var(--radius-sm); text-decoration: none;
  color: var(--ink-soft); font-size: 14px; font-weight: 500;
}
.nav a:hover { background: var(--bg-soft); color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); font-weight: 700; }
.theme-toggle {
  margin-left: 8px; padding: 7px 12px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink-soft); border-radius: var(--radius-sm);
  font: 500 13px var(--font); cursor: pointer;
}
.theme-toggle:hover { background: var(--bg-soft); color: var(--ink); }
.hamburger {
  display: none; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  width: 44px; height: 44px; padding: 0;
  background: none; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  cursor: pointer;
}
.hamburger span { display: block; width: 20px; height: 2px; background: var(--ink); }
.mobile-menu { border-bottom: 1px solid var(--line); background: var(--surface); }
.mobile-menu__nav {
  display: flex; flex-direction: column; padding: 12px 24px 20px;
}
.mobile-menu__nav a {
  padding: 12px 4px; text-decoration: none; color: var(--ink-soft);
  border-bottom: 1px solid var(--line); font-size: 16px;
}
.mobile-menu__nav .theme-toggle { margin: 12px 0 0; align-self: flex-start; }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero { padding: 72px 0 48px; }
.hero__inner { max-width: 760px; }
.hero__eyebrow {
  font-size: 13px; letter-spacing: 3px; text-transform: uppercase;
  color: var(--ink-faint); margin: 0 0 16px; font-weight: 600;
}
.hero__title {
  font-size: clamp(40px, 7vw, 64px); letter-spacing: -0.5px; margin: 0 0 20px;
  font-weight: 800;
}
.hero__intro { font-size: 18px; line-height: 1.7; color: var(--ink-soft); margin: 0; max-width: 680px; }

/* ==========================================================================
   核心入口卡（四张，视觉最突出）
   ========================================================================== */
.entrances { padding: 24px 0 48px; }
.entrances__grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
  max-width: var(--maxw); margin: 0 auto; padding: 0 24px;
}
.entrance-card {
  display: flex; flex-direction: column; gap: 12px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px 20px;
  text-decoration: none; color: inherit;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.entrance-card:hover, .entrance-card:focus-visible {
  transform: translateY(-2px); box-shadow: var(--shadow-lg);
  border-color: var(--line-strong); outline: none;
}
.entrance-card__emoji { font-size: 32px; line-height: 1; }
.entrance-card__body { display: flex; flex-direction: column; gap: 6px; }
.entrance-card__label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.5px;
  text-transform: uppercase; color: var(--ink-faint);
}
.entrance-card--warehouse .entrance-card__label { color: var(--accent); }
.entrance-card--visa .entrance-card__label { color: var(--danger); }
.entrance-card__title { font-size: 19px; font-weight: 700; }
.entrance-card__copy { font-size: 14px; color: var(--ink-soft); line-height: 1.5; }
.entrance-card__cta {
  margin-top: auto; padding-top: 8px; font-size: 14px; font-weight: 600;
  color: var(--accent);
}
body.mode-life .entrance-card__cta { color: var(--life-accent); }

/* ==========================================================================
   通用 Section
   ========================================================================== */
.section { padding: 48px 0; }
.section__title { font-size: 26px; margin-bottom: 20px; letter-spacing: -0.3px; }
.section__empty { color: var(--ink-faint); }
.more-link { display: inline-block; margin-top: 20px; font-weight: 600; color: var(--accent); text-decoration: none; }
.more-link:hover { text-decoration: underline; }

/* ==========================================================================
   Projects
   ========================================================================== */
.project-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.project-list--full { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.project-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
}
.project-card__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.project-card__head h3 { font-size: 17px; }
.project-card__summary { font-size: 14px; color: var(--ink-soft); margin: 0 0 14px; line-height: 1.55; }
.project-card__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-family: var(--mono); font-size: 11px; padding: 3px 8px;
  background: var(--bg-soft); color: var(--ink-soft); border-radius: 4px;
}
.status-pill { font-family: var(--mono); font-size: 11px; padding: 3px 9px; border-radius: 20px; font-weight: 600; }
.status-pill--active { background: var(--ok); color: #fff; }
.status-pill--building { background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn); }

/* ==========================================================================
   Life 预览 / 链接
   ========================================================================== */
.life-preview__links { display: flex; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.life-link {
  display: inline-block; padding: 12px 18px; border: 1px solid var(--line);
  border-radius: var(--radius); text-decoration: none; font-weight: 600;
  background: var(--surface); box-shadow: var(--shadow);
}
.life-link:hover { border-color: var(--line-strong); transform: translateY(-1px); }

/* ==========================================================================
   Family / Dogs（Life Mode）
   ========================================================================== */
.page-head { padding: 64px 0 8px; }
.page-head__title { font-size: clamp(32px, 5vw, 46px); letter-spacing: -0.5px; font-weight: 800; }
.page-head__lede { font-size: 17px; color: var(--ink-soft); margin-top: 12px; }

/* —— 合并后狗狗页面 —— */
.dog-single-grid { display: flex; flex-direction: column; gap: 24px; }
.dog-profile {
  display: flex; align-items: flex-start; gap: 18px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px;
  box-shadow: var(--shadow);
}
.dog-profile__emoji { font-size: 56px; line-height: 1; flex-shrink: 0; }
.dog-profile__body { flex: 1; min-width: 0; }
.dog-profile__name { font-size: 24px; margin-bottom: 6px; }
.dog-profile__short { color: var(--ink-soft); margin: 0 0 14px; }
.coming-soon--inline { margin-top: 0; text-align: left; }

/* —— 狗狗照片墙 —— */
.dog-photos-section { background: var(--bg-soft); }
.dog-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  max-width: var(--maxw); margin: 0 auto; padding: 0 24px;
}
.dog-photo {
  display: block; aspect-ratio: 4 / 5; overflow: hidden;
  border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--surface); box-shadow: var(--shadow);
}
.dog-photo img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.2s ease;
}
.dog-photo:hover img, .dog-photo:focus-visible img { transform: scale(1.03); }

@media (max-width: 520px) {
  .dog-profile { flex-direction: column; align-items: flex-start; gap: 12px; }
  .dog-photos { grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 16px; }
}

/* —— Coming Soon（自然空状态，非 Placeholder）—— */
.coming-soon {
  background: var(--bg-soft); border: 1px dashed var(--line-strong);
  border-radius: var(--radius); padding: 28px; text-align: center;
}
.coming-soon__text { color: var(--ink-soft); margin: 0; }
.back-link { margin-top: 24px; }
.back-link a { color: var(--accent); text-decoration: none; font-weight: 600; }
.back-link a:hover { text-decoration: underline; }

/* ==========================================================================
   About 正文
   ========================================================================== */
.about-layout {
  display: flex; align-items: flex-start; gap: 40px;
  max-width: 880px; margin: 0 auto; padding: 0 24px;
}
.about-portrait {
  flex-shrink: 0; margin: 0;
}
.about-portrait img {
  display: block; width: 220px; height: auto; border-radius: var(--radius);
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.about-layout--photo {
  justify-content: center;
}
.about-layout--photo .about-portrait img {
  width: 360px; border-radius: var(--radius); 
}
.about-body { flex: 1; min-width: 0; max-width: 640px; }
.about-body p { font-size: 17px; line-height: 1.8; color: var(--ink-soft); margin: 0 0 16px; }
.about-body p:first-child { color: var(--ink); font-size: 18px; }

@media (max-width: 620px) {
  .about-layout { flex-direction: column; gap: 20px; }
  .about-portrait img { width: 160px; margin: 0 auto; }
  .about-layout--photo .about-portrait img { width: 280px; }
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer { border-top: 1px solid var(--line); padding: 32px 0; margin-top: 40px; }
.footer__inner { text-align: center; }
.footer p { margin: 0 0 4px; font-size: 14px; }
.footer__muted { color: var(--ink-faint); font-size: 13px; }

/* ==========================================================================
   响应式
   ========================================================================== */
@media (max-width: 900px) {
  .entrances__grid { grid-template-columns: repeat(2, 1fr); }
  .project-list { grid-template-columns: repeat(2, 1fr); }
  .dog-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .nav { display: none; }
  .hamburger { display: flex; }
  .entrances__grid { grid-template-columns: 1fr; }
  .project-list { grid-template-columns: 1fr; }
  .dog-grid { grid-template-columns: 1fr; }
  .hero { padding: 48px 0 32px; }
  .section { padding: 32px 0; }
}

/* ==========================================================================
   动效 / 无障碍
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
  .entrance-card:hover, .dog-card:hover { transform: none; }
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
