/* ============================================================
   忆所 · 印样间
   暗房灯箱：暗的房间，一块发亮的灯箱，一张纸质配方卡。
   红色只留给"正在显影"这件事。
   ============================================================ */

:root {
  --bench:        #14181a;
  --bench-deep:   #0e1213;
  --bench-line:   #262d2f;
  --bench-line-2: #333c3e;
  --chalk:        #c3c8c1;
  --chalk-dim:    #7b837d;

  --paper:      #e8e7df;
  --paper-hi:   #f6f6f0;
  --paper-line: #cbcabe;
  --paper-line-2: #dedcd0;
  --ink:        #1c2224;
  --ink-soft:   #5d6663;

  --safelight:  #c8452c;

  /* 中文 思源黑体 Source Han Sans（网页端用同一设计的 Noto Sans SC 字体文件），
     西文 Source Sans Pro。西文字体在前，所以拉丁字母走 Source Sans Pro，
     汉字自动落到思源黑体。 */
  --sans: "Source Sans Pro", "Noto Sans SC", "Source Han Sans SC", "Source Han Sans CN",
          "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;

  /* 标题：同一套字，靠字重和字距拉开层级，不再用宋体 */
  --display: "Source Sans Pro", "Noto Sans SC", "Source Han Sans SC", "Source Han Sans CN",
             "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;

  /* 编号 / 日期 / 尺寸：以前是等宽，现在也用 Source Sans Pro，
     靠 tabular-nums 让数字仍然对齐 */
  --num: "Source Sans Pro", "Noto Sans SC", "Source Han Sans SC", "PingFang SC", sans-serif;

  --top-h: 64px;
  --rail: 372px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bench);
  color: var(--chalk);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body { min-height: 100dvh; }

button, input, select { font: inherit; color: inherit; }

button { cursor: pointer; }

img { -webkit-user-drag: none; }

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

.ico {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.meta {
  font-family: var(--num);
  font-variant-numeric: tabular-nums;
  font-size: 9.5px;
  letter-spacing: .08em;
  color: var(--ink-soft);
}

/* ---------------- 品牌锁定 ---------------- */

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.brand-cn {
  font-family: var(--display);
  font-weight: 500;
  font-size: 21px;
  letter-spacing: .06em;
  color: var(--ink);
  line-height: 1;
}

.brand-en {
  font-family: var(--num);
  font-variant-numeric: tabular-nums;
  font-size: 8.5px;
  letter-spacing: .24em;
  color: var(--ink-soft);
  white-space: nowrap;
}

.topbar .brand-cn { color: var(--chalk); }
.topbar .brand-en { color: var(--chalk-dim); }

/* ---------------- 门 ---------------- */

.gate {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 48px 28px;
  background:
    radial-gradient(120% 90% at 50% -10%, #1d2325 0%, rgba(20,24,26,0) 60%),
    var(--bench);
}

.gate-grid {
  width: 100%;
  max-width: 880px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 404px;
  gap: 64px;
  align-items: start;
}

.gate-mark {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding-top: 4px;
}

.mark-cn {
  font-family: var(--display);
  font-weight: 500;
  font-size: 54px;
  line-height: 1;
  letter-spacing: .1em;
  color: var(--chalk);
}

.mark-en {
  margin-top: 16px;
  font-family: var(--num);
  font-variant-numeric: tabular-nums;
  font-size: 9.5px;
  letter-spacing: .34em;
  color: var(--chalk-dim);
}

.gate-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.gate-card {
  background: var(--paper);
  color: var(--ink);
  padding: 32px 32px 28px;
  border-radius: 1px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, .06),
    0 0 90px -10px rgba(232, 231, 223, .10),
    0 40px 90px -40px rgba(0, 0, 0, .9);
}

.gate-title {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 500;
  letter-spacing: .02em;
  margin: 0 0 10px;
  color: var(--ink);
}

.gate-lede {
  margin: 0 0 26px;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--ink-soft);
}

.gate-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 14px;
  color: var(--ink-soft);
  font-size: 10.5px;
}

.gate-or::before,
.gate-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--paper-line);
}

.gate-wechat {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.gate-msg {
  margin: 14px 0 0;
  min-height: 16px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--safelight);
}

.gate-msg.ok { color: var(--ink); }

.gate-switch {
  margin-top: 14px;
  width: 100%;
  text-align: center;
}


/* ---------------- 表单 ---------------- */

.field {
  display: block;
  margin-bottom: 16px;
}

.field > span {
  display: block;
  font-size: 10.5px;
  letter-spacing: .06em;
  color: var(--ink-soft);
  margin-bottom: 5px;
}

.field input,
.field select {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #b9b8ac;
  border-radius: 0;
  padding: 7px 1px;
  font-size: 14px;
  color: var(--ink);
  transition: border-color .15s ease;
}

.field input::placeholder { color: #a3a49a; }

.field-note {
  margin: -6px 0 16px;
  font-size: 10.5px;
  line-height: 1.6;
  letter-spacing: .02em;
  color: var(--ink-soft);
}

.field input:focus,
.field select:focus {
  outline: none;
  border-bottom-color: var(--ink);
}

.field input:focus-visible,
.field select:focus-visible {
  outline: none;
  border-bottom-color: var(--ink);
  box-shadow: 0 1px 0 0 var(--ink);
}

.field select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='6' viewBox='0 0 9 6'%3E%3Cpath d='M1 1l3.5 3.5L8 1' fill='none' stroke='%235d6663' stroke-width='1.2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 3px center;
  padding-right: 16px;
  font-family: var(--num);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  letter-spacing: .02em;
}

.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.switch {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  color: var(--ink-soft);
  cursor: pointer;
  user-select: none;
}

.switch input {
  width: 13px;
  height: 13px;
  accent-color: var(--ink);
  margin: 0;
}

.swatches {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.swatch {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 10px;
  color: var(--ink-soft);
  cursor: pointer;
}

.swatch input[type="color"] {
  width: 40px;
  height: 24px;
  padding: 0;
  border: 1px solid #b9b8ac;
  border-radius: 1px;
  background: transparent;
  cursor: pointer;
}

.swatch input[type="color"]::-webkit-color-swatch-wrapper { padding: 2px; }
.swatch input[type="color"]::-webkit-color-swatch { border: 0; }

.field-swatch {
  display: flex;
  align-items: center;
  gap: 12px;
}

.field-swatch > span { margin: 0; }

.field-swatch input[type="color"] {
  width: 40px;
  height: 24px;
  padding: 0;
  border: 1px solid #b9b8ac;
  background: transparent;
}

.range {
  display: grid;
  grid-template-columns: 74px 1fr 38px;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.range > span {
  font-size: 11.5px;
  color: var(--ink-soft);
}

.range > b {
  font-family: var(--num);
  font-variant-numeric: tabular-nums;
  font-size: 10px;
  font-weight: 400;
  text-align: right;
  color: var(--ink);
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 16px;
  background: transparent;
  margin: 0;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 1px;
  background: #b3b2a6;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 14px;
  margin-top: -7px;
  background: var(--ink);
  border: 0;
  border-radius: 1px;
}

input[type="range"]::-moz-range-track {
  height: 1px;
  background: #b3b2a6;
}

input[type="range"]::-moz-range-thumb {
  width: 10px;
  height: 14px;
  background: var(--ink);
  border: 0;
  border-radius: 1px;
}

/* ---------------- 按钮 ---------------- */

.btn-ink {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: var(--ink);
  color: var(--paper-hi);
  font-size: 12.5px;
  letter-spacing: .06em;
  transition: background .15s ease, transform .1s ease;
}

.btn-ink:hover { background: #2b3436; border-color: #2b3436; }
.btn-ink:active { transform: translateY(1px); }
.btn-ink[disabled] {
  background: #a9a89c;
  border-color: #a9a89c;
  color: #f2f1e9;
  cursor: not-allowed;
}

.btn-line {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  border: 1px solid rgba(28, 34, 36, .38);
  border-radius: 2px;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  transition: border-color .15s ease, background .15s ease;
}

.btn-line:hover { border-color: var(--ink); background: rgba(28, 34, 36, .04); }

.on-dark.btn-line,
.topbar .btn-line {
  border-color: var(--bench-line-2);
  color: var(--chalk);
}

.on-dark.btn-line:hover,
.topbar .btn-line:hover {
  border-color: #55605f;
  background: rgba(255, 255, 255, .04);
}

.btn-paper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 15px;
  border: 1px solid var(--paper);
  border-radius: 2px;
  background: var(--paper);
  color: var(--ink);
  font-size: 12px;
  letter-spacing: .04em;
  transition: background .15s ease;
}

.btn-paper:hover { background: #f2f2ea; border-color: #f2f2ea; }

.text-btn {
  background: none;
  border: 0;
  padding: 0;
  font-size: 11.5px;
  letter-spacing: .04em;
  color: var(--ink-soft);
  border-bottom: 1px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}

.text-btn:hover { color: var(--ink); border-bottom-color: var(--ink); }

.account .text-btn { color: var(--chalk-dim); }
.account .text-btn:hover { color: var(--chalk); border-bottom-color: var(--chalk); }

/* ---------------- 顶栏 ---------------- */

.topbar {
  height: var(--top-h);
  flex: none;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 22px;
  border-bottom: 1px solid var(--bench-line);
  background: var(--bench-deep);
}

.modes {
  display: flex;
  border: 1px solid var(--bench-line-2);
  border-radius: 2px;
  overflow: hidden;
  margin-left: 6px;
}

.modes button {
  padding: 7px 18px;
  background: transparent;
  border: 0;
  border-left: 1px solid var(--bench-line-2);
  color: var(--chalk-dim);
  font-size: 12px;
  letter-spacing: .04em;
  transition: color .15s ease, background .15s ease;
}

.modes button:first-child { border-left: 0; }
.modes button:hover { color: var(--chalk); }

.modes button[aria-selected="true"] {
  background: var(--paper);
  color: var(--ink);
}

.account {
  margin-left: auto;
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.account .who {
  font-family: var(--num);
  font-variant-numeric: tabular-nums;
  font-size: 10px;
  color: var(--chalk-dim);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 级别小标：1 级亮一点，2 / 3 级收着 */
.account .who-tier {
  font-family: var(--num);
  font-variant-numeric: tabular-nums;
  font-size: 9.5px;
  letter-spacing: .08em;
  padding: 2px 6px;
  color: var(--chalk-dim);
  border: 1px solid var(--bench-line-2);
  border-radius: 1px;
}

.studio[data-tier="1"] .account .who-tier {
  color: var(--safelight);
  border-color: rgba(200, 69, 44, .5);
}

/* ---------------- 工作台 ---------------- */

.studio {
  display: flex;
  flex-direction: column;
  height: 100dvh;
}

.bench {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--rail);
  overflow: hidden;
}

.stage {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 22px 24px 0;
}

.stage-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.stage-copy { max-width: 52ch; }

.stage-copy h1 {
  margin: 0;
  font-family: var(--display);
  font-size: 19px;
  font-weight: 500;
  letter-spacing: .04em;
  color: var(--chalk);
}

.stage-copy p {
  margin: 0;
  font-size: 12px;
  line-height: 1.7;
  color: var(--chalk-dim);
}

.stage-flag {
  margin-top: 6px !important;
  font-size: 11.5px !important;
  color: #cd6a53 !important;
}

.stage-tools {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}

/* 进度：安全灯 */

.progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.progress-rail {
  flex: 1;
  height: 2px;
  background: #272e30;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0;
  background: var(--safelight);
  transition: width .28s ease;
}

.progress-text {
  font-family: var(--num);
  font-variant-numeric: tabular-nums;
  font-size: 9.5px;
  letter-spacing: .06em;
  color: #cd6a53;
  white-space: nowrap;
}

/* 灯箱 */

.lamp {
  position: relative;
  flex: 1;
  min-height: 0;
  margin-top: 18px;
  padding: 22px;
  overflow: auto;
  border-radius: 2px;
  background: linear-gradient(180deg, #ecece3 0%, #dcdcce 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, .09),
    inset 0 0 110px rgba(120, 118, 100, .2),
    0 34px 80px -34px rgba(0, 0, 0, .95);
}

.lamp.dragover::after {
  content: "松手，放进灯箱";
  position: absolute;
  inset: 10px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--ink-soft);
  color: var(--ink);
  font-size: 13px;
  background: rgba(246, 246, 240, .82);
  z-index: 3;
}

.lamp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  gap: 18px;
  align-content: start;
}

.lamp-stack {
  display: grid;
  gap: 20px;
  justify-items: center;
}

/* 一张印样 */

.print {
  position: relative;
  margin: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #cecdc0;
  box-shadow: 0 8px 22px -12px rgba(0, 0, 0, .55);
  transition: box-shadow .2s ease, transform .2s ease;
}

.print:hover {
  box-shadow: 0 14px 30px -14px rgba(0, 0, 0, .6);
}

.print-img {
  background: #fbfbf7;
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  padding: 7px;
  overflow: hidden;
}

.print-img img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  pointer-events: none;
}

.print-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 7px;
  border-top: 1px solid #e3e2d6;
  font-family: var(--num);
  font-variant-numeric: tabular-nums;
  font-size: 9px;
  letter-spacing: .04em;
  color: var(--ink-soft);
}

.print-bar .no { color: var(--ink); }

.print-acts {
  position: absolute;
  inset: 0 0 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(20, 24, 26, .62);
  opacity: 0;
  transition: opacity .18s ease;
}

.print:hover .print-acts,
.print:focus-within .print-acts { opacity: 1; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 2px;
  background: rgba(20, 24, 26, .5);
  color: #f2f2ea;
  transition: background .15s ease;
}

.icon-btn:hover { background: rgba(246, 246, 240, .18); }

.icon-btn.warn { color: #e8907c; border-color: rgba(232, 144, 124, .5); }
.icon-btn.warn:hover { background: rgba(200, 69, 44, .28); }

/* 灯箱上的大图（长条 / A4） */

.plate {
  margin: 0;
  position: relative;
  background: #fff;
  border: 1px solid #b6b4a3;
  box-shadow: 0 18px 44px -22px rgba(0, 0, 0, .65);
  max-width: 100%;
}

.plate img {
  display: block;
  max-width: 100%;
  max-height: calc(100dvh - 372px);
  width: auto;
  height: auto;
}

/* Index Sheet 是横的整条：整条要能一眼看完，白边跟着画面走，别在右边留一条 */
.lamp > .plate {
  margin-inline: auto;
}

.plate-tag {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 8px;
  background: #f4f4ee;
  border-top: 1px solid #dddcd0;
  font-family: var(--num);
  font-variant-numeric: tabular-nums;
  font-size: 9px;
  color: var(--ink-soft);
}

/* 空灯箱 */

.lamp-empty {
  position: absolute;
  inset: 22px;
  display: grid;
  place-items: center;
  gap: 0;
  border: 1px dashed #aca99a;
  text-align: center;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
}

.lamp-empty:hover {
  border-color: var(--ink-soft);
  background: rgba(255, 255, 255, .45);
}

.lamp-empty .plus {
  display: block;
  width: 30px;
  height: 30px;
  margin: 0 auto 14px;
  color: #a3a094;
}

.lamp-empty .plus .ico { width: 30px; height: 30px; stroke-width: 1.1; }

.lamp-empty h2 {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
}

.lamp-empty p {
  margin: 0;
  font-size: 12px;
  line-height: 1.8;
  color: var(--ink-soft);
}

.lamp-hint {
  margin: 0;
  padding: 34px 0;
  text-align: center;
  font-size: 12.5px;
  line-height: 1.9;
  color: var(--ink-soft);
}

/* 底片顺序 */

.queue-wrap {
  flex: none;
  padding: 15px 0 18px;
}

.queue-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 9px;
}

.queue-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: .08em;
  color: var(--chalk);
}

.queue-head .meta { color: var(--chalk-dim); }

.queue {
  display: flex;
  gap: 11px;
  margin: 0;
  padding: 2px 2px 6px;
  list-style: none;
  overflow-x: auto;
  overflow-y: hidden;
  min-height: 92px;
  scrollbar-width: thin;
}

.queue::-webkit-scrollbar { height: 5px; }
.queue::-webkit-scrollbar-thumb { background: #39423f; }

.queue-item {
  position: relative;
  flex: none;
  width: 94px;
  cursor: grab;
}

.queue-item:active { cursor: grabbing; }

.queue-item img {
  display: block;
  width: 94px;
  height: 62px;
  object-fit: cover;
  background: #0b0e0f;
  border: 1px solid #2f3739;
  pointer-events: none;
  transition: border-color .15s ease;
}

.queue-item:hover img { border-color: #616d6b; }

.queue-item.is-dragging { opacity: .35; }

.queue-no {
  display: block;
  margin-top: 5px;
  font-family: var(--num);
  font-variant-numeric: tabular-nums;
  font-size: 9px;
  letter-spacing: .08em;
  color: var(--chalk-dim);
}

.queue-rm {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #454f4f;
  border-radius: 50%;
  background: #1d2325;
  color: var(--chalk);
  opacity: 0;
  transition: opacity .15s ease, color .15s ease;
}

.queue-rm .ico { width: 10px; height: 10px; }

.queue-item:hover .queue-rm,
.queue-item:focus-within .queue-rm { opacity: 1; }

.queue-rm:hover { color: #e8907c; border-color: #7a4a40; }

.queue-empty {
  padding: 26px 0;
  font-size: 12px;
  color: #6a726d;
}

/* ---------------- 配方卡 ---------------- */

.recipe {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  background: var(--paper);
  color: var(--ink);
  border-left: 1px solid var(--bench-line);
  scrollbar-width: thin;
}

.recipe::-webkit-scrollbar { width: 6px; }
.recipe::-webkit-scrollbar-thumb { background: #c2c1b4; }

.recipe-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 17px 20px 12px;
  background: var(--paper);
  border-bottom: 1px solid var(--paper-line);
}

.recipe-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: .1em;
}

.recipe-stock {
  font-family: var(--num);
  font-variant-numeric: tabular-nums;
  font-size: 9px;
  letter-spacing: .05em;
  color: var(--ink-soft);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.block {
  padding: 16px 20px;
  border-bottom: 1px solid var(--paper-line);
}

.block-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 13px;
}

.block-title h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .1em;
  color: var(--ink);
}

.seg {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  margin-bottom: 14px;
  border: 1px solid #b9b8ac;
  border-radius: 2px;
  overflow: hidden;
}

.seg button {
  padding: 7px 0;
  border: 0;
  border-left: 1px solid #b9b8ac;
  background: transparent;
  color: var(--ink-soft);
  font-size: 11.5px;
  transition: background .15s ease, color .15s ease;
}

.seg button:first-child { border-left: 0; }
.seg button:hover { background: rgba(28, 34, 36, .05); }

.seg button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper-hi);
}

.recipes {
  list-style: none;
  margin: 0;
  padding: 0;
}

.recipe-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed #d3d2c5;
}

.recipe-item:last-child { border-bottom: 0; padding-bottom: 0; }

.recipe-load {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 0;
  text-align: left;
  background: none;
  border: 0;
}

.recipe-load b {
  font-size: 12.5px;
  font-weight: 400;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recipe-load span {
  font-family: var(--num);
  font-variant-numeric: tabular-nums;
  font-size: 8.5px;
  letter-spacing: .04em;
  color: var(--ink-soft);
}

.recipe-del {
  flex: none;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: none;
  color: #9a9b90;
}

.recipe-del .ico { width: 12px; height: 12px; }
.recipe-del:hover { color: var(--safelight); }

.recipes-empty {
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--ink-soft);
}

.recipe-new {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  padding-bottom: 9px;
  border-bottom: 1px dashed #d3d2c5;
}

.recipe-new input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #b9b8ac;
  padding: 5px 1px;
  font-size: 12.5px;
  color: var(--ink);
}

.recipe-new input:focus { outline: none; border-bottom-color: var(--ink); }

.recipe-foot {
  position: sticky;
  bottom: 0;
  margin-top: auto;
  padding: 14px 20px 18px;
  background: var(--paper);
  border-top: 1px solid var(--paper-line);
}

/* ---------------- 放大 ---------------- */

.loupe {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 44px;
  background: rgba(9, 11, 12, .965);
}

.loupe img {
  max-width: 100%;
  max-height: calc(100dvh - 148px);
  object-fit: contain;
  box-shadow: 0 30px 80px -30px #000;
}

.loupe-close {
  position: fixed;
  top: 20px;
  right: 22px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--bench-line-2);
  border-radius: 2px;
  background: transparent;
  color: var(--chalk);
}

.loupe-close:hover { border-color: #5d6968; }

.loupe-foot {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 10.5px;
  color: var(--chalk-dim);
}

/* ---------------- 提示 ---------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 12px);
  z-index: 70;
  padding: 9px 15px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--paper-line);
  border-radius: 2px;
  font-size: 12px;
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, .8);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}

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

/* ---------------- 自适应 ---------------- */

@media (max-width: 1080px) {
  .studio { height: auto; min-height: 100dvh; }
  .bench {
    grid-template-columns: minmax(0, 1fr);
    overflow: visible;
  }
  .stage { min-height: 70dvh; padding-bottom: 4px; }
  .lamp { min-height: 42dvh; }
  .recipe {
    border-left: 0;
    border-top: 1px solid var(--bench-line);
    overflow: visible;
  }
  .recipe-head, .recipe-foot { position: static; }
  .recipe-foot { border-top: 1px solid var(--paper-line); }
}

@media (max-width: 880px) {
  .gate-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 34px;
    max-width: 440px;
  }
  .gate-mark { padding-top: 0; }
  .mark-cn { font-size: 40px; }
}

@media (max-width: 720px) {
  .topbar {
    height: auto;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 16px;
  }
  .modes {
    order: 3;
    width: 100%;
    margin: 0;
  }
  .modes button { flex: 1; padding: 8px 0; }
  .account { margin-left: auto; }
  .account .who { display: none; }
  .stage { padding: 16px 16px 0; }
  .stage-copy h1 { font-size: 17px; }
  .stage-tools { width: 100%; }
  .stage-tools .btn-paper { flex: 1; }
  .lamp { padding: 14px; margin-top: 14px; }
  .lamp-grid { grid-template-columns: 1fr; gap: 14px; }
  .lamp-empty { inset: 14px; }
  .plate img { max-height: 54dvh; }
  .queue { min-height: 86px; }
  .queue-item, .queue-item img { width: 82px; }
  .queue-item img { height: 56px; }
  .gate-card { padding: 28px 22px 24px; }
  .gate-title { font-size: 23px; }
  .loupe { padding: 18px; }
  .loupe-foot { bottom: 16px; }
}

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

/* ---------------- 打印 ---------------- */

#print-root { display: none; }

@media print {
  @page { size: A4 portrait; margin: 0; }

  html, body {
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    color: #000 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body[data-printing="1"] .studio,
  body[data-printing="1"] .gate,
  body[data-printing="1"] .loupe,
  body[data-printing="1"] .toast {
    display: none !important;
  }

  body[data-printing="1"] #print-root { display: block !important; }

  #print-root .sheet-page {
    display: block;
    width: 100%;
    height: 100vh;
    margin: 0;
    padding: 0;
    break-after: page;
    page-break-after: always;
    break-inside: avoid;
  }

  #print-root .sheet-page:last-child {
    break-after: auto;
    page-break-after: auto;
  }

  #print-root[data-fit="1"] .sheet-page img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  #print-root[data-fit="0"] .sheet-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10mm;
  }

  #print-root[data-fit="0"] .sheet-page img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
  }
}


/* ---------------- 门的页签与提示 ---------------- */

.gate-tabs {
  margin: 22px 0 18px;
}

#auth-tabs button[aria-selected="true"] {
  background: var(--ink);
  color: var(--paper-hi);
}

#auth-tabs button:hover {
  background: rgba(28, 34, 36, .05);
}

#auth-tabs button[aria-selected="true"]:hover {
  background: var(--ink);
}

#auth-form .btn-ink {
  width: 100%;
  margin-top: 4px;
}

.gate-hint {
  margin: 16px 0 0;
  font-size: 11px;
  line-height: 1.7;
  color: var(--ink-soft);
  opacity: .85;
}

/* ---------------- 后台：用户管理 ---------------- */

.admin {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 40px 24px;
  background: rgba(10, 13, 14, .78);
  backdrop-filter: blur(3px);
}

.admin-panel {
  width: min(720px, 100%);
  max-height: min(84dvh, 820px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 26px 26px 20px;
  background: var(--paper);
  color: var(--ink);
  border-radius: 1px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, .07),
    0 40px 90px -40px rgba(0, 0, 0, .9);
}

.admin-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.admin-head-copy { flex: 1; min-width: 0; }

.admin-head-acts {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 2px;
}

.admin-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: .03em;
}

.admin-sub {
  margin: 6px 0 0;
  font-family: var(--num);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  color: var(--ink-soft);
}

.admin-note {
  margin: 6px 0 0;
  font-size: 10.5px;
  line-height: 1.7;
  color: #8b8c82;
}

.admin-close {
  flex: none;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--paper-line);
  border-radius: 2px;
  background: transparent;
  color: var(--ink-soft);
}

.admin-close:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.admin-new {
  display: grid;
  grid-template-columns: 1fr 1fr 160px auto;
  gap: 8px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--paper-line);
}

.admin-new input,
.admin-new select {
  height: 34px;
  padding: 0 10px;
  font-size: 12.5px;
  color: var(--ink);
  background: var(--paper-hi);
  border: 1px solid var(--paper-line);
  border-radius: 2px;
}

.admin-new select { padding: 0 6px; font-size: 12px; }

.admin-new input:focus,
.admin-new select:focus {
  outline: none;
  border-color: var(--ink);
}

.admin-new .btn-ink {
  height: 34px;
  padding: 0 16px;
  font-size: 12px;
}

.admin-list {
  list-style: none;
  margin: 0;
  padding: 0 4px 0 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.admin-empty {
  padding: 18px 2px;
  font-size: 12px;
  color: var(--ink-soft);
}

.admin-user {
  padding: 12px 14px;
  border: 1px solid var(--paper-line);
  border-left: 2px solid var(--paper-line);
  background: var(--paper-hi);
}

.admin-user.is-pending { border-left-color: #b58a2b; }
.admin-user.is-active { border-left-color: #4f7a56; }
.admin-user.is-disabled { border-left-color: #9a9a90; opacity: .78; }

.admin-user-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-name {
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: .01em;
  color: var(--ink);
}

.admin-badge {
  font-size: 9.5px;
  letter-spacing: .08em;
  padding: 1px 5px;
  color: var(--paper-hi);
  background: var(--ink);
  border-radius: 1px;
}

.admin-chip {
  margin-left: auto;
  font-size: 10px;
  letter-spacing: .06em;
  color: var(--ink-soft);
}

.admin-meta {
  margin: 5px 0 0;
  font-family: var(--num);
  font-variant-numeric: tabular-nums;
  font-size: 10.5px;
  color: #7b8279;
}

.admin-acts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}

.admin-btn {
  height: 26px;
  padding: 0 10px;
  font-size: 11px;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--paper-line);
  border-radius: 2px;
}

.admin-btn:hover { border-color: var(--ink); }

.admin-btn.is-ok {
  border-color: #6d8f74;
  color: #3f6146;
}

.admin-btn.is-warn:hover {
  border-color: var(--safelight);
  color: var(--safelight);
}

.admin-pw {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* 行内的级别下拉：跟那一排小按钮一个尺寸 */
.admin-tier {
  height: 26px;
  padding: 0 6px;
  font-size: 11px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--paper-line);
  border-radius: 2px;
}

.admin-tier:hover { border-color: var(--ink); }
.admin-tier:disabled { opacity: .55; border-style: dashed; }

.admin-pw input {
  width: 170px;
  height: 26px;
  padding: 0 8px;
  font-size: 11.5px;
  color: var(--ink);
  background: var(--paper-hi);
  border: 1px solid var(--ink);
  border-radius: 2px;
}

#admin-msg {
  margin: 0;
  min-height: 15px;
}

/* ---------------- 改密码 ---------------- */

.admin-panel.is-narrow {
  width: min(420px, 100%);
  max-height: none;
}

.pwd-form .field { margin-bottom: 14px; }

.pwd-form .btn-ink {
  width: 100%;
  margin-top: 4px;
}

#pwd-msg {
  margin: 0;
  min-height: 15px;
}

/* ---------------- 透明底预览 ---------------- */

.plate.is-clear {
  background-image:
    linear-gradient(45deg, #d8d6cb 25%, transparent 25%, transparent 75%, #d8d6cb 75%),
    linear-gradient(45deg, #d8d6cb 25%, transparent 25%, transparent 75%, #d8d6cb 75%);
  background-size: 16px 16px;
  background-position: 0 0, 8px 8px;
  background-color: #f2f1ea;
}

.plate.is-clear figcaption {
  background: rgba(242, 241, 234, .92);
}
