/* =========================================================
   靛纹工坊 · 视觉改版
   白族扎染：靛蓝、棉白、针脚、冰裂纹
   ========================================================= */

:root {
  --navy: #1b264f;
  --navy-deep: #172142;
  --panel: #22305c;
  --panel-2: #263464;
  --control: #2b3d6e;
  --line: rgba(201, 216, 245, .24);
  --line-soft: rgba(201, 216, 245, .14);
  --ink: #f4f1e8;
  --cream: #f4efe3;
  --paper: #f7f3e8;
  --blue: #c9d8f5;
  --muted: #b6c1de;
  --gold: #c9a86a;
  --serif: "PingFang SC", -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Microsoft YaHei", sans-serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color-scheme: dark;
}

html { background: var(--navy); }

body {
  background:
    radial-gradient(ellipse at 50% -12%, #3a4b82 0, transparent 55%),
    radial-gradient(ellipse at 84% 112%, #2b3b6e 0, transparent 45%),
    var(--navy);
  color: var(--ink);
  font-family: var(--sans);
}

/* 织物细纹 */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .5;
  background-image:
    repeating-linear-gradient(0deg, rgba(255,255,255,.025) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, rgba(255,255,255,.018) 0 1px, transparent 1px 5px);
  mix-blend-mode: screen;
}

/* ---------- header ---------- */
.app-header {
  background: linear-gradient(180deg, #243363 0%, #1a254e 100%);
  border-bottom: 1px dashed rgba(201, 216, 245, .28);
  box-shadow: 0 12px 34px #050b1f44;
  padding-top: calc(14px + env(safe-area-inset-top));
  padding-bottom: 14px;
}

.brand strong {
  font-family: var(--serif);
  font-size: 24px;
  letter-spacing: 4px;
  font-weight: 600;
}

.brand small {
  letter-spacing: .18em;
  color: var(--muted);
}

.app-header nav button {
  background: transparent;
  border: 1px solid rgba(201, 216, 245, .26);
  color: var(--ink);
  backdrop-filter: blur(6px);
}

.app-header nav .primary {
  background: var(--cream);
  color: #1b264f;
  border-color: var(--cream);
  box-shadow: 0 6px 18px #050b1f66;
}

/* ---------- 扎染工艺导览条 ---------- */
.craft-hero {
  position: relative;
  overflow: hidden;
  max-width: 1600px;
  margin: 16px auto 0;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  border: 1px solid rgba(201, 216, 245, .2);
  border-radius: 22px;
  background: linear-gradient(110deg, rgba(36, 51, 99, .92), rgba(26, 37, 78, .94));
  box-shadow: 0 18px 44px #050b1f3d, inset 0 1px 0 rgba(255, 255, 255, .05);
}

.craft-hero::before {
  content: "";
  position: absolute;
  inset: -30%;
  pointer-events: none;
  background:
    radial-gradient(circle at 25% 40%, rgba(120, 160, 240, .18), transparent 55%),
    radial-gradient(circle at 80% 70%, rgba(90, 120, 200, .12), transparent 60%);
  animation: indigoWash 16s ease-in-out infinite alternate;
}

.craft-copy {
  position: relative;
  z-index: 1;
  max-width: 660px;
}

.craft-kicker {
  display: block;
  font-size: 10px;
  letter-spacing: .32em;
  color: var(--blue);
  opacity: .78;
}

.craft-copy h1 {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: 5px;
  margin: 6px 0 4px;
  color: var(--cream);
}

.craft-copy p {
  font-size: 12px;
  line-height: 1.7;
  letter-spacing: .08em;
  color: var(--muted);
}

.craft-steps {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.craft-step {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 76px;
}

.craft-step b {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1;
  color: var(--cream);
  font-weight: 600;
}

.craft-step span {
  font-size: 13px;
  letter-spacing: .16em;
  color: var(--ink);
}

.craft-step em {
  font-style: normal;
  font-size: 10px;
  letter-spacing: .2em;
  color: var(--muted);
}

.craft-steps i {
  width: 36px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201, 216, 245, .7), transparent);
  box-shadow: 0 0 6px rgba(201, 216, 245, .35);
}

/* ---------- 工作台面板 ---------- */
main { position: relative; z-index: 1; }

.panel {
  background: linear-gradient(180deg, rgba(40, 55, 112, .96), rgba(29, 41, 86, .98));
  border: 1px solid rgba(201, 216, 245, .22);
  border-radius: 20px;
  box-shadow: 0 22px 50px #050b1f55, inset 0 1px 0 rgba(255, 255, 255, .06);
}

.panel::before {
  inset: 9px;
  border: 1px dashed rgba(201, 216, 245, .2);
  border-radius: 14px;
}

.panel-heading h1,
.panel-heading h2 {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 2px;
}

.panel-heading .step-note {
  font-size: 10px;
  letter-spacing: .12em;
  color: var(--muted);
}

.panel-ornament span {
  width: 60px;
  height: 60px;
  opacity: .5;
}

/* ---------- 纹样库 ---------- */
#search {
  background: #18244a;
  border: 1px dashed rgba(201, 216, 245, .3);
  color: var(--ink);
}

#search::placeholder { color: rgba(182, 193, 222, .6); }

.tabs button {
  border: 1px solid rgba(201, 216, 245, .18);
  background: transparent;
  color: var(--muted);
}

.tabs .on {
  background: var(--cream);
  border-color: var(--cream);
  color: #1b264f;
}

#library { gap: 9px; }

.motif {
  position: relative;
  overflow: hidden;
  padding: 6px;
  background: var(--cream);
  border: 1px solid #ddd5c3;
  border-radius: 13px;
  color: #1b264f;
  transition: transform .25s cubic-bezier(.2, .7, .2, 1), box-shadow .25s, border-color .25s;
}

.motif::after {
  content: "";
  position: absolute;
  inset: -40%;
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s ease;
  background: radial-gradient(circle at 50% 62%, rgba(38, 52, 111, .18), transparent 60%);
}

.motif:hover {
  transform: translateY(-3px) rotate(-.5deg);
  border-color: #c9d8f5;
  box-shadow: 0 12px 26px #050b1f55, 0 0 0 1px rgba(201, 216, 245, .35);
}

.motif:hover::after { opacity: 1; }

.motif img {
  background: var(--paper);
  border-radius: 8px;
}

.motif.just-added { animation: tileBloom .65s ease-out; }

/* ---------- 工具与画布 ---------- */
.tool-buttons button {
  background: rgba(43, 61, 110, .8);
  border: 1px solid rgba(201, 216, 245, .18);
}

.tool-buttons button[aria-pressed=true] {
  background: var(--cream);
  color: #1b264f;
}

.canvas-wrap {
  position: relative;
  background: var(--paper);
  border: 1px solid #c9d8f5;
  border-radius: 16px;
  box-shadow: inset 0 0 0 5px rgba(255, 255, 255, .35), 0 14px 30px #050b1f44;
}

.canvas-wrap::before {
  content: "";
  position: absolute;
  inset: 7px;
  z-index: 1;
  border: 1px dashed rgba(38, 52, 111, .25);
  border-radius: 11px;
  pointer-events: none;
}

.canvas-wrap canvas { position: relative; z-index: 0; }

/* 填色时的靛蓝涟漪 */
.ink-ripple {
  position: absolute;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  z-index: 3;
  border-radius: 50%;
  pointer-events: none;
  border: 1px solid rgba(201, 216, 245, .65);
  background: radial-gradient(circle, rgba(201, 216, 245, .28), transparent 70%);
  mix-blend-mode: screen;
  animation: inkRipple .75s ease-out forwards;
}

/* ---------- 按钮与设置 ---------- */
button {
  border-radius: 12px;
  transition: background-color .16s ease, border-color .16s ease, transform .14s ease, box-shadow .16s ease;
}

button.primary,
.primary {
  background: var(--cream);
  color: #1b264f;
  border-color: var(--cream);
  box-shadow: 0 6px 18px #050b1f55;
}

button:hover { transform: translateY(-1px); }
button:active { transform: translateY(0) scale(.98); }

.settings-group {
  border-bottom: 1px dashed rgba(201, 216, 245, .16);
}

.settings-group summary {
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 1px;
}

.mobile-nav {
  background: #18244a;
  border-top: 1px dashed rgba(201, 216, 245, .22);
}

/* ---------- 入场上浮 ---------- */
@keyframes riseIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

@keyframes indigoWash {
  0% { transform: translate3d(-2%, 0, 0) scale(1); }
  100% { transform: translate3d(2%, -2%, 0) scale(1.06); }
}

@keyframes inkRipple {
  from { transform: scale(.4); opacity: .8; }
  to { transform: scale(6); opacity: 0; }
}

@keyframes tileBloom {
  0% { box-shadow: 0 0 0 0 rgba(201, 216, 245, .55); }
  100% { box-shadow: 0 0 0 14px rgba(201, 216, 245, 0); }
}

body.is-ready .craft-hero {
  animation: riseIn .7s cubic-bezier(.2, .7, .2, 1) .05s both;
}

body.is-ready .panel {
  animation: riseIn .7s cubic-bezier(.2, .7, .2, 1) both;
}

body.is-ready .library-panel { animation-delay: .12s; }
body.is-ready #studio { animation-delay: .2s; }
body.is-ready .properties { animation-delay: .28s; }

/* ---------- 移动端 ---------- */
@media (max-width: 900px) {
  .craft-hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    margin: 14px 12px 0;
    padding: 20px;
  }
  .craft-copy h1 { font-size: 28px; letter-spacing: 4px; }
  .craft-steps { gap: 12px; }
  .craft-steps i { width: 26px; }
  .craft-step b { font-size: 22px; }
}

@media (max-width: 600px) {
  .craft-step em { display: none; }
  .craft-steps i { display: none; }
  .craft-steps { width: 100%; justify-content: space-between; }
}

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

.canvas-wrap.canvas-bloom { animation: canvasBloom .65s ease-out; }
@keyframes canvasBloom {
  0% { box-shadow: inset 0 0 0 5px rgba(255,255,255,.35), 0 0 0 0 rgba(201,216,245,.5); }
  100% { box-shadow: inset 0 0 0 5px rgba(255,255,255,.35), 0 0 0 18px rgba(201,216,245,0); }
}

/* =========================================================
   Apple-inspired refinement
   ========================================================= */

.app-header {
  position: sticky;
  background: rgba(18, 28, 58, .72);
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
  backdrop-filter: blur(22px) saturate(1.2);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .04), 0 18px 40px rgba(0, 0, 0, .18);
}

.brand strong { font-size: 22px; letter-spacing: 3px; }

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(54px, 7vw, 96px) max(24px, 6vw) clamp(36px, 5vw, 64px);
}

.hero::before {
  content: "";
  position: absolute;
  inset: -20% -10%;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 60% at 28% 38%, rgba(110, 150, 240, .2), transparent 62%),
    radial-gradient(ellipse 45% 45% at 78% 62%, rgba(90, 120, 200, .14), transparent 65%);
  animation: indigoWash 18s ease-in-out infinite alternate;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 1600px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: clamp(28px, 5vw, 70px);
  align-items: center;
}

.hero-kicker {
  display: block;
  font-size: 10px;
  letter-spacing: .34em;
  color: var(--blue);
  opacity: .8;
}

.hero h1 {
  font-family: var(--serif);
  font-size: clamp(46px, 6.2vw, 92px);
  line-height: 1.02;
  letter-spacing: .04em;
  font-weight: 600;
  color: var(--cream);
  margin: 16px 0 22px;
}

.hero h1 em {
  font-style: normal;
  color: var(--blue);
  text-shadow: 0 0 46px rgba(140, 180, 255, .28);
}

.hero p {
  max-width: 560px;
  font-size: clamp(14px, 1.05vw, 17px);
  line-height: 1.9;
  letter-spacing: .03em;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 34px;
  flex-wrap: wrap;
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 999px;
  background: var(--cream);
  color: #1b264f;
  font-size: 14px;
  letter-spacing: .04em;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .35);
  transition: transform .3s cubic-bezier(.2, .7, .2, 1), box-shadow .3s;
}

.cta:hover { transform: translateY(-2px); box-shadow: 0 24px 50px rgba(0, 0, 0, .45); }

.cta-ghost {
  display: inline-flex;
  align-items: center;
  padding: 13px 22px;
  border-radius: 999px;
  border: 1px solid rgba(201, 216, 245, .24);
  color: var(--ink);
  font-size: 13px;
  letter-spacing: .04em;
  background: rgba(255, 255, 255, .03);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: border-color .25s, background .25s, transform .25s;
}

.cta-ghost:hover {
  border-color: rgba(201, 216, 245, .5);
  background: rgba(255, 255, 255, .06);
  transform: translateY(-1px);
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 38px;
  font-size: 10px;
  letter-spacing: .2em;
  color: rgba(182, 193, 222, .6);
}

.hero-meta i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 10px rgba(201, 168, 106, .6);
}

.hero-visual {
  position: relative;
  aspect-ratio: 1;
  min-width: 0;
  display: grid;
  place-items: center;
  transform: translate3d(calc(var(--mx, 0) * 14px), calc(var(--my, 0) * 14px), 0);
  transition: transform .25s ease-out;
  will-change: transform;
}

.orbit {
  position: absolute;
  border-radius: 50%;
  border: 1px dashed rgba(201, 216, 245, .22);
  pointer-events: none;
}

.orbit-a { inset: 4%; animation: spin 70s linear infinite; }
.orbit-b { inset: 16%; border-style: solid; border-color: rgba(201, 216, 245, .1); animation: spin 100s linear infinite reverse; }

.hero-motif {
  width: 72%;
  height: 72%;
  object-fit: contain;
  filter: drop-shadow(0 30px 60px rgba(0, 0, 0, .45)) drop-shadow(0 0 30px rgba(140, 180, 255, .18));
  animation: motifFloat 9s ease-in-out infinite alternate;
}

.hero-chip {
  position: absolute;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid rgba(201, 216, 245, .2);
  background: rgba(26, 37, 78, .55);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  font-size: 10px;
  letter-spacing: .14em;
  color: var(--blue);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .25);
  white-space: nowrap;
  animation: chipFloat 7s ease-in-out infinite alternate;
}

.chip-a { left: 2%; top: 26%; }
.chip-b { right: 0; top: 48%; animation-delay: -2s; }
.chip-c { left: 12%; bottom: 12%; animation-delay: -4s; }

/* 工作台间距与玻璃面板 */
main {
  max-width: 1680px;
  padding: 28px max(24px, 6vw) 48px;
  gap: 22px;
}

.panel {
  background: rgba(33, 46, 90, .72);
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
  backdrop-filter: blur(18px) saturate(1.1);
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 24px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, .35);
}

.panel::before {
  inset: 12px;
  border: 1px dashed rgba(201, 216, 245, .12);
  border-radius: 16px;
}

/* 页脚 */
.site-footer {
  position: relative;
  overflow: hidden;
  margin-top: 40px;
  padding: 64px max(24px, 6vw) 44px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  background: linear-gradient(180deg, rgba(23, 33, 66, .3), rgba(17, 25, 52, .88));
}

.site-footer::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -45%;
  width: min(1500px, 150vw);
  aspect-ratio: 1;
  transform: translateX(-50%);
  pointer-events: none;
  background: url("src/assets/main_04_line_bright.png") center bottom / contain no-repeat;
  opacity: .08;
  -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,.95) 0%, rgba(0,0,0,.5) 45%, transparent 78%);
  mask-image: linear-gradient(to top, rgba(0,0,0,.95) 0%, rgba(0,0,0,.5) 45%, transparent 78%);
}

.footer-inner {
  position: relative;
  z-index: 1;
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
}

.footer-brand strong {
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: 3px;
  color: var(--cream);
}

.footer-brand p {
  margin-top: 6px;
  font-size: 11px;
  letter-spacing: .16em;
  color: var(--muted);
}

.footer-links {
  display: flex;
  gap: 24px;
  font-size: 12px;
  letter-spacing: .08em;
}

.footer-links a { color: var(--muted); transition: color .2s; }
.footer-links a:hover { color: var(--cream); }

.footer-note {
  font-size: 10px;
  letter-spacing: .18em;
  color: rgba(182, 193, 222, .55);
}

/* 动效 */
@keyframes motifFloat {
  from { transform: translateY(-6px) rotate(-2deg); }
  to { transform: translateY(8px) rotate(2deg); }
}

@keyframes spin { to { transform: rotate(360deg); } }

@keyframes chipFloat {
  from { transform: translateY(-4px); }
  to { transform: translateY(5px); }
}

body.is-ready .hero-copy { animation: riseIn .9s cubic-bezier(.2, .7, .2, 1) .08s both; }
body.is-ready .hero-visual { animation: riseIn .9s cubic-bezier(.2, .7, .2, 1) .2s both; }

/* 响应式 */
@media (max-width: 980px) {
  .hero-inner { grid-template-columns: 1fr; gap: 30px; }
  .hero-visual { width: min(520px, 82vw); margin: 0 auto; order: -1; }
  .hero h1 { margin-top: 12px; }
  .hero-meta { margin-top: 26px; }
}

@media (max-width: 760px) {
  .hero { padding-top: 36px; }
  .hero-visual { width: min(400px, 84vw); }
  .hero-chip { font-size: 9px; padding: 7px 11px; }
  .chip-a { left: 0; top: 20%; }
  .chip-b { right: 0; top: 52%; }
  .chip-c { left: 6%; bottom: 8%; }
  .footer-inner { align-items: flex-start; flex-direction: column; gap: 18px; }
  .site-footer { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
}

/* =========================================================
   iPhone / mobile-first workspace
   ========================================================= */

@media (max-width: 760px) {

  .app-header {
    padding: calc(8px + env(safe-area-inset-top)) 14px 8px;
    gap: 6px;
  }
  .brand { gap: 0; min-width: 0; }
  .brand strong { font-size: 18px; letter-spacing: 2px; }
  .brand small { display: none; }
  .app-header nav { gap: 5px; flex-shrink: 0; }
  .app-header nav button {
    min-width: 42px;
    min-height: 42px;
    padding: 0 10px;
    font-size: 12px;
  }
  #undo, #clear {
    width: 42px;
    min-width: 42px;
    padding: 0;
    font-size: 0;
    display: grid;
    place-items: center;
  }
  #undo::before { content: "↶"; font-size: 20px; line-height: 1; }
  #clear::before { content: "清"; font-size: 14px; line-height: 1; letter-spacing: 0; }
  #export { font-size: 12px; padding: 0 10px; }

  .hero { padding: 26px 18px 24px; }
  .hero-inner { display: block; }
  .hero-visual { display: none; }
  .hero-kicker { font-size: 9px; letter-spacing: .24em; }
  .hero h1 {
    font-size: 36px;
    line-height: 1.12;
    letter-spacing: 2px;
    margin: 10px 0 12px;
  }
  .hero p { font-size: 13px; line-height: 1.8; }
  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 20px;
  }
  .cta, .cta-ghost { width: 100%; justify-content: center; padding: 13px 18px; }
  .hero-meta { display: none; }

  main {
    display: flex;
    flex-direction: column;
    padding: 12px 12px calc(94px + env(safe-area-inset-bottom));
    gap: 12px;
    max-width: 100%;
  }

  main[data-view="patterns"] .studio,
  main[data-view="patterns"] .properties,
  main[data-view="studio"] .library-panel,
  main[data-view="studio"] .properties,
  main[data-view="settings"] .library-panel,
  main[data-view="settings"] .studio {
    display: none !important;
  }

  .panel {
    width: 100%;
    padding: 16px;
    border-radius: 20px;
  }
  .panel::before { inset: 8px; border-radius: 14px; }
  .panel-heading h1, .panel-heading h2 { font-size: 19px; }

  .library-panel { position: static; }
  #library {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    max-height: calc(100vh - 250px);
    max-height: calc(100dvh - 250px);
  }
  .motif { padding: 5px; }
  .motif img { border-radius: 7px; }

  .boards { grid-template-columns: 1fr; }
  .canvas-wrap { border-radius: 14px; }

  .mobile-nav {
    gap: 6px;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
    background: rgba(18, 28, 58, .82);
    -webkit-backdrop-filter: blur(22px) saturate(1.2);
    backdrop-filter: blur(22px) saturate(1.2);
    border-top: 1px solid rgba(255, 255, 255, .08);
    box-shadow: 0 -12px 40px rgba(0, 0, 0, .3);
  }
  .mobile-nav button {
    flex: 1;
    min-height: 48px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--ink);
    font-size: 12px;
    letter-spacing: .06em;
    box-shadow: none;
  }
  .mobile-nav button[aria-selected="true"] {
    background: var(--cream);
    color: #1b264f;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .3);
  }
}

/* 手机端画布优先：把画布提到工具栏上方 */
@media (max-width: 760px) {
  #studio { display: flex; flex-direction: column; }
  #studio .panel-heading { order: 0; }
  #studio .board-tabs { order: 1; }
  #studio .boards { order: 2; }
  #studio .tool-buttons { order: 3; margin-top: 12px; }
  #studio .fill-palette { order: 4; margin: 12px 0 6px; }
  #studio .tool-hint { order: 5; }
  #studio .canvas-style { order: 6; margin-top: 8px; }
  #studio .zoom-tools { order: 7; }
  #studio .gesture-hint { order: 8; }
  #studio #status { order: 9; }
  #studio .export-result { order: 10; }
  #studio .step-note { display: none; }
  #studio .boards { margin-top: 4px; }
  #studio .canvas-wrap { aspect-ratio: 1; }
  .app-header { position: sticky; top: 0; }
}

@media (max-width: 760px) {
  body.tool-mode .hero { display: none; }
  .app-header { background: rgba(18, 28, 58, .9); }
  body.tool-mode #patterns,
  body.tool-mode #studio,
  body.tool-mode #settings { scroll-margin-top: 72px; }
}

/* =========================================================
   导出结果 · 全局浮层（手机优先）
   ========================================================= */
.export-result {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  width: min(460px, calc(100vw - 32px));
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(201, 216, 245, .22);
  border-radius: 20px;
  background: rgba(24, 35, 74, .93);
  -webkit-backdrop-filter: blur(26px) saturate(1.3);
  backdrop-filter: blur(26px) saturate(1.3);
  box-shadow: 0 24px 70px rgba(3, 10, 30, .55), inset 0 1px 0 rgba(255, 255, 255, .08);
  color: var(--ink);
  animation: exportRise .38s cubic-bezier(.2, .8, .2, 1) both;
}
.export-result[hidden] { display: none !important; }
#exportThumb {
  flex: 0 0 auto;
  width: 78px;
  height: 78px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, .25);
  background: #fff;
}
.export-copy { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.export-copy strong { font-family: var(--serif); font-size: 17px; font-weight: 600; letter-spacing: .08em; }
.export-copy > span { font-size: 12px; color: var(--muted); line-height: 1.5; }
.export-actions { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.export-actions a,
.export-actions button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: .05em;
}
.export-actions a { background: var(--cream); color: #1b264f; border: 1px solid var(--cream); font-weight: 600; }
.export-actions button { background: transparent; color: var(--ink); border: 1px solid rgba(201, 216, 245, .3); }
#exportClose { margin-left: auto; color: var(--muted); padding: 0 12px; }
@keyframes exportRise {
  from { opacity: 0; transform: translate(-50%, 16px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .export-result { animation: none; }
}
@media (max-width: 760px) {
  .export-result {
    left: 12px;
    right: 12px;
    bottom: calc(84px + env(safe-area-inset-bottom));
    width: auto;
    transform: none;
    gap: 12px;
    padding: 12px;
    border-radius: 18px;
    animation-name: exportRiseMobile;
  }
  #exportThumb { width: 64px; height: 64px; border-radius: 10px; }
  .export-copy strong { font-size: 15px; }
  .export-copy > span { font-size: 11px; }
  .export-actions { gap: 6px; margin-top: 6px; }
  .export-actions a, .export-actions button { min-height: 38px; padding: 0 13px; font-size: 12px; }
  #exportClose { padding: 0 10px; }

  /* 触控反馈：轻微下压，接近 iOS 控件 */
  button, .motif { transition: transform .15s ease, background-color .15s ease, color .15s ease, border-color .15s ease; }
  button:active, .motif:active { transform: scale(.97); }
  .mobile-nav button:active { transform: scale(.94); }
}
@keyframes exportRiseMobile {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 760px) {
  a { touch-action: manipulation; }
}

/* =========================================================
   Liquid Glass · Apple-inspired ink ground
   深靛墨色 + 液态玻璃 + 细颗粒，不靠高饱和蓝色渐变
   ========================================================= */

:root {
  --navy: #070d19;
  --navy-deep: #050912;
  --panel: #0d1628;
  --panel-2: #111c31;
  --control: #16233b;
  --line: rgba(226, 234, 246, .14);
  --line-soft: rgba(226, 234, 246, .08);
  --ink: #f2eee4;
  --cream: #f2edde;
  --paper: #f6f1e6;
  --blue: #b9c8e2;
  --muted: #99a7c0;
  --gold: #c9a86a;
}

html { background: #070d19; }

body {
  position: relative;
  isolation: isolate;
  background:
    radial-gradient(110% 62% at 50% -18%, rgba(116, 138, 172, .15) 0%, rgba(116, 138, 172, 0) 64%),
    radial-gradient(90% 58% at 50% 118%, rgba(20, 31, 50, .42) 0%, rgba(20, 31, 50, 0) 70%),
    linear-gradient(180deg, #080f1d 0%, #0a1324 48%, #060b14 100%);
  color: var(--ink);
}

/* 顶部微光 + 暗角，制造“深色玻璃桌面”的层次 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 78% 46% at 50% 0%, rgba(255, 255, 255, .055), transparent 64%),
    radial-gradient(ellipse 120% 92% at 50% 42%, transparent 48%, rgba(0, 0, 0, .46) 100%);
}

/* 极细颗粒 + 织物纹理；只作用于背景，不盖在玻璃面板上 */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .42;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E"),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .018) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .012) 0 1px, transparent 1px 6px);
  background-size: 180px 180px, auto, auto;
  mix-blend-mode: soft-light;
}

/* 悬浮玻璃导航条 */
.app-header {
  position: sticky;
  top: 12px;
  z-index: 40;
  width: min(1680px, calc(100% - 32px));
  margin: 12px auto 0;
  padding: 11px 16px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, .025) 38%, rgba(255, 255, 255, .06)),
    rgba(8, 13, 24, .62);
  -webkit-backdrop-filter: blur(30px) saturate(155%);
  backdrop-filter: blur(30px) saturate(155%);
  box-shadow:
    0 18px 50px rgba(0, 0, 0, .40),
    inset 0 1px 0 rgba(255, 255, 255, .20),
    inset 0 -1px 0 rgba(0, 0, 0, .28);
}

.app-header::after,
.panel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  padding: 1px;
  pointer-events: none;
  background: linear-gradient(135deg,
    rgba(255, 255, 255, .44),
    rgba(255, 255, 255, .08) 26%,
    rgba(255, 255, 255, .015) 58%,
    rgba(255, 240, 215, .18));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
}

.app-header nav button {
  border-radius: 999px;
  background: rgba(255, 255, 255, .055);
  border: 1px solid rgba(255, 255, 255, .13);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .10);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.app-header nav .primary {
  background: linear-gradient(180deg, #faf6ea 0%, #e9e1d1 100%);
  color: #111a2c;
  border-color: rgba(255, 255, 255, .42);
  box-shadow:
    0 8px 22px rgba(0, 0, 0, .32),
    inset 0 1px 0 #fff;
}

/* 英雄区：不再使用高饱和蓝色光斑，只保留极轻的冷光 */
.hero {
  z-index: 1;
}

.hero::before {
  inset: -10%;
  background:
    radial-gradient(ellipse 58% 50% at 24% 28%, rgba(170, 184, 208, .10), transparent 70%),
    radial-gradient(ellipse 50% 44% at 78% 62%, rgba(92, 108, 136, .07), transparent 72%);
  animation: none;
}

.hero h1 em {
  color: #c5d1e5;
  text-shadow: 0 0 50px rgba(180, 198, 228, .12);
}

.hero-visual::before {
  content: "";
  position: absolute;
  inset: 11%;
  z-index: 0;
  border-radius: 50%;
  pointer-events: none;
  background:
    radial-gradient(circle at 34% 24%, rgba(255, 255, 255, .15), rgba(255, 255, 255, .035) 42%, rgba(255, 255, 255, 0) 70%),
    linear-gradient(145deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .012));
  border: 1px solid rgba(255, 255, 255, .10);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .22),
    inset 0 -24px 44px rgba(0, 0, 0, .22),
    0 34px 80px rgba(0, 0, 0, .28);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
  backdrop-filter: blur(16px) saturate(130%);
}

.hero-motif {
  position: relative;
  z-index: 1;
  filter:
    drop-shadow(0 34px 58px rgba(0, 0, 0, .52))
    drop-shadow(0 0 28px rgba(190, 204, 228, .10));
}

.orbit {
  border-color: rgba(255, 255, 255, .09);
}

.orbit-b {
  border-color: rgba(255, 255, 255, .055);
}

.hero-chip {
  background: rgba(255, 255, 255, .055);
  border-color: rgba(255, 255, 255, .14);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  backdrop-filter: blur(22px) saturate(150%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .16),
    0 12px 28px rgba(0, 0, 0, .25);
}

.cta {
  background: linear-gradient(180deg, #fbf7ec 0%, #eae2d2 100%);
  color: #111a2c;
  box-shadow:
    0 18px 40px rgba(0, 0, 0, .36),
    inset 0 1px 0 #fff;
}

.cta-ghost {
  background: rgba(255, 255, 255, .045);
  border-color: rgba(255, 255, 255, .14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .10);
}

/* 玻璃工作台：取消虚线内框，改用 1px 高光边 */
.panel {
  border: 1px solid rgba(255, 255, 255, .115);
  border-radius: 26px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .095), rgba(255, 255, 255, .022) 38%, rgba(255, 255, 255, .05)),
    rgba(11, 19, 35, .56);
  -webkit-backdrop-filter: blur(30px) saturate(150%);
  backdrop-filter: blur(30px) saturate(150%);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, .44),
    inset 0 1px 0 rgba(255, 255, 255, .17),
    inset 0 -1px 0 rgba(0, 0, 0, .32);
}

.panel::before { display: none; }

.panel-ornament span {
  opacity: .30;
}

/* 控件统一成薄玻璃 */
#search {
  background: rgba(255, 255, 255, .055);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .10);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

#search:focus {
  border-color: rgba(255, 255, 255, .30);
  box-shadow:
    0 0 0 3px rgba(185, 200, 226, .10),
    inset 0 1px 0 rgba(255, 255, 255, .16);
  outline: none;
}

.tabs button {
  background: rgba(255, 255, 255, .035);
  border-color: rgba(255, 255, 255, .10);
}

.tabs .on {
  background: linear-gradient(180deg, #faf6ea, #eae2d2);
  border-color: rgba(255, 255, 255, .40);
  color: #111a2c;
  box-shadow: inset 0 1px 0 #fff;
}

.tool-buttons button {
  background: rgba(255, 255, 255, .055);
  border-color: rgba(255, 255, 255, .12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .10);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.tool-buttons button[aria-pressed=true] {
  background: linear-gradient(180deg, #faf6ea, #eae2d2);
  color: #111a2c;
  border-color: rgba(255, 255, 255, .40);
  box-shadow:
    0 8px 18px rgba(0, 0, 0, .25),
    inset 0 1px 0 #fff;
}

.board-tabs {
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 15px;
}

.board-tabs button[aria-selected=true] {
  background: linear-gradient(180deg, #fbf7ec, #eae2d2);
  color: #111a2c;
  box-shadow:
    0 3px 10px rgba(0, 0, 0, .20),
    inset 0 1px 0 #fff;
}

.canvas-wrap {
  border-color: rgba(255, 255, 255, .48);
  box-shadow:
    inset 0 0 0 5px rgba(255, 255, 255, .32),
    0 18px 38px rgba(0, 0, 0, .34);
}

.settings-group {
  border-bottom-color: rgba(255, 255, 255, .08);
}

.motif {
  background: linear-gradient(160deg, #f6f1e6, #ebe4d6);
  border-color: rgba(255, 255, 255, .18);
}

/* 页脚压暗，纹样作为玻璃桌面下的一层水印 */
.site-footer {
  z-index: 1;
  background: linear-gradient(180deg, rgba(7, 13, 25, .18), rgba(4, 8, 15, .90));
  border-top-color: rgba(255, 255, 255, .07);
}

.site-footer::before {
  opacity: .06;
}

/* 导出浮层也使用液态玻璃 */
.export-result {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .025) 44%, rgba(255, 255, 255, .06)),
    rgba(9, 15, 29, .82);
  border-color: rgba(255, 255, 255, .16);
  -webkit-backdrop-filter: blur(30px) saturate(155%);
  backdrop-filter: blur(30px) saturate(155%);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, .52),
    inset 0 1px 0 rgba(255, 255, 255, .19),
    inset 0 -1px 0 rgba(0, 0, 0, .35);
}

.export-actions a {
  background: linear-gradient(180deg, #fbf7ec, #e9e1d1);
  color: #111a2c;
  border-color: rgba(255, 255, 255, .40);
  box-shadow: inset 0 1px 0 #fff;
}

.export-actions button {
  background: rgba(255, 255, 255, .045);
  border-color: rgba(255, 255, 255, .14);
}

/* 手机：更轻的模糊、悬浮胶囊导航、安全性留白 */
@media (max-width: 760px) {
  .app-header {
    top: calc(6px + env(safe-area-inset-top));
    width: calc(100% - 16px);
    margin: calc(6px + env(safe-area-inset-top)) auto 0;
    padding: 8px 10px;
    border-radius: 18px;
    -webkit-backdrop-filter: blur(26px) saturate(155%);
    backdrop-filter: blur(26px) saturate(155%);
  }

  .panel {
    border-radius: 22px;
    background:
      linear-gradient(135deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .02) 40%, rgba(255, 255, 255, .05)),
      rgba(11, 19, 35, .62);
    -webkit-backdrop-filter: blur(22px) saturate(148%);
    backdrop-filter: blur(22px) saturate(148%);
  }
  .library-panel {
    position: relative;
    top: auto;
  }

  .mobile-nav {
    left: 10px;
    right: 10px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    gap: 6px;
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 26px;
    background:
      linear-gradient(135deg, rgba(255, 255, 255, .11), rgba(255, 255, 255, .025) 42%, rgba(255, 255, 255, .06)),
      rgba(8, 13, 24, .68);
    -webkit-backdrop-filter: blur(30px) saturate(160%);
    backdrop-filter: blur(30px) saturate(160%);
    box-shadow:
      0 18px 48px rgba(0, 0, 0, .46),
      inset 0 1px 0 rgba(255, 255, 255, .19),
      inset 0 -1px 0 rgba(0, 0, 0, .30);
  }

  .mobile-nav button[aria-selected="true"] {
    background: linear-gradient(180deg, #fbf7ec, #e9e1d1);
    color: #111a2c;
    border: 1px solid rgba(255, 255, 255, .42);
    box-shadow:
      0 8px 20px rgba(0, 0, 0, .30),
      inset 0 1px 0 #fff;
  }

  .export-result {
    bottom: calc(88px + env(safe-area-inset-bottom));
  }

  body.tool-mode #patterns,
  body.tool-mode #studio,
  body.tool-mode #settings {
    scroll-margin-top: calc(76px + env(safe-area-inset-top));
  }
}

/* =========================================================
   本机保存 / 存到手机
   ========================================================= */
.save-group .actions {
  margin-top: 10px;
}

.save-group .actions button {
  background: rgba(255, 255, 255, .055);
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .10);
}

#saveNow {
  background: linear-gradient(180deg, #fbf7ec, #e9e1d1);
  color: #111a2c;
  border-color: rgba(255, 255, 255, .40);
  box-shadow: inset 0 1px 0 #fff;
}

#clearSaved {
  color: var(--muted);
}

/* “已保存 / 已恢复”轻提示 */
.save-toast {
  position: fixed;
  top: 92px;
  left: 50%;
  z-index: 35;
  transform: translate(-50%, -6px);
  padding: 9px 16px;
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .03) 50%, rgba(255, 255, 255, .07)),
    rgba(9, 15, 29, .78);
  -webkit-backdrop-filter: blur(26px) saturate(155%);
  backdrop-filter: blur(26px) saturate(155%);
  box-shadow:
    0 14px 36px rgba(0, 0, 0, .36),
    inset 0 1px 0 rgba(255, 255, 255, .18);
  color: var(--ink);
  font-size: 12px;
  letter-spacing: .06em;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .22s ease, transform .22s ease;
}

.save-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.save-toast[hidden] { display: none !important; }

/* 保存图片浮层：手机优先的“存到手机”主按钮 */
.export-actions #shareImage {
  background: linear-gradient(180deg, #fbf7ec, #e9e1d1);
  color: #111a2c;
  border-color: rgba(255, 255, 255, .40);
  box-shadow:
    0 8px 18px rgba(0, 0, 0, .24),
    inset 0 1px 0 #fff;
  font-weight: 600;
}

.export-actions #download {
  background: rgba(255, 255, 255, .045);
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, .14);
  font-weight: 400;
}

@media (max-width: 760px) {
  .save-toast {
    top: calc(80px + env(safe-area-inset-top));
    padding: 8px 14px;
    font-size: 11px;
  }
}

/* 底栏未选中项也带一层极薄的玻璃，避免在深色背景上看不清 */
@media (max-width: 760px) {
  .mobile-nav button {
    background: rgba(255, 255, 255, .035);
    color: var(--ink);
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
  }
  .mobile-nav button[aria-selected="true"] {
    background: linear-gradient(180deg, #fbf7ec, #e9e1d1);
    color: #111a2c;
    text-shadow: none;
  }
}

/* =========================================================
   字体与文字层级 · Apple-like editorial
   暖白标题 + 冷银正文，减少彩色文字，建立更安静的层级
   ========================================================= */
:root {
  --text-strong: #f7f3e9;
  --text-body: #c8d2e2;
  --text-muted: #98a6bd;
  --text-faint: #748197;
  --accent: #b8c9e6;
  --warm: #d8c39a;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  color: var(--text-body);
  font-feature-settings: "kern" 1;
  text-rendering: optimizeLegibility;
}

::selection {
  background: rgba(184, 201, 230, .24);
  color: var(--text-strong);
}

.brand strong {
  color: var(--text-strong);
  letter-spacing: .12em;
}

.brand small {
  color: var(--text-faint);
  font-size: 10.5px;
  letter-spacing: .16em;
}

.hero-kicker {
  color: rgba(204, 216, 235, .62);
  font-size: 10.5px;
  letter-spacing: .26em;
}

.hero h1 {
  color: var(--text-strong);
  letter-spacing: .02em;
  font-weight: 600;
}

.hero h1 em {
  color: var(--text-strong);
  opacity: .64;
  text-shadow: none;
}

 .hero p {
  color: rgba(213, 222, 237, .82);
  font-size: clamp(15px, 1.06vw, 16.5px);
  line-height: 1.84;
  letter-spacing: .015em;
}

.hero-meta {
  color: rgba(182, 195, 216, .56);
  font-size: 10.5px;
  letter-spacing: .18em;
}

.hero-chip {
  color: rgba(215, 226, 242, .84);
  font-size: 10.5px;
  font-weight: 500;
}

.cta {
  color: #101827;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: .02em;
}

.cta-ghost {
  color: var(--text-body);
  font-size: 14px;
  font-weight: 500;
}

.panel-heading h1,
.panel-heading h2 {
  color: var(--text-strong);
  letter-spacing: .06em;
}

.panel-heading .step-note,
.step-note {
  color: var(--text-faint);
  font-size: 11px;
  letter-spacing: .08em;
}

.field-caption,
label {
  color: var(--text-muted);
}

label {
  font-size: 12.5px;
}

label > output,
output {
  color: var(--text-muted);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.tool-hint,
.hint,
.stage-title span {
  color: var(--text-muted);
}

.tool-hint {
  font-size: 12.5px;
  line-height: 1.7;
}

.gesture-hint {
  color: var(--text-faint);
  font-size: 11.5px;
}

#status {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.65;
}

#selection {
  color: var(--text-muted);
}

.tool-buttons button {
  color: var(--text-body);
  font-size: 13.5px;
  font-weight: 500;
}

.tool-buttons button[aria-pressed="true"] {
  color: #101827;
}

.tabs button {
  color: var(--text-muted);
  font-size: 12.5px;
}

.tabs .on {
  color: #101827;
  font-weight: 500;
}

#search {
  color: var(--text-strong);
}

#search::placeholder {
  color: var(--text-faint);
}

.motif span {
  font-size: 10.5px;
  font-weight: 500;
}

.board-tabs button {
  color: var(--text-muted);
  font-size: 12.5px;
}

.board-tabs button[aria-selected="true"] {
  color: #101827;
  font-weight: 500;
}

.settings-group summary {
  color: var(--text-strong);
  letter-spacing: .03em;
}

.settings-group summary::after {
  color: var(--text-faint);
}

select {
  color: var(--text-body);
}

.check {
  color: var(--text-muted);
}

.actions button {
  color: var(--text-body);
}

.site-footer .footer-brand strong {
  color: var(--text-strong);
}

.footer-brand p,
.footer-note {
  color: var(--text-faint);
}

.footer-links a {
  color: var(--text-muted);
}

.mobile-nav button {
  font-weight: 500;
  letter-spacing: .04em;
}

.mobile-nav button[aria-selected="true"] {
  font-weight: 600;
}

.export-copy strong {
  color: var(--text-strong);
}

.export-copy > span {
  color: var(--text-muted);
}

.save-toast {
  color: var(--text-strong);
}

@media (max-width: 760px) {
  .brand strong {
    font-size: 18px;
    letter-spacing: .10em;
  }

  .hero-kicker {
    font-size: 10px;
    letter-spacing: .22em;
  }

  .hero h1 {
    font-size: 40px;
    line-height: 1.08;
    letter-spacing: .01em;
    margin: 12px 0 14px;
  }

  .hero p {
    font-size: 15px;
    line-height: 1.8;
  }

  .cta,
  .cta-ghost {
    font-size: 14.5px;
  }

  .panel-heading h1,
  .panel-heading h2 {
    font-size: 20px;
  }

  label {
    font-size: 13px;
  }

  .tool-buttons button {
    font-size: 14px;
  }

  .tabs button {
    font-size: 12.5px;
  }

  .mobile-nav button {
    font-size: 12.5px;
  }
}

/* 底栏文字的独立绘制层，避免被 backdrop-filter 的雾面吃掉 */
@media (max-width: 760px) {
  .mobile-nav {
    background:
      linear-gradient(135deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .02) 42%, rgba(255, 255, 255, .05)),
      rgba(7, 12, 23, .84);
  }
  .mobile-nav button {
    position: relative;
    z-index: 1;
    isolation: isolate;
    background: rgba(8, 14, 26, .34);
    border: 1px solid rgba(255, 255, 255, .055);
    color: var(--text-strong);
  }
  .mobile-nav button[aria-selected="true"] {
    background: linear-gradient(180deg, #fbf7ec, #e9e1d1);
    border-color: rgba(255, 255, 255, .42);
    color: #111a2c;
  }
}

/* =========================================================
   Glass v2 · 更蓝的靛蓝底 + 更明显的磨砂/折射
   背景里先放低饱和蓝色光场，玻璃才有东西可以“磨”
   ========================================================= */

:root {
  --navy: #081c34;
  --navy-deep: #040f1e;
}

html { background: #07182c; }

body {
  background:
    radial-gradient(110% 72% at 16% -14%, rgba(66, 136, 194, .32) 0%, rgba(66, 136, 194, 0) 60%),
    radial-gradient(92% 66% at 92% 8%, rgba(32, 96, 152, .26) 0%, rgba(32, 96, 152, 0) 64%),
    radial-gradient(100% 76% at 50% 118%, rgba(16, 58, 96, .50) 0%, rgba(16, 58, 96, 0) 68%),
    linear-gradient(180deg, #081e37 0%, #091a2e 46%, #06101f 100%);
}

body::before {
  background:
    radial-gradient(ellipse 54% 44% at 16% 18%, rgba(72, 142, 196, .34), transparent 70%),
    radial-gradient(ellipse 50% 46% at 86% 28%, rgba(38, 105, 160, .28), transparent 72%),
    radial-gradient(ellipse 62% 42% at 52% 104%, rgba(24, 78, 122, .30), transparent 72%),
    radial-gradient(ellipse 84% 45% at 50% 0%, rgba(170, 204, 234, .07), transparent 64%),
    radial-gradient(ellipse 120% 92% at 50% 42%, transparent 42%, rgba(0, 6, 14, .48) 100%);
}

body::after {
  opacity: .46;
}

/* 面板：更透、更厚的雾面；加一层极细颗粒，肉眼能看出“磨砂” */
.panel {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.10'/%3E%3C/svg%3E") 0 0 / 140px 140px repeat,
    radial-gradient(120% 80% at 14% 0%, rgba(255, 255, 255, .16), transparent 48%),
    linear-gradient(135deg, rgba(255, 255, 255, .13), rgba(255, 255, 255, .025) 40%, rgba(255, 255, 255, .08)),
    rgba(8, 26, 46, .36);
  border-color: rgba(255, 255, 255, .21);
  -webkit-backdrop-filter: blur(38px) saturate(172%) brightness(1.04);
  backdrop-filter: blur(38px) saturate(172%) brightness(1.04);
  box-shadow:
    0 38px 100px rgba(0, 0, 0, .48),
    inset 0 1px 0 rgba(255, 255, 255, .30),
    inset 0 -1px 0 rgba(0, 0, 0, .38),
    inset 0 22px 42px -34px rgba(255, 255, 255, .28);
}

.panel::after {
  background: linear-gradient(135deg,
    rgba(255, 255, 255, .62),
    rgba(255, 255, 255, .14) 24%,
    rgba(255, 255, 255, .025) 60%,
    rgba(255, 242, 220, .24));
}

/* 顶栏：让背景的蓝光透进来 */
.app-header {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .15), rgba(255, 255, 255, .025) 40%, rgba(255, 255, 255, .08)),
    rgba(6, 21, 38, .46);
  border-color: rgba(255, 255, 255, .21);
  -webkit-backdrop-filter: blur(40px) saturate(175%) brightness(1.04);
  backdrop-filter: blur(40px) saturate(175%) brightness(1.04);
  box-shadow:
    0 22px 60px rgba(0, 0, 0, .44),
    inset 0 1px 0 rgba(255, 255, 255, .30),
    inset 0 -1px 0 rgba(0, 0, 0, .32);
}

.app-header::after {
  background: linear-gradient(135deg,
    rgba(255, 255, 255, .60),
    rgba(255, 255, 255, .12) 26%,
    rgba(255, 255, 255, .02) 60%,
    rgba(255, 242, 220, .22));
}

/* 导出浮层也一起加厚 */
.export-result {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .025) 44%, rgba(255, 255, 255, .07)),
    rgba(8, 23, 41, .78);
  border-color: rgba(255, 255, 255, .20);
  -webkit-backdrop-filter: blur(40px) saturate(175%) brightness(1.04);
  backdrop-filter: blur(40px) saturate(175%) brightness(1.04);
}

@media (max-width: 760px) {
  .app-header {
    background:
      linear-gradient(135deg, rgba(255, 255, 255, .15), rgba(255, 255, 255, .025) 40%, rgba(255, 255, 255, .08)),
      rgba(6, 21, 38, .52);
    -webkit-backdrop-filter: blur(30px) saturate(172%) brightness(1.04);
    backdrop-filter: blur(30px) saturate(172%) brightness(1.04);
  }

  .panel {
    background:
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.10'/%3E%3C/svg%3E") 0 0 / 140px 140px repeat,
      radial-gradient(120% 80% at 14% 0%, rgba(255, 255, 255, .15), transparent 48%),
      linear-gradient(135deg, rgba(255, 255, 255, .13), rgba(255, 255, 255, .025) 40%, rgba(255, 255, 255, .08)),
      rgba(8, 26, 46, .40);
    -webkit-backdrop-filter: blur(30px) saturate(170%) brightness(1.04);
    backdrop-filter: blur(30px) saturate(170%) brightness(1.04);
  }

  .mobile-nav {
    background:
      linear-gradient(135deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .025) 42%, rgba(255, 255, 255, .07)),
      rgba(6, 21, 38, .58);
    -webkit-backdrop-filter: blur(34px) saturate(175%) brightness(1.04);
    backdrop-filter: blur(34px) saturate(175%) brightness(1.04);
    border-color: rgba(255, 255, 255, .20);
  }
}

/* =========================================================
   Glass v3 · 让磨砂真正可见
   乳白雾面 + 更重的模糊 + 细霜纹 + 背景纹样透出
   ========================================================= */
body {
  background:
    radial-gradient(110% 72% at 16% -14%, rgba(74, 150, 208, .36) 0%, rgba(74, 150, 208, 0) 60%),
    radial-gradient(92% 66% at 92% 8%, rgba(36, 108, 168, .30) 0%, rgba(36, 108, 168, 0) 64%),
    radial-gradient(100% 76% at 50% 118%, rgba(18, 66, 108, .54) 0%, rgba(18, 66, 108, 0) 68%),
    linear-gradient(180deg, #09233f 0%, #091b31 46%, #06111f 100%);
}

body::before {
  background:
    radial-gradient(ellipse 42% 34% at 18% 22%, rgba(78, 158, 214, .44), transparent 72%),
    radial-gradient(ellipse 40% 34% at 84% 24%, rgba(42, 116, 174, .36), transparent 72%),
    radial-gradient(ellipse 54% 36% at 54% 102%, rgba(28, 92, 146, .36), transparent 72%),
    radial-gradient(ellipse 84% 45% at 50% 0%, rgba(176, 210, 240, .08), transparent 64%),
    radial-gradient(ellipse 120% 92% at 50% 42%, transparent 38%, rgba(0, 6, 14, .50) 100%);
}

/* 乳白雾面 + 霜纹 + 高光 */
.panel {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E") 0 0 / 140px 140px repeat,
    repeating-linear-gradient(118deg, rgba(255, 255, 255, .018) 0 1px, transparent 1px 5px),
    radial-gradient(120% 80% at 14% 0%, rgba(255, 255, 255, .20), transparent 50%),
    linear-gradient(135deg, rgba(255, 255, 255, .15), rgba(255, 255, 255, .045) 42%, rgba(255, 255, 255, .09)),
    rgba(174, 202, 232, .075);
  border-color: rgba(255, 255, 255, .29);
  -webkit-backdrop-filter: blur(44px) saturate(125%) brightness(1.10);
  backdrop-filter: blur(44px) saturate(125%) brightness(1.10);
  box-shadow:
    0 38px 100px rgba(0, 0, 0, .50),
    inset 0 1px 0 rgba(255, 255, 255, .46),
    inset 0 -1px 0 rgba(0, 0, 0, .42),
    inset 0 0 56px rgba(190, 220, 250, .11);
}

.app-header {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, .04) 40%, rgba(255, 255, 255, .10)),
    rgba(174, 202, 232, .055);
  border-color: rgba(255, 255, 255, .30);
  -webkit-backdrop-filter: blur(44px) saturate(130%) brightness(1.12);
  backdrop-filter: blur(44px) saturate(130%) brightness(1.12);
  box-shadow:
    0 22px 60px rgba(0, 0, 0, .44),
    inset 0 1px 0 rgba(255, 255, 255, .48),
    inset 0 -1px 0 rgba(0, 0, 0, .34),
    inset 0 0 32px rgba(190, 220, 250, .08);
}

.export-result {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, .045) 44%, rgba(255, 255, 255, .10)),
    rgba(174, 202, 232, .06);
  border-color: rgba(255, 255, 255, .30);
  -webkit-backdrop-filter: blur(44px) saturate(130%) brightness(1.12);
  backdrop-filter: blur(44px) saturate(130%) brightness(1.12);
}

@media (max-width: 760px) {
  .panel {
    background:
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E") 0 0 / 140px 140px repeat,
      repeating-linear-gradient(118deg, rgba(255, 255, 255, .018) 0 1px, transparent 1px 5px),
      radial-gradient(120% 80% at 14% 0%, rgba(255, 255, 255, .19), transparent 50%),
      linear-gradient(135deg, rgba(255, 255, 255, .15), rgba(255, 255, 255, .045) 42%, rgba(255, 255, 255, .09)),
      rgba(174, 202, 232, .075);
    -webkit-backdrop-filter: blur(34px) saturate(125%) brightness(1.10);
    backdrop-filter: blur(34px) saturate(125%) brightness(1.10);
    border-color: rgba(255, 255, 255, .28);
  }

  .app-header {
    background:
      linear-gradient(135deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, .04) 40%, rgba(255, 255, 255, .10)),
      rgba(174, 202, 232, .055);
    -webkit-backdrop-filter: blur(34px) saturate(130%) brightness(1.12);
    backdrop-filter: blur(34px) saturate(130%) brightness(1.12);
  }

  .mobile-nav {
    background:
      linear-gradient(135deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, .04) 42%, rgba(255, 255, 255, .10)),
      rgba(174, 202, 232, .06);
    -webkit-backdrop-filter: blur(38px) saturate(130%) brightness(1.12);
    backdrop-filter: blur(38px) saturate(130%) brightness(1.12);
    border-color: rgba(255, 255, 255, .28);
  }
}

/* =========================================================
   Glass v4 · 烟熏磨砂（保留霜纹与折射，但恢复文字对比）
   ========================================================= */
.panel {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.14'/%3E%3C/svg%3E") 0 0 / 140px 140px repeat,
    repeating-linear-gradient(118deg, rgba(255, 255, 255, .016) 0 1px, transparent 1px 5px),
    linear-gradient(115deg, transparent 0 37%, rgba(255, 255, 255, .055) 42%, transparent 47% 100%),
    radial-gradient(120% 80% at 14% 0%, rgba(255, 255, 255, .17), transparent 50%),
    linear-gradient(135deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .03) 42%, rgba(255, 255, 255, .07)),
    rgba(7, 27, 48, .50);
  border-color: rgba(255, 255, 255, .27);
  -webkit-backdrop-filter: blur(42px) saturate(150%) brightness(1.02);
  backdrop-filter: blur(42px) saturate(150%) brightness(1.02);
  box-shadow:
    0 40px 100px rgba(0, 0, 0, .50),
    inset 0 1px 0 rgba(255, 255, 255, .44),
    inset 0 -1px 0 rgba(0, 0, 0, .44),
    inset 0 0 60px rgba(172, 205, 242, .10);
}

.app-header {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .035) 40%, rgba(255, 255, 255, .09)),
    rgba(5, 21, 38, .50);
  border-color: rgba(255, 255, 255, .28);
  -webkit-backdrop-filter: blur(42px) saturate(155%) brightness(1.03);
  backdrop-filter: blur(42px) saturate(155%) brightness(1.03);
  box-shadow:
    0 22px 60px rgba(0, 0, 0, .46),
    inset 0 1px 0 rgba(255, 255, 255, .46),
    inset 0 -1px 0 rgba(0, 0, 0, .36),
    inset 0 0 34px rgba(172, 205, 242, .08);
}

.export-result {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .04) 44%, rgba(255, 255, 255, .08)),
    rgba(7, 24, 43, .80);
  border-color: rgba(255, 255, 255, .28);
  -webkit-backdrop-filter: blur(42px) saturate(155%) brightness(1.03);
  backdrop-filter: blur(42px) saturate(155%) brightness(1.03);
}

/* 烟熏玻璃上的二级文字 */
.panel .hint,
.panel .tool-hint,
.panel .gesture-hint,
.panel .step-note,
.panel label,
.panel output,
.panel #selection,
.panel .field-caption,
.panel #status,
.panel .stage-title span {
  color: #b8c6da;
}

.panel .tabs button {
  color: rgba(228, 238, 251, .68);
}

.panel #libraryStatus,
.panel #count {
  color: #b8c6da;
}

.panel #search::placeholder {
  color: rgba(218, 229, 244, .48);
}

.panel .board-tabs button {
  color: #b8c6da;
}

@media (max-width: 760px) {
  .panel {
    background:
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.14'/%3E%3C/svg%3E") 0 0 / 140px 140px repeat,
      repeating-linear-gradient(118deg, rgba(255, 255, 255, .016) 0 1px, transparent 1px 5px),
      linear-gradient(115deg, transparent 0 37%, rgba(255, 255, 255, .055) 42%, transparent 47% 100%),
      radial-gradient(120% 80% at 14% 0%, rgba(255, 255, 255, .16), transparent 50%),
      linear-gradient(135deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .03) 42%, rgba(255, 255, 255, .07)),
      rgba(7, 27, 48, .54);
    -webkit-backdrop-filter: blur(34px) saturate(150%) brightness(1.02);
    backdrop-filter: blur(34px) saturate(150%) brightness(1.02);
  }

  .app-header {
    background:
      linear-gradient(135deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .035) 40%, rgba(255, 255, 255, .09)),
      rgba(5, 21, 38, .58);
    -webkit-backdrop-filter: blur(34px) saturate(155%) brightness(1.03);
    backdrop-filter: blur(34px) saturate(155%) brightness(1.03);
  }

  .mobile-nav {
    background:
      linear-gradient(135deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .035) 42%, rgba(255, 255, 255, .08)),
      rgba(5, 19, 34, .64);
    -webkit-backdrop-filter: blur(38px) saturate(155%) brightness(1.03);
    backdrop-filter: blur(38px) saturate(155%) brightness(1.03);
    border-color: rgba(255, 255, 255, .26);
  }

  .mobile-nav button {
    background: rgba(4, 12, 24, .48);
    color: var(--text-strong);
  }

  .mobile-nav button[aria-selected="true"] {
    background: linear-gradient(180deg, #fbf7ec, #e9e1d1);
    color: #111a2c;
  }
}

/* 玻璃上的浅色胶囊控件必须是深色字 */
.panel .tabs .on,
.panel .tabs button.on {
  color: #101827;
  font-weight: 600;
  text-shadow: none;
}

.panel .board-tabs button[aria-selected="true"] {
  color: #101827;
  font-weight: 600;
  text-shadow: none;
}

.panel #search::placeholder {
  color: rgba(218, 229, 244, .56);
}

/* 首屏也放一块肉眼可见的磨砂玻璃：meta 胶囊 + 幽灵按钮 */
.hero-meta {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  margin-top: 28px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, .26);
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .17), rgba(255, 255, 255, .04) 46%, rgba(255, 255, 255, .09)),
    rgba(174, 202, 232, .055);
  -webkit-backdrop-filter: blur(26px) saturate(140%) brightness(1.04);
  backdrop-filter: blur(26px) saturate(140%) brightness(1.04);
  box-shadow:
    0 14px 34px rgba(0, 0, 0, .24),
    inset 0 1px 0 rgba(255, 255, 255, .36),
    inset 0 -1px 0 rgba(0, 0, 0, .22);
}

.hero-meta i {
  box-shadow: 0 0 10px rgba(201, 168, 106, .9);
}

.cta-ghost {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .035) 46%, rgba(255, 255, 255, .08)),
    rgba(174, 202, 232, .05);
  border-color: rgba(255, 255, 255, .27);
  -webkit-backdrop-filter: blur(26px) saturate(140%) brightness(1.04);
  backdrop-filter: blur(26px) saturate(140%) brightness(1.04);
  box-shadow:
    0 14px 34px rgba(0, 0, 0, .22),
    inset 0 1px 0 rgba(255, 255, 255, .34),
    inset 0 -1px 0 rgba(0, 0, 0, .20);
}

.hero-chip {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .17), rgba(255, 255, 255, .04) 46%, rgba(255, 255, 255, .08)),
    rgba(174, 202, 232, .055);
  border-color: rgba(255, 255, 255, .26);
  -webkit-backdrop-filter: blur(26px) saturate(140%) brightness(1.04);
  backdrop-filter: blur(26px) saturate(140%) brightness(1.04);
  box-shadow:
    0 14px 32px rgba(0, 0, 0, .24),
    inset 0 1px 0 rgba(255, 255, 255, .34);
}

@media (max-width: 760px) {
  .hero-meta {
    display: inline-flex;
    margin-top: 20px;
    padding: 7px 12px;
    gap: 8px;
    font-size: 9.5px;
    letter-spacing: .10em;
    color: rgba(220, 230, 244, .72);
  }

  .cta-ghost {
    background:
      linear-gradient(135deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .035) 46%, rgba(255, 255, 255, .08)),
      rgba(174, 202, 232, .05);
    -webkit-backdrop-filter: blur(26px) saturate(140%) brightness(1.04);
    backdrop-filter: blur(26px) saturate(140%) brightness(1.04);
  }
}

/* =========================================================
   Color correction · 收掉青绿，回到更纯的皇家靛蓝
   ========================================================= */
:root {
  --navy: #081634;
  --navy-deep: #040a17;
}

html { background: #081634; }

body {
  background:
    radial-gradient(110% 72% at 16% -14%, rgba(70, 96, 190, .34) 0%, rgba(70, 96, 190, 0) 60%),
    radial-gradient(92% 66% at 92% 8%, rgba(36, 62, 150, .30) 0%, rgba(36, 62, 150, 0) 64%),
    radial-gradient(100% 76% at 50% 118%, rgba(14, 34, 90, .55) 0%, rgba(14, 34, 90, 0) 68%),
    linear-gradient(180deg, #081733 0%, #071229 46%, #040a17 100%);
}

body::before {
  background:
    radial-gradient(ellipse 42% 34% at 18% 22%, rgba(78, 112, 204, .40), transparent 72%),
    radial-gradient(ellipse 40% 34% at 84% 24%, rgba(44, 74, 164, .34), transparent 72%),
    radial-gradient(ellipse 54% 36% at 54% 102%, rgba(26, 50, 120, .36), transparent 72%),
    radial-gradient(ellipse 84% 45% at 50% 0%, rgba(180, 196, 238, .08), transparent 64%),
    radial-gradient(ellipse 120% 92% at 50% 42%, transparent 38%, rgba(2, 4, 12, .50) 100%);
}

.panel {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.14'/%3E%3C/svg%3E") 0 0 / 140px 140px repeat,
    repeating-linear-gradient(118deg, rgba(255, 255, 255, .016) 0 1px, transparent 1px 5px),
    linear-gradient(115deg, transparent 0 37%, rgba(255, 255, 255, .055) 42%, transparent 47% 100%),
    radial-gradient(120% 80% at 14% 0%, rgba(255, 255, 255, .17), transparent 50%),
    linear-gradient(135deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .03) 42%, rgba(255, 255, 255, .07)),
    rgba(8, 18, 40, .52);
}

.app-header {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .035) 40%, rgba(255, 255, 255, .09)),
    rgba(6, 15, 34, .52);
}

.export-result {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .04) 44%, rgba(255, 255, 255, .08)),
    rgba(7, 16, 36, .82);
}

.hero::before {
  background:
    radial-gradient(ellipse 58% 50% at 24% 28%, rgba(90, 112, 198, .10), transparent 70%),
    radial-gradient(ellipse 50% 44% at 78% 62%, rgba(50, 76, 148, .08), transparent 72%);
}

.hero-meta,
.cta-ghost,
.hero-chip {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .17), rgba(255, 255, 255, .04) 46%, rgba(255, 255, 255, .09)),
    rgba(174, 186, 230, .06);
}

@media (max-width: 760px) {
  .panel {
    background:
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.14'/%3E%3C/svg%3E") 0 0 / 140px 140px repeat,
      repeating-linear-gradient(118deg, rgba(255, 255, 255, .016) 0 1px, transparent 1px 5px),
      linear-gradient(115deg, transparent 0 37%, rgba(255, 255, 255, .055) 42%, transparent 47% 100%),
      radial-gradient(120% 80% at 14% 0%, rgba(255, 255, 255, .16), transparent 50%),
      linear-gradient(135deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .03) 42%, rgba(255, 255, 255, .07)),
      rgba(8, 18, 40, .56);
  }

  .app-header {
    background:
      linear-gradient(135deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .035) 40%, rgba(255, 255, 255, .09)),
      rgba(6, 15, 34, .60);
  }

  .mobile-nav {
    background:
      linear-gradient(135deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .035) 42%, rgba(255, 255, 255, .08)),
      rgba(6, 14, 34, .66);
  }

  .cta-ghost {
    background:
      linear-gradient(135deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .035) 46%, rgba(255, 255, 255, .08)),
      rgba(174, 186, 230, .06);
  }
}

/* 首屏玻璃胶囊文字再提亮一档 */
.hero-meta {
  color: rgba(214, 226, 242, .74);
  border-color: rgba(255, 255, 255, .30);
}

/* =========================================================
   Cool Flat + Interaction Glass
   静态：纯色冷蓝、平面、无光晕/无高光/无持续玻璃
   交互：只有按下/悬停的控件短暂出现玻璃
   ========================================================= */
:root {
  --navy: #091b31;
  --navy-deep: #050f1d;
  --cream: #eaf1f8;
  --paper: #f2f6fa;
  --ink: #f3f7fb;
  --text-strong: #f3f7fb;
  --text-body: #c2cedf;
  --text-muted: #91a1b6;
  --text-faint: #697a8f;
  --blue: #a9c3e1;
  --gold: #a8bfd8;
}

html,
body {
  background: #091b31;
}

body {
  background: #091b31;
  color: var(--text-body);
}

/* 静态层：去掉所有环境光、暗角、颗粒、玻璃透镜 */
body::before,
body::after,
.hero::before,
.hero-visual::before,
.orbit {
  display: none;
}

.bg-motif {
  opacity: .06;
}

/* 顶栏：平面冷蓝，不再持续玻璃 */
.app-header {
  background: #0a1b2e;
  border: 1px solid rgba(190, 210, 235, .13);
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.app-header::after {
  display: none;
}

.app-header nav button {
  background: transparent;
  border: 1px solid rgba(190, 210, 235, .15);
  color: var(--text-body);
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.app-header nav .primary {
  background: var(--cream);
  border-color: var(--cream);
  color: #0b1624;
  box-shadow: none;
}

/* 面板：实色冷蓝，干净的 1px 边 */
.panel {
  background: #0e2136;
  border: 1px solid rgba(190, 210, 235, .12);
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.panel::before,
.panel::after {
  display: none;
}

.panel-ornament span {
  opacity: .22;
}

/* 首屏 */
.hero-motif {
  filter: none;
}

.hero-meta {
  background: transparent;
  border: 1px solid rgba(190, 210, 235, .24);
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  color: var(--text-muted);
}

.hero-meta i {
  background: var(--gold);
  box-shadow: none;
}

.hero-chip {
  background: #0c1f34;
  border: 1px solid rgba(190, 210, 235, .18);
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  color: var(--text-body);
}

.cta {
  background: var(--cream);
  color: #0b1624;
  box-shadow: none;
}

.cta-ghost {
  background: transparent;
  border: 1px solid rgba(190, 210, 235, .22);
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  color: var(--text-body);
}

/* 控件：平面状态 */
#search {
  background: #0a1c2e;
  border: 1px solid rgba(190, 210, 235, .16);
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  color: var(--text-strong);
}

.tabs button {
  background: transparent;
  border: 1px solid rgba(190, 210, 235, .14);
  color: var(--text-muted);
  box-shadow: none;
}

.tabs .on {
  background: var(--cream);
  border-color: var(--cream);
  color: #0b1624;
  box-shadow: none;
}

.tool-buttons button {
  background: #142a42;
  border: 1px solid rgba(190, 210, 235, .14);
  color: var(--text-body);
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.tool-buttons button[aria-pressed="true"] {
  background: var(--cream);
  border-color: var(--cream);
  color: #0b1624;
  box-shadow: none;
}

.board-tabs {
  background: #0a1b2e;
  border: 1px solid rgba(190, 210, 235, .12);
  box-shadow: none;
}

.board-tabs button {
  background: transparent;
  color: var(--text-muted);
  box-shadow: none;
}

.board-tabs button[aria-selected="true"] {
  background: var(--cream);
  color: #0b1624;
  box-shadow: none;
}

.canvas-wrap {
  background: var(--paper);
  border: 1px solid rgba(190, 210, 235, .28);
  box-shadow: none;
}

.motif {
  background: var(--paper);
  border: 1px solid rgba(190, 210, 235, .18);
  box-shadow: none;
}

.motif:hover {
  box-shadow: none;
}

/* 底栏：平面，active 仍然是一块冷白 */
.mobile-nav {
  background: #0a1b2e;
  border: 1px solid rgba(190, 210, 235, .13);
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.mobile-nav button {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-body);
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  text-shadow: none;
}

.mobile-nav button[aria-selected="true"] {
  background: var(--cream);
  border-color: var(--cream);
  color: #0b1624;
  box-shadow: none;
}

/* 浮层与保存区：平面 */
.export-result,
.save-toast {
  background: #0b1c2f;
  border: 1px solid rgba(190, 210, 235, .18);
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.save-group .actions button {
  background: transparent;
  border: 1px solid rgba(190, 210, 235, .16);
  box-shadow: none;
}

#saveNow,
.export-actions #shareImage {
  background: var(--cream);
  border-color: var(--cream);
  color: #0b1624;
  box-shadow: none;
}

#download,
.export-actions #download {
  background: transparent;
  border: 1px solid rgba(190, 210, 235, .18);
  color: var(--text-body);
}

.site-footer {
  background: #081628;
  border-top-color: rgba(190, 210, 235, .10);
  box-shadow: none;
}

/* 交互时才出现的玻璃：只作用于未选中的控件 */
@media (hover: hover) {
  .app-header nav button:not(.primary):hover,
  .tabs button:not(.on):hover,
  .tool-buttons button[aria-pressed="false"]:hover,
  .board-tabs button[aria-selected="false"]:hover,
  .cta-ghost:hover,
  .actions button:not(#saveNow):hover,
  .export-actions #download:hover {
    filter: none;
    color: var(--text-strong);
    background: rgba(255, 255, 255, .10);
    border-color: rgba(210, 228, 246, .34);
    -webkit-backdrop-filter: blur(18px) saturate(135%);
    backdrop-filter: blur(18px) saturate(135%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22);
  }
}

@media (hover: none), (max-width: 760px) {
  .app-header nav button:not(.primary):active,
  .tabs button:not(.on):active,
  .tool-buttons button[aria-pressed="false"]:active,
  .board-tabs button[aria-selected="false"]:active,
  .mobile-nav button[aria-selected="false"]:active,
  .cta-ghost:active,
  .actions button:not(#saveNow):active,
  .export-actions #download:active {
    color: var(--text-strong);
    background: rgba(255, 255, 255, .12);
    border-color: rgba(210, 228, 246, .36);
    -webkit-backdrop-filter: blur(18px) saturate(135%);
    backdrop-filter: blur(18px) saturate(135%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .24);
  }
}

/* 交互玻璃再明确一点：只有悬停/按下时才有反光与内高光 */
@media (hover: hover) {
  .app-header nav button:not(.primary):hover,
  .tabs button:not(.on):hover,
  .tool-buttons button[aria-pressed="false"]:hover,
  .board-tabs button[aria-selected="false"]:hover,
  .cta-ghost:hover,
  .actions button:not(#saveNow):hover,
  .export-actions #download:hover {
    background:
      linear-gradient(135deg, rgba(255, 255, 255, .17), rgba(255, 255, 255, .04) 55%, rgba(255, 255, 255, .10)),
      rgba(18, 40, 66, .45);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, .28),
      inset 0 -1px 0 rgba(0, 0, 0, .24);
  }
}

@media (hover: none), (max-width: 760px) {
  .app-header nav button:not(.primary):active,
  .tabs button:not(.on):active,
  .tool-buttons button[aria-pressed="false"]:active,
  .board-tabs button[aria-selected="false"]:active,
  .mobile-nav button[aria-selected="false"]:active,
  .cta-ghost:active,
  .actions button:not(#saveNow):active,
  .export-actions #download:active {
    background:
      linear-gradient(135deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, .045) 55%, rgba(255, 255, 255, .11)),
      rgba(18, 40, 66, .48);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, .30),
      inset 0 -1px 0 rgba(0, 0, 0, .26);
  }
}

/* 静态次要按钮也别太隐形；仍然是无阴影平面 */
.app-header nav button:not(.primary) {
  background: rgba(255, 255, 255, .025);
  border-color: rgba(190, 210, 235, .24);
  color: rgba(226, 236, 248, .80);
}
.panel .tabs button:not(.on) {
  color: #a9b8ca;
}

/* 画布旋转控制 */
.rotate-tools {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 7px;
}
.rotate-tools input { flex: 1; min-width: 0; }
.rotate-tools button {
  min-width: 42px;
  min-height: 34px;
  padding: 4px 8px;
  border-radius: 9px;
  background: #142a42;
  border: 1px solid rgba(190, 210, 235, .14);
  color: var(--text-body);
  box-shadow: none;
}
.rotate-tools output {
  min-width: 38px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
@media (max-width: 760px) {
  #studio .rotate-tools { order: 8; margin-top: 4px; }
  .rotate-tools button { min-width: 44px; min-height: 40px; }
  .rotate-tools output { min-width: 42px; }
}

/* =========================================================
   今日一纹 + 我的作品
   ========================================================= */
.daily-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px;
  gap: 10px;
  align-items: center;
  padding: 11px;
  margin: 0 0 12px;
  border: 1px solid rgba(190, 210, 235, .15);
  border-radius: 16px;
  background: #0b1c2f;
}
.daily-card[hidden] { display: none !important; }
.daily-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.daily-kicker { font-size: 9px; letter-spacing: .14em; color: var(--text-faint); }
#dailyName { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--serif); font-size: 16px; line-height: 1.25; color: var(--text-strong); }
#dailyMeta { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; color: var(--text-muted); }
.daily-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.daily-actions button { min-height: 30px; padding: 5px 8px; border-radius: 8px; border: 1px solid rgba(190, 210, 235, .18); background: transparent; color: var(--text-body); font-size: 10px; line-height: 1; }
#dailyAdd { background: var(--cream); color: #0b1624; border-color: var(--cream); }
#dailyImage { width: 64px; height: 64px; padding: 5px; object-fit: contain; border: 1px solid rgba(190, 210, 235, .18); border-radius: 10px; background: var(--paper); }

/* 作品集：静态平面，无持续玻璃 */
#works,
.works-scrim { display: none; }
.works-panel { padding: 18px; }
.works-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.works-title { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.works-title h2 { margin: 0; font-family: var(--serif); font-size: 20px; letter-spacing: .06em; color: var(--text-strong); }
#worksCount { font-size: 10px; color: var(--text-muted); }
.works-head-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.works-head-actions button { min-height: 36px; padding: 6px 12px; border-radius: 9px; font-size: 11px; }
#saveCurrentWork { background: var(--cream); color: #0b1624; border-color: var(--cream); }
#closeWorks { background: transparent; color: var(--text-body); border: 1px solid rgba(190, 210, 235, .18); }
#worksHint { margin: 10px 0 0; }
.works-empty { margin-top: 22px; padding: 26px 14px; display: flex; flex-direction: column; align-items: center; gap: 6px; border: 1px dashed rgba(190, 210, 235, .18); border-radius: 16px; text-align: center; }
.works-empty[hidden] { display: none !important; }
.works-empty strong { font-family: var(--serif); font-size: 18px; font-weight: 600; color: var(--text-strong); }
.works-empty span { font-size: 12px; color: var(--text-muted); line-height: 1.7; }
.works-empty button { margin-top: 8px; min-height: 38px; padding: 6px 14px; border: 1px solid rgba(190, 210, 235, .20); background: transparent; color: var(--text-body); }
.works-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-top: 14px; }
.work-card { display: flex; flex-direction: column; min-width: 0; overflow: hidden; border: 1px solid rgba(190, 210, 235, .16); border-radius: 16px; background: #0b1c2f; }
.work-card.is-current { border-color: rgba(234, 241, 248, .50); }
.work-open { display: block; width: 100%; padding: 0; border: 0; border-radius: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.work-open img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--paper); }
.work-meta { display: flex; flex-direction: column; gap: 2px; padding: 9px 10px; }
.work-meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 600; color: var(--text-strong); }
.work-meta small { font-size: 10px; color: var(--text-faint); }
.work-actions { display: flex; gap: 6px; padding: 0 10px 10px; margin-top: auto; }
.work-actions button { flex: 1; min-height: 34px; padding: 4px 6px; border-radius: 8px; border: 1px solid rgba(190, 210, 235, .14); background: transparent; color: var(--text-muted); font-size: 10px; }

/* 手机：作品是主视图；桌面：作品是右侧抽屉 */
@media (max-width: 760px) {
  #openWorks { display: none; }
  main[data-view="patterns"] .works-panel,
  main[data-view="studio"] .works-panel,
  main[data-view="settings"] .works-panel,
  main[data-view="works"] .library-panel,
  main[data-view="works"] .studio,
  main[data-view="works"] .properties { display: none !important; }
  main[data-view="works"] .works-panel { display: flex !important; flex-direction: column; }
  .works-panel { width: 100%; padding: 16px; }
  .works-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .works-head-actions { width: 100%; }
  .works-head-actions button { flex: 1; min-height: 40px; }
  .daily-actions button { min-height: 34px; font-size: 11px; }
  #studio .rotate-tools { order: 8; }
}

@media (min-width: 761px) {
  body.works-open { overflow: hidden; }
  .works-scrim { position: fixed; inset: 0; z-index: 45; background: rgba(3, 9, 18, .62); }
  body.works-open .works-scrim { display: block; }
  body.works-open #works {
    display: flex;
    position: fixed;
    top: 100px;
    right: 24px;
    bottom: 24px;
    width: min(820px, calc(100vw - 48px));
    z-index: 50;
    flex-direction: column;
    overflow: hidden;
    padding: 20px;
    background: #0e2136;
    border: 1px solid rgba(190, 210, 235, .15);
    border-radius: 26px;
    box-shadow: none;
  }
  body.works-open #works .works-grid { flex: 1; overflow: auto; align-content: start; }
  body.works-open #works .works-empty { flex: 1; justify-content: center; }
}

/* 作品集/每日按钮的交互玻璃 */
@media (hover: hover) {
  #dailyNext:hover,
  #closeWorks:hover,
  #worksEmptyStart:hover,
  .work-actions button:hover {
    background:
      linear-gradient(135deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .04) 55%, rgba(255, 255, 255, .09)),
      rgba(18, 40, 66, .48);
    border-color: rgba(210, 228, 246, .32);
    -webkit-backdrop-filter: blur(16px) saturate(135%);
    backdrop-filter: blur(16px) saturate(135%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .24);
  }
}

@media (hover: none), (max-width: 760px) {
  #dailyNext:active,
  #closeWorks:active,
  #worksEmptyStart:active,
  .work-actions button:active {
    background:
      linear-gradient(135deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .04) 55%, rgba(255, 255, 255, .09)),
      rgba(18, 40, 66, .50);
    border-color: rgba(210, 228, 246, .34);
    -webkit-backdrop-filter: blur(16px) saturate(135%);
    backdrop-filter: blur(16px) saturate(135%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .26);
  }
}

/* 作品集次要按钮 */
#newWork {
  background: transparent;
  color: var(--text-body);
  border: 1px solid rgba(190, 210, 235, .18);
}
@media (hover: hover) {
  #newWork:hover {
    background:
      linear-gradient(135deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .04) 55%, rgba(255, 255, 255, .09)),
      rgba(18, 40, 66, .48);
    border-color: rgba(210, 228, 246, .32);
    -webkit-backdrop-filter: blur(16px) saturate(135%);
    backdrop-filter: blur(16px) saturate(135%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .24);
  }
}
@media (hover: none), (max-width: 760px) {
  #newWork:active {
    background:
      linear-gradient(135deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .04) 55%, rgba(255, 255, 255, .09)),
      rgba(18, 40, 66, .50);
    border-color: rgba(210, 228, 246, .34);
    -webkit-backdrop-filter: blur(16px) saturate(135%);
    backdrop-filter: blur(16px) saturate(135%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .26);
  }
}

/* 手机作品集：横向卡片列表，避免单件作品只占半宽 */
@media (max-width: 760px) {
  body.tool-mode .site-footer { display: none; }
  .works-grid { display: flex; flex-direction: column; gap: 10px; }
  .work-card { flex-direction: row; align-items: stretch; }
  .work-open { display: flex; flex: 1; align-items: center; gap: 10px; min-width: 0; padding: 10px; }
  .work-open img { flex: 0 0 92px; width: 92px; height: 92px; aspect-ratio: 1; border-radius: 10px; object-fit: cover; }
  .work-meta { flex: 1; justify-content: center; padding: 0; min-width: 0; }
  .work-actions { flex: 0 0 62px; flex-direction: column; width: 62px; padding: 10px 10px 10px 0; margin: 0; }
  .work-actions button { min-height: 34px; font-size: 10px; }
}

/* 桌面作品抽屉固定高度：top 100 + bottom 24 */
@media (min-width: 761px) {
  body.works-open #works {
    bottom: auto;
    height: calc(100vh - 124px);
    height: calc(100dvh - 124px);
  }
}

/* 作品集底部说明 + 手机填满可用高度 */
.works-foot-note {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(190, 210, 235, .10);
  font-size: 10px;
  line-height: 1.6;
  letter-spacing: .04em;
  color: var(--text-faint);
}
@media (max-width: 760px) {
  .works-panel { min-height: calc(100dvh - 190px); }
  .works-panel .works-grid { flex: 1; align-content: start; }
}

@media (max-width: 360px) {
  .mobile-nav button {
    font-size: 11.5px;
    letter-spacing: 0;
    white-space: nowrap;
    padding-left: 2px;
    padding-right: 2px;
  }
  .works-head-actions {
    gap: 5px;
  }
  .works-head-actions button {
    font-size: 10px;
    padding: 5px 5px;
    white-space: nowrap;
  }
}

/* 桌面打开作品抽屉时，main 不能形成高于 scrim 的 stacking context */
@media (min-width: 761px) {
  body.works-open main { z-index: auto; }
}

/* =========================================================
   Apple-like interaction polish
   ========================================================= */
.canvas-hud {
  position: absolute;
  top: 10px;
  left: 50%;
  z-index: 4;
  transform: translate(-50%, -4px);
  padding: 5px 11px;
  border: 1px solid rgba(190, 210, 235, .20);
  border-radius: 999px;
  background: rgba(7, 19, 33, .90);
  color: var(--text-strong);
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: .05em;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  opacity: 0;
  transition: opacity .16s ease, transform .16s ease;
}
.canvas-hud.show { opacity: 1; transform: translate(-50%, 0); }
.canvas-hud[hidden] { display: none !important; }

@keyframes viewIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@media (max-width: 760px) {
  body.is-ready .panel.view-enter { animation: viewIn .28s cubic-bezier(.2, .8, .2, 1) both; }
  .mobile-nav button {
    transition: background-color .20s ease, color .20s ease, border-color .20s ease,
      transform .16s ease, box-shadow .20s ease;
  }
}

@keyframes drawerIn {
  from { opacity: 0; transform: translateX(18px); }
  to { opacity: 1; transform: none; }
}
@keyframes scrimIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@media (min-width: 761px) {
  body.works-open #works { animation: drawerIn .26s cubic-bezier(.2, .8, .2, 1) both; }
  body.works-open .works-scrim { animation: scrimIn .20s ease both; }
}

/* 保存提示要盖过作品抽屉 */
.save-toast { z-index: 60; }

/* 画布样式这一行是旧版留下的深紫底，改成冷色平面分隔行 */
.canvas-style {
  margin: 12px 0 12px;
  padding: 10px 0 0;
  background: transparent;
  border: 0;
  border-top: 1px solid rgba(190, 210, 235, .10);
  border-radius: 0;
}
.canvas-style label {
  margin-top: 0;
  padding-top: 0;
  color: var(--text-muted);
  font-weight: 500;
}
.canvas-style select {
  flex: 1;
  max-width: 220px;
  background: #0b1c2f;
  border: 1px solid rgba(190, 210, 235, .16);
  color: var(--text-body);
}

/* 全站统一为苹方，去掉标题前的菱形点与左上角装饰 */
:root {
  --sans: "PingFang SC", "SF Pro Display", "SF Pro Text", -apple-system,
    BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  --serif: "PingFang SC", "SF Pro Display", "SF Pro Text", -apple-system,
    BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

.panel-heading h1::before,
.panel-heading h2::before {
  content: none;
  display: none;
}

.panel-ornament span:nth-child(1) {
  display: none;
}

/* 空画布引导 */
.canvas-empty {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  width: min(260px, 72%);
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 16px;
  border: 1px solid rgba(11, 28, 47, .12);
  border-radius: 16px;
  background: var(--paper);
  color: #0b1624;
  text-align: center;
}
.canvas-empty[hidden] { display: none !important; }
.canvas-empty strong { font-size: 18px; font-weight: 600; }
.canvas-empty span { font-size: 12px; line-height: 1.6; color: #5b6b80; }
.canvas-empty button {
  margin-top: 4px;
  min-height: 38px;
  padding: 6px 16px;
  border: 1px solid #0e2136;
  border-radius: 999px;
  background: #0e2136;
  color: #eaf1f8;
  font-size: 12px;
}

/* 首次手势提示 */
.gesture-coach {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(190, 210, 235, .18);
  border-radius: 14px;
  background: #0b1c2f;
  color: var(--text-body);
}
.gesture-coach[hidden] { display: none !important; }
.gesture-coach > div { flex: 1; min-width: 0; }
.gesture-coach strong { display: block; margin-bottom: 2px; font-size: 11px; color: var(--text-strong); }
.gesture-coach span { display: block; font-size: 11px; line-height: 1.55; color: var(--text-muted); }
.gesture-coach button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 5px 10px;
  border: 1px solid var(--cream);
  border-radius: 9px;
  background: var(--cream);
  color: #0b1624;
  font-size: 11px;
}

/* 靛蓝配方 */
.dye-presets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}
.dye-presets button {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  min-height: 36px;
  padding: 6px 8px;
  border: 1px solid rgba(190, 210, 235, .16);
  border-radius: 9px;
  background: transparent;
  color: var(--text-body);
  font-size: 11px;
  text-align: left;
}
.dye-presets i {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 50%;
  background: #194778;
}
@media (hover: hover) {
  .dye-presets button:hover {
    background: rgba(255, 255, 255, .10);
    border-color: rgba(210, 228, 246, .32);
    -webkit-backdrop-filter: blur(14px) saturate(130%);
    backdrop-filter: blur(14px) saturate(130%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22);
  }
}
@media (hover: none), (max-width: 760px) {
  .dye-presets button:active {
    background: rgba(255, 255, 255, .12);
    border-color: rgba(210, 228, 246, .34);
    -webkit-backdrop-filter: blur(14px) saturate(130%);
    backdrop-filter: blur(14px) saturate(130%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .24);
  }
}

/* 当前纹样的档案入口与档案卡 */
.selection-tools {
  margin: -4px 0 12px;
}
.selection-tools button {
  min-height: 32px;
  padding: 4px 10px;
  border: 1px solid rgba(190, 210, 235, .16);
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
}
.selection-tools button:disabled { opacity: .4; }

.motif-archive {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 20px;
}
.motif-archive[hidden] { display: none !important; }
.archive-scrim {
  position: absolute;
  inset: 0;
  background: rgba(3, 9, 18, .68);
}
.archive-card {
  position: relative;
  z-index: 1;
  width: min(390px, calc(100vw - 32px));
  max-height: min(82dvh, 680px);
  overflow: auto;
  padding: 20px;
  border: 1px solid rgba(190, 210, 235, .16);
  border-radius: 22px;
  background: #0e2136;
  color: var(--text-body);
}
.archive-close {
  position: absolute;
  top: 10px;
  right: 10px;
  min-height: 32px;
  padding: 4px 10px;
  border: 1px solid rgba(190, 210, 235, .16);
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
}
#archiveImage {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: contain;
  padding: 12px;
  border: 1px solid rgba(190, 210, 235, .12);
  border-radius: 14px;
  background: var(--paper);
}
.archive-kicker { display: block; margin-top: 16px; font-size: 10px; letter-spacing: .12em; color: var(--text-faint); }
#archiveName { margin: 4px 0 6px; font-size: 24px; font-weight: 600; letter-spacing: .02em; color: var(--text-strong); }
#archiveDesc { font-size: 12px; line-height: 1.8; color: var(--text-muted); }
.archive-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid rgba(190, 210, 235, .10);
  font-size: 10px;
  letter-spacing: .08em;
  color: var(--text-faint);
}
@media (max-width: 760px) {
  .motif-archive { place-items: end center; padding: 0 10px calc(10px + env(safe-area-inset-bottom)); }
  .archive-card { width: 100%; max-height: min(80dvh, 640px); border-radius: 22px 22px 16px 16px; }
  #archiveImage { height: 200px; }
  #archiveName { font-size: 22px; }
}

/* =========================================================
   苹果中文网页的字体逻辑：SF Pro（拉丁/数字）+ 苹方（中文）
   收紧字距，放大正文，减少“版式字体”的痕迹
   ========================================================= */
:root {
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  --serif: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
}

body {
  font-family: var(--sans);
}

.brand strong {
  letter-spacing: .03em;
  font-weight: 600;
}

.brand small {
  font-size: 11px;
  letter-spacing: .08em;
}

.hero-kicker {
  font-size: 11px;
  letter-spacing: .14em;
}

.hero h1 {
  letter-spacing: -.01em;
  font-weight: 600;
}

.hero h1 em {
  opacity: .72;
}

.hero p {
  font-size: clamp(16px, 1.06vw, 17px);
  line-height: 1.7;
}

.hero-meta {
  font-size: 11px;
  letter-spacing: .10em;
}

.panel-heading h1,
.panel-heading h2 {
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: 0;
}

.step-note,
.panel-heading .step-note {
  font-size: 11px;
  letter-spacing: .02em;
}

.works-title h2 {
  font-size: 22px;
  letter-spacing: 0;
}

.export-copy strong {
  letter-spacing: .02em;
}

.footer-brand strong,
.footer-brand p,
.footer-note {
  letter-spacing: .04em;
}

#count,
.daily-kicker,
#dailyMeta,
.work-meta small,
.works-foot-note,
.archive-kicker,
.archive-meta,
.motif span {
  font-size: 11px;
  letter-spacing: .03em;
}

#dailyName {
  font-size: 17px;
}

@media (max-width: 760px) {
  .hero p {
    font-size: 16px;
    line-height: 1.68;
  }

  .panel-heading h1,
  .panel-heading h2 {
    font-size: 21px;
  }

  .works-title h2 {
    font-size: 21px;
  }

  .export-copy > span {
    font-size: 12px;
  }
}

/* 档案卡关闭按钮更清晰 */
.archive-close {
  z-index: 3;
  background: #0b1c2f;
  border-color: rgba(190, 210, 235, .24);
  color: var(--text-strong);
}
@media (max-width: 760px) {
  .archive-card { padding-top: 24px; }
  .archive-card::before {
    content: "";
    position: absolute;
    top: 8px;
    left: 50%;
    width: 36px;
    height: 4px;
    transform: translateX(-50%);
    border-radius: 999px;
    background: rgba(190, 210, 235, .26);
  }
}

/* 极简：去掉面板四角的装饰点/纹，保留纯平面版式 */
.panel-ornament { display: none; }

/* 作品题名 + 展签卡 */
.work-title-edit {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-muted);
}
.work-title-edit input {
  flex: 1;
  min-width: 0;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid rgba(190, 210, 235, .16);
  border-radius: 9px;
  background: #0b1c2f;
  color: var(--text-strong);
  font-size: 13px;
}
.work-title-edit input::placeholder { color: var(--text-faint); }
.export-actions #shareCard {
  background: transparent;
  border: 1px solid rgba(190, 210, 235, .18);
  color: var(--text-body);
  font-weight: 400;
}
@media (hover: hover) {
  .export-actions #shareCard:hover {
    background: rgba(255, 255, 255, .10);
    border-color: rgba(210, 228, 246, .32);
    -webkit-backdrop-filter: blur(14px) saturate(130%);
    backdrop-filter: blur(14px) saturate(130%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22);
  }
}
@media (hover: none), (max-width: 760px) {
  .export-actions #shareCard:active {
    background: rgba(255, 255, 255, .12);
    border-color: rgba(210, 228, 246, .34);
    -webkit-backdrop-filter: blur(14px) saturate(130%);
    backdrop-filter: blur(14px) saturate(130%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .24);
  }
}

/* 导出浮层：关闭按钮移到右上角，动作按钮保持一行 */
#exportClose.export-close {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border: 1px solid rgba(190, 210, 235, .16);
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1;
}
.export-actions { padding-right: 24px; }
@media (max-width: 760px) {
  .export-actions { padding-right: 18px; gap: 6px; }
  .export-actions a, .export-actions button { padding-left: 10px; padding-right: 10px; }
}

/* =========================================================
   藏蓝校正：更深、更蓝、更少青绿
   ========================================================= */
:root {
  --navy: #0b1934;
  --navy-deep: #071022;
  --panel: #101f3e;
  --panel-2: #132346;
  --control: #172c4e;
}

html,
body {
  background: #0b1934;
}

.panel {
  background: #101f3e;
}

.app-header {
  background: #0d1b39;
}

.mobile-nav {
  background: #0d1b39;
}

#search {
  background: #0d1c37;
}

.board-tabs {
  background: #0d1b39;
}

.tool-buttons button {
  background: #172c4e;
}

.canvas-style select {
  background: #0d1c37;
}

.export-result,
.save-toast,
.gesture-coach,
.daily-card,
.work-card,
.work-title-edit input {
  background: #0d1e3a;
}

.archive-card {
  background: #101f3e;
}

.archive-close {
  background: #0d1e3a;
}

.site-footer {
  background: #081226;
}

.canvas-hud {
  background: rgba(8, 18, 38, .92);
}
