/* ==========================================================================
   液态毛玻璃 · 打印系统共用样式
   - 只有浅色：干净、清澈、偏白，参照苹果的系统界面
   - 背景：近白底色上几团缓慢变形的“液体”，再盖一层磨砂玻璃
   - 扁平：选中压平成白色平面 + 蓝字，阴影很轻，边缘一像素
   - 交互：以鼠标悬停为主（上浮、亮起、滑动指示、光泽扫过），不做跟随光标的光圈
   ========================================================================== */
@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap");

:root {
  --bg-0: #fbfcfd;
  --bg-1: #f1f4f7;
  --liquid-1: #dae2ec;
  --liquid-2: #e3e8ef;
  --liquid-3: #d5dde8;
  --liquid-4: #e6ebf2;

  --ink: #1d1d1f;
  --muted: #6e6e73;
  --faint: #98989d;
  --accent: #0a84ff;
  --accent-hover: #0071e3;
  --accent-soft: rgba(10, 132, 255, .1);
  --accent-ring: rgba(10, 132, 255, .22);
  --ok: #248a3d;
  --warn: #b25000;
  --bad: #d70015;

  --glass: rgba(255, 255, 255, .62);
  --glass-strong: rgba(255, 255, 255, .78);
  --glass-soft: rgba(255, 255, 255, .45);
  --glass-raised: rgba(255, 255, 255, .95);
  --glass-bar: rgba(252, 252, 253, .94);
  --line: rgba(0, 0, 0, .06);
  --line-strong: rgba(0, 0, 0, .12);
  --edge: rgba(255, 255, 255, .9);
  --hover-fill: rgba(0, 0, 0, .035);
  --depth: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 28px -14px rgba(0, 0, 0, .12);
  --depth-hover: 0 2px 4px rgba(0, 0, 0, .05), 0 16px 40px -18px rgba(0, 0, 0, .2);
  --blur: blur(24px) saturate(180%);

  /* 旧变量名，页面里还有引用 */
  --hair: var(--line);
  --shade: rgba(0, 0, 0, .14);
  --lens: inset 0 1px 0 var(--edge), inset 0 0 0 1px rgba(255, 255, 255, .5);
  --on: var(--accent);
  --on-deep: var(--accent-hover);
  --glow: var(--accent-ring);
  --sky-0: #fbfcfd; --band-2: #e3e9f0; --band-4: #eaeef3; --band-6: #f1f4f7;
  --cloud-c: #e3e9f0; --cloud-m: #eaeef3; --cloud-y: #fff3c4;

  --r-xl: 22px;
  --r-lg: 16px;
  --r-md: 11px;
  --r-pill: 999px;
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --ease: cubic-bezier(.25, .8, .25, 1);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Manrope", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --mono: "SF Mono", "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  color-scheme: light;   /* 始终浅色，不跟随系统深色模式 */
}

* { box-sizing: border-box; }
html { background: var(--bg-0); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: transparent;
  font: 14px/1.6 var(--font);
  font-feature-settings: "tnum" 1;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.mono, .eyebrow { font-family: var(--mono); font-size: 11px; letter-spacing: .02em; color: var(--faint); font-weight: 400; }
.display { font-weight: 500; letter-spacing: -.02em; }

/* ---------- 背景：液态毛玻璃 ---------- */
.ink-field { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  background: linear-gradient(165deg, var(--bg-0) 0%, var(--bg-1) 100%); }
.ink-field i {
  position: absolute; z-index: 0;
  background: radial-gradient(120% 120% at 30% 25%, #fff 0%, var(--c) 55%, var(--c) 100%);
  box-shadow: inset 6px 8px 18px rgba(255, 255, 255, .9), inset -10px -14px 30px rgba(0, 0, 0, .035);
  animation: morph var(--d, 26s) ease-in-out infinite alternate, float var(--fd, 34s) ease-in-out infinite alternate;
  animation-delay: var(--dl, 0s);
}
.ink-field i:nth-child(1) { --c: var(--liquid-1); width: 46vmax; height: 40vmax; left: -10vmax; top: -12vmax; --d: 24s; --fd: 38s; }
.ink-field i:nth-child(2) { --c: var(--liquid-2); width: 38vmax; height: 34vmax; right: -8vmax; top: 6vmax; --d: 30s; --fd: 42s; --dl: -9s; }
.ink-field i:nth-child(3) { --c: var(--liquid-3); width: 34vmax; height: 30vmax; left: 26vmax; bottom: -14vmax; --d: 27s; --fd: 36s; --dl: -15s; }
.ink-field i:nth-child(4) { --c: var(--liquid-4); width: 26vmax; height: 24vmax; left: 4vmax; bottom: 6vmax; --d: 22s; --fd: 30s; --dl: -4s; }
/* 盖在液体上的那层磨砂玻璃 */
.ink-field::before { content: ""; position: absolute; inset: 0; z-index: 1;
  background: rgba(255, 255, 255, .18);
  -webkit-backdrop-filter: blur(28px) saturate(140%); backdrop-filter: blur(34px) saturate(140%); }
.ink-field::after { /* 磨砂颗粒 */
  content: ""; position: absolute; inset: 0; z-index: 2; opacity: .035; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%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)'/%3E%3C/svg%3E");
}
@keyframes morph {
  0%   { border-radius: 42% 58% 63% 37% / 41% 44% 56% 59%; }
  33%  { border-radius: 58% 42% 38% 62% / 55% 38% 62% 45%; }
  66%  { border-radius: 37% 63% 51% 49% / 37% 62% 38% 63%; }
  100% { border-radius: 61% 39% 45% 55% / 48% 57% 43% 52%; }
}
@keyframes float {
  0%   { transform: translate3d(0, 0, 0) rotate(0deg); }
  50%  { transform: translate3d(3vmax, 2vmax, 0) rotate(8deg); }
  100% { transform: translate3d(-2vmax, 4vmax, 0) rotate(-6deg); }
}

/* ---------- 玻璃面板：扁平、轻阴影、一像素亮边 ---------- */
.glass {
  position: relative;
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border-radius: var(--r-xl);
  box-shadow: inset 0 0 0 1px var(--edge), 0 0 0 1px var(--line), var(--depth);
  isolation: isolate;
  transition: box-shadow .35s var(--ease), background .35s var(--ease);
}
.glass.strong { background: var(--glass-strong); }
.glass.soft { background: var(--glass-soft); box-shadow: inset 0 0 0 1px var(--edge), 0 0 0 1px var(--line); }
.glass.lift:hover { box-shadow: inset 0 0 0 1px var(--edge), 0 0 0 1px var(--line), var(--depth-hover); }

/* 加载时玻璃“凝结”出现 */
.condense { animation: condense .7s var(--ease) both; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes condense {
  from { opacity: 0; transform: translateY(10px) scale(.99); filter: blur(6px); }
  to   { opacity: 1; transform: none; filter: none; }
}

/* ---------- 按钮 ---------- */
.btn {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 17px; border-radius: var(--r-pill); border: 0; cursor: pointer; white-space: nowrap; font-weight: 500;
  background: var(--glass-strong); color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  transition: transform .3s var(--spring), box-shadow .25s var(--ease), background .25s var(--ease), color .25s;
}
/* 悬停：亮起、上浮，表面扫过一道液体光泽 */
.btn::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .7) 50%, transparent 70%);
  transform: translateX(-130%); transition: transform .8s var(--ease);
}
.btn:hover:not(:disabled) { background: var(--glass-raised); transform: translateY(-1px);
  box-shadow: inset 0 0 0 1px var(--line-strong), 0 6px 16px -8px rgba(0, 0, 0, .18); }
.btn:hover:not(:disabled)::after { transform: translateX(130%); }
.btn:active:not(:disabled) { transform: translateY(0) scale(.97); transition-duration: .1s; }
.btn.primary { color: #fff; background: var(--accent); box-shadow: none; }
.btn.primary::after { background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .35) 50%, transparent 70%); }
.btn.primary:hover:not(:disabled) { background: var(--accent-hover); box-shadow: 0 8px 20px -8px rgba(0, 113, 227, .55); }
.btn.done::before {
  content: attr(data-done); position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center;
  border-radius: inherit; color: var(--ok); font-weight: 600; background: #e8f6ec;
  animation: done-in .4s var(--spring) both; }
@keyframes done-in { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.sm { padding: 5px 13px; font-size: 13px; }

/* ---------- 分段控件：选中是白色平面 + 蓝字，悬停有一块浅色平面跟过去 ---------- */
.liquid-tabs { position: relative; display: inline-flex; padding: 3px; border-radius: var(--r-pill);
  background: rgba(118, 118, 128, .1); }
.liquid-tabs > button { position: relative; z-index: 2; border: 0; background: none; cursor: pointer; padding: 6px 18px;
  border-radius: var(--r-pill); color: var(--muted); font-weight: 500; transition: color .25s var(--ease), transform .3s var(--spring); }
.liquid-tabs > button:hover { color: var(--ink); }
.liquid-tabs > button:active { transform: scale(.95); }
.liquid-tabs > button.on { color: var(--accent); font-weight: 600; }
.liquid-tabs .drop, .liquid-tabs .ghost {
  position: absolute; top: 3px; bottom: 3px; left: 0; width: 0; border-radius: var(--r-pill);
  transition: left .5s var(--spring), width .5s var(--spring), opacity .25s var(--ease);
}
.liquid-tabs .drop { z-index: 1; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .1), 0 3px 8px -2px rgba(0, 0, 0, .06); }
.liquid-tabs .ghost { z-index: 0; background: rgba(255, 255, 255, .7); box-shadow: 0 1px 2px rgba(0, 0, 0, .05); opacity: 0; }
.liquid-tabs.hovering .ghost { opacity: 1; }
.liquid-tabs .drop.moving { animation: stretch .5s var(--ease); }
@keyframes stretch { 35% { transform: scaleX(1.08) scaleY(.88); } 100% { transform: none; } }

/* ---------- 复选框 ---------- */
.check {
  appearance: none; -webkit-appearance: none; flex: none; cursor: pointer; margin: 0;
  width: 18px; height: 18px; border-radius: 6px; position: relative;
  background: #fff; box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, .2);
  transition: background .2s var(--ease), box-shadow .2s, transform .3s var(--spring);
}
.check:hover:not(:disabled) { box-shadow: inset 0 0 0 1.5px var(--accent), 0 0 0 4px var(--accent-soft); }
.check:active { transform: scale(.85); }
.check:checked, .check:indeterminate { background: var(--accent); box-shadow: none; }
.check:checked:hover, .check:indeterminate:hover { box-shadow: 0 0 0 4px var(--accent-soft); }
.check::after {
  content: ""; position: absolute; left: 6px; top: 2.5px; width: 4px; height: 9px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) scale(0); transform-origin: 50% 60%;
  transition: transform .35s var(--spring);
}
.check:checked::after { transform: rotate(45deg) scale(1); }
.check:indeterminate::after { left: 4px; top: 7.5px; width: 8px; height: 0; border-width: 0 0 2px 0; transform: none; }
.check:disabled { opacity: .35; cursor: not-allowed; }

/* ---------- 表单 ---------- */
.input, select.input {
  padding: 8px 12px; border-radius: var(--r-md); border: 0; background: rgba(255, 255, 255, .85);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  transition: box-shadow .2s var(--ease), background .2s;
}
.input:hover { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .22); background: #fff; }
.input:focus { outline: none; background: #fff; box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 4px var(--accent-ring); }
select.input { cursor: pointer; }

/* ---------- 状态标签 ---------- */
.tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; padding: 2px 10px; border-radius: var(--r-pill);
  color: var(--muted); background: rgba(118, 118, 128, .1); white-space: nowrap; transition: color .3s, background .3s; }
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag.paid, .tag.printing { color: var(--accent); background: var(--accent-soft); }
.tag.printing::before { animation: pulse 1.1s ease-in-out infinite; }
.tag.done { color: var(--ok); background: rgba(36, 138, 61, .1); }
.tag.failed { color: var(--bad); background: rgba(215, 0, 21, .08); }
.tag.held { color: var(--warn); background: rgba(178, 80, 0, .09); }
@keyframes pulse { 50% { transform: scale(1.7); opacity: .3; } }

/* ---------- 透镜：悬停标题时，一颗玻璃水滴从字上滑过 ---------- */
.lens-host { position: relative; display: inline-block; }
.lens {
  position: absolute; z-index: 3; pointer-events: none; top: 50%; left: 0;
  width: 2.2em; height: 1.6em; margin-top: -.8em; border-radius: 46% 54% 50% 50% / 52% 48% 52% 48%;
  background: rgba(255, 255, 255, .08);
  -webkit-backdrop-filter: blur(.3px) brightness(1.04); backdrop-filter: blur(.3px) brightness(1.04);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .95), inset 0 -6px 10px -6px rgba(255, 255, 255, .8), inset 0 0 0 1px rgba(255, 255, 255, .6), 0 4px 10px -6px rgba(0, 0, 0, .2);
  animation: lens-sweep 1.8s var(--ease) both;
}
@keyframes lens-sweep {
  0%   { transform: translateX(-20%) scale(.6); opacity: 0; }
  15%  { opacity: 1; transform: translateX(0) scale(1); }
  50%  { transform: translateX(calc(var(--w, 200px) * .5)) scale(1.05, .95); }
  85%  { opacity: 1; }
  100% { transform: translateX(var(--w, 200px)) scale(.85); opacity: 0; }
}

/* ---------- 出纸动画 ---------- */
.paper-out {
  position: fixed; z-index: 50; width: 64px; height: 84px; border-radius: 5px; pointer-events: none;
  background: #fff;
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .25), inset 0 0 0 1px rgba(0, 0, 0, .06);
  background-image: repeating-linear-gradient(180deg, transparent 0 13px, rgba(0, 0, 0, .1) 13px 14px);
  background-size: 70% 100%; background-position: 50% 16px; background-repeat: no-repeat;
  animation: paper 1.25s var(--ease) forwards;
}
@keyframes paper {
  0%   { transform: translate(-50%, 0) scaleY(.05); opacity: 0; transform-origin: 50% 100%; }
  20%  { opacity: 1; }
  55%  { transform: translate(-50%, -92px) scaleY(1) rotate(-2deg); }
  100% { transform: translate(-50%, -140px) rotate(-6deg) scale(.9); opacity: 0; }
}

/* ---------- 进度：扁平细管，带一道流动的亮光 ---------- */
.flow { position: relative; height: 6px; border-radius: var(--r-pill); overflow: hidden; background: rgba(118, 118, 128, .14); }
.flow > div { position: relative; height: 100%; border-radius: inherit; background: var(--accent); transition: width .4s var(--ease); overflow: hidden; }
.flow > div::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent);
  animation: glint 1.6s ease-in-out infinite; }
@keyframes glint { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .paper-out, .lens { display: none; }
}
