/* ==========================================================================
   风车 Frank 个人网站 · 羊毛毡手作 × 苹果全液态玻璃 宽屏多页样式表
   ========================================================================== */
@view-transition {
  navigation: auto;
}

:root {
  --felt-bg: #f3eada;
  --felt-bg-deep: #e8dcc8;
  --felt-indigo: #1e3a8a;
  --felt-indigo-light: #2b4fb5;
  --felt-amber: #f59e0b;
  --felt-amber-soft: #fcd34d;
  --felt-brick: #b91c1c;
  --felt-sage: #5b7c68;
  --ink: #162032;
  --ink-soft: #475569;
  --glass-bg: linear-gradient(145deg, rgba(255, 255, 255, 0.7), rgba(255, 251, 243, 0.46));
  --glass-border: rgba(255, 255, 255, 0.86);
  --glass-shadow: 0 22px 54px rgba(30, 58, 138, 0.09), 0 4px 16px rgba(22, 32, 50, 0.05);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --max-w: 1400px;
}

/* 暖夜台灯模式（点击 3D 台灯或灵动岛按钮丝滑切换） */
body.is-night {
  --felt-bg: #221d1a;
  --felt-bg-deep: #181412;
  --ink: #f8f1e4;
  --ink-soft: #cbbba6;
  --glass-bg: linear-gradient(145deg, rgba(58, 48, 42, 0.68), rgba(36, 30, 26, 0.52));
  --glass-border: rgba(255, 224, 178, 0.28);
  --glass-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), 0 4px 18px rgba(0, 0, 0, 0.25);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background-color: var(--felt-bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.65;
  transition: background-color 0.55s ease, color 0.4s ease;
}

/* 羊毛毡短绒纤维质感 + 棚拍顶光 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.36;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.48'/%3E%3C/svg%3E");
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(circle at 50% 10%, rgba(255, 250, 238, 0.42), transparent 60%),
              radial-gradient(circle at 50% 100%, rgba(160, 134, 102, 0.18), transparent 55%);
  transition: opacity 0.5s ease;
}
body.is-night::after {
  background: radial-gradient(circle at 68% 35%, rgba(245, 158, 11, 0.16), transparent 52%),
              radial-gradient(circle at 20% 85%, rgba(30, 58, 138, 0.22), transparent 55%);
}

/* 背景边缘大块缝线羊毛毡（延展至屏幕边缘，消除宽屏留白感） */
.felt-backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}
.felt-patch-bg {
  position: absolute;
  border-radius: 44px;
  box-shadow: 0 22px 48px rgba(22, 32, 50, 0.15), inset 0 2px 10px rgba(255, 255, 255, 0.25);
  transition: opacity 0.5s ease;
}
.felt-patch-bg::after {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 34px;
  border: 2px dashed rgba(255, 255, 255, 0.48);
}
.fp-1 { width: 320px; height: 260px; top: -40px; left: -50px; background: linear-gradient(145deg, #fbbf24, #d97706); transform: rotate(-10deg); }
.fp-2 { width: 340px; height: 260px; top: -50px; right: -40px; background: linear-gradient(145deg, #25469b, #172d6e); transform: rotate(9deg); }
.fp-3 { width: 280px; height: 280px; border-radius: 50%; bottom: -70px; left: -60px; background: linear-gradient(145deg, #dc2626, #991b1b); }
.fp-3::after { border-radius: 50%; }
.fp-4 { width: 300px; height: 220px; bottom: -40px; right: -50px; background: linear-gradient(145deg, #6b8e78, #4b6a57); transform: rotate(-8deg); }
body.is-night .felt-patch-bg { opacity: 0.55; }

/* ================= 顶部：全液态玻璃「灵动岛」 ================= */
.island-wrap {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  width: max-content;
  max-width: calc(100vw - 24px);
  view-transition-name: liquid-island;
}

.liquid-island {
  position: relative;
  border-radius: 999px;
  background: var(--glass-bg);
  backdrop-filter: blur(28px) saturate(195%);
  -webkit-backdrop-filter: blur(28px) saturate(195%);
  border: 1px solid var(--glass-border);
  box-shadow:
    0 14px 38px rgba(30, 58, 138, 0.12),
    0 2px 8px rgba(22, 32, 50, 0.05),
    inset 0 1.5px 0 rgba(255, 255, 255, 0.92);
  padding: 7px 11px;
  transition: border-radius 0.42s var(--spring), padding 0.42s var(--spring), box-shadow 0.3s ease;
  overflow: hidden;
}
.liquid-island::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: linear-gradient(120deg,
    rgba(255, 255, 255, 0.95),
    rgba(251, 191, 36, 0.35),
    rgba(96, 165, 250, 0.35),
    rgba(244, 114, 182, 0.22),
    rgba(255, 255, 255, 0.9));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.island-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.island-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 8px rgba(30, 58, 138, 0.16);
  cursor: pointer;
  flex-shrink: 0;
  background: #fcd34d;
  transition: transform 0.65s var(--spring);
}
.island-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.island-avatar.is-spin { transform: rotate(720deg) scale(1.1); }

.island-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 99px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  background: rgba(255, 255, 255, 0.45);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.25s var(--spring), background 0.2s ease;
  white-space: nowrap;
}
body.is-night .island-pill-btn { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 224, 178, 0.25); }
.island-pill-btn:hover { background: rgba(255, 255, 255, 0.82); transform: translateY(-1px); }
body.is-night .island-pill-btn:hover { background: rgba(255, 255, 255, 0.18); }

.dot-live {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.22);
  animation: breathe 2.2s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.22); }
  50% { box-shadow: 0 0 0 6px rgba(22, 163, 74, 0.04); }
}

.island-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 2px;
}
.island-nav a {
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 99px;
  transition: all 0.25s var(--spring);
  white-space: nowrap;
}
.island-nav a:hover { color: var(--ink); background: rgba(255, 255, 255, 0.45); }
.island-nav a.is-active {
  color: var(--felt-indigo);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 3px 10px rgba(30, 58, 138, 0.12), inset 0 1px 0 #fff;
}
body.is-night .island-nav a.is-active {
  color: #1c1714;
  background: #fcd34d;
}

.island-tools {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-left: 4px;
  border-left: 1px dashed rgba(30, 58, 138, 0.18);
}
.icon-mini {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.65);
  background: rgba(255, 255, 255, 0.42);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
  transition: transform 0.25s var(--spring), background 0.2s;
}
body.is-night .icon-mini { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 224, 178, 0.22); }
.icon-mini:hover { transform: scale(1.08); background: rgba(255, 255, 255, 0.85); }

/* 灵动岛展开抽屉 */
.island-drawer {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.48s var(--spring), opacity 0.28s ease, padding 0.35s ease;
}
.liquid-island.is-expanded { border-radius: 28px; padding: 10px 14px 14px; }
.liquid-island.is-expanded .island-drawer { max-height: 220px; opacity: 1; padding-top: 12px; }
.drawer-inner {
  border-top: 1px dashed rgba(30, 58, 138, 0.18);
  padding-top: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
}

/* ================= 宽屏主容器 ================= */
.page-container {
  position: relative;
  z-index: 5;
  width: min(var(--max-w), calc(100vw - 48px));
  margin: 0 auto;
  padding: 96px 0 56px;
}

/* 通用液态玻璃面板 */
.glass-panel {
  position: relative;
  border-radius: 28px;
  background: var(--glass-bg);
  backdrop-filter: blur(26px) saturate(185%);
  -webkit-backdrop-filter: blur(26px) saturate(185%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow), inset 0 1.5px 0 rgba(255, 255, 255, 0.88);
  overflow: hidden;
  transition: transform 0.35s var(--spring), box-shadow 0.35s ease;
}
body.is-night .glass-panel { box-shadow: var(--glass-shadow), inset 0 1px 0 rgba(255, 232, 196, 0.22); }

.glass-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 255, 255, 0.48), transparent 56%);
  opacity: 0;
  transition: opacity 0.28s ease;
  pointer-events: none;
}
body.is-night .glass-panel::after {
  background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 0%), rgba(252, 211, 77, 0.16), transparent 56%);
}
.glass-panel:hover::after { opacity: 1; }

/* 手作毛毡缝线徽章 */
.felt-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 13px;
  font-size: 12px;
  font-weight: 700;
  position: relative;
  box-shadow: 0 6px 16px rgba(22, 32, 50, 0.16);
}
.felt-badge::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 10px;
  border: 1.2px dashed rgba(255, 255, 255, 0.65);
  pointer-events: none;
}
.fb-brick { background: var(--felt-brick); color: #fff8f0; }
.fb-indigo { background: var(--felt-indigo); color: #fff; }
.fb-amber { background: linear-gradient(135deg, #fbbf24, #d97706); color: #fffdf8; }
.fb-sage { background: var(--felt-sage); color: #fff; }

/* 圆形毛毡缝线图标 */
.felt-icon-circle {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
  color: #fff;
  position: relative;
  box-shadow: 0 8px 18px rgba(22, 32, 50, 0.18);
  flex-shrink: 0;
}
.felt-icon-circle::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 1.4px dashed rgba(255, 255, 255, 0.68);
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 22px;
  border-radius: 99px;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.85);
  transition: transform 0.25s var(--spring), box-shadow 0.25s ease, background 0.2s;
}
.btn:active { transform: scale(0.96); }
.btn-primary {
  background: var(--felt-indigo);
  color: #fff;
  box-shadow: 0 8px 20px rgba(30, 58, 138, 0.25);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(30, 58, 138, 0.34); }
body.is-night .btn-primary { background: #f59e0b; color: #1c1714; border-color: #fde68a; }
.btn-glass {
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink);
  backdrop-filter: blur(12px);
}
body.is-night .btn-glass { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 224, 178, 0.25); }
.btn-glass:hover { transform: translateY(-2px); background: rgba(255, 255, 255, 0.92); }
body.is-night .btn-glass:hover { background: rgba(255, 255, 255, 0.22); }

/* 页面通用头部 */
.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 26px;
}
.page-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.page-title { font-size: 32px; font-weight: 800; letter-spacing: 0.4px; }
.page-sub { font-size: 14px; color: var(--ink-soft); margin-top: 6px; max-width: 660px; }

/* 玻璃筛选胶囊条 */
.glass-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 5px;
  border-radius: 99px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 22px rgba(30, 58, 138, 0.08);
}
.glass-tab {
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 99px;
  cursor: pointer;
  transition: all 0.26s var(--spring);
}
.glass-tab.is-active {
  background: rgba(255, 255, 255, 0.92);
  color: var(--felt-indigo);
  box-shadow: 0 3px 10px rgba(30, 58, 138, 0.12);
}
body.is-night .glass-tab.is-active { background: #fcd34d; color: #1c1714; }

/* 标签胶囊 */
.tag-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.9);
  color: var(--ink);
}
body.is-night .tag-pill { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 224, 178, 0.22); }

/* 弹窗 / 灯箱 */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.56);
  backdrop-filter: blur(10px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-overlay.is-open { display: flex; }
.modal-card {
  width: min(680px, 100%);
  padding: 28px;
  border-radius: 28px;
  background: rgba(255, 252, 246, 0.92);
  color: #162032;
  border: 1px solid #fff;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
  position: relative;
  animation: modalIn 0.34s var(--spring);
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* 底部备案栏 */
.site-footer {
  margin-top: 48px;
  padding: 20px 26px;
  border-radius: 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
  color: var(--ink-soft);
}
.site-footer a { color: var(--ink-soft); text-decoration: none; }
.site-footer a:hover { color: var(--felt-indigo); }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(18px);
  padding: 11px 20px;
  border-radius: 99px;
  background: rgba(255, 253, 248, 0.92);
  backdrop-filter: blur(22px);
  border: 1px solid #fff;
  box-shadow: 0 14px 36px rgba(22, 32, 50, 0.18);
  color: #162032;
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: all 0.34s var(--spring);
  z-index: 300;
}
.toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 移动端适配 */
@media (max-width: 900px) {
  .page-container { width: calc(100vw - 28px); padding-top: 86px; }
  .island-pill-btn span:not(.dot-live) { display: none; }
  .island-nav a { padding: 5px 8px; font-size: 12px; }
  .page-title { font-size: 25px; }
}

/* 无障碍：减弱动态效果 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* 首页 3D 书桌视口 */
.stage-3d-card {
  min-width: 0;
  min-height: 520px;
  isolation: isolate;
  background: radial-gradient(ellipse at 42% 32%, #f3e6d4 0%, #e8d5be 54%, #dac4ae 100%);
}

body.is-night .stage-3d-card {
  background: radial-gradient(ellipse at 70% 37%, #513831 0%, #2b2730 56%, #1d202a 100%);
}

.stage-3d-card::after { display: none; }
.stage-3d-card [hidden] { display: none; }

#desk3dCanvas {
  position: absolute;
  inset: 0;
}

#desk3dCanvas canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}

#desk3dCanvas canvas.is-grabbing { cursor: grabbing !important; }

.desk-glass {
  color: #363348;
  background: rgba(255, 250, 242, 0.63);
  border: 1px solid rgba(255, 255, 255, 0.68);
  box-shadow: 0 6px 20px rgba(50, 32, 28, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.68);
  backdrop-filter: blur(16px) saturate(135%);
  -webkit-backdrop-filter: blur(16px) saturate(135%);
}

body.is-night .desk-glass {
  color: #f5e7d8;
  background: rgba(38, 35, 46, 0.75);
  border-color: rgba(238, 211, 191, 0.28);
  box-shadow: 0 6px 20px rgba(11, 8, 13, 0.25), inset 0 1px 0 rgba(245, 216, 202, 0.16);
}

.desk-hud {
  position: absolute;
  z-index: 3;
  right: 14px;
  bottom: 14px;
  display: flex;
  align-items: center;
  gap: 1px;
  padding: 3px;
  border-radius: 16px;
}

.desk-hud button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 11px;
  color: inherit;
  background: transparent;
  font: 500 21px/1 system-ui, sans-serif;
  cursor: pointer;
}

.desk-hud button:last-child { font-size: 16px; }
.desk-hud button:hover:not(:disabled),
.desk-hud button[aria-pressed="true"] { background: rgba(255, 255, 255, 0.34); }
body.is-night .desk-hud button:hover:not(:disabled),
body.is-night .desk-hud button[aria-pressed="true"] { background: rgba(255, 226, 202, 0.15); }
.desk-hud button:disabled { opacity: 0.36; cursor: default; }

.desk-pin {
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.desk-pin::before,
.desk-pin::after {
  content: "";
  grid-area: 1 / 1;
  border-radius: 50%;
}

.desk-pin::before {
  width: 15px;
  height: 15px;
  border: 1px solid rgba(255, 247, 225, 0.84);
  animation: desk-pin-pulse 2.8s ease-out infinite;
}

.desk-pin::after {
  width: 7px;
  height: 7px;
  background: #fff3df;
  box-shadow: 0 0 0 1px rgba(62, 56, 77, 0.45), 0 1px 5px rgba(36, 29, 42, 0.36);
}

.desk-pin:hover::after,
.desk-pin:focus-visible::after { background: #ffd192; }

.desk-pin:focus-visible,
.desk-hud button:focus-visible {
  outline: 2px solid #6079bc;
  outline-offset: -2px;
}

@keyframes desk-pin-pulse {
  0% { opacity: 0.68; transform: scale(0.58); }
  68%, 100% { opacity: 0; transform: scale(1.4); }
}

.desk-tooltip {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 72px;
  width: max-content;
  max-width: calc(100% - 24px);
  padding: 8px 14px;
  border-radius: 18px;
  font-size: 13px;
  font-weight: 650;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 5px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.desk-tooltip.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.desk-drag-hint {
  position: absolute;
  z-index: 2;
  left: 16px;
  bottom: 30px;
  margin: 0;
  color: #62594f;
  opacity: 0.72;
  font-size: 11px;
  transition: opacity 0.32s ease;
  pointer-events: none;
}

body.is-night .desk-drag-hint { color: #ddc8b9; }
.desk-drag-hint.is-dismissed { opacity: 0; }

.desk-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 24px;
  color: var(--ink-soft);
  text-align: center;
  pointer-events: none;
}

@media (max-width: 680px) {
  .stage-3d-card { min-height: clamp(390px, 80vw, 520px); }
}

@media (max-width: 430px) {
  .desk-drag-hint { left: 12px; bottom: 70px; }
  .desk-tooltip { bottom: 91px; }
  .desk-hud { right: 10px; bottom: 10px; }
}

@media (any-pointer: coarse) {
  .desk-pin { width: 44px; height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .desk-pin::before { animation: none; opacity: 0.35; }
  .desk-tooltip, .desk-drag-hint { transition: none; }
}
