﻿/* ============ 烘焙工作台 · 样式 ============ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #fdf9f0;
  --surface: #ffffff;
  --surface-2: #fdf4e2;
  --ink: #3a2510;
  --ink-2: #7d6a52;
  --ink-3: #b39d81;
  --line: #f2e5cc;
  --line-strong: #e4cfa6;
  --accent: #f5811f;
  --accent-deep: #d9690a;
  --accent-soft: #fff1da;
  --accent-soft-2: #ffd89b;
  --gold: #ffb648;
  --danger: #e0452f;
  --danger-soft: #ffe3dc;
  /* 亮色玻璃骨架（顶栏 + 侧栏） */
  --chrome: #fff8ec;
  --chrome-line: #f0e0bf;
  --chrome-ink: #3a2510;
  --chrome-dim: #a08a6c;
  --chrome-hover: rgba(245, 129, 31, .10);
  --shadow-sm: 0 1px 2px rgba(120, 70, 10, .05), 0 4px 14px -8px rgba(120, 70, 10, .10);
  --shadow-md: 0 2px 6px rgba(120, 70, 10, .06), 0 14px 34px -14px rgba(120, 70, 10, .18);
  --shadow-dark: 0 10px 26px -12px rgba(120, 70, 10, .30);
  --glow-sm: 0 12px 30px -10px rgba(255, 145, 30, .55), 0 0 18px rgba(255, 180, 72, .30);
  --glow-md: 0 18px 46px -12px rgba(255, 130, 20, .65), 0 0 28px rgba(255, 175, 65, .40);
  --glow-rest: 0 12px 32px -14px rgba(255, 150, 40, .45), 0 0 14px rgba(255, 190, 100, .22);
  --grad-hot: linear-gradient(135deg, #ffb347 0%, #ff8a1f 55%, #ff6a2a 100%);
  --font: "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif;
  --font-display: Georgia, "Times New Roman", "SimSun", "STSong", serif;
}

html { height: 100%; }
body {
  height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1100px 500px at 88% -14%, rgba(255, 182, 72, .34), transparent 62%),
    radial-gradient(950px 480px at -10% 110%, rgba(255, 122, 26, .18), transparent 62%),
    radial-gradient(760px 420px at 52% 46%, rgba(255, 208, 128, .14), transparent 70%),
    var(--bg);
  animation: pageIn .35s ease;
  overflow: hidden;
}
@keyframes pageIn { from { opacity: 0; } }

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; color: inherit; }
::selection { background: var(--accent-soft); color: var(--accent-deep); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #f0cf96; border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #ffb648; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 顶栏（深色骨架） ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px; height: 62px; flex: none;
  background: var(--chrome);
  border-bottom: 1px solid var(--chrome-line);
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px;
  background: var(--grad-hot);
  border: 1px solid rgba(255, 255, 255, .6);
  display: grid; place-items: center; font-size: 20px;
  box-shadow: 0 4px 16px -4px rgba(255, 140, 30, .55), 0 0 12px rgba(255, 190, 100, .55);
}
.brand-text h1 {
  font-family: var(--font-display);
  font-size: 19px; font-weight: 700; letter-spacing: .06em; line-height: 1.2;
  color: var(--chrome-ink);
}
.brand-text p { font-size: 11px; color: var(--chrome-dim); letter-spacing: .28em; margin-top: 2px; }
.top-right { display: flex; align-items: center; gap: 8px; }
.save-status {
  font-size: 12px; color: var(--chrome-dim); margin-right: 8px;
  opacity: 0; transition: opacity .3s; white-space: nowrap;
}
.save-status.on { opacity: 1; }
.topbar .btn.ghost { color: var(--chrome-dim); }
.topbar .btn.ghost:hover { color: var(--chrome-ink); background: var(--chrome-hover); border-color: rgba(246, 231, 211, .16); box-shadow: none; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 500;
  border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink-2);
  transition: all .16s ease;
  white-space: nowrap;
}
.btn:hover { color: var(--ink); border-color: #c7ae88; transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--grad-hot); border-color: transparent; color: #fff; font-weight: 600; box-shadow: 0 6px 18px -6px rgba(255, 140, 30, .6); }
.btn.primary:hover { filter: brightness(1.07); box-shadow: 0 8px 22px -6px rgba(255, 140, 30, .75); border-color: transparent; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface); border-color: var(--line-strong); box-shadow: none; }
.btn.danger { color: var(--danger); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff5f2; font-weight: 600; }
.btn.danger:hover { background: #93291f; border-color: #93291f; }
.btn.ghost.danger { background: transparent; border-color: transparent; color: var(--danger); }
.btn.ghost.danger:hover { background: var(--danger-soft); border-color: var(--danger-soft); }
.btn.block { width: 100%; justify-content: center; padding: 10px; }

.ibtn {
  width: 27px; height: 27px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent; color: var(--ink-3);
  transition: all .15s ease; flex: none;
}
.ibtn:hover { background: var(--accent-soft); color: var(--accent-deep); }
.ibtn.danger:hover { background: var(--danger-soft); color: var(--danger); }
.ibtn:active { transform: scale(.92); }

.linkbtn {
  background: none; border: none; color: var(--accent-deep);
  font-size: 12px; text-decoration: underline dotted; padding: 2px 4px;
}
.linkbtn:hover { color: var(--accent); }

/* ---------- 布局 ---------- */
.layout { flex: 1; display: flex; min-height: 0; }

/* ---------- 侧栏（深色骨架） ---------- */
.sidebar {
  width: 302px; flex: none; display: flex; flex-direction: column;
  padding: 16px 14px 10px; min-height: 0;
  border-right: 1px solid var(--chrome-line);
  background: linear-gradient(180deg, #fff9ee 0%, #fdf1da 100%);
}
.search {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255, 255, 255, .85); border: 1px solid var(--line-strong);
  border-radius: 10px; padding: 7px 11px; margin: 12px 0 10px;
  transition: border-color .15s, box-shadow .15s;
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(255, 150, 40, .25), 0 0 16px rgba(255, 180, 72, .35); }
.search .s-ico { color: var(--chrome-dim); display: inline-flex; }
.search input { border: none; outline: none; background: transparent; width: 100%; font-size: 13px; color: var(--chrome-ink); }
.search input::placeholder { color: #c9b696; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chip {
  border: 1px solid var(--line-strong); background: rgba(255, 255, 255, .8);
  color: var(--ink-2); font-size: 12px; padding: 4px 11px; border-radius: 999px;
  transition: all .15s ease;
}
.chip:hover { border-color: var(--accent); color: var(--accent-deep); transform: translateY(-1px); box-shadow: 0 0 12px rgba(255, 170, 60, .35); }
.chip.on { background: var(--grad-hot); border-color: transparent; color: #fff; font-weight: 600; box-shadow: 0 3px 12px -2px rgba(255, 140, 30, .55); }

.rlist { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding-right: 2px; }

/* 列表工具条 & 批量管理 */
.list-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 26px; margin-bottom: 8px; flex-wrap: wrap;
}
.lb-title { font-size: 11px; letter-spacing: .18em; color: var(--chrome-dim); font-weight: 700; }
.lb-btn {
  background: none; border: none; color: var(--chrome-dim);
  font-size: 12px; padding: 3px 8px; border-radius: 7px; cursor: pointer;
  transition: all .15s ease; white-space: nowrap;
}
.lb-btn:hover { color: var(--chrome-ink); background: var(--chrome-hover); }
.lb-btn.danger { color: #e08b7d; }
.lb-btn.danger:hover { color: #f2a597; background: rgba(226, 120, 105, .14); }
.lb-btn.danger.off { opacity: .38; pointer-events: none; }
.lb-count { font-size: 11.5px; color: var(--chrome-dim); margin: 0 2px 0 auto; }
.r-check {
  width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid var(--line-strong); flex: none;
  display: grid; place-items: center; transition: all .15s ease;
  background: transparent;
}
.r-check::after { content: '✓'; font-size: 11px; font-weight: 800; color: transparent; transition: color .15s; }
.r-check.on { background: var(--accent); border-color: var(--accent); }
.r-check.on::after { color: #fff6ea; }
.r-item:hover .r-check { border-color: var(--line-strong); }
.r-item:hover .r-check.on { border-color: var(--accent); }
.r-item.sel .r-in { border-color: rgba(196, 118, 62, .6); }
.sidebar.batching .r-acts { display: none; }
.side-empty {
  text-align: center; color: var(--chrome-dim); font-size: 13px; line-height: 1.9;
  padding: 30px 10px;
}
/* 配方卡片：悬浮呼吸 + 指向抬升 */
.r-item {
  border-radius: 12px;
  animation: cardFloat 4.6s ease-in-out infinite;
  will-change: transform;
}
.r-item .r-in {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 10px 10px 12px; border-radius: 11px;
  border: 1px solid transparent; cursor: pointer;
  transition: background .16s ease, border-color .16s ease, box-shadow .2s ease;
}
.r-item:hover .r-in {
  background: #ffffff;
  border-color: var(--line);
  box-shadow: var(--glow-md);
}
.r-item.on .r-in {
  background: #ffffff; border-color: var(--accent-soft-2);
  box-shadow: var(--glow-rest);
}
.r-item.on .r-in::before {
  content: ''; position: absolute; left: 0; top: 9px; bottom: 9px;
  width: 3.5px; border-radius: 3px; background: var(--grad-hot);
}
.r-item:hover .r-emoji { animation: wiggle .55s ease; }
.r-emoji { font-size: 20px; width: 26px; text-align: center; flex: none; }
.r-main { flex: 1; min-width: 0; }
.r-name {
  font-size: 13.5px; font-weight: 600; color: var(--chrome-ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: color .15s ease;
}
.r-item:hover .r-name, .r-item.on .r-name { color: var(--ink); }
.r-meta {
  font-size: 11px; color: var(--chrome-dim); margin-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: color .15s ease;
}
.r-item:hover .r-meta, .r-item.on .r-meta { color: var(--ink-3); }
.r-acts { display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.r-item:hover .r-acts, .r-item.on .r-acts { opacity: 1; }

@keyframes cardFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2.5px); }
}
@keyframes wiggle {
  0%, 100% { transform: rotate(0) scale(1); }
  30% { transform: rotate(-9deg) scale(1.18); }
  65% { transform: rotate(7deg) scale(1.1); }
}

.side-foot {
  padding: 10px 4px 2px; font-size: 11px; color: var(--chrome-dim);
  letter-spacing: .05em; border-top: 1px dashed rgba(246, 231, 211, .16); margin-top: 8px;
}

/* ---------- 编辑区 ---------- */
.editor { flex: 1; overflow-y: auto; padding: 26px 36px 90px; min-width: 0; }
.ed-in { max-width: 880px; margin: 0 auto; animation: swapIn .22s ease; }
@keyframes swapIn { from { opacity: 0; transform: translateY(6px); } }

/* 配方头 */
.rhead {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; padding: 20px 22px 18px; box-shadow: var(--shadow-sm);
}
.rhead-top { display: flex; align-items: flex-start; gap: 14px; }
.rname {
  flex: 1; min-width: 0; border: none; background: transparent; outline: none;
  font-family: var(--font-display); font-size: 28px; font-weight: 700;
  line-height: 1.3; padding: 2px 0; color: var(--ink);
  border-bottom: 2px solid transparent; transition: border-color .2s;
}
.rname:hover { border-bottom-color: var(--line); }
.rname:focus { border-bottom-color: var(--accent); }
.rname::placeholder { color: #cbbba4; }
.rhead-acts { display: flex; gap: 6px; padding-top: 4px; flex: none; }

.rmeta { display: flex; gap: 26px; flex-wrap: wrap; margin-top: 16px; }
.rmeta .f { display: flex; flex-direction: column; gap: 3px; min-width: 150px; flex: 1; }
.rmeta .f.notes { flex: 100%; }
.rmeta label { font-size: 10.5px; letter-spacing: .18em; color: var(--ink-3); font-weight: 600; }
.rmeta input, .rmeta .ro {
  border: none; border-bottom: 1px solid var(--line-strong); background: transparent;
  font-size: 13.5px; padding: 4px 1px; outline: none; transition: border-color .15s;
  border-radius: 0;
}
.rmeta input:focus { border-bottom-color: var(--accent); }
.rmeta input::placeholder { color: #cbbba4; }
.rmeta .ro { color: var(--ink-2); border-bottom-color: transparent; padding-left: 0; }
.rmeta textarea {
  border: 1px solid var(--line); background: var(--surface-2); border-radius: 10px;
  padding: 9px 12px; font-size: 13px; line-height: 1.7; outline: none; resize: vertical;
  min-height: 56px; transition: border-color .15s, box-shadow .15s; width: 100%;
}
.rmeta textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface); }

/* 换算条 */
.scalebar {
  position: sticky; top: 0px; z-index: 8;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 14px 0;
  padding: 9px 14px;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(8px);
  border: 1px solid var(--accent-soft-2); border-radius: 13px;
  box-shadow: var(--shadow-sm), var(--glow-rest);
}
.sc-label { font-size: 12px; font-weight: 700; letter-spacing: .2em; color: var(--ink-3); }
.seg { display: flex; gap: 2px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg-b {
  border: none; background: transparent; border-radius: 999px;
  font-size: 12.5px; padding: 4px 11px; color: var(--ink-2);
  transition: all .15s ease; font-variant-numeric: tabular-nums;
}
.seg-b:hover { color: var(--ink); }
.seg-b.on { background: var(--grad-hot); color: #fff; font-weight: 600; box-shadow: 0 4px 14px -4px rgba(255, 140, 30, .6); }
.sc-custom {
  width: 64px; border: 1px solid var(--line); border-radius: 8px;
  padding: 5px 8px; font-size: 12.5px; outline: none; background: var(--surface);
  transition: border-color .15s, box-shadow .15s; text-align: center;
}
.sc-custom:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.scale-pill {
  background: var(--accent-soft); color: var(--accent-deep);
  border: 1px solid var(--accent-soft-2); border-radius: 999px;
  font-size: 12px; padding: 4px 12px; font-weight: 600;
  animation: pop .2s ease;
}
.sc-hint { font-size: 11.5px; color: var(--ink-3); margin-left: auto; }

/* ---------- 分组卡片 ---------- */
.groups { display: flex; flex-direction: column; gap: 14px; }
.gcard {
  position: relative;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 15px; padding: 4px 18px 14px;
  box-shadow: var(--shadow-sm), var(--glow-rest);
  transition: box-shadow .25s ease;
}
.gcard:hover {
  box-shadow: var(--shadow-md), var(--glow-md);
}
.ghead { display: flex; align-items: center; gap: 10px; padding: 12px 0 8px; }
.gname {
  flex: 1; min-width: 120px; border: none; background: transparent; outline: none;
  font-size: 15px; font-weight: 700; color: var(--ink);
  border-bottom: 1.5px solid transparent; transition: border-color .15s; padding: 2px 0;
}
.gname:hover { border-bottom-color: var(--line); }
.gname:focus { border-bottom-color: var(--accent); }
.gmeta { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }

.irow {
  display: grid;
  grid-template-columns: 24px 26px minmax(0, 1fr) 96px 62px 78px 116px;
  gap: 8px; align-items: center;
}
.ihead {
  font-size: 10.5px; letter-spacing: .16em; color: var(--ink-3); font-weight: 600;
  padding: 2px 0 6px; border-bottom: 1px solid var(--line);
}
.ihead .a, .irow .cell.a { text-align: right; }

.irow { padding: 3px 0; border-bottom: 1px solid rgba(233, 221, 202, .6); transition: background .15s, opacity .15s; }
.irow:last-of-type { border-bottom-color: transparent; }
.irow:hover { background: rgba(250, 244, 233, .55); border-radius: 8px; }
.irow.base {
  background: linear-gradient(90deg, rgba(217, 164, 65, .13), rgba(217, 164, 65, .02) 75%);
  box-shadow: inset 2.5px 0 0 var(--gold);
  border-radius: 0 8px 8px 0;
}
.irow.base:hover { background: linear-gradient(90deg, rgba(217, 164, 65, .2), rgba(217, 164, 65, .04) 75%); }

.cell.grip { color: #d3c3a8; cursor: grab; display: flex; justify-content: center; }
.cell.grip:hover { color: var(--ink-3); }
.irow input, .irow select {
  border: none; background: transparent; outline: none;
  font-size: 13.5px; padding: 6px 2px; width: 100%;
  border-bottom: 1.5px dashed transparent;
  transition: border-color .15s;
  border-radius: 0;
}
.irow:hover input:not(:disabled), .irow:hover select { border-bottom-color: var(--line); }
.irow input:focus { border-bottom: 1.5px solid var(--accent); }
.irow input::placeholder { color: #d3c3a8; }
.irow input[data-f="iname"] { font-weight: 500; }
.irow .cell.a input { text-align: right; font-variant-numeric: tabular-nums; }
.editor.scaled .irow .cell.a input:not(:disabled) { color: var(--accent-deep); font-weight: 600; }
.irow .cell.p input { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: 13px; }
.irow.base .cell.p input { color: var(--accent-deep); font-weight: 700; }
.irow .cell.u select {
  border: 1px solid var(--line); border-radius: 7px; padding: 5px 4px;
  background: var(--surface-2); font-size: 12.5px; color: var(--ink-2);
  cursor: pointer; appearance: none; text-align: center;
  transition: border-color .15s;
}
.irow .cell.u select:hover { border-color: var(--line-strong); }

.cell.ops { display: flex; align-items: center; gap: 3px; justify-content: flex-end; }
.cell.ops .ibtn { opacity: 0; transition: opacity .15s; }
.irow:hover .cell.ops .ibtn, .irow.base .cell.ops .ibtn { opacity: 1; }
.base-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 700; color: var(--accent-deep);
  background: var(--accent-soft); border: 1px solid var(--accent-soft-2);
  padding: 3px 9px; border-radius: 999px; white-space: nowrap;
}

.g-empty { padding: 18px 4px; color: var(--ink-3); font-size: 13px; text-align: center; }
.add-row {
  margin-top: 10px; width: 100%;
  border: 1.5px dashed var(--line-strong); border-radius: 10px;
  background: transparent; color: var(--ink-3);
  font-size: 13px; padding: 8px; display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: all .18s ease;
}
.add-row:hover { border-color: var(--accent); color: var(--accent-deep); background: var(--accent-soft); }
.add-group {
  margin-top: 4px; width: 100%;
  border: 1.5px dashed var(--line); border-radius: 12px;
  background: transparent; color: var(--ink-3);
  font-size: 12.5px; padding: 10px; display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: all .18s ease;
}
.add-group:hover { border-color: var(--accent); color: var(--accent-deep); background: rgba(247, 233, 215, .5); }

.irow.anim-in { animation: rowIn .24s ease; }
@keyframes rowIn { from { opacity: 0; transform: translateY(-5px); } }
.irow.leaving { animation: rowOut .18s ease forwards; pointer-events: none; }
@keyframes rowOut { to { opacity: 0; transform: translateX(10px); } }
.irow.dragging { opacity: .35; }
.irow.ins-top { box-shadow: 0 -2px 0 var(--accent); }
.irow.ins-bot { box-shadow: 0 2px 0 var(--accent); }

/* ---------- 空状态 ---------- */
.empty { text-align: center; padding: 90px 20px; }
.empty-emoji { font-size: 58px; animation: floaty 3.2s ease-in-out infinite; }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
.empty h2 { font-family: var(--font-display); font-size: 24px; margin: 18px 0 10px; letter-spacing: .05em; }
.empty p { color: var(--ink-3); font-size: 14px; margin-bottom: 24px; }

/* ---------- Toast ---------- */
#toasts {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 100;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 16px;
  background: linear-gradient(135deg, #4a2c12, #2f1a08); color: #ffe9c8;
  padding: 11px 18px; border-radius: 13px; font-size: 13.5px;
  border: 1px solid rgba(255, 170, 60, .35);
  box-shadow: var(--shadow-md), 0 0 22px rgba(255, 150, 40, .35);
  opacity: 0; transform: translateY(12px);
  transition: all .25s ease; pointer-events: auto; max-width: 86vw;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast button {
  background: none; border: none; color: #f2b169; font-weight: 700; font-size: 13.5px;
  padding: 2px 4px; border-radius: 6px;
}
.toast button:hover { text-decoration: underline; }

/* ---------- 弹窗 ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(52, 39, 26, .42); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fadeIn .18s ease;
}
@keyframes fadeIn { from { opacity: 0; } }
.modal {
  background: var(--surface); border-radius: 17px;
  padding: 20px 22px; width: min(480px, 94vw);
  box-shadow: 0 28px 70px -18px rgba(120, 60, 10, .35), 0 18px 50px -18px rgba(255, 150, 40, .45);
  animation: pop .2s cubic-bezier(.2, 1.1, .4, 1);
}
.modal.wide { width: min(780px, 95vw); }
@keyframes pop { from { opacity: 0; transform: scale(.95) translateY(8px); } }
.m-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.m-title { font-size: 15.5px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.m-text { color: var(--ink-2); font-size: 13.5px; line-height: 1.8; margin: 10px 0 4px; }
.m-acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

.p-opts { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 12px 2px; margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }

/* 两级菜单：配方 / 配方+制作步骤 */
.ed-tabs {
  display: flex; gap: 6px; margin: 14px 0 -2px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 13px; padding: 4px;
}
.ed-tab {
  flex: 1; border: none; background: transparent; border-radius: 9px;
  font-size: 13.5px; font-weight: 600; color: var(--ink-2);
  padding: 9px 10px; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  transition: all .18s ease; white-space: nowrap;
}
.ed-tab:hover { color: var(--ink); }
.ed-tab.on {
  background: var(--surface); color: var(--accent-deep);
  box-shadow: var(--shadow-sm), var(--glow-rest);
}
.ed-tab-badge {
  font-size: 11px; font-weight: 700; min-width: 19px; height: 19px;
  border-radius: 999px; padding: 0 6px;
  background: var(--accent-soft); color: var(--accent-deep);
  display: inline-grid; place-items: center;
}

/* SOP 制作流程（子菜单内的步骤区块） */
.btn.sm { padding: 5px 11px; font-size: 12.5px; }
.sop-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 13px 0 8px;
}
.sop-head-title {
  font-size: 15px; font-weight: 800; letter-spacing: .04em; color: var(--ink);
  display: flex; align-items: center; gap: 7px;
}
.sop-head-title::before {
  content: ''; width: 4px; height: 16px; border-radius: 2px;
  background: linear-gradient(180deg, var(--gold), var(--accent));
}
.sop-head-space { flex: 1; }

/* 穿穿插配：步骤下方的投放配料 */
.flow-ings {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: -3px 0 10px 32px;
  padding: 8px 12px;
  background: linear-gradient(160deg, #fdf6e9, var(--accent-soft));
  border: 1px dashed var(--accent-soft-2);
  border-radius: 11px;
  animation: rowIn .25s ease;
}
.fi-lab {
  font-size: 11px; font-weight: 800; letter-spacing: .2em;
  color: var(--accent-deep); flex: none;
}
.fi-chips { display: flex; gap: 7px; flex-wrap: wrap; }
.fi-chip {
  display: inline-flex; flex-direction: column; gap: 1px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 9px; padding: 4px 11px; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.fi-chip:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm), var(--glow-rest); border-color: var(--accent-soft-2); }
.fi-chip b { font-size: 12.5px; color: var(--ink); }
.fi-chip i { font-style: normal; font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.fi-chip.base { border-color: rgba(192, 138, 62, .55); }
.fi-chip.base b::after { content: ' ★'; color: var(--gold); font-size: 10px; }
.fi-chip.miss { opacity: .6; border-style: dashed; cursor: default; }
.fi-chip.miss i { color: var(--danger); }
.flow-unused {
  margin-bottom: 10px; padding: 8px 13px;
  background: #fdf1e6; border: 1px dashed #e3b98d; border-radius: 10px;
  font-size: 12.5px; color: #7a4b1e; line-height: 1.8;
}
.flow-unused b { margin: 0 2px; }
.sop-order {
  display: flex; align-items: center; flex-wrap: wrap; gap: 5px;
  background: var(--surface-2); border: 1px dashed var(--line-strong);
  border-radius: 10px; padding: 8px 12px; margin-bottom: 10px;
}
.so-lab { font-size: 11px; font-weight: 700; letter-spacing: .15em; color: var(--ink-3); margin-right: 4px; }
.so-chip {
  background: var(--surface); border: 1px solid var(--accent-soft-2);
  color: var(--accent-deep); font-size: 12px; font-weight: 600;
  padding: 2.5px 10px; border-radius: 999px; white-space: nowrap;
}
.so-arrow { color: var(--ink-3); font-size: 11px; }
.sop-list { display: flex; flex-direction: column; gap: 10px; }
.s-row {
  display: grid; grid-template-columns: 24px 26px 1fr; gap: 8px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface-2); padding: 10px 12px;
  transition: box-shadow .18s ease, border-color .18s ease, opacity .15s;
  animation: none;
}
.s-row:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.cell.s-grip { color: #d3c3a8; cursor: grab; display: flex; justify-content: center; padding-top: 4px; }
.s-row.dragging { opacity: .35; }
.s-row.ins-top { box-shadow: 0 -2px 0 var(--accent); }
.s-row.ins-bot { box-shadow: 0 2px 0 var(--accent); }
.s-main { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.s-line1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.s-no {
  font-family: Georgia, serif; font-size: 15px; font-weight: 700; color: var(--accent);
  background: var(--accent-soft); border-radius: 8px; padding: 1px 8px; flex: none;
}
.s-title {
  flex: 1; min-width: 140px; border: none; background: transparent; outline: none;
  font-size: 14px; font-weight: 700; border-bottom: 1.5px dashed transparent;
  padding: 2px 0; transition: border-color .15s;
}
.s-title:hover { border-bottom-color: var(--line); }
.s-title:focus { border-bottom-color: var(--accent); }
.s-badge {
  display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid var(--line); background: var(--surface);
  border-radius: 8px; padding: 2px 8px; font-size: 13px; flex: none;
}
.s-badge input { border: none; background: transparent; outline: none; font-size: 12px; width: 72px; }
.s-badge input::placeholder { color: #cbbba4; }
.s-row .ibtn.danger { margin-left: auto; }
.s-text, .s-tips {
  width: 100%; resize: vertical; outline: none; border-radius: 9px;
  padding: 7px 10px; font-size: 13px; line-height: 1.75;
  border: 1px solid var(--line); background: var(--surface);
  transition: border-color .15s, box-shadow .15s; font-family: inherit;
}
.s-text:focus, .s-tips:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.s-tips { background: #fdf6e7; border-color: #efdfc0; color: #6a5222; }
.s-tips::placeholder { color: #bfa46a; }
/* 傻瓜式制作记录 */
.record-add {
  margin-top: 10px; width: 100%;
  border: 1.5px solid rgba(255, 170, 60, .8); border-radius: 12px;
  background: linear-gradient(135deg, #fff3dd, #ffe4b8); color: var(--accent-deep);
  font-size: 13.5px; font-weight: 600; padding: 12px;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  transition: all .18s ease;
}
.record-add:hover { filter: brightness(1.04); transform: translateY(-1px); box-shadow: var(--glow-sm); }
.s-row.simple .s-line1 { gap: 6px; }
.s-row.simple .s-no {
  font-family: Georgia, serif; font-size: 16px; font-weight: 800; color: var(--accent);
  background: var(--accent-soft); border-radius: 9px; min-width: 30px; height: 30px;
  display: grid; place-items: center; flex: none;
}
.s-row.simple .s-title { flex: 1; }
.pick-row { display: flex; align-items: flex-start; gap: 9px; }
.pick-lab {
  font-size: 11px; font-weight: 800; letter-spacing: .18em; color: var(--ink-3);
  padding-top: 5px; flex: none;
}
.pick-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pick-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 999px;
  padding: 3px 11px 3px 12px; cursor: pointer; font-family: inherit;
  transition: all .14s ease;
}
.pick-chip span { font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.pick-chip i {
  font-style: normal; font-size: 11px; color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.pick-chip:hover { border-color: var(--accent-soft-2); transform: translateY(-1px); }
.pick-chip.on {
  background: var(--accent-soft); border-color: var(--accent);
  box-shadow: 0 2px 8px -4px rgba(164, 85, 31, .45);
}
.pick-chip.on span { color: var(--accent-deep); font-weight: 700; }
.pick-chip.on::before { content: '✓'; font-size: 11px; font-weight: 800; color: var(--accent); }
.pick-chip.extra { border-style: dashed; }
.s-more { display: flex; flex-direction: column; gap: 6px; animation: rowIn .2s ease; }
.s-tips-line {
  width: 100%; border: 1px solid #efdfc0; background: #fdf6e7; border-radius: 9px;
  padding: 7px 10px; font-size: 12.5px; color: #6a5222; outline: none;
  transition: border-color .15s, box-shadow .15s; font-family: inherit;
}
.s-tips-line:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(192, 138, 62, .15); }
.s-tips-line::placeholder { color: #bfa46a; }
.ibtn.on-more { background: var(--accent-soft); color: var(--accent-deep); }
.s-ings input {
  flex: 1; border: none; border-bottom: 1.5px dashed var(--line); background: transparent;
  outline: none; font-size: 12.5px; color: var(--ink-2); padding: 2px 0; transition: border-color .15s;
}
.s-ings input:focus { border-bottom-color: var(--accent); }

/* AI 评审 */
.btn.spark { background: var(--grad-hot); border-color: transparent; color: #fff; font-weight: 600; box-shadow: 0 6px 20px -6px rgba(255, 130, 20, .65), 0 0 14px rgba(255, 180, 72, .35); }
.btn.spark:hover { filter: brightness(1.07); color: #fff; }

.ai-sub { color: var(--ink-2); font-size: 12.5px; margin: 8px 0 10px; line-height: 1.7; }
.ai-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.ai-tag {
  border: 1px dashed var(--line-strong); background: var(--surface-2);
  color: var(--ink-2); font-size: 12px; padding: 4px 11px; border-radius: 999px;
  transition: all .15s ease;
}
.ai-tag:hover { border-color: var(--accent); color: var(--accent-deep); transform: translateY(-1px); }
.ai-tag.on { border-style: solid; border-color: var(--accent-soft-2); background: var(--accent-soft); color: var(--accent-deep); }
.ai-text {
  width: 100%; min-height: 88px; resize: vertical; outline: none;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  padding: 10px 12px; font-size: 13.5px; line-height: 1.7;
  transition: border-color .15s, box-shadow .15s;
}
.ai-text:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ai-engine { font-size: 12px; color: var(--ink-3); margin: 8px 0 2px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ai-engine b { color: var(--ink-2); }
.ai-cfg { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; padding: 10px; border: 1px dashed var(--line-strong); border-radius: 10px; background: var(--surface-2); }
.ai-cfg[hidden] { display: none; }
.ai-cfg input, .ai-cfg select {
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
  padding: 6px 9px; font-size: 12.5px; outline: none; min-width: 130px; flex: 1;
}
.ai-cfg input:focus, .ai-cfg select:focus { border-color: var(--accent); }
.ai-cfg-tip { flex-basis: 100%; font-size: 11px; color: var(--ink-3); line-height: 1.6; }

#aiResults { margin-top: 14px; }
.ai-roles { display: flex; flex-direction: column; gap: 10px; }
.role-card {
  position: relative;
  border: 1px solid var(--line); border-radius: 13px; background: var(--surface);
  padding: 12px 14px; animation: rowIn .28s ease;
  transition: box-shadow .22s ease;
}
.role-card:hover {
  box-shadow: var(--shadow-sm), var(--glow-sm);
}
.role-head { display: flex; align-items: center; gap: 9px; margin-bottom: 7px; }
.role-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(145deg, var(--accent-soft), #fdf6e9);
  border: 1px solid var(--accent-soft-2);
  display: grid; place-items: center; font-size: 17px; flex: none;
}
.role-name { font-weight: 700; font-size: 14px; }
.role-text { font-size: 13px; color: var(--ink-2); line-height: 1.85; white-space: normal; }
.ai-syn {
  margin-top: 12px; border: 1.5px solid var(--accent-soft-2);
  background: linear-gradient(160deg, #fdf6e9, var(--surface));
  border-radius: 13px; padding: 12px 16px;
}
.ai-syn-title { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ai-engine-tag {
  font-size: 10.5px; font-weight: 600; color: var(--accent-deep);
  background: var(--accent-soft); border-radius: 999px; padding: 2px 9px;
}
.ai-points { margin: 8px 0 2px 20px; }
.ai-points li { font-size: 13px; color: var(--ink-2); line-height: 1.9; }
.ai-adjs { margin-top: 12px; }
.ai-adjs-title { font-weight: 700; font-size: 13.5px; margin-bottom: 8px; }
.adj-row {
  display: flex; align-items: center; gap: 12px; justify-content: space-between;
  border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2);
  padding: 9px 9px 9px 14px; margin-bottom: 7px;
  transition: all .16s ease; animation: rowIn .25s ease;
}
.adj-row:hover { border-color: var(--accent-soft-2); transform: translateY(-1px); }
.adj-row.done { opacity: .62; background: #f3f7ec; border-color: #dbe7cb; }
.adj-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.adj-main b { font-size: 13px; color: var(--ink); }
.adj-note { font-size: 11.5px; color: var(--ink-3); }

/* 导入识别清单 */
.imp-list { max-height: 38vh; overflow-y: auto; margin: 12px 0 4px; display: flex; flex-direction: column; gap: 8px; }
.imp-item {
  position: relative;
  border: 1px solid var(--line); border-radius: 11px; padding: 9px 13px;
  background: var(--surface-2);
  transition: box-shadow .22s ease, border-color .16s ease;
  animation: rowIn .25s ease;
}
.imp-item:hover {
  box-shadow: var(--shadow-sm), var(--glow-sm); border-color: var(--line-strong);
}

.imp-name { font-weight: 600; font-size: 13.5px; }
.imp-meta { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }
.p-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.p-hint {
  font-size: 12.5px; color: var(--accent-deep); background: var(--accent-soft);
  border: 1px dashed var(--accent-soft-2); border-radius: 9px;
  padding: 7px 12px; line-height: 1.6;
}
.p-lab { font-size: 12.5px; font-weight: 700; color: var(--ink-2); letter-spacing: .1em; }
.chk { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.chk input { accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer; }
.paper {
  margin-top: 12px; max-height: 50vh; overflow: auto;
  background: #fff; border: 1px solid var(--line-strong); border-radius: 10px;
  padding: 26px 30px; box-shadow: inset 0 0 12px rgba(64, 44, 22, .04);
}

/* ---------- 打印纸 ---------- */
#printSheet { display: none; }

.sheet { font: 11pt/1.55 var(--font); color: #1c1917; }
.sheet .s-head {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 20px;
  border-bottom: 2.5px solid #1c1917; padding-bottom: 10px;
}
.sheet h1 { font-family: var(--font-display); font-size: 21pt; font-weight: 700; line-height: 1.3; }
.sheet .s-meta { font-size: 8.5pt; color: #57534e; letter-spacing: .06em; text-align: right; line-height: 1.8; white-space: nowrap; }
.sheet .sg { margin-top: 15px; }
.sheet .sg h3 { font-size: 11pt; margin-bottom: 1px; display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.sheet .sg h3::after { content: ''; flex: 1; height: 1px; background: #d6d3d1; }
.sheet table { width: 100%; border-collapse: collapse; }
.sheet thead { display: table-header-group; }
.sheet th {
  font-size: 8pt; color: #78716c; font-weight: 600; text-align: left;
  padding: 7px 2px 3px; letter-spacing: .12em;
}
.sheet td { padding: 5px 4px; border-bottom: .75px solid #d6d3d1; font-size: 10.5pt; overflow-wrap: break-word; word-wrap: break-word; word-break: break-word; }
.sheet td.a { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; width: 90px; }
.sheet td.nt { max-width: 220px; overflow-wrap: break-word; word-wrap: break-word; word-break: break-word; white-space: pre-wrap; line-height: 1.6; font-size: 9pt; color: #57534e; vertical-align: top; }
.sheet th.a { text-align: right; }
.sheet th.nt { width: 40%; }
.sheet td.p { text-align: right; color: #78716c; width: 62px; font-size: 9.5pt; font-variant-numeric: tabular-nums; }
.sheet tr.b td { font-weight: 700; }
.sheet tr.b td.p { color: #1c1917; }
.sheet .s-notes {
  margin-top: 16px; border: 1px solid #d6d3d1; border-radius: 6px;
  padding: 10px 13px; font-size: 9.5pt; color: #44403c; white-space: pre-wrap; line-height: 1.8;
}
.sheet .s-notes b { display: block; font-size: 8pt; letter-spacing: .2em; color: #78716c; margin-bottom: 5px; }

.sheet .sop-ol { margin: 4pt 0 0 0; padding-left: 16pt; }
.sheet .sop-ol li { margin-bottom: 8pt; break-inside: avoid; }
.sheet .sp-head b { font-size: 11pt; }
.sheet .sp-badge {
  font-size: 8pt; border: .5pt solid #d6d3d1; border-radius: 999px;
  padding: 1pt 6pt; margin-left: 6pt; color: #57534e; white-space: nowrap;
}
.sheet .sp-ings { font-size: 9pt; color: #57534e; margin-top: 2pt; }
.sheet .sp-ings b { color: #1c1917; }
.sheet .sp-text { font-size: 10pt; margin-top: 3pt; line-height: 1.7; }
.sheet .sp-tips {
  margin-top: 3pt; border-left: 2pt solid #d9a441; background: #faf6ec;
  padding: 4pt 8pt; font-size: 8.5pt; color: #6a5222; line-height: 1.6;
}
.sheet .s-foot { margin-top: 26px; text-align: center; color: #a8a29e; font-size: 8pt; letter-spacing: .3em; }

@media print {
  @page { size: A4; margin: 15mm 14mm; }
  body { background: #fff; overflow: visible; }
  body > .topbar, body > .layout, #toasts, .modal-backdrop { display: none !important; }
  #printSheet { display: block !important; }
  .sheet .sg { break-inside: auto; }
  .sheet .sg h3 { break-after: avoid; }
  .sheet tr { break-inside: avoid; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .sidebar { width: auto; max-height: 40vh; border-right: none; border-bottom: 1px solid var(--line); }
  .editor { padding: 16px 14px 80px; }
  .rhead-top { flex-direction: column; }
  .rhead-acts { justify-content: flex-end; }
  .sc-hint { display: none; }
  .ihead, .irow { grid-template-columns: 18px minmax(0, 1fr) 82px 56px 64px 96px; gap: 6px; }
  .rmeta { gap: 14px; }
}
@media (hover: none) {
  .r-acts, .cell.ops .ibtn { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .r-item, .r-emoji, .empty-emoji, .imp-item { animation: none !important; }
  .r-item:hover .r-in, .gcard:hover, .role-card:hover, .imp-item:hover { transform: none !important; }
}

/* ---------- 鍏抽敭绗旇瀛楁 ---------- */
.note-field {
  background: linear-gradient(160deg, #fffaf0, #fff3dc);
  border: 1.5px solid var(--accent-soft-2);
  border-radius: 15px; padding: 14px 18px;
  box-shadow: var(--shadow-sm), var(--glow-rest);
  margin-top: 4px;
}
.note-field label {
  display: flex; align-items: baseline; gap: 10px;
  font-size: 13.5px; font-weight: 800; color: var(--accent-deep);
  letter-spacing: .04em; margin-bottom: 8px;
}
.note-hint { font-size: 11.5px; font-weight: 500; color: var(--ink-3); letter-spacing: 0; }
.note-area {
  width: 100%; min-height: 88px; resize: none; outline: none;
  border: 1px solid var(--line-strong); border-radius: 11px;
  background: rgba(255, 255, 255, .9);
  padding: 10px 13px; font-size: 13.5px; line-height: 1.9; color: var(--ink);
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.note-area:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(255, 150, 40, .22), 0 0 18px rgba(255, 180, 72, .3); }
.note-area::placeholder { color: #ccb28c; }
/* ---------- unified recipe sheet ---------- */
.bigcard { padding: 6px 20px 18px; }
.big-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 0 10px; border-bottom: 1.5px solid var(--accent-soft-2); }
.big-title { font-size: 15px; font-weight: 800; letter-spacing: .04em; }
.grp { padding: 4px 0 6px; border-bottom: 1px dashed var(--line); }
.grp .ghead { padding: 10px 0 6px; }
.steps-sec { padding: 6px 0 2px; border-bottom: 1px dashed var(--line); }
.steps-sec .sop-list { display: flex; flex-direction: column; gap: 10px; }
.fields-sec { padding: 10px 0 4px; }
.fs-head { font-size: 13px; font-weight: 800; color: var(--accent-deep); margin-bottom: 8px; display: flex; align-items: baseline; gap: 10px; }
.fs-hint { font-size: 11.5px; font-weight: 500; color: var(--ink-3); }
.fs-empty { font-size: 12.5px; color: var(--ink-3); padding: 6px 2px 10px; }
.field-row { display: grid; grid-template-columns: 24px 26px minmax(120px, 30%) 14px 1fr 30px; align-items: center; gap: 8px; margin-bottom: 7px; animation: rowIn .22s ease; transition: opacity .15s; }
.field-row.leaving { opacity: 0; }
.fld-label { width: 34%; border: 1px solid var(--line-strong); background: var(--surface-2); border-radius: 9px; padding: 7px 11px; font-size: 13px; font-weight: 700; color: var(--accent-deep); outline: none; transition: border-color .15s, box-shadow .15s; }
.fld-value { flex: 1; border: 1px solid var(--line); background: var(--surface); border-radius: 9px; padding: 7px 11px; font-size: 13px; outline: none; transition: border-color .15s, box-shadow .15s; }
.fld-label:focus, .fld-value:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 150, 40, .2); }
.fld-sep { color: var(--ink-3); font-weight: 700; }
.note-field { margin-top: 12px; }
/* ---------- block sheet extras ---------- */
.b-table { display: flex; flex-direction: column; gap: 2px; }
.cell.k { display: grid; place-items: center; }
.k-dot {
  width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center;
  font-size: 12px; line-height: 1; user-select: none;
  background: var(--surface-2); border: 1px solid var(--line);
}
.k-dot.ing { background: var(--accent-soft); border-color: var(--accent-soft-2); }
.k-dot.step { background: #e8f3ff; border-color: #c4ddf5; }
.k-dot.grp { background: var(--surface); }
.grp-row {
  display: grid; grid-template-columns: 24px 26px minmax(0, 1fr) auto 30px;
  align-items: center; gap: 8px; padding: 4px 0; margin-top: 8px;
  border-bottom: 1.5px solid var(--accent-soft-2); padding-bottom: 7px;
}
.grp-title {
  border: none; background: transparent; outline: none; font-size: 14.5px; font-weight: 800;
  color: var(--ink); border-bottom: 1.5px dashed transparent; padding: 2px 0; transition: border-color .15s;
}
.grp-title:hover { border-bottom-color: var(--line); }
.grp-title:focus { border-bottom-color: var(--accent); }
.grp-title::placeholder { color: #cbb693; }
.nt-row { display: grid; grid-template-columns: 24px 26px 1fr 30px; align-items: center; gap: 8px; padding: 3px 0; }
.nt-text {
  border: 1px solid var(--line); background: #fffdf4; border-radius: 9px;
  padding: 7px 11px; font-size: 13px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.nt-text:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255, 182, 72, .18); }
.fld-label { width: auto; }
.legend-bar { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 11.5px; color: var(--ink-3); }

/* stars */
.f-stars .stars-widget { display: inline-flex; gap: 1px; padding: 4px 0; }
.star-b {
  background: none; border: none; font-size: 19px; line-height: 1; padding: 0 1px;
  color: #d9c9a8; cursor: pointer; transition: transform .12s ease, color .12s ease;
}
.star-b:hover { transform: scale(1.22); color: var(--gold); }
.star-b.on { color: var(--gold); text-shadow: 0 0 8px rgba(255, 182, 72, .75); }
.r-stars {
  display: inline-block; margin-right: 6px; font-size: 11px; font-weight: 800;
  color: var(--gold); background: #fff3d6; border: 1px solid #ffd89b;
  border-radius: 999px; padding: 1px 7px; vertical-align: 1px;
}

/* total weight */
.tw-wrap { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); }
.tw-input {
  width: 74px; border: 1px solid var(--accent-soft-2); border-radius: 8px;
  background: var(--surface); padding: 5px 8px; font-size: 12.5px; outline: none; text-align: center;
}
.tw-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 150, 40, .2); }
/* ============================================================
 * 七色光晕科幻风 + row3 三列表样式
 * 追加到 style.css 末尾，覆盖之前的暖金配色
 * ============================================================ */

/* ---------- row3 三列表 ---------- */
.sheet3 {
  display: flex; flex-direction: column;
  border: 1px solid rgba(120, 180, 255, .18);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0, 8, 20, .3);
}
.row3 {
  display: grid;
  grid-template-columns: 28px minmax(120px, 1.6fr) 100px minmax(160px, 2fr) 78px 34px;
  gap: 10px; align-items: center;
  padding: 6px 12px;
  border-bottom: 1px solid rgba(120, 180, 255, .08);
  transition: background .15s ease;
}
/* 备注列允许占满整行高度并从顶部开始排列文字 */
.row3 .cell.nt { align-self: stretch; display: flex; align-items: flex-start; }
.row3:last-child { border-bottom: none; }
.row3:hover { background: rgba(120, 180, 255, .06); }
.row3.head {
  background: rgba(120, 180, 255, .12);
  font-size: 11px; letter-spacing: .14em; font-weight: 700;
  color: rgba(160, 200, 255, .8);
  padding: 8px 12px;
  text-transform: uppercase;
  align-items: center;
}
.row3.base {
  background: rgba(255, 180, 50, .08);
  box-shadow: inset 2px 0 0 var(--gold);
}
.row3.leaving { animation: rowOut .18s ease forwards; }
.row3.anim-in { animation: rowIn .22s ease; }
.row3.dragging { opacity: .35; }
.row3.ins-top { box-shadow: 0 -2px 0 var(--accent); }
.row3.ins-bot { box-shadow: 0 2px 0 var(--accent); }
.row3 .cell { min-width: 0; overflow: visible; display: flex; align-items: center; }
.row3 .cell:not(.nt) { overflow: hidden; }
.row3 .cell.nt { overflow: visible; }
.row3 .cell.a, .row3 .cell.basecell, .row3 .cell.delcell { justify-content: flex-end; }
.row3 .cell.basecell { justify-content: center; }

.row3 .cell.grip { color: rgba(120, 180, 255, .4); cursor: grab; display: flex; justify-content: center; padding-top: 4px; }
.row3 .cell.grip:hover { color: rgba(120, 180, 255, .8); }

.row3 input {
  border: none; background: transparent; outline: none;
  color: #e0eaf8; font-size: 13.5px; padding: 5px 2px;
  border-bottom: 1.5px solid transparent;
  transition: border-color .15s;
  font-family: inherit;
  width: 100%; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.row3 input:hover { border-bottom-color: rgba(120, 180, 255, .25); }
.row3 input:focus { border-bottom-color: var(--accent); }
.row3 input::placeholder { color: rgba(120, 160, 220, .3); }
.row3 .cell.a input { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- 浏览态行样式（纯文本 + 备注自动换行） ---------- */
.row3.browse {
  padding: 8px 12px;
  cursor: default;
}
.row3.browse .cell.num {
  font-size: 12px; color: rgba(90, 116, 148, .6);
  font-variant-numeric: tabular-nums; text-align: center; padding-top: 3px;
}
.row3.browse .cell.nm {
  font-size: 13.5px; font-weight: 600; color: #d4e4f8;
  overflow-wrap: break-word; word-wrap: break-word; word-break: break-all;
  line-height: 1.6; padding-top: 1px;
}
.row3.browse .cell.wt {
  font-size: 13.5px; color: #8ea8cc;
  font-variant-numeric: tabular-nums; text-align: right; padding-top: 1px;
}
.row3.browse .cell.nt {
  font-size: 12.5px; color: #8ea8cc;
  overflow-wrap: break-word; word-wrap: break-word; word-break: break-word;
  line-height: 1.7; white-space: pre-wrap;
}
.row3.browse .base-tag {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; font-weight: 700; color: var(--gold);
  text-shadow: 0 0 8px rgba(255, 200, 80, .5);
  white-space: nowrap;
}
.rname-ro {
  font-size: 24px; font-weight: 700; color: #d4e4f8;
  font-family: inherit; line-height: 1.3;
  text-shadow: 0 0 12px rgba(74, 158, 255, .2);
  padding: 2px 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  flex: 1; min-width: 0;
}

.base-radio {
  border: none; background: none; cursor: pointer;
  color: rgba(120, 180, 255, .4); font-size: 12px; font-weight: 600;
  padding: 4px 2px; white-space: nowrap; transition: color .15s;
}
.base-radio:hover { color: var(--gold); }
.base-radio.on {
  color: var(--gold);
  text-shadow: 0 0 8px rgba(255, 200, 80, .6);
}

/* ---------- 科幻配色：深空底 + 七色光晕 ---------- */
:root {
  --bg: #060a18;
  --surface: rgba(10, 16, 32, .85);
  --surface-2: rgba(16, 24, 48, .6);
  --ink: #d4e4f8;
  --ink-2: #8ea8cc;
  --ink-3: #5a7494;
  --line: rgba(80, 140, 220, .15);
  --line-strong: rgba(100, 160, 240, .3);
  --accent: #4a9eff;
  --accent-deep: #2a7acc;
  --accent-soft: rgba(74, 158, 255, .12);
  --accent-soft-2: rgba(74, 158, 255, .25);
  --gold: #ffc247;
  --danger: #ff4a5e;
  --danger-soft: rgba(255, 74, 94, .12);
  --chrome: rgba(8, 12, 28, .9);
  --chrome-line: rgba(60, 100, 180, .2);
  --chrome-ink: #c0d8f8;
  --chrome-dim: #5a7494;
  --chrome-hover: rgba(74, 158, 255, .08);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, .5);
  --glow-sm: 0 0 16px hsla(var(--hue, 210), 85%, 60%, .3), 0 8px 24px -8px rgba(0, 0, 0, .5);
  --glow-md: 0 0 24px hsla(var(--hue, 210), 85%, 60%, .4), 0 12px 32px -8px rgba(0, 0, 0, .6);
  --glow-rest: 0 0 12px hsla(var(--hue, 210), 80%, 55%, .2);
  --grad-hot: linear-gradient(135deg, #4a9eff, #7c6aff, #b56aff, #ff6a9e, #ff6a5e);
}

body {
  background:
    radial-gradient(ellipse 1200px 600px at 80% -10%, rgba(30, 60, 120, .25), transparent 60%),
    radial-gradient(ellipse 800px 500px at 20% 110%, rgba(80, 30, 120, .18), transparent 60%),
    radial-gradient(ellipse 600px 400px at 50% 50%, rgba(20, 50, 100, .08), transparent 70%),
    var(--bg);
  color: var(--ink);
}

/* 星空网格 */
body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(rgba(60, 100, 180, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(60, 100, 180, .04) 1px, transparent 1px);
  background-size: 48px 48px;
}
/* 极光带 */
body::after {
  content: ''; position: fixed; top: -20%; left: -10%; right: -10%; height: 40%;
  pointer-events: none; z-index: 0;
  background: conic-gradient(from 180deg,
    rgba(74, 158, 255, .06), rgba(124, 106, 255, .06), rgba(181, 106, 255, .06),
    rgba(255, 106, 158, .06), rgba(255, 106, 94, .06), rgba(74, 158, 255, .06));
  filter: blur(60px);
  animation: aurora 20s ease-in-out infinite alternate;
}
@keyframes aurora {
  0%   { transform: translateX(-4%) rotate(-3deg); opacity: .6; }
  50%  { transform: translateX(4%) rotate(2deg); opacity: 1; }
  100% { transform: translateX(-2%) rotate(-1deg); opacity: .7; }
}

/* 深色骨架 */
.topbar { background: var(--chrome); border-bottom: 1px solid var(--chrome-line); backdrop-filter: blur(12px); }
.brand-mark { background: var(--grad-hot); border: none; box-shadow: 0 0 16px rgba(124, 106, 255, .5); }
.brand-text h1 { color: var(--chrome-ink); text-shadow: 0 0 12px rgba(74, 158, 255, .3); }
.brand-text p { color: var(--chrome-dim); }
.sidebar { background: linear-gradient(180deg, rgba(8, 12, 28, .95), rgba(12, 18, 36, .9)); border-right: 1px solid var(--chrome-line); }

/* 按钮科幻化 */
.btn.primary { background: var(--grad-hot); background-size: 200% 100%; animation: gradShift 3s ease infinite; border: none; color: #fff; font-weight: 600; box-shadow: 0 4px 16px rgba(124, 106, 255, .4); }
.btn.spark { background: var(--grad-hot); background-size: 200% 100%; animation: gradShift 3s ease infinite; border: none; color: #fff; font-weight: 600; box-shadow: 0 4px 16px rgba(181, 106, 255, .4); }
@keyframes gradShift { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

/* 卡片七色光晕 — 每张卡按位置注入 --hue */
.gcard {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--glow-rest), var(--shadow-sm);
  backdrop-filter: blur(8px);
}
.gcard:hover { box-shadow: var(--glow-md), var(--shadow-md); border-color: var(--line-strong); }

.r-item .r-in { border-radius: 11px; transition: all .18s ease; }
.r-item:hover .r-in { background: rgba(20, 30, 56, .9); border-color: var(--line-strong); box-shadow: var(--glow-sm); }
.r-item.on .r-in { background: rgba(16, 24, 48, .95); border-color: var(--accent-soft-2); }

/* 大卡片七色渐变边框 */
.bigcard { border: 1px solid transparent; background-clip: padding-box; position: relative; }
.bigcard::before {
  content: ''; position: absolute; inset: -1px; border-radius: 16px; z-index: -1;
  background: linear-gradient(135deg, rgba(74,158,255,.3), rgba(124,106,255,.2), rgba(181,106,255,.25), rgba(255,106,158,.2), rgba(255,106,94,.2));
}

/* 大标题霓虹 */
.big-title {
  color: transparent;
  background: var(--grad-hot); -webkit-background-clip: text; background-clip: text;
  text-shadow: 0 0 20px rgba(124, 106, 255, .3);
}

/* 侧栏搜索框 */
.search { background: rgba(10, 16, 32, .8); border-color: var(--line); }
.search input { color: var(--chrome-ink); }
.search input::placeholder { color: rgba(90, 116, 148, .6); }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), 0 0 12px rgba(74, 158, 255, .2); }

/* 分类标签 */
.chip { background: transparent; border-color: var(--line); color: var(--chrome-dim); }
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

/* 滚动条 */
::-webkit-scrollbar-thumb { background: rgba(60, 100, 180, .3); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(74, 158, 255, .5); border: 2px solid transparent; background-clip: padding-box; }

/* 星级 */
.star-b { color: rgba(90, 116, 148, .5); }
.star-b.on { color: var(--gold); text-shadow: 0 0 10px rgba(255, 200, 80, .7); }

/* 弹窗 */
.modal { background: var(--surface); border: 1px solid var(--line-strong); box-shadow: 0 24px 60px rgba(0,0,0,.6), 0 0 30px rgba(74,158,255,.15); }
.modal-backdrop { background: rgba(2, 6, 16, .7); backdrop-filter: blur(6px); }

/* Toast */
.toast { background: linear-gradient(135deg, rgba(20, 30, 60, .95), rgba(12, 18, 36, .95)); color: #c0d8f8; border: 1px solid var(--line-strong); box-shadow: var(--shadow-md), 0 0 16px rgba(74,158,255,.2); }

/* 打印纸保持白底 */
.sheet { color: #1a1a1a; }

/* 空状态 */
.empty h2 { color: var(--ink); }
.empty p { color: var(--ink-2); }

.gcard:focus-within,
.gcard:focus-within .r-in {
  transform: none !important;
  transition: transform 0.3s ease;
}

/* ============================================================
 * 日系浅色主题（data-theme="light"）
 * 温暖米白 + 樱花粉 + 抹茶绿点缀，日式简约风
 * ============================================================ */
[data-theme="light"] {
  --bg: #faf6ef;
  --surface: #ffffff;
  --surface-2: #f5f0e8;
  --ink: #3a3226;
  --ink-2: #7a6e5e;
  --ink-3: #b0a494;
  --line: #e8e0d4;
  --line-strong: #d4c8b6;
  --accent: #d4736e;
  --accent-deep: #b85e58;
  --accent-soft: #fdf0ee;
  --accent-soft-2: #f5d9d5;
  --gold: #c9a96e;
  --danger: #c75450;
  --danger-soft: #fdf0ee;
  --chrome: #f7f3ec;
  --chrome-line: #e4dccf;
  --chrome-ink: #3a3226;
  --chrome-dim: #9a8e7e;
  --chrome-hover: rgba(212, 115, 110, .08);
  --shadow-sm: 0 1px 3px rgba(80, 60, 30, .06), 0 4px 10px -6px rgba(80, 60, 30, .08);
  --shadow-md: 0 2px 8px rgba(80, 60, 30, .08), 0 10px 24px -10px rgba(80, 60, 30, .12);
  --glow-sm: 0 4px 16px -6px rgba(201, 169, 110, .25);
  --glow-md: 0 8px 24px -8px rgba(201, 169, 110, .3);
  --glow-rest: 0 2px 10px -4px rgba(201, 169, 110, .15);
  --grad-hot: linear-gradient(135deg, #e8908b, #d4736e, #c9a96e);
}

/* 浅色主题 body */
[data-theme="light"] body,
body:has(html[data-theme="light"]) {
  background:
    radial-gradient(ellipse 800px 400px at 85% -8%, rgba(212, 115, 110, .06), transparent 60%),
    radial-gradient(ellipse 600px 400px at 10% 110%, rgba(201, 169, 110, .08), transparent 60%),
    var(--bg);
  color: var(--ink);
}

/* 浅色主题下覆盖深色组件 */
html[data-theme="light"] body {
  background:
    radial-gradient(ellipse 800px 400px at 85% -8%, rgba(212, 115, 110, .06), transparent 60%),
    radial-gradient(ellipse 600px 400px at 10% 110%, rgba(201, 169, 110, .08), transparent 60%),
    var(--bg) !important;
  color: var(--ink);
}
html[data-theme="light"] body::before {
  background-image:
    linear-gradient(rgba(180, 160, 140, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(180, 160, 140, .05) 1px, transparent 1px);
}
html[data-theme="light"] body::after {
  background: conic-gradient(from 180deg,
    rgba(212, 115, 110, .04), rgba(201, 169, 110, .04), rgba(140, 180, 160, .04),
    rgba(212, 115, 110, .04), rgba(201, 169, 110, .04), rgba(212, 115, 110, .04));
}

html[data-theme="light"] .topbar { background: var(--chrome); border-bottom: 1px solid var(--chrome-line); }
html[data-theme="light"] .brand-mark { background: var(--grad-hot); box-shadow: 0 2px 10px rgba(212, 115, 110, .3); }
html[data-theme="light"] .brand-text h1 { color: var(--chrome-ink); text-shadow: none; }
html[data-theme="light"] .brand-text p { color: var(--chrome-dim); }
html[data-theme="light"] .sidebar { background: linear-gradient(180deg, #f7f3ec, #f0ebe2); border-right: 1px solid var(--chrome-line); }
html[data-theme="light"] .search { background: rgba(255, 255, 255, .9); border-color: var(--line); }
html[data-theme="light"] .search input { color: var(--chrome-ink); }
html[data-theme="light"] .search input::placeholder { color: var(--chrome-dim); }
html[data-theme="light"] .search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

html[data-theme="light"] .chip { background: transparent; border-color: var(--line); color: var(--chrome-dim); }
html[data-theme="light"] .chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-deep); }

html[data-theme="light"] .r-item:hover .r-in { background: #fff; border-color: var(--line); box-shadow: var(--glow-sm); }
html[data-theme="light"] .r-item.on .r-in { background: #fff; border-color: var(--accent-soft-2); box-shadow: var(--glow-rest); }
html[data-theme="light"] .r-name { color: var(--chrome-ink); }
html[data-theme="light"] .r-item:hover .r-name, html[data-theme="light"] .r-item.on .r-name { color: var(--ink); }
html[data-theme="light"] .r-meta { color: var(--chrome-dim); }
html[data-theme="light"] .r-item:hover .r-meta, html[data-theme="light"] .r-item.on .r-meta { color: var(--ink-2); }
html[data-theme="light"] .r-check { border-color: var(--line-strong); }

html[data-theme="light"] .gcard { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
html[data-theme="light"] .gcard:hover { box-shadow: var(--shadow-md); border-color: var(--line-strong); }
html[data-theme="light"] .gcard::before {
  background: linear-gradient(135deg, rgba(212,115,110,.15), rgba(201,169,110,.1), rgba(140,180,160,.1), rgba(212,115,110,.1));
}

html[data-theme="light"] .big-title { background: var(--grad-hot); -webkit-background-clip: text; background-clip: text; text-shadow: none; }

html[data-theme="light"] .sheet3 { background: var(--surface-2); border-color: var(--line); }
html[data-theme="light"] .row3 { border-bottom-color: var(--line); }
html[data-theme="light"] .row3:hover { background: rgba(212, 115, 110, .04); }
html[data-theme="light"] .row3.head { background: var(--surface-2); color: var(--ink-2); }
html[data-theme="light"] .row3.base { background: rgba(201, 169, 110, .1); box-shadow: inset 2px 0 0 var(--gold); }
html[data-theme="light"] .row3 input { color: var(--ink); }
html[data-theme="light"] .row3 input:hover { border-bottom-color: var(--line-strong); }
html[data-theme="light"] .row3 input:focus { border-bottom-color: var(--accent); }
html[data-theme="light"] .row3 input::placeholder { color: var(--ink-3); }

html[data-theme="light"] .row3.browse .cell.nm { color: var(--ink); }
html[data-theme="light"] .row3.browse .cell.wt { color: var(--ink-2); }
html[data-theme="light"] .row3.browse .cell.nt { color: var(--ink-2); }
html[data-theme="light"] .row3.browse .cell.num { color: var(--ink-3); }
html[data-theme="light"] .row3 .cell.grip { color: var(--ink-3); }

html[data-theme="light"] .base-radio { color: var(--ink-3); }
html[data-theme="light"] .base-radio.on { color: var(--gold); text-shadow: none; }
html[data-theme="light"] .base-tag { color: var(--gold); text-shadow: none; }

html[data-theme="light"] .rname-ro { color: var(--ink); text-shadow: none; }
html[data-theme="light"] .rname { color: var(--ink); }
html[data-theme="light"] .rname::placeholder { color: var(--ink-3); }

html[data-theme="light"] .btn.primary { background: var(--grad-hot); box-shadow: 0 3px 10px rgba(212, 115, 110, .3); }
html[data-theme="light"] .btn.spark { background: var(--grad-hot); box-shadow: 0 3px 10px rgba(212, 115, 110, .3); }
html[data-theme="light"] .btn.ghost { color: var(--chrome-dim); }
html[data-theme="light"] .btn.ghost:hover { color: var(--ink); background: var(--chrome-hover); }

html[data-theme="light"] .star-b { color: var(--ink-3); }
html[data-theme="light"] .star-b.on { color: var(--gold); text-shadow: none; }
html[data-theme="light"] .r-stars { color: var(--gold); background: var(--accent-soft); border-color: var(--accent-soft-2); }

html[data-theme="light"] .side-foot { color: var(--chrome-dim); border-top-color: var(--line); }
html[data-theme="light"] .side-empty { color: var(--chrome-dim); }
html[data-theme="light"] .lb-title, html[data-theme="light"] .lb-btn, html[data-theme="light"] .lb-count { color: var(--chrome-dim); }
html[data-theme="light"] .lb-btn:hover { color: var(--ink); background: var(--chrome-hover); }

html[data-theme="light"] .modal { background: var(--surface); border: 1px solid var(--line); box-shadow: 0 20px 50px rgba(80,60,30,.15); }
html[data-theme="light"] .modal-backdrop { background: rgba(58, 50, 38, .3); backdrop-filter: blur(4px); }

html[data-theme="light"] .toast { background: linear-gradient(135deg, #3a3226, #2c2620); color: #f0ebe2; border: 1px solid var(--line-strong); }

html[data-theme="light"] .empty h2 { color: var(--ink); }
html[data-theme="light"] .empty p { color: var(--ink-2); }

html[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(180, 160, 140, .3); }
html[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: rgba(180, 160, 140, .5); }

html[data-theme="light"] .sop-head-title { color: var(--ink); }
html[data-theme="light"] .fs-head { color: var(--accent-deep); }

/* 云端账户与手机布局 */
.mobile-back { display: none; }
.cloud-viewer { color: var(--ink-3); font-size: 12px; align-self: center; white-space: nowrap; }
.cloud-mode #saveStatus { cursor: pointer; }
.cloud-login {
  position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center;
  padding: 20px; background: var(--bg);
}
.cloud-login-card {
  width: min(420px, 100%); display: grid; gap: 16px; padding: 30px;
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 22px; box-shadow: var(--shadow-md); color: var(--ink);
}
.cloud-login-icon { font-size: 38px; }
.cloud-login-card h2 { font-size: 23px; }
.cloud-login-card p { color: var(--ink-2); font-size: 13px; line-height: 1.6; }
.cloud-login-card label { display: grid; gap: 7px; font-size: 13px; color: var(--ink-2); }
.cloud-login-card input {
  width: 100%; min-height: 44px; padding: 10px 12px;
  border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--surface-2); color: var(--ink); font-size: 16px;
}
.cloud-login-card .btn { justify-content: center; min-height: 44px; }
.cloud-login-error { color: var(--danger); font-size: 13px; min-height: 1em; }
.cloud-member-hint { color: var(--ink-2); font-size: 13px; line-height: 1.6; margin: 8px 0 16px; }
.cloud-member-list { display: grid; gap: 7px; margin-bottom: 18px; }
.cloud-member-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface-2); font-size: 13px; overflow-wrap: anywhere;
}
.cloud-member-row small { color: var(--ink-3); white-space: nowrap; }
.cloud-member-form { display: grid; gap: 11px; }
.cloud-member-form h3 { margin: 0 0 2px; font-size: 16px; }
.cloud-member-form label { display: grid; gap: 5px; color: var(--ink-2); font-size: 13px; }
.cloud-member-form input {
  width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid var(--line-strong);
  border-radius: 9px; background: var(--surface-2); color: var(--ink); font-size: 16px;
}
.cloud-member-error { min-height: 1em; color: var(--danger); font-size: 13px; }

@media (max-width: 700px) {
  body.cloud-mode { height: 100dvh; }
  .cloud-mode .topbar {
    height: auto; min-height: 60px; padding: 8px 12px;
    display: flex; flex-wrap: wrap; row-gap: 7px;
  }
  .cloud-mode .brand { gap: 8px; min-width: 0; }
  .cloud-mode .brand-mark { width: 32px; height: 32px; font-size: 18px; }
  .cloud-mode .brand-text h1 { font-size: 14px; white-space: nowrap; }
  .cloud-mode .brand-text p { display: none; }
  .cloud-mode .top-right {
    width: 100%; min-width: 0; overflow-x: auto; gap: 3px;
    scrollbar-width: none; justify-content: flex-start;
  }
  .cloud-mode .top-right::-webkit-scrollbar { display: none; }
  .cloud-mode .top-right .btn { min-height: 40px; padding: 7px 10px; flex: none; }
  .cloud-mode .top-right .btn:not(.cloud-account) span { display: none; }
  .cloud-mode .save-status { font-size: 11px; margin-right: 3px; }
  .cloud-mode .layout { display: block; min-height: 0; overflow: hidden; }
  .cloud-mode .sidebar, .cloud-mode .editor {
    height: 100%; max-height: none; width: 100%; overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .cloud-mode .sidebar { padding: 12px 14px 20px; border-right: 0; }
  .cloud-mode .editor { padding: 14px 12px 70px; }
  .cloud-mode[data-mobile-view="list"] .editor { display: none; }
  .cloud-mode[data-mobile-view="detail"] .sidebar { display: none; }
  .cloud-mode[data-mobile-view="detail"] .mobile-back {
    display: inline-flex; align-items: center; min-height: 36px; padding: 4px 7px;
    border: 0; border-radius: 8px; background: transparent; color: var(--chrome-ink);
    font-size: 13px; font-weight: 650;
  }
  .cloud-mode .rlist { overflow: visible; flex: none; }
  .cloud-mode .r-item { animation: none; }
  .cloud-mode .r-acts { opacity: 1; }
  .cloud-mode .rhead { padding: 16px; }
  .cloud-mode .rhead-top { gap: 8px; }
  .cloud-mode .rhead-acts { justify-content: flex-start; flex-wrap: wrap; }
  .cloud-mode .rhead-acts .btn { min-height: 40px; }
  .cloud-mode .rname, .cloud-mode .rname-ro { font-size: 22px; white-space: normal; }
  .cloud-mode .rmeta { gap: 12px; }
  .cloud-mode .rmeta .f { min-width: 110px; }
  .cloud-mode .bigcard { padding: 12px; }
  .cloud-mode .big-head { flex-wrap: wrap; gap: 8px; }
  .cloud-mode .row3.head { display: none; }
  .cloud-mode .row3:not(.head) {
    grid-template-columns: minmax(0, 1fr) 62px 38px;
    gap: 8px; padding: 12px 10px;
  }
  .cloud-mode .row3:not(.head):not(.browse) .cell.grip { display: none; }
  .cloud-mode .row3:not(.head):not(.browse) .cell:nth-child(2) { grid-column: 1; grid-row: 1; }
  .cloud-mode .row3:not(.head):not(.browse) .cell:nth-child(3) { grid-column: 2 / 4; grid-row: 1; }
  .cloud-mode .row3:not(.head):not(.browse) .cell:nth-child(4) { grid-column: 1; grid-row: 2; }
  .cloud-mode .row3:not(.head):not(.browse) .cell:nth-child(5) { grid-column: 2; grid-row: 2; }
  .cloud-mode .row3:not(.head):not(.browse) .cell:nth-child(6) { grid-column: 3; grid-row: 2; }
  .cloud-mode .row3 input { min-height: 36px; font-size: 16px; }
  .cloud-mode .row3.browse { grid-template-columns: 24px minmax(0, 1fr) 80px; }
  .cloud-mode .row3.browse .cell.num { grid-column: 1; grid-row: 1; }
  .cloud-mode .row3.browse .cell.nm { grid-column: 2; grid-row: 1; }
  .cloud-mode .row3.browse .cell.wt { grid-column: 3; grid-row: 1; }
  .cloud-mode .row3.browse .cell.nt { grid-column: 2 / 4; grid-row: 2; }
  .cloud-mode .row3.browse .cell.basecell { grid-column: 2 / 4; grid-row: 3; justify-content: flex-start; }
  .cloud-mode .row3.browse .cell.delcell { display: none; }
  .cloud-mode .modal { width: min(100%, 560px); max-height: 90dvh; overflow-y: auto; }
  .cloud-mode .modal-backdrop { padding: 10px; }
  .cloud-mode .paper { overflow-x: auto; }
  .cloud-mode .m-acts { flex-wrap: wrap; }
  .cloud-mode .m-acts .btn { min-height: 42px; }
}
