/* styles.css — WordPaper. 卡通动画 UI：圆胖贴纸卡片、糖果色、漂浮点缀、Q 弹按压。 */
:root {
  --bg: #fff3e2;
  --bg-2: #ffe3c6;
  --panel: #fffdf8;
  --ink: #503722;
  --sub: #ab8a63;
  --accent: #ff8f4d;
  --accent-2: #ffb067;
  --accent-soft: #ffe0c2;
  --accent-ink: #fff7ee;
  --line: #f3d9b8;
  --line-strong: #e8b98a;
  --good: #3dbb85;
  --danger: #e2605c;
  --radius: 28px;
  --radius-sm: 18px;
  --shadow: 0 5px 0 rgba(120, 72, 20, 0.07), 0 16px 34px rgba(120, 72, 20, 0.12);
  --shadow-sm: 0 3px 0 rgba(120, 72, 20, 0.08), 0 7px 16px rgba(120, 72, 20, 0.10);
  --font: "Yuanti SC", "YouYuan", "幼圆", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans CJK SC", -apple-system, "Segoe UI", Arial, sans-serif;
}
:root { --sub: #ab8a63; }

* { box-sizing: border-box; }
/* HTML 的 hidden 属性不能被组件的 display:flex / display:grid 覆盖。
   否则「自定义尺寸」会在非自定义尺寸时仍然露出来，也会让设置值看起来和当前壁纸不一致。 */
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 205, 150, .55), transparent 42%),
    radial-gradient(circle at 88% 14%, rgba(255, 228, 180, .7), transparent 48%),
    radial-gradient(circle at 50% 100%, rgba(255, 214, 170, .4), transparent 55%),
    linear-gradient(160deg, var(--bg), var(--bg-2));
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body::before {
  content: ""; position: fixed; inset: -20%; z-index: 0; pointer-events: none;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.66), transparent 23%),
    radial-gradient(circle at 72% 68%, rgba(255,182,120,.18), transparent 27%);
  animation: paper-glow 16s ease-in-out infinite alternate;
}
@keyframes paper-glow { from { transform: translate3d(-1.5%, -1%, 0) scale(1); } to { transform: translate3d(1.5%, 1%, 0) scale(1.04); } }

/* 漂浮的卡通点缀（星星/圆点/加号），跟着视口轻轻晃 */
.float-deco { position: fixed; z-index: 0; pointer-events: none; opacity: .28; color: #cb8f5e; animation: floaty var(--dur, 10s) ease-in-out infinite; font-size: var(--fs, 14px); }
@keyframes floaty { 0%, 100% { transform: translate3d(0,0,0) rotate(-6deg); opacity: .12; } 50% { transform: translate3d(0,-13px,0) rotate(8deg); opacity: .5; } }

.app { display: flex; flex-direction: column; min-height: 100vh; position: relative; z-index: 1; }

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  padding: 11px 22px;
  background: rgba(255, 252, 247, 0.76);
  backdrop-filter: blur(18px) saturate(1.18);
  border-bottom: 1px solid rgba(183, 132, 84, .23);
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo {
  width: 44px; height: 44px; flex: 0 0 auto; position: relative; overflow: hidden;
  display: grid; place-items: center; color: #fffaf2; font: 800 21px/1 Georgia, "Times New Roman", serif;
  background: linear-gradient(145deg, #30354b, #171b2c);
  border-radius: 13px 18px 13px 18px;
  box-shadow: 0 8px 18px rgba(31, 38, 64, .22), inset 0 1px 0 rgba(255,255,255,.18);
  transform: rotate(-4deg); animation: logo-wob 6s ease-in-out infinite;
}
 .logo::after { content: ""; position: absolute; right: 0; top: 0; width: 13px; height: 13px; background: #f7bf86; clip-path: polygon(0 0,100% 0,100% 100%); opacity: .94; }
 .logo span { position: relative; z-index: 1; transform: translateY(-1px); }
@keyframes logo-wob { 0%, 100% { transform: rotate(-4deg) translateY(0); } 50% { transform: rotate(2deg) translateY(-3px); } }
.topbar h1 { font-size: 23px; margin: 0; letter-spacing: -.025em; font-weight: 800; position: relative; }
/* 标题旁一闪一闪的小星星 */
.topbar h1::after { content: "✨"; position: absolute; right: -22px; top: -8px; font-size: 14px; animation: twinkle 2.2s ease-in-out infinite; }
@keyframes twinkle { 0%, 100% { opacity: .25; transform: scale(.8) rotate(0); } 50% { opacity: 1; transform: scale(1.15) rotate(20deg); } }
.tagline { margin: 2px 0 0; font-size: 12.5px; color: var(--sub); font-weight: 600; }
.top-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.account-tools { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.68); font-size: 11px; }
.account-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-weight: 800; }
.sync-status { color: var(--good); font-weight: 800; white-space: nowrap; }
.sync-status[data-state="saving"] { color: var(--sub); }
.sync-status[data-state="local"] { color: var(--sub); }
.sync-status[data-state="error"], .sync-status[data-state="conflict"] { color: var(--danger); }
.account-link { color: var(--sub); text-decoration: none; font: inherit; font-weight: 700; }
.account-link:hover { color: var(--accent); }
.account-button { padding: 0; border: 0; background: none; cursor: pointer; }
.legacy-import { color: var(--orange, #b85b28); }
.pet-primary { background: #e9f7ff; border-color: #9fcbea; color: #1e618c; box-shadow: 0 5px 0 rgba(70, 142, 189, .28); }
.pet-primary:hover { background: #d9f1ff; box-shadow: 0 8px 0 rgba(70, 142, 189, .3); }
.pet-primary:active { box-shadow: 0 1px 0 rgba(70, 142, 189, .28); }

/* ---------- buttons (圆胖贴纸：粗描边 + 底部厚实色边，Q 弹按压) ---------- */
.btn {
  font-family: var(--font); font-size: 13.5px; font-weight: 800; cursor: pointer;
  padding: 9px 17px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: #fff; color: var(--ink);
  transition: transform .12s cubic-bezier(.34,1.56,.64,1), box-shadow .12s, background .12s, filter .12s;
  box-shadow: 0 2px 3px rgba(120,72,20,.08), 0 7px 18px rgba(120,72,20,.07);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 7px 18px rgba(120,72,20,.15); }
.btn:active { transform: translateY(1px) scale(.99); box-shadow: 0 2px 5px rgba(120,72,20,.10); }
.btn.primary {
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  color: var(--accent-ink); border-color: #e8763a;
  border-color: transparent;
  box-shadow: 0 9px 20px rgba(205, 105, 38, .25);
  text-shadow: 0 1px 2px rgba(180, 90, 30, .30);
  position: relative; overflow: hidden;
}
/* 主按钮一道流动的光泽，显得更活 */
.btn.primary::after {
  content: ""; position: absolute; top: -40%; bottom: -40%; left: -30%; width: 34%;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,.5), transparent);
  transform: skewX(-20deg); animation: btn-sheen 3.2s ease-in-out infinite;
}
@keyframes btn-sheen { 0%, 55% { left: -40%; } 85%, 100% { left: 130%; } }
.btn.primary:hover { filter: brightness(1.07); box-shadow: 0 13px 24px rgba(205,105,38,.28); }
.btn.primary:active { box-shadow: 0 4px 10px rgba(205,105,38,.18); }
.btn.soft { background: var(--accent-soft); border-color: rgba(216,150,80,.38); color: #a05a1f; box-shadow: 0 5px 14px rgba(216,150,80,.14); }
.btn.soft:hover { background: #ffd4a8; box-shadow: 0 10px 20px rgba(216,150,80,.18); }
.btn.soft:active { box-shadow: 0 3px 7px rgba(216,150,80,.15); }
.btn.ghost { background: rgba(255,255,255,.6); border-color: var(--line); color: var(--sub); box-shadow: 0 5px 0 rgba(120,72,20,.10); }
.btn.ghost:hover { box-shadow: 0 8px 0 rgba(120,72,20,.12); }
.btn.ghost:active { box-shadow: 0 1px 0 rgba(120,72,20,.10); }
.btn.small { padding: 8px 15px; font-size: 13px; }
.btn.danger { color: var(--danger); border-color: #f0b6b2; background: #fff; }
.btn.danger:hover { background: #fdeceb; border-color: var(--danger); }

/* ---------- workbench (预览为主：居中对称大画布在上，控制面板等宽对称在下) ---------- */
.workbench {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr) 330px;
  gap: 14px; padding: 14px 20px;
  max-width: 1800px; margin: 0 auto; width: 100%;
  align-items: start;
}
/* 左右对称辅助面板：内容纵排，严格等宽，逻辑分组；
   内容高于一屏时各自内部滚动 —— 预览始终保持完整可见（主区域） */
.panel { display: flex; min-width: 0; }
.panel-col {
  display: flex; flex-direction: column; gap: 12px; flex: 1; min-width: 0;
  max-height: calc(100vh - 118px);
  overflow-y: auto;
  scrollbar-width: thin;
}
.panel-col::-webkit-scrollbar { width: 6px; }
.panel-col::-webkit-scrollbar-thumb { background: rgba(120,72,20,.22); border-radius: 3px; }
/* 卡片是 flex 项，禁止被压缩（overflow:hidden 的卡片 min-height 会塌成 0） */
.panel-col > .card { flex-shrink: 0; }
.panel-left { grid-column: 1; }
.panel-right { grid-column: 3; }

/* ---------- 整理模块模式：卡片只能落在两侧的整齐堆叠槽位 ---------- */
.layout-actions { align-items:center; }
.module-grip { display:none; position:absolute; z-index:4; right:10px; top:9px; width:30px; height:30px; border:1px solid rgba(204,132,70,.42); border-radius:10px; background:#fff9f0; color:var(--accent-2); font:900 16px/1 var(--font); cursor:grab; box-shadow:0 3px 8px rgba(139,82,31,.10); }
.module-grip:active { cursor:grabbing; }
.layout-editing .module-grip { display:grid; place-items:center; }
.layout-editing .module-card { outline:1px dashed rgba(220,136,64,.52); outline-offset:4px; }
.layout-editing .module-card:hover { transform:none; }
.layout-editing .panel-col { padding:5px 6px 9px; border-radius:24px; background:rgba(255,255,255,.18); }
.panel-col.layout-drop-target { box-shadow:inset 0 0 0 2px rgba(255,143,77,.48); background:rgba(255,230,199,.36); }
.module-card.layout-dragging { opacity:.38; transform:scale(.98); }
.layout-slot { height:12px; margin:-6px 0; border-radius:999px; pointer-events:none; transition:height .14s, background .14s; }
.layout-slot.active { height:28px; margin:0; background:linear-gradient(90deg,transparent,rgba(255,143,77,.48),transparent); }
@media (max-width: 760px) { .layout-actions { width:100%; justify-content:flex-end; } .module-grip { display:none !important; } .layout-editing .panel-col { padding:0; } }

.card {
  background: rgba(255, 253, 248, .82);
  border: 1px solid rgba(196, 143, 93, .28);
  border-radius: 22px;
  padding: 9px 12px;
  box-shadow: 0 11px 30px rgba(115, 74, 31, .09), inset 0 1px 0 rgba(255,255,255,.78);
  position: relative;
  animation: card-pop .5s cubic-bezier(.34,1.56,.64,1) backwards;
  transition: transform .28s cubic-bezier(.2,.85,.28,1), box-shadow .28s, border-color .28s;
}
/* 卡片依次弹入（错落动画），悬浮时轻轻浮起 */
.panel-col > .card:nth-child(1) { animation-delay: .02s; }
.panel-col > .card:nth-child(2) { animation-delay: .07s; }
.panel-col > .card:nth-child(3) { animation-delay: .12s; }
.panel-col > .card:nth-child(4) { animation-delay: .17s; }
@keyframes card-pop { from { opacity: 0; transform: translateY(12px); filter: blur(3px); } to { opacity: 1; transform: none; filter: none; } }
.panel-col > .card:hover { transform: translateY(-2px); border-color: rgba(196, 128, 68, .48); box-shadow: 0 16px 34px rgba(115,74,31,.13), inset 0 1px 0 #fff; }
.card h2 {
  font-size: 13.5px; margin: 0 0 6px; color: var(--ink); font-weight: 800;
  display: flex; align-items: center; gap: 7px; letter-spacing: .01em;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 9px; margin-bottom: 6px; }
.card-head h2 { margin: 0; }
.h-emoji { display: inline-grid; place-items: center; width: 26px; height: 26px; font-size: 15px; background: color-mix(in srgb, var(--accent-soft) 58%, white); border-radius: 9px; box-shadow: inset 0 0 0 1px rgba(216,140,70,.12); flex: 0 0 auto; transition: transform .2s cubic-bezier(.34,1.56,.64,1); }
.card:hover .h-emoji { transform: rotate(-10deg) scale(1.12); }

/* collapsible low-frequency cards (details.card) */
details.card { padding: 0; overflow: hidden; }
details.card > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 700; color: var(--ink); padding: 14px 16px; letter-spacing: .01em;
  user-select: none;
}
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::after {
  content: "▸"; margin-left: auto; color: var(--sub); font-size: 13px; transition: transform .18s;
}
details.card[open] > summary::after { transform: rotate(90deg); }
details.card > summary:hover { background: var(--bg); }
details.card .card-body { padding: 0 16px 16px; }
details.card[open] > summary { border-bottom: 2px solid var(--line); margin-bottom: 14px; }

.h-emoji { font-size: 18px; }
.hint { font-size: 12px; color: var(--sub); margin: 0 0 8px; line-height: 1.55; }
.hint b { color: var(--accent-2); }

.divider { height: 2px; background: var(--line); border-radius: 2px; margin: 12px 0; }

/* ---------- rows & inputs ---------- */
.row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 5px; font-size: 12.5px; }
.row > span { color: var(--sub); flex: 0 0 auto; font-weight: 500; }
.row select, .row input[type="number"], .inline input, .nw-grid input, textarea, #custom-fields input {
  font-family: var(--font); font-size: 12.5px; padding: 6px 10px;
  border: 2.5px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; color: var(--ink); transition: border-color .12s, box-shadow .12s;
  box-shadow: inset 0 2px 0 rgba(120,72,20,.05);
}
.row select:focus, .row input:focus, textarea:focus, .nw-grid input:focus, #custom-fields input:focus {
  outline: none; border-color: var(--accent-2); box-shadow: 0 0 0 3px var(--accent-soft);
}
.row select { flex: 1; min-width: 0; }
.row input[type="number"] { width: 80px; }
.inline { display: flex; align-items: center; gap: 6px; }
.inline input { width: 74px; }

.slider-row { gap: 10px; }
.slider-row input[type="range"] { flex: 1; min-width: 0; accent-color: var(--accent); height: 22px; cursor: pointer; }
.slider-row b { flex: 0 0 48px; text-align: right; font-size: 13px; color: var(--accent-2); font-weight: 700; }
.count-row { margin-bottom: 1px; }
.count-field, .percent-field { display: inline-flex; align-items: center; gap: 5px; flex: 0 0 auto; }
.count-field input, .percent-field input {
  width: 68px; min-width: 0; padding: 6px 8px; text-align: center; font: 800 13px var(--font);
  color: var(--ink); border: 2.5px solid var(--line); border-radius: 12px; background: #fff;
}
.count-field input:focus, .percent-field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.count-field em, .percent-field em { font-size: 12px; font-style: normal; color: var(--sub); font-weight: 700; }
.input-hint { margin: 2px 0 0; color: var(--sub); font-size: 10.5px; line-height: 1.45; }
.slider-row .percent-field { margin-left: -2px; }
.row .percent-field input { width: 55px; }
.ink-row { align-items: flex-start; }
.ink-row > span { padding-top: 6px; }

.checks { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; margin-top: 4px; }
.checks label { display: flex; align-items: center; gap: 7px; cursor: pointer; }
.checks input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer; }

/* segmented */
.seg { display: inline-flex; background: var(--bg-2); border-radius: 999px; padding: 3px; gap: 3px; }
.seg-btn {
  border: none; background: transparent; font-family: var(--font); font-size: 12.5px; font-weight: 600;
  padding: 6px 13px; border-radius: 999px; cursor: pointer; color: var(--sub); transition: all .12s;
}
.seg-btn.on { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }

/* ---------- library cards (2 列贴纸网格，卡通 + 不截断) ---------- */
/* 300px 侧栏放三列会触发卡片最小内容宽度，产生横向滚动并截掉第三列。
   两列让词库名称、数量和按钮都能完整可点。 */
.lib-search { margin-bottom: 8px; }
.lib-search input { width: 100%; box-sizing: border-box; padding: 8px 11px; border-radius: 11px; border: 1px solid rgba(150,110,70,.28); background: rgba(255,255,255,.82); color: var(--ink); font: 600 12.5px/1.3 var(--font); outline: none; transition: border-color .16s ease, box-shadow .16s ease; }
.lib-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(179,64,42,.10); }
.lib-search input::placeholder { color: var(--sub); opacity: .7; font-weight: 500; }
.lib-empty { grid-column: 1 / -1; padding: 18px 12px; text-align: center; color: var(--sub); font-size: 12px; background: rgba(255,255,255,.5); border: 1px dashed rgba(150,110,70,.3); border-radius: 12px; }
.lib-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; margin-bottom: 6px; }
.lib-card {
  display: flex; align-items: center; gap: 6px; text-align: left; width: 100%;
  padding: 5px 7px; border: 1px solid rgba(196,143,93,.30); border-radius: 13px;
  background: #fff; cursor: pointer; font-family: var(--font);
  box-shadow: 0 3px 9px rgba(120,72,20,.055);
  transition: transform .14s cubic-bezier(.34,1.56,.64,1), box-shadow .14s, border-color .14s, background .14s;
}
.lib-card:hover { border-color: var(--accent-2); transform: translateY(-2px); box-shadow: 0 8px 16px rgba(120,72,20,.11); }
.lib-card:active { transform: translateY(1px); box-shadow: 0 2px 5px rgba(120,72,20,.08); }
.lib-card.on {
  border-color: var(--accent); background: linear-gradient(140deg, #fff, var(--accent-soft));
  box-shadow: 0 7px 16px rgba(216,130,50,.16);
}
.lib-icon {
  font-size: 16px; flex: 0 0 auto; width: 28px; height: 28px; display: grid; place-items: center;
  background: var(--bg-2); border-radius: 9px; box-shadow: inset 0 -2px 0 rgba(120,72,20,.08);
  transition: transform .14s;
}
.lib-card:hover .lib-icon { transform: scale(1.1) rotate(-6deg); }
.lib-card.on .lib-icon { background: #fff; }
.lib-body { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.18; gap: 0; }
.lib-body b { font-size: 12.5px; color: var(--ink); font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-body i { font-style: normal; font-size: 10px; color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-count {
  flex: 0 0 auto; align-self: center; font-size: 9px; font-weight: 800; color: #a05a1f;
  background: var(--accent-soft); padding: 2px 5px; border-radius: 999px; margin-left: 1px;
  box-shadow: inset 0 -1px 0 rgba(216,140,70,.3); white-space: nowrap;
}
.selected-library-action {
  display:flex; align-items:center; justify-content:space-between; gap:8px; margin:8px 0 4px;
  padding:7px 8px 7px 10px; border:1px dashed rgba(196,143,93,.46); border-radius:13px;
  background:linear-gradient(100deg, rgba(255,249,239,.88), rgba(255,239,216,.72));
}
.selected-library-action span { min-width:0; color:var(--sub); font-size:11px; font-weight:800; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.selected-library-action .btn { flex:0 0 auto; box-shadow:0 3px 8px rgba(120,72,20,.09); }

/* ---------- import ---------- */
.import-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.import-tile {
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
  padding: 16px 10px; border: 2px dashed var(--line); border-radius: var(--radius-sm);
  background: #fff; cursor: pointer; transition: all .12s;
}
.import-tile:hover { border-color: var(--accent); background: var(--accent-soft); border-style: solid; }
.import-tile.shot { border-color: var(--accent-2); background: linear-gradient(150deg, #fff, var(--accent-soft)); }
.import-tile input { display: none; }
.it-icon { font-size: 26px; }
.import-tile b { font-size: 13px; color: var(--ink); }
.import-tile i { font-style: normal; font-size: 11.5px; color: var(--sub); }
.pack-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.mini-label { font-size: 11.5px; color: var(--sub); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.pack-chips { margin-bottom: 0; }
.chip {
  font-family: var(--font); font-size: 12px; font-weight: 700; padding: 5px 11px; cursor: pointer;
  border: 2.5px solid var(--line); background: #fff; border-radius: 999px; color: var(--sub);
  box-shadow: 0 3px 0 rgba(120,72,20,.10); transition: all .13s cubic-bezier(.34,1.56,.64,1);
}
.chip:hover { border-color: var(--accent); color: var(--accent-2); transform: translateY(-2px); box-shadow: 0 5px 0 rgba(120,72,20,.12); }
.chip:active { transform: translateY(1px); box-shadow: 0 1px 0 rgba(120,72,20,.10); }
textarea { width: 100%; resize: vertical; margin-bottom: 8px; }
.sub { margin-top: 10px; }
.sub summary { font-size: 12.5px; color: var(--sub); cursor: pointer; margin-bottom: 9px; }
.nw-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 9px; }
.nw-grid input:first-child, .nw-grid input:last-child { grid-column: 1 / -1; }
.row-btns { display: flex; gap: 8px; }

/* ---------- 记忆复习 (SRS) card ---------- */
.srs-card .card-head { margin-bottom: 6px; }
.srs-switch { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--sub); cursor: pointer; font-weight: 600; }
.srs-switch input { accent-color: var(--accent); width: 16px; height: 16px; cursor: pointer; }
.srs-status { font-size: 12.5px; color: var(--sub); margin: 2px 0 10px; font-weight: 600; }
.srs-status b { color: var(--accent-2); }
.srs-records { display:flex; flex-direction:column; gap:4px; margin:0 0 9px; max-height:116px; overflow:auto; }
.srs-record { display:flex; align-items:center; gap:6px; padding:5px 7px; border-radius:10px; background:rgba(255,255,255,.66); color:var(--sub); font-size:11px; }
.srs-record b { color:var(--ink); max-width:82px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }.srs-record span { margin-left:auto; white-space:nowrap; font-variant-numeric:tabular-nums; }
.srs-record.empty { display:block; color:var(--sub); background:transparent; padding:2px 0; }
.srs-learn { width: 100%; margin-bottom: 8px; }
.srs-notice { width:100%; margin:-2px 0 8px; font-size:11px; }
.srs-countdown {
  display: flex; align-items: center; gap: 8px;
  background: linear-gradient(140deg, var(--accent-soft), #fff3e2);
  border: 2px solid #f7d3ab; border-radius: var(--radius-sm);
  padding: 7px 12px; font-size: 12.5px; color: #a05a1f; font-weight: 600;
}
.srs-countdown[hidden] { display: none !important; }
.srs-cd-icon { font-size: 17px; animation: srs-bell 2.4s ease-in-out infinite; transform-origin: top center; }
@keyframes srs-bell { 0%,100% { transform: rotate(0); } 8% { transform: rotate(14deg); } 16% { transform: rotate(-12deg); } 24% { transform: rotate(8deg); } 32% { transform: rotate(0); } }
.srs-cd-text b { font-variant-numeric: tabular-nums; font-size: 14px; letter-spacing: .02em; }
.srs-countdown.due { background: linear-gradient(140deg, #ffd9a0, #ffce8a); border-color: var(--accent); animation: srs-glow 1.4s ease-in-out infinite; }
@keyframes srs-glow { 0%,100% { box-shadow: 0 0 0 0 rgba(255,157,92,.45); } 50% { box-shadow: 0 0 0 6px rgba(255,157,92,.12); } }

/* ---------- 艾宾浩斯记忆本：像一摞正在复习的索引卡，不和主面板重复操作 ---------- */
.memory-card { width:min(680px, calc(100vw - 28px)); background:linear-gradient(145deg,#fffdf7,#fff1df); border:1px solid rgba(202,137,77,.3); }
.memory-summary { display:flex; gap:8px; flex-wrap:wrap; margin:2px 0 13px; }
.memory-pill { padding:6px 10px; border-radius:999px; background:#fff; color:var(--sub); font-size:12px; font-weight:800; border:1px solid var(--line); }
.memory-pill b { color:var(--accent-2); }
.memory-pill-forgot { background:#fff7f1; border-color:#f2c8ad; }
.memory-notebook-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; max-height:min(56vh,530px); overflow:auto; padding:2px 3px 8px; }
.memory-entry { position:relative; min-height:128px; text-align:left; border:1px solid rgba(175,116,62,.20); border-radius:18px; padding:15px 15px 13px; background:rgba(255,255,255,.78); color:var(--ink); box-shadow:0 5px 14px rgba(116,72,32,.08); cursor:default; overflow:hidden; transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.memory-entry.due { padding-bottom:62px; border-color:rgba(255,143,77,.62); background:linear-gradient(145deg,#fff,#fff1df); }
.memory-entry.due::before { content:"到期复习"; position:absolute; right:-18px; top:8px; transform:rotate(34deg); padding:3px 21px; background:var(--accent); color:#fff; font-size:10px; font-weight:900; letter-spacing:.08em; }
.memory-entry.due:hover { transform:translateY(-2px) rotate(-.35deg); box-shadow:0 11px 22px rgba(183,96,35,.17); }
.memory-entry b { display:block; font-size:20px; letter-spacing:.02em; margin-right:35px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.memory-entry .memory-meta { display:block; margin-top:5px; font-size:11px; color:var(--accent-2); font-weight:800; }
.memory-entry .memory-meaning { display:block; margin-top:13px; color:var(--sub); font-size:13px; line-height:1.45; }
.memory-entry .memory-meaning.locked { color:transparent; user-select:none; border-radius:7px; background:repeating-linear-gradient(-45deg,#eed7bd 0 5px,#f6e8d7 5px 10px); width:82%; height:18px; }
.memory-actions { position:absolute; left:14px; right:14px; bottom:13px; display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.memory-answer { min-height:34px; border-radius:12px; font:800 12px/1 var(--font); cursor:pointer; transition:transform .14s ease, box-shadow .14s ease, filter .14s ease; }
.memory-answer:hover { transform:translateY(-2px); filter:saturate(1.08); }
.memory-answer:active { transform:translateY(1px); }
.memory-answer:disabled { cursor:wait; opacity:.55; transform:none; }
.memory-answer.forgot { color:#9a4c31; border:1px solid #e8ad91; background:#fff8f3; box-shadow:0 3px 0 #f1d0bd; }
.memory-answer.remembered { color:#32694d; border:1px solid #9bc9ae; background:#f2fff7; box-shadow:0 3px 0 #c6e4d1; }
.memory-entry.answered { min-height:148px; animation:memory-answer-pop .34s cubic-bezier(.34,1.56,.64,1); }
.memory-entry.answered.remembered { border-color:#88c7a2; background:linear-gradient(145deg,#fff,#effbf4); }
.memory-entry.answered.forgotten { border-color:#e8ad91; background:linear-gradient(145deg,#fff,#fff2e9); }
.memory-entry.mastered { border-color:#a7ccb5; background:linear-gradient(145deg,#fbfff9,#edf8f1); }
.memory-entry.mastered::after { content:"已巩固"; position:absolute; right:12px; top:12px; padding:4px 7px; border-radius:999px; background:#dff2e6; color:#387052; font-size:10px; font-weight:900; }
.memory-result { display:inline-flex; margin-top:12px; padding:5px 9px; border-radius:999px; background:rgba(255,255,255,.82); color:var(--accent-2); font-size:11px; font-weight:900; }
.memory-undo { display:inline-flex; margin-top:12px; margin-left:7px; padding:5px 11px; border-radius:999px; border:1px solid rgba(150,110,70,.35); background:rgba(255,255,255,.7); color:#8a6a4a; font:800 11px/1 var(--font); cursor:pointer; vertical-align:top; transition:background .15s ease, transform .15s ease; }
.memory-undo:hover { background:#fff; transform:translateY(-1px); }
.memory-undo:active { transform:translateY(0); }
@keyframes memory-answer-pop { from { transform:scale(.96); opacity:.72; } to { transform:scale(1); opacity:1; } }
.memory-empty { grid-column:1/-1; padding:30px 16px; text-align:center; border:1px dashed var(--line-strong); border-radius:18px; color:var(--sub); font-size:13px; background:rgba(255,255,255,.45); }
@media (max-width:620px){ .memory-notebook-list{grid-template-columns:1fr;} }

/* preset 提醒用 2 列网格，省两行高度 */
#preset-reminders { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 6px; }
#preset-reminders .chip { text-align: left; padding: 4px 9px; font-size: 11px; }

/* ---------- reminders ---------- */
.rem-input { display: flex; gap: 6px; margin-bottom: 8px; }
.rem-input input[type="time"] { width: 92px; font-family: var(--font); font-size: 12.5px; padding: 7px; border: 2px solid var(--line); border-radius: var(--radius-sm); background:#fff; }
.rem-input input:not([type="time"]) { flex: 1; font-family: var(--font); font-size: 13px; padding: 7px 11px; border: 2px solid var(--line); border-radius: var(--radius-sm); min-width: 0; }
.rem-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 7px; max-height: 190px; overflow: auto; }
.rem-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; padding: 5px 10px; background: var(--bg-2); border-radius: 14px; }
.rem-row input { accent-color: var(--accent); width: 16px; height: 16px; }
.rem-row .rem-text { flex: 1; min-width: 0; }
.rem-row.done .rem-text { text-decoration: line-through; color: var(--sub); }
.rem-del { border: none; background: transparent; color: var(--sub); cursor: pointer; font-size: 18px; line-height: 1; padding: 0 3px; border-radius: 6px; }
.rem-del:hover { color: var(--danger); background: #fdeceb; }
.muted { color: var(--sub); font-size: 12.5px; }

/* ---------- theme swatches & patterns ---------- */
.swatches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; flex: 1; }
.swatch { aspect-ratio: 16/6; border-radius: 12px; border: 3px solid transparent; cursor: pointer; position: relative; overflow: hidden; padding: 0; box-shadow: var(--shadow-sm); transition: transform .16s cubic-bezier(.34,1.56,.64,1), border-color .14s; }
.swatch:hover { transform: translateY(-3px) scale(1.04) rotate(-1deg); }
.swatch span { position: absolute; left: 7px; bottom: 3px; font-size: 10.5px; font-weight: 700; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.5); font-family: var(--font); }
.swatch.on { border-color: var(--ink); transform: scale(1.03); animation: swatch-pop .4s cubic-bezier(.34,1.56,.64,1); }
@keyframes swatch-pop { 0% { transform: scale(.9); } 60% { transform: scale(1.08); } 100% { transform: scale(1.03); } }
.pattern-picker { display: flex; flex-wrap: wrap; gap: 5px; flex: 1 1 100%; }
.pattern-chip { font-family: var(--font); font-size: 11.5px; font-weight: 600; padding: 5px 11px; cursor: pointer; border: 2.5px solid var(--line); background: #fff; border-radius: 999px; color: var(--sub); box-shadow: 0 3px 0 rgba(120,72,20,.08); transition: all .13s cubic-bezier(.34,1.56,.64,1); }
.pattern-chip:hover { border-color: var(--accent-2); transform: translateY(-2px); }
.pattern-chip.on { border-color: var(--accent); background: var(--accent-soft); color: #8a4a1f; font-weight: 800; }

/* ---------- ink (text color) picker ---------- */
.ink-picker { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; align-items: center; }
.ink-chip { cursor: pointer; border-radius: 999px; border: 2px solid var(--line); transition: all .12s; padding: 0; }
.ink-chip.auto { font-family: var(--font); font-size: 12.5px; padding: 6px 12px; background: #fff; color: var(--sub); }
.ink-chip.auto.on { border-color: var(--accent); background: var(--accent-soft); color: #8a4a1f; font-weight: 600; }
.ink-chip.sw { width: 26px; height: 26px; box-shadow: inset 0 0 0 2px rgba(255,255,255,.6); }
.ink-chip.sw:hover { transform: scale(1.12); }
.ink-chip.sw.on { border-color: var(--ink); transform: scale(1.12); }
.ink-chip.custom { position: relative; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; background: #fff; overflow: hidden; }
.ink-chip.custom input[type="color"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.ink-chip.custom span { font-size: 16px; pointer-events: none; }
.ink-chip.custom.on { border-color: var(--accent); }

/* ---------- custom background photo ---------- */
.bg-photo { margin: 2px 0 4px; }
.bg-photo .mini-label { display: block; margin-bottom: 4px; }
.bg-photo-row { display: flex; gap: 8px; align-items: center; }
.bg-tile { flex: 1; padding: 6px 10px; flex-direction: row; justify-content: center; gap: 7px; }
.bg-tile .it-icon { font-size: 19px; }
.bg-tile i { display: none; }
.bgphoto-preview { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.bgphoto-preview[hidden] { display: none !important; }
.bgphoto-preview img { width: 84px; height: 60px; object-fit: cover; border-radius: var(--radius-sm); border: 2px solid var(--line); box-shadow: var(--shadow-sm); }
.bgphoto-preview small { color: var(--sub); font-size: 10px; text-align: center; }


/* ---------- preview (主区域：居中对称大画布 + 交互) ---------- */
.preview { position: relative; display: flex; flex-direction: column; gap: 10px; min-width: 0; align-items: center; }
.preview-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 0 4px; width: 100%; }
#meta { font-weight: 700; color: var(--ink); font-size: 13.5px; }
.meta-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pet-dock {
  width: 100%; display: flex; align-items: center; gap: 11px; padding: 10px 12px;
  color: #eef6ff; border: 1px solid rgba(126,190,231,.36); border-radius: 19px;
  background: linear-gradient(115deg, #202a44 0%, #315c7b 58%, #3f93b5 125%);
  box-shadow: 0 12px 28px rgba(31,49,82,.16), inset 0 1px 0 rgba(255,255,255,.16);
  overflow: hidden; position: relative;
}
.pet-dock::after { content:""; position:absolute; width:160px; height:160px; right:-55px; top:-92px; border-radius:50%; border:1px solid rgba(255,255,255,.15); box-shadow: 0 0 0 22px rgba(255,255,255,.035), 0 0 0 45px rgba(255,255,255,.025); }
.pet-dock-face { width:40px; height:40px; flex:0 0 auto; display:grid; place-items:center; position:relative; z-index:1; border-radius:13px 13px 16px 16px; background:#fff6e8; color:#27354e; font:800 16px/1 Georgia, serif; box-shadow: inset 0 -4px 0 #f5c987; }
.pet-dock-face::before, .pet-dock-face::after { content:""; position:absolute; top:-5px; width:12px; height:12px; background:#fff6e8; z-index:-1; }
.pet-dock-face::before { left:3px; clip-path:polygon(0 0,100% 100%,0 100%); }.pet-dock-face::after { right:3px; clip-path:polygon(100% 0,100% 100%,0 100%); }
.pet-dock-copy { display:flex; flex:1; min-width:0; flex-direction:column; gap:2px; position:relative; z-index:1; }.pet-dock-copy b { font-size:13px; letter-spacing:.02em; }.pet-dock-copy span { color:#cce6f8; font-size:11px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.pet-dock-actions { display:flex; gap:7px; flex:0 0 auto; position:relative; z-index:1; }.pet-dock-main { background:#fff6e8; border-color:transparent; color:#284866; box-shadow:0 5px 13px rgba(9,30,52,.18); }.pet-dock-main:hover { background:#fffdf8; }
.pet-dock-fx { display:flex; align-items:center; gap:5px; flex:0 0 auto; position:relative; z-index:1; font-size:11px; color:#dbe9f7; }
.pet-dock-fx select { font:inherit; color:#f4f9ff; background:rgba(255,255,255,.16); border:1px solid rgba(255,255,255,.34); border-radius:8px; padding:3px 6px; outline:none; cursor:pointer; }
.pet-dock-fx select option { color:#284866; background:#fff; }
.pet-dock-sync { display:flex; align-items:center; gap:5px; flex:0 0 auto; position:relative; z-index:1; font-size:11px; color:#dbe9f7; cursor:pointer; user-select:none; }
.pet-dock-sync input { accent-color:#c7a56b; width:14px; height:14px; cursor:pointer; margin:0; }
.pet-dock[data-state="checking"] .pet-dock-face { animation: pet-dock-breathe 1.2s ease-in-out infinite; }
.pet-dock[data-state="unavailable"] .pet-dock-face { filter: grayscale(.32); opacity: .82; }
.pet-dock[data-state="active"] .pet-dock-face { box-shadow: 0 0 0 3px rgba(82,121,96,.16), 0 2px 8px rgba(31,45,53,.14); }
.pet-dock-main:disabled { cursor: wait; opacity: .62; transform: none; }
@keyframes pet-dock-breathe { 50% { transform: translateY(-2px); opacity: .72; } }
.word-inspector { position:absolute !important; z-index:30; left:24px !important; right:auto !important; bottom:26px !important; top:auto !important; width:auto !important; max-width:calc(100% - 48px) !important; transform:none !important; writing-mode:horizontal-tb !important; display:flex; align-items:center; gap:7px 9px; flex-wrap:wrap; padding:10px 12px; border-radius:16px; border:1px solid rgba(232,137,77,.32); background:rgba(255,252,247,.95); backdrop-filter:blur(12px); box-shadow:0 10px 24px rgba(0,0,0,.22); animation: inspector-in .24s cubic-bezier(.2,.8,.3,1); }
@keyframes inspector-in { from { opacity:0; transform:translateY(-7px); } to { opacity:1; transform:none; } }
.word-inspector-head { display:flex; align-items:baseline; gap:6px; margin-right:auto; min-width:120px; }.word-inspector-head b { color:var(--ink); font-size:15px; }.word-inspector-head span:last-child { color:var(--sub); font-size:10.5px; }.inspector-kicker { color:var(--accent-2); font-size:10px; font-weight:800; letter-spacing:.08em; }
.word-inspector label { display:flex; align-items:center; gap:5px; color:var(--sub); font-size:11px; font-weight:700; }.word-inspector select { min-width:68px; padding:5px 7px; font:600 11px var(--font); border:1px solid var(--line); border-radius:9px; color:var(--ink); background:#fff; }.word-inspector input[type="range"] { width:76px; accent-color:var(--accent); }.word-inspector input[type="number"] { width:43px; padding:5px 3px; font:700 11px var(--font); text-align:center; border:1px solid var(--line); border-radius:8px; color:var(--ink); background:#fff; }.word-inspector em { font-style:normal; color:var(--accent-2); }.word-inspector input[type="color"] { width:28px; height:26px; padding:1px; border:1px solid var(--line); border-radius:8px; background:#fff; }
.scale-auto-note { padding:6px 9px; border-radius:999px; color:var(--sub); background:var(--accent-soft); font-size:10.5px; font-weight:700; }
.stage {
  background:
    radial-gradient(circle at 30% 20%, #3a3f52, #23263a 70%);
  border-radius: var(--radius); padding: 18px;
  display: flex; align-items: center; justify-content: center; position: relative;
  min-height: 300px; box-shadow: var(--shadow); overflow: visible;
  width: 100%; background-size: 160% 160%;
  animation: stage-breathe 12s ease-in-out infinite alternate;
}
@keyframes stage-breathe { from { background-position: 0% 20%; } to { background-position: 100% 80%; } }

/* 预览直接编辑器取代右侧的重复字体卡；宠物入口也只保留中央主区这一处。 */
#module-typography, #module-desktop { display: none; }
#preview-canvas {
  display: block; border-radius: 14px; box-shadow: 0 14px 44px rgba(0,0,0,.4);
  max-width: 100%; height: auto; cursor: grab;
  animation: canvas-in .45s cubic-bezier(.34,1.56,.64,1);
}
@keyframes canvas-in { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
#preview-canvas.grabbing { cursor: grabbing; }
#preview-canvas.drag-photo-ready { cursor: grab; }
#preview-canvas.drag-word-ready { cursor: move; }
.drag-legend { position:absolute; z-index:2; top:12px; left:12px; display:flex; gap:6px; flex-wrap:wrap; max-width:calc(100% - 24px); pointer-events:none; }
.drag-legend span { padding:5px 8px; border-radius:999px; color:#eef6ff; background:rgba(24,32,53,.76); border:1px solid rgba(255,255,255,.20); backdrop-filter:blur(8px); font-size:10.5px; font-weight:700; box-shadow:0 4px 12px rgba(0,0,0,.16); }
.drag-state { position:absolute; z-index:5; left:50%; top:50%; transform:translate(-50%,-50%); padding:9px 14px; border-radius:999px; color:#fff; background:rgba(31,43,70,.88); border:1px solid rgba(255,255,255,.32); box-shadow:0 10px 28px rgba(0,0,0,.28); pointer-events:none; font-size:12px; font-weight:800; animation:drag-state-in .16s ease-out; }
@keyframes drag-state-in { from { opacity:0; transform:translate(-50%,-42%) scale(.94); } to { opacity:1; transform:translate(-50%,-50%) scale(1); } }

/* ---------- import modal (按钮触发的弹窗) ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 150; display: flex; align-items: center; justify-content: center;
  background: rgba(74, 59, 46, .42); backdrop-filter: blur(4px); padding: 20px;
  animation: modalfade .18s ease;
}
.modal-overlay[hidden] { display: none !important; }
@keyframes modalfade { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  background: var(--panel); border: 2px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 18px 60px rgba(74, 59, 46, .35); width: 100%; max-width: 480px;
  max-height: 88vh; overflow-y: auto; padding: 18px 20px;
  animation: modalpop .22s cubic-bezier(.34,1.56,.64,1);
}
.library-card { max-width: 920px; height: min(82vh, 760px); display:flex; flex-direction:column; }
.library-card .modal-head { align-items:flex-start; }
.library-card .modal-head h2 { margin-bottom:2px; }
.library-card .hint { margin:0; }
.library-screening-bar { display:flex; align-items:center; gap:8px; flex-wrap:wrap; padding:10px 0; border-bottom:1px solid var(--line); }
.library-screening-bar input { flex:1 1 220px; min-width:180px; }
.library-progress { padding:5px 8px; border-radius:999px; color:var(--sub); background:var(--accent-soft); font-size:11px; font-weight:800; }
.library-word-list { min-height:0; overflow:auto; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; padding:12px 2px 4px; }
.library-word { display:grid; grid-template-columns:1fr auto; gap:4px 10px; align-items:center; padding:10px 11px; border:1px solid var(--line); border-radius:14px; background:rgba(255,255,255,.72); transition:opacity .16s, transform .16s, border-color .16s; }
.library-word:hover { transform:translateY(-1px); border-color:var(--accent); }
.library-word.known { opacity:.52; background:rgba(238,245,237,.78); }
.library-word-main { min-width:0; }.library-word-main b { display:block; color:var(--ink); font-size:16px; }.library-word-main small { display:block; margin-top:2px; color:var(--sub); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.library-word label { display:flex; align-items:center; gap:4px; color:var(--sub); font-size:10px; font-weight:800; white-space:nowrap; }.library-word input { accent-color:#57a96d; }
@media (max-width:760px) { .library-card { height:88vh; }.library-word-list { grid-template-columns:1fr; } }
@keyframes modalpop { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.modal-head h2 { font-size: 16px; margin: 0; display: flex; align-items: center; gap: 8px; }
.modal-close {
  flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--line);
  background: #fff; color: var(--sub); font-size: 15px; cursor: pointer; line-height: 1; transition: all .12s;
}
.modal-close:hover { border-color: var(--danger); color: var(--danger); transform: rotate(90deg); }
.modal-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- desktop card (卡通蓝天渐变 + 整齐分区) ---------- */
.desktop-card {
  background: linear-gradient(145deg, rgba(255,253,248,.94) 8%, #e8f5ff 100%);
  border-color: rgba(108, 175, 213, .38);
  overflow: hidden;
}
.desktop-card::after {
  content: "✦"; position: absolute; right: 16px; top: 13px; font-size: 22px; color: #58a4d5; opacity: .7;
  animation: floaty 8s ease-in-out infinite;
}
.desktop-card .btn { width: 100%; margin-top: 6px; }
.dl-row { margin-top: 7px; margin-bottom: 0; }

/* 宠物控制分区：每组一行，标签 + 按钮，整齐对齐 */
#pet-controls { margin-top: 9px; border-top: 2px dashed var(--line); padding-top: 9px; display: flex; flex-direction: column; gap: 8px; }
#pet-controls::before { content: "小词灵正在桌面等你"; font-size: 12px; font-weight: 800; color: #317da9; letter-spacing: .03em; }
.pet-group { display: flex; align-items: center; gap: 9px; }
.pet-group-label {
  flex: 0 0 64px; font-size: 12.5px; font-weight: 800; color: var(--sub);
  display: flex; align-items: center; gap: 4px;
}
.pet-group-btns { display: flex; gap: 7px; flex-wrap: wrap; flex: 1; }
.pet-group-btns .chip { background: rgba(255,255,255,.78); border-color: rgba(91,160,202,.34); color: #286c95; }
.pet-hint { margin: 0; line-height: 1.6; }

/* ---------- live overlay ---------- */
.live-overlay { position: fixed; inset: 0; z-index: 100; background: #000; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.live-overlay[hidden] { display: none !important; }
#live-canvas { display: block; }
#live-canvas.fade { animation: livefade .6s ease; }
@keyframes livefade { from { opacity: 0; } to { opacity: 1; } }
.live-exit {
  position: fixed; top: 18px; right: 18px; z-index: 110;
  width: 42px; height: 42px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(0,0,0,.4); color: #fff; font-size: 18px; opacity: .4; transition: opacity .2s;
}
.live-exit:hover { opacity: 1; background: rgba(0,0,0,.65); }
.live-peek {
  position: fixed; left: 50%; bottom: 48px; transform: translateX(-50%); z-index: 110;
  background: rgba(20, 24, 32, .88); color: #f2f4f7; border-radius: 16px;
  padding: 15px 20px; max-width: min(90vw, 430px); box-shadow: 0 12px 44px rgba(0,0,0,.5);
  backdrop-filter: blur(8px); pointer-events: none;
}
.peek-title { font-size: 12px; color: #9aa4b2; margin-bottom: 9px; letter-spacing: .06em; }
.peek-item { font-size: 14px; padding: 3px 0; }
.unlock-ring { position: fixed; left: 50%; top: 50%; z-index: 109; width: 74px; height: 74px; margin: -37px 0 0 -37px; border-radius: 50%; border: 3px solid rgba(255,255,255,.25); pointer-events: none; }
.unlock-ring.anim::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 3px solid #fff; border-top-color: transparent; border-right-color: transparent; animation: unlockfill var(--ms, 1200ms) linear forwards; }
@keyframes unlockfill { from { transform: rotate(0); } to { transform: rotate(360deg); } }
body.live .app { display: none; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(24px) scale(.95);
  background: var(--ink); color: #fff8f0; font-size: 13.5px; font-weight: 500; padding: 12px 22px; border-radius: 999px;
  opacity: 0; pointer-events: none; transition: all .28s cubic-bezier(.34,1.56,.64,1); z-index: 200; box-shadow: 0 10px 28px rgba(0,0,0,.3);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }

/* ---------- support & feedback ---------- */
.support-nav { color: var(--accent); border-color: var(--accent); background: var(--paper); }
.support-nav.on { color: var(--accent-ink); background: var(--accent); }
.support-view { width: min(1040px, calc(100% - 40px)); margin: 28px auto 54px; }
.support-back { margin: 0 0 15px; padding: 0; border: 0; color: var(--sub); background: transparent; font: 800 13px/1.4 var(--font); cursor: pointer; }
.support-back:hover { color: var(--accent); }
.support-hero { position: relative; overflow: hidden; padding: 43px 54px 35px; border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px); background: linear-gradient(120deg, var(--paper), var(--accent-soft) 55%, var(--paper)); box-shadow: var(--shadow); }
.support-hero::before { content: "✦  ✧  ♥  ✦"; position: absolute; top: -4px; right: 38px; color: var(--accent); opacity: .2; font-size: 54px; letter-spacing: 13px; transform: rotate(8deg); }
.support-kicker { position: relative; display: inline-flex; padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--accent); background: var(--paper); font: 800 10px/1.2 var(--font); letter-spacing: .04em; }
.support-hero h2 { position: relative; max-width: 610px; margin: 16px 0 10px; color: var(--ink); font: 800 36px/1.25 var(--font); letter-spacing: -.045em; }
.support-hero p { position: relative; max-width: 610px; margin: 0; color: var(--sub); font-size: 14px; font-weight: 600; line-height: 1.8; }
.support-sparkle { position: absolute; right: 83px; bottom: 26px; display: grid; width: 112px; height: 112px; place-items: center; border-radius: 48% 44% 52% 45%; color: var(--accent-ink); background: linear-gradient(145deg, var(--accent), var(--accent-2)); box-shadow: 0 15px 30px color-mix(in srgb, var(--accent) 25%, transparent); font-size: 52px; transform: rotate(-9deg); }
.support-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.support-card { min-height: 255px; padding: 26px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow-sm); }
.support-icon { display: grid; width: 47px; height: 47px; margin-bottom: 16px; place-items: center; border-radius: var(--radius-sm); background: var(--accent-soft); font-size: 23px; }
.support-card:nth-child(2) .support-icon { filter: hue-rotate(120deg); }
.support-card h3 { margin: 0 0 8px; color: var(--ink); font-size: 20px; }
.support-card p { min-height: 46px; margin: 0 0 19px; color: var(--sub); font-size: 13px; font-weight: 600; line-height: 1.65; }
.support-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.support-primary { display: inline-flex; align-items: center; min-height: 42px; color: var(--accent-ink); border-color: transparent; background: linear-gradient(145deg, var(--accent), var(--accent-2)); text-decoration: none; box-shadow: 0 8px 18px color-mix(in srgb, var(--accent) 22%, transparent); }
.support-copy { min-height: 42px; padding: 8px 13px; }
.support-note { margin: 16px 3px 0; color: var(--sub); font-size: 12px; font-weight: 600; text-align: center; }

/* ---------- responsive ---------- */
@media (max-width: 1420px) {
  .workbench { grid-template-columns: 300px minmax(0, 1fr) 300px; }
}
@media (max-width: 1120px) {
  /* 窄屏：预览置顶整行，左右面板退到下方两列 */
  .workbench { grid-template-columns: 1fr 1fr; }
  .preview { grid-column: 1 / -1; grid-row: 1; }
  .panel-left { grid-column: 1; grid-row: 2; }
  .panel-right { grid-column: 2; grid-row: 2; }
  .panel-col { max-height: none; }
  .topbar { position: static; }
  .import-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .workbench { grid-template-columns: 1fr; }
  .preview { grid-row: 1; }
  .panel-left { grid-column: 1; grid-row: 2; }
  .panel-right { grid-column: 1; grid-row: 3; }
  .stage { min-height: 300px; }
  .support-view { width: min(100% - 24px, 1040px); margin-top: 17px; }
  .support-hero { padding: 31px 24px 28px; }
  .support-hero h2 { font-size: 28px; }
  .support-sparkle { position: relative; right: auto; bottom: auto; width: 62px; height: 62px; margin: 19px 0 0 auto; font-size: 31px; }
  .support-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .lib-cards { grid-template-columns: 1fr; }
}

/* ========================================================================== */
/* 2026 editorial refresh · 日系校样工作室                                      */
/*
   这一层有意保留原有 DOM 与交互，只重新定义视觉语法：纸面、墨色、校对朱红、
   靛青工作台。避免厚描边、糖果渐变和持续弹跳，让高密度工具更像编辑工作台。
*/
@scope (:root[data-ui-theme="editorial"]) {
:root {
  --bg: #ece7dc;
  --bg-2: #e5dfd3;
  --panel: #fffdf7;
  --paper: #fffdf7;
  --paper-muted: #f6f1e7;
  --ink: #292825;
  --sub: #6f665b;
  --accent: #d9563d;
  --accent-2: #bb4936;
  --accent-soft: #f6e3dc;
  --accent-ink: #fffdf8;
  --indigo: #304b5d;
  --indigo-soft: #dce5e8;
  --sage: #778879;
  --line: #d7cec0;
  --line-strong: #bdb2a2;
  --good: #527960;
  --danger: #b64e42;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 18px 40px rgba(54, 48, 40, .11), 0 2px 6px rgba(54, 48, 40, .06);
  --shadow-sm: 0 5px 14px rgba(54, 48, 40, .08);
  --font: "Avenir Next", "Hiragino Sans GB", "PingFang SC", "Microsoft YaHei",
    "Noto Sans CJK SC", sans-serif;
  --font-editorial: "Iowan Old Style", "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  --font-mono: "SFMono-Regular", "IBM Plex Mono", "Menlo", monospace;
}

body {
  color: var(--ink);
  background:
    linear-gradient(rgba(55, 72, 78, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(55, 72, 78, .018) 1px, transparent 1px),
    radial-gradient(circle at 5% 8%, rgba(255, 255, 255, .86), transparent 28%),
    linear-gradient(145deg, #f4f0e7 0%, #e9e3d8 100%);
  background-size: 24px 24px, 24px 24px, auto, auto;
  background-attachment: fixed;
}
body::before {
  inset: 0;
  opacity: .34;
  background:
    repeating-linear-gradient(103deg, transparent 0 13px, rgba(78, 65, 49, .018) 13px 14px),
    radial-gradient(circle at 72% 18%, rgba(255,255,255,.7), transparent 31%);
  animation: none;
}
.float-deco {
  color: var(--indigo);
  opacity: .13;
  animation: none;
  font-family: var(--font-mono);
}

/* 顶部像校样单的题头，而不是漂浮的品牌卡。 */
.topbar {
  min-height: 68px;
  padding: 10px clamp(16px, 2vw, 34px);
  background: rgba(255, 253, 247, .92);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(255,255,255,.9), 0 8px 24px rgba(55,48,38,.045);
  backdrop-filter: blur(14px);
}
.brand { gap: 13px; }
.logo {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  color: #fffdf6;
  background: var(--indigo);
  border: 1px solid #203b4b;
  box-shadow: 4px 4px 0 #d9cbb9;
  transform: none;
  animation: none;
  font: 700 20px/1 var(--font-editorial);
}
.logo::before {
  content: "校";
  position: absolute;
  right: -4px;
  bottom: -4px;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  color: #fff;
  background: var(--accent);
  border: 2px solid var(--paper);
  font: 700 8px/1 var(--font);
}
.logo::after { display: none; }
.topbar h1 {
  font-family: var(--font-editorial);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .015em;
}
.topbar h1::after { content: "DAILY PROOF"; position: static; display: inline-block; margin-left: 10px; color: var(--accent); opacity: 1; transform: none; animation: none; font: 600 8px/1 var(--font-mono); letter-spacing: .16em; vertical-align: middle; }
.tagline { margin-top: 3px; color: var(--sub); font-size: 11.5px; font-weight: 500; letter-spacing: .015em; }
.top-actions { gap: 7px; }

/* 单一按钮语法：薄边、短圆角、无果冻回弹。 */
.btn,
.chip,
.pattern-chip {
  border-width: 1px;
  border-radius: 7px;
  box-shadow: none;
  font-weight: 650;
  transition: color .16s ease, background .16s ease, border-color .16s ease,
    box-shadow .16s ease, transform .16s ease;
}
.btn { padding: 8px 13px; background: rgba(255,253,247,.92); border-color: var(--line); font-size: 12.5px; }
.btn:hover,
.chip:hover,
.pattern-chip:hover { transform: translateY(-1px); border-color: var(--indigo); box-shadow: 0 4px 10px rgba(48,75,93,.09); }
.btn:active,
.chip:active,
.pattern-chip:active { transform: translateY(0); box-shadow: none; }
.btn.primary {
  color: var(--accent-ink);
  background: var(--accent-2);
  border-color: var(--accent-2);
  box-shadow: none;
  text-shadow: none;
}
.btn.primary::after { display: none; }
.btn.primary:hover { filter: none; background: #c84a34; border-color: #c84a34; box-shadow: 0 5px 12px rgba(174,65,44,.17); }
.btn.primary:active,
.btn.soft:active,
.btn.ghost:active,
.pet-primary:active { box-shadow: none; }
.btn.soft { color: var(--indigo); background: var(--indigo-soft); border-color: #becdd2; box-shadow: none; }
.btn.soft:hover { color: #213d4e; background: #d1dfe3; box-shadow: 0 4px 10px rgba(48,75,93,.1); }
.btn.ghost { color: var(--sub); background: transparent; border-color: var(--line); box-shadow: none; }
.btn.ghost:hover { color: var(--ink); background: rgba(255,255,255,.65); box-shadow: none; }
.pet-primary { color: var(--indigo); background: var(--indigo-soft); border-color: #becdd2; box-shadow: none; }
.btn.danger { color: var(--danger); background: transparent; border-color: #d9aaa2; }
.btn.small { padding: 7px 11px; font-size: 11.5px; }

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* 工作台保留三栏；左右是连续资料抽屉，中央校样保持最强层级。 */
.workbench {
  grid-template-columns: 292px minmax(520px, 1fr) 304px;
  gap: 16px;
  padding: 18px clamp(14px, 1.5vw, 28px) 28px;
  max-width: 1840px;
}
.panel-col { gap: 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,253,247,.78); box-shadow: 0 12px 30px rgba(61,53,43,.055); }
.panel-col::-webkit-scrollbar { width: 5px; }
.panel-col::-webkit-scrollbar-thumb { background: #b9afa1; border-radius: 5px; }
.panel-col > .card {
  border-width: 0 0 1px;
  border-color: var(--line);
  border-radius: 0;
  box-shadow: none;
}
.panel-col > .card:first-child { border-radius: 9px 9px 0 0; }
.panel-col > .card:last-child { border-bottom: 0; border-radius: 0 0 9px 9px; }
.card {
  padding: 13px 14px;
  background: rgba(255,253,247,.76);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  animation: proof-in .28s ease-out backwards;
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease;
}
@keyframes proof-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.panel-col > .card:hover { transform: none; border-color: var(--line); background: rgba(255,255,252,.96); box-shadow: inset 3px 0 0 var(--indigo); }
.card h2 { margin-bottom: 9px; font-family: var(--font-editorial); font-size: 13.5px; font-weight: 700; letter-spacing: .035em; }
.card-head { margin-bottom: 8px; }
.h-emoji {
  width: 23px;
  height: 23px;
  border-radius: 4px;
  color: var(--indigo);
  background: var(--paper-muted);
  border: 1px solid var(--line);
  box-shadow: none;
  font-size: 13px;
  filter: grayscale(.18);
}
.card:hover .h-emoji { transform: none; }
.hint { color: var(--sub); font-size: 11.5px; line-height: 1.65; }
.hint b { color: var(--accent-2); }
.divider { height: 1px; margin: 13px 0; background: var(--line); }

details.card { background: rgba(255,253,247,.76); }
details.card > summary { padding: 13px 14px; font-family: var(--font-editorial); font-size: 13.5px; font-weight: 700; }
details.card > summary::after { content: "+"; font: 500 17px/1 var(--font-mono); transform: none; }
details.card[open] > summary::after { content: "−"; transform: none; }
details.card > summary:hover { background: var(--paper-muted); }
details.card[open] > summary { margin-bottom: 10px; border-bottom: 1px solid var(--line); }
details.card .card-body { padding: 0 14px 14px; }

/* 模块编排只在编辑态显示明确校样网格。 */
.module-grip { top: 7px; right: 8px; width: 27px; height: 27px; color: var(--indigo); background: var(--paper); border: 1px solid var(--line-strong); border-radius: 4px; box-shadow: none; }
.layout-editing .module-card { outline: 1px dashed var(--indigo); outline-offset: -4px; }
.layout-editing .panel-col { padding: 5px; border-radius: 10px; background: rgba(48,75,93,.055); }
.panel-col.layout-drop-target { box-shadow: inset 0 0 0 2px var(--indigo); background: var(--indigo-soft); }
.layout-slot.active { background: linear-gradient(90deg, transparent, rgba(48,75,93,.45), transparent); }

/* 表单像编辑标尺：细边、清晰焦点、数字使用等宽字。 */
.row { margin-bottom: 7px; font-size: 12px; }
.row > span { color: var(--sub); font-weight: 550; }
.row select,
.row input[type="number"],
.inline input,
.nw-grid input,
textarea,
#custom-fields input,
.rem-input input[type="time"],
.rem-input input:not([type="time"]),
.count-field input,
.percent-field input,
.library-screening-bar input {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255,255,252,.88);
  box-shadow: inset 0 1px 2px rgba(45,40,34,.035);
}
.row select:focus,
.row input:focus,
textarea:focus,
.nw-grid input:focus,
#custom-fields input:focus,
.count-field input:focus,
.percent-field input:focus {
  border-color: var(--indigo);
  box-shadow: 0 0 0 2px rgba(48,75,93,.13);
}
.count-field input,
.percent-field input,
.slider-row b { font-family: var(--font-mono); font-weight: 600; }
.slider-row input[type="range"],
.word-inspector input[type="range"] {
  height: 16px;
  accent-color: var(--accent);
}
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 0; background: linear-gradient(90deg, var(--line-strong), var(--line)); }
input[type="range"]::-webkit-slider-thumb { margin-top: -5px; }
.slider-row b { color: var(--accent); }
.checks { gap: 7px; color: var(--sub); }
.checks input[type="checkbox"],
.srs-switch input { accent-color: var(--accent); }

/* 分段选择不是胶囊，而是校样标签。 */
.seg { padding: 2px; gap: 0; border: 1px solid var(--line); border-radius: 6px; background: var(--paper-muted); }
.seg-btn { padding: 6px 9px; border-radius: 4px; font-size: 11.5px; }
.seg-btn.on { color: #fff; background: var(--indigo); box-shadow: none; }

/* 词库变成书目目录，选中项用朱红校对线标记。 */
.lib-cards { gap: 4px; margin-bottom: 9px; }
.lib-card {
  position: relative;
  min-height: 43px;
  padding: 6px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255,255,252,.7);
  box-shadow: none;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}
.lib-card::before { content: ""; position: absolute; left: -1px; top: 7px; bottom: 7px; width: 2px; background: transparent; }
.lib-card:hover { transform: translateY(-1px); border-color: var(--line-strong); background: #fff; box-shadow: none; }
.lib-card:active { transform: none; box-shadow: none; }
.lib-card.on { border-color: #d8aaa0; background: #fff8f5; box-shadow: none; }
.lib-card.on::before { background: var(--accent); }
.lib-icon { width: 25px; height: 29px; border-radius: 3px; background: var(--paper-muted); box-shadow: inset 2px 0 0 var(--line-strong); filter: saturate(.72); }
.lib-card:hover .lib-icon { transform: none; }
.lib-card.on .lib-icon { background: #f6ebe5; }
.lib-body b { font-size: 11.5px; font-weight: 650; }
.lib-body i { font-size: 9.5px; }
.lib-count { color: var(--accent-2); background: transparent; padding: 0; border-radius: 0; box-shadow: none; font-family: var(--font-mono); font-weight: 600; }
.selected-library-action { margin: 6px 0 9px; padding: 7px 0; border-width: 1px 0; border-style: solid; border-color: var(--line); border-radius: 0; background: transparent; }
.selected-library-action span { color: var(--indigo); font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .04em; }
.selected-library-action .btn { box-shadow: none; }

.chip { padding: 5px 9px; color: var(--sub); background: rgba(255,255,252,.76); border-color: var(--line); font-size: 11px; }
.chip:hover { color: var(--indigo); }
.import-tile { padding: 15px 10px; border: 1px dashed var(--line-strong); border-radius: 7px; background: rgba(255,255,252,.65); }
.import-tile:hover { border-color: var(--indigo); background: var(--indigo-soft); }
.import-tile.shot { border-color: var(--accent); background: #fff8f5; }
.it-icon { font-size: 22px; filter: grayscale(.12); }

/* 记忆区和提醒区更像记录表，不再堆叠软糖卡片。 */
.srs-record { padding: 6px 7px; border-radius: 4px; border-left: 2px solid var(--line-strong); background: rgba(255,255,252,.62); }
.srs-record b { font-family: var(--font-editorial); }
.srs-countdown { padding: 8px 10px; color: var(--indigo); background: var(--indigo-soft); border: 1px solid #bccbd0; border-radius: 6px; }
.srs-cd-icon { animation: none; }
.srs-countdown.due { color: var(--accent-2); background: #f8e5df; border-color: #dea99f; animation: none; box-shadow: inset 3px 0 0 var(--accent); }
.rem-row { padding: 6px 8px; border-radius: 4px; background: var(--paper-muted); border-left: 2px solid var(--line-strong); }
.rem-del:hover { color: var(--danger); background: #f7e8e5; }

/* 色板与纹理是小型材料样本，而不是糖果按钮。 */
.swatches { gap: 5px; }
.swatch { border-width: 1px; border-radius: 5px; box-shadow: none; transition: transform .15s ease, border-color .15s ease; }
.swatch:hover { transform: translateY(-1px); }
.swatch.on { transform: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(217,86,61,.13); animation: none; }
.swatch span { left: 5px; bottom: 3px; font-size: 9px; font-weight: 600; }
.pattern-picker { gap: 4px; }
.pattern-chip { padding: 5px 8px; border-color: var(--line); background: rgba(255,255,252,.75); font-size: 10.5px; }
.pattern-chip.on { color: var(--accent-2); border-color: var(--accent); background: #fff8f5; }
.ink-picker { gap: 6px; }
.ink-chip { border-width: 1px; border-radius: 5px; }
.ink-chip.auto { border-radius: 6px; }
.ink-chip.auto.on { color: var(--accent-2); border-color: var(--accent); background: #fff8f5; }
.ink-chip.sw { width: 24px; height: 24px; }
.ink-chip.sw:hover,
.ink-chip.sw.on { transform: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(217,86,61,.12); }
.bgphoto-preview img { border: 1px solid var(--line); border-radius: 5px; box-shadow: none; }

/* 中央区域：靛青裁切台 + 浮在其上的真实校样。 */
.preview { gap: 9px; }
.preview-top { min-height: 32px; padding: 0 2px; }
#meta { color: var(--sub); font-family: var(--font-mono); font-size: 10.5px; font-weight: 550; letter-spacing: .02em; }
.meta-actions { gap: 6px; }
.pet-dock {
  gap: 10px;
  padding: 8px 10px;
  color: var(--ink);
  background: rgba(255,253,247,.9);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(54,48,40,.055);
}
.pet-dock::before { content: "DESK ASSISTANT"; position: absolute; right: 13px; top: 5px; color: var(--line-strong); font: 600 7px/1 var(--font-mono); letter-spacing: .14em; }
.pet-dock::after { display: none; }
.pet-dock-face { width: 38px; height: 38px; border: 0; border-radius: 50%; background: transparent; box-shadow: 0 2px 8px rgba(31,45,53,.14); overflow: hidden; }
.pet-dock-face::before,
.pet-dock-face::after { content: none; }
.pet-dock-face svg { display: block; width: 100%; height: 100%; }
.pet-dock-copy b { font-family: var(--font-editorial); font-size: 12.5px; }
.pet-dock-copy span { color: var(--sub); font-size: 10.5px; }
.pet-dock-main { color: var(--indigo); background: transparent; border-color: var(--indigo); box-shadow: none; }
.pet-dock-main:hover { color: #fff; background: var(--indigo); }
.stage {
  min-height: 320px;
  padding: 16px;
  border: 1px solid #233947;
  border-radius: 11px;
  background:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px),
    radial-gradient(circle at 50% 18%, #405b6a 0%, #2d4656 46%, #243b49 100%);
  background-size: 24px 24px, 24px 24px, auto;
  box-shadow: 0 15px 34px rgba(38,48,52,.16), inset 0 0 0 5px rgba(255,255,255,.035);
  animation: none;
}
.stage::before,
.stage::after { content: ""; position: absolute; z-index: 1; width: 22px; height: 22px; pointer-events: none; opacity: .7; }
.stage::before { left: 8px; top: 8px; border-left: 1px solid #a9bbc1; border-top: 1px solid #a9bbc1; }
.stage::after { right: 8px; bottom: 8px; border-right: 1px solid #a9bbc1; border-bottom: 1px solid #a9bbc1; }
#preview-canvas { border-radius: 4px; box-shadow: 0 16px 34px rgba(10,20,25,.34), 0 0 0 1px rgba(255,255,255,.18); animation: canvas-in .3s ease-out; }
@keyframes canvas-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.drag-legend { top: 11px; left: 11px; gap: 4px; }
.drag-legend span { padding: 5px 7px; border-radius: 4px; color: #eef3f4; background: rgba(26,43,53,.86); border: 1px solid rgba(204,219,223,.28); box-shadow: none; font-family: var(--font-mono); font-size: 9px; }
.drag-state { padding: 8px 12px; border-radius: 5px; background: rgba(34,58,71,.94); font-size: 11px; box-shadow: 0 8px 20px rgba(0,0,0,.2); }
.word-inspector {
  left: 12px;
  right: 12px;
  bottom: 12px;
  gap: 9px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  background: rgba(255,253,247,.97);
  box-shadow: 0 10px 24px rgba(20,29,33,.18);
  animation: inspector-in .18s ease-out;
}
@keyframes inspector-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.word-inspector-head b { font-family: var(--font-editorial); font-size: 14px; }
.inspector-kicker { color: var(--accent); font-family: var(--font-mono); font-size: 8px; letter-spacing: .12em; }
.word-inspector select,
.word-inspector input[type="number"],
.word-inspector input[type="color"] { border: 1px solid var(--line); border-radius: 4px; }
.scale-auto-note { border-radius: 4px; color: var(--indigo); background: var(--indigo-soft); }

/* 对话框如置于桌上的校样页，采用稳定淡入而不是 Q 弹。 */
.modal-overlay { background: rgba(35,42,43,.52); backdrop-filter: blur(8px) saturate(.75); animation: modalfade .16s ease; }
.modal-card {
  position: relative;
  padding: 20px 22px;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  box-shadow: 0 24px 70px rgba(30,34,33,.25);
  animation: modalproof .2s ease-out;
}
.modal-card::before { content: ""; position: absolute; left: 22px; right: 22px; top: 0; height: 2px; background: var(--accent); }
@keyframes modalproof { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.modal-head { padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-family: var(--font-editorial); font-size: 17px; letter-spacing: .02em; }
.modal-close { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 5px; background: transparent; }
.modal-close:hover { color: #fff; border-color: var(--accent); background: var(--accent); transform: none; }
.library-screening-bar { border-bottom: 1px solid var(--line); }
.library-progress,
.memory-pill { border: 1px solid var(--line); border-radius: 5px; background: var(--paper-muted); }
.library-word { padding: 10px 11px; border: 1px solid var(--line); border-radius: 6px; background: rgba(255,255,252,.72); }
.library-word:hover { transform: none; border-color: var(--indigo); box-shadow: inset 3px 0 0 var(--indigo); }
.library-word.known { background: #edf1eb; }

/* 记忆本：白纸上的双列校对条，两个答案保持一眼可辨。 */
.memory-card { width: min(680px, calc(100vw - 40px)); max-width: 680px; background: var(--paper); border-color: var(--line-strong); }
.memory-notebook-list { gap: 9px; }
.memory-entry { min-height: 126px; padding: 14px; border: 1px solid var(--line); border-radius: 7px; background: rgba(255,255,252,.8); box-shadow: none; }
.memory-entry.due { border-color: #d8aaa0; background: #fffaf7; }
.memory-entry.due::before { right: -22px; top: 8px; padding: 3px 25px; background: var(--accent-2); font: 650 8px/1.4 var(--font-mono); letter-spacing: .1em; }
.memory-entry.due:hover { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(80,57,44,.08); }
.memory-entry b { font-family: var(--font-editorial); font-size: 19px; }
.memory-entry .memory-meta { color: var(--accent-2); font-family: var(--font-mono); font-size: 9.5px; }
.memory-entry .memory-meaning.locked { border-radius: 3px; background: repeating-linear-gradient(-45deg,#dfd7ca 0 4px,#eee9df 4px 8px); }
.memory-answer { min-height: 34px; border-radius: 5px; box-shadow: none !important; }
.memory-answer:hover { transform: translateY(-1px); }
.memory-answer.forgot { color: var(--danger); border: 1px solid #d7a49b; background: transparent; }
.memory-answer.remembered { color: #fff; border: 1px solid var(--good); background: var(--good); }
.memory-entry.answered { animation: memory-answer-pop .2s ease-out; }
@keyframes memory-answer-pop { from { opacity: .6; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.memory-entry.mastered::after,
.memory-result { border-radius: 4px; }
.memory-empty { border-radius: 7px; }

.toast { border-radius: 6px; background: var(--indigo); color: #fff; box-shadow: 0 10px 26px rgba(28,44,54,.22); transition: opacity .2s ease, transform .2s ease; }

/* Responsive：中屏预览优先，小屏操作区不横向溢出。 */
@media (max-width: 1420px) {
  .workbench { grid-template-columns: 270px minmax(480px, 1fr) 280px; gap: 12px; }
}
@media (max-width: 1120px) {
  .workbench { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .preview { grid-column: 1 / -1; }
  .panel-col { border-radius: 10px; }
  .topbar { position: sticky; }
}
@media (max-width: 720px) {
  .topbar { align-items: flex-start; padding: 10px 13px; }
  .topbar h1::after { display: none; }
  .tagline { max-width: 240px; }
  .workbench { grid-template-columns: minmax(0, 1fr); padding: 10px; gap: 10px; }
  .preview { grid-column: 1; grid-row: 1; }
  .panel-left { grid-column: 1; grid-row: 2; }
  .panel-right { grid-column: 1; grid-row: 3; }
  .preview-top { align-items: flex-start; }
  .meta-actions { width: 100%; }
  .meta-actions .btn { flex: 1; }
  .pet-dock { align-items: flex-start; flex-wrap: wrap; }
  .pet-dock-actions { width: 100%; }
  .pet-dock-main { width: 100%; }
  .pet-dock::before { display: none; }
  .stage { min-height: 260px; padding: 10px; }
  .word-inspector { position: absolute; left: 10px; right: 10px; bottom: 10px; width: auto; max-height: calc(100% - 20px); margin-top: 0; overflow: auto; }
}
@media (max-width: 480px) {
  .brand { gap: 10px; }
  .logo { width: 36px; height: 36px; }
  .topbar h1 { font-size: 19px; }
  .top-actions { width: 100%; justify-content: flex-end; }
  .lib-cards,
  .memory-notebook-list { grid-template-columns: 1fr; }
  .library-screening-bar .chip { flex: 1 1 auto; }
}
}

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

/* 校样主题使用后置的通用按钮规则；支持页主操作需明确保留印泥红底与白字，
   避免在暖白纸面上失去对比。标识字母也始终压在校样角标上方。 */
:root[data-ui-theme="editorial"] .logo { background: #304b5d; }
:root[data-ui-theme="editorial"] .logo::before { z-index: 1; }
:root[data-ui-theme="editorial"] .logo span { z-index: 2; color: #fffdf6; }
:root[data-ui-theme="editorial"] .support-hero { background: linear-gradient(118deg, #fffdf7, #f3eadc 58%, #fbf2e5); }
:root[data-ui-theme="editorial"] .support-hero h2,
:root[data-ui-theme="editorial"] .support-card h3 { color: #332a22; }
:root[data-ui-theme="editorial"] .support-hero p,
:root[data-ui-theme="editorial"] .support-card p,
:root[data-ui-theme="editorial"] .support-note { color: #625448; }
:root[data-ui-theme="editorial"] .support-primary.btn { color: #fffdf8; border-color: #bb4936; background: #d9563d; box-shadow: 0 6px 12px rgba(174,65,44,.18); }
:root[data-ui-theme="editorial"] .support-primary.btn:hover { color: #fff; border-color: #b6402d; background: #c84a34; }
:root[data-ui-theme="editorial"] .support-copy.btn { color: #4b4035; border-color: #cbb9a6; background: #fffdf8; }

/* ---------- 下载桌面伴侣弹窗 ---------- */
.dl-card { max-width: 470px; }
.dl-options { display: flex; flex-direction: column; gap: 8px; }
.dl-opt {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 14px;
  background: rgba(255,255,255,.72); text-decoration: none; color: var(--ink);
  transition: border-color .14s, transform .14s, box-shadow .14s;
}
.dl-opt:hover { border-color: var(--accent); transform: translateY(-1px); }
.dl-opt.recommended { border-color: var(--accent); box-shadow: 0 4px 18px rgba(23,80,63,.12); }
.dl-opt-main b { display: block; font-size: 14.5px; }
.dl-opt-main small { display: block; margin-top: 2px; color: var(--sub); font-size: 11.5px; line-height: 1.5; }
.dl-badge {
  flex: 0 0 auto; padding: 3px 9px; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 800;
}
.dl-chip-hint { margin: 10px 2px 0; font-size: 11.5px; }
.dl-gate { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 10px; }
.dl-gate summary { cursor: pointer; color: var(--accent); font-size: 12.5px; font-weight: 700; }
.dl-gate ol { margin: 8px 0 6px; padding-left: 20px; color: var(--ink); font-size: 12.5px; line-height: 1.9; }
.dl-gate p { margin: 6px 0 0; color: var(--sub); font-size: 11.5px; line-height: 1.7; }
