/* 表情包工作室 · 模板制作（/app）
   与 AI 客服页共用同一套颜色变量；深色模式只改变量。 */
:root {
  --bg: #f5f5f7;
  --card: #ffffff;
  --surface-2: #f2f2f7;
  --surface-3: #e8e8ed;
  --ink: #1d1d1f;
  --ink-2: #3a3a3f;
  --muted: #6e6e73;
  --faint: #8e8e93;
  --line: #e3e3e8;
  --line-strong: #d1d1d6;
  --accent: #0071e3;
  --accent-hover: #0062c4;
  --accent-ink: #0060c0;
  --accent-2: #b9d6ff;
  --accent-soft: #eaf3ff;
  --green: #1f8a4c;
  --green-soft: #e8f5ec;
  --danger: #c4372d;
  --danger-soft: #fdeceb;
  --focus: #7db4ff;
  --check-a: #f0f0f2;
  --check-b: #ffffff;
  --scrim: rgba(18, 18, 22, .38);
  --glass: rgba(245, 245, 247, .82);
  --shadow: 0 4px 24px rgba(0, 0, 0, .05);
  --radius: 22px;
  --checker: repeating-conic-gradient(var(--check-a) 0% 25%, var(--check-b) 0% 50%) 50% / 14px 14px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --card: #1c1c1e;
    --surface-2: #2c2c2e;
    --surface-3: #3a3a3c;
    --ink: #f5f5f7;
    --ink-2: #d1d1d6;
    --muted: #a1a1a6;
    --faint: #8e8e93;
    --line: #2c2c2e;
    --line-strong: #3a3a3c;
    --accent: #0a84ff;
    --accent-hover: #3395ff;
    --accent-ink: #5eaaff;
    --accent-2: #1e4f86;
    --accent-soft: #0a2440;
    --green: #32d74b;
    --green-soft: #0f2b17;
    --danger: #ff6961;
    --danger-soft: #3a1513;
    --focus: #3d8bff;
    --check-a: #2a2a2d;
    --check-b: #1f1f22;
    --scrim: rgba(0, 0, 0, .6);
    --glass: rgba(0, 0, 0, .78);
    --shadow: 0 4px 24px rgba(0, 0, 0, .4);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
body {
  margin: 0 auto; max-width: 600px; min-height: 100dvh; color: var(--ink); background: var(--bg);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased; padding-bottom: calc(24px + env(safe-area-inset-bottom));
}
button, input, textarea, select { font: inherit; color: inherit; }
input, textarea, select { font-size: 16px; } /* iOS 小于 16px 会放大页面 */
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
h1 { font-size: 28px; line-height: 1.3; letter-spacing: -.03em; margin: 8px 0 10px; }
h2 { font-size: 20px; letter-spacing: -.02em; margin: 0 0 4px; }
h3 { font-size: 15px; margin: 0 0 8px; }
.muted { color: var(--muted); margin: 0 0 12px; }
.small { font-size: 13px; }
.grow { flex: 1; }
.center { text-align: center; }
[hidden] { display: none !important; }

/* 顶栏 */
.bar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 8px; min-height: 56px;
  padding: calc(6px + env(safe-area-inset-top)) 12px 6px; background: var(--glass);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--line);
}
.bar-title { display: flex; align-items: center; gap: 8px; font-weight: 650; font-size: 16px; letter-spacing: -.02em; }
.brand-mark { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: #fff; background: linear-gradient(145deg, #2b8cff, #0060df); }
.brand-mark svg { width: 18px; height: 18px; stroke-width: 1.7; }
.brand-mark.big { width: 64px; height: 64px; border-radius: 18px; margin: 0 auto; }
.brand-mark.big svg { width: 40px; height: 40px; }
.icon-btn { display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; border: 0; background: none; padding: 0; cursor: pointer; color: var(--ink); border-radius: 50%; }
.icon-btn svg { width: 22px; height: 22px; }
.points, .reference-btn { display: inline-flex; align-items: center; gap: 4px; min-height: 34px; border: 0; border-radius: 999px; padding: 0 12px; background: var(--card); cursor: pointer; white-space: nowrap; font-size: 13px; color: var(--ink-2); }
.points b { color: var(--ink); font-variant-numeric: tabular-nums; }
.reference-btn svg { width: 16px; height: 16px; }

.screen { padding: 16px 16px 0; }

/* 按钮 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; border: 1px solid var(--line); background: var(--card); border-radius: 14px; padding: 11px 16px; cursor: pointer; font-weight: 600; text-decoration: none; color: var(--ink); transition: background .15s, transform .1s; }
.btn:hover:not(:disabled) { background: var(--surface-2); }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { opacity: .42; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.big { min-height: 52px; padding: 13px 18px; font-size: 16px; }
.btn.full { width: 100%; }
.link { min-height: 44px; border: 0; background: none; color: var(--muted); cursor: pointer; padding: 6px 10px; }
.link:hover { color: var(--ink); }
.price { font-weight: 500; opacity: .85; margin-left: 2px; font-size: .88em; }
.actions { margin: 16px 0; display: grid; gap: 10px; }
.actions.two { grid-template-columns: 1fr 1fr; }
.flow-cta { position: sticky; bottom: 0; z-index: 5; margin-bottom: 0; padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(to bottom, transparent, var(--bg) 16px); }

/* 卡片 */
.card { background: var(--card); border-radius: var(--radius); padding: 20px; margin: 14px 0; box-shadow: var(--shadow); }
.alert { background: var(--danger-soft); color: var(--danger); border-radius: 14px; padding: 12px 14px; margin: 12px 0; font-size: 14px; }
.field { display: grid; gap: 6px; margin-top: 14px; }
.field > span { font-size: 14px; font-weight: 500; }
.field input, .field textarea, .field select, #cell-text { width: 100%; border: 1px solid var(--line); border-radius: 13px; padding: 11px 13px; background: var(--surface-2); outline: none; resize: none; }
.field input:focus, .field textarea:focus, .field select:focus, #cell-text:focus { border-color: var(--accent); background: var(--card); }

/* 登录 */
.login { min-height: 92dvh; max-width: 400px; margin: auto; display: flex; flex-direction: column; justify-content: center; text-align: center; gap: 10px; padding: 0 8px; }
.login .muted { line-height: 1.8; }
.code-input { min-height: 56px; border: 1px solid var(--line-strong); border-radius: 16px; padding: 12px 16px; text-align: center; font-size: 20px; letter-spacing: .12em; font-family: ui-monospace, "SF Mono", Menlo, monospace; background: var(--card); outline: none; margin-top: 14px; }
.code-input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent); }

/* 首页 */
.entries { display: grid; gap: 10px; }
.entry { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); text-decoration: none; color: var(--ink); border: 0; cursor: pointer; text-align: left; width: 100%; }
.entry:active { transform: scale(.99); }
.entry-icon { display: grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); }
.entry-icon svg { width: 26px; height: 26px; }
.entry.featured { background: linear-gradient(135deg, #0a7cff, #0058d6); color: #fff; }
.entry.featured .entry-icon { background: rgba(255, 255, 255, .18); color: #fff; }
.entry.featured small { color: rgba(255, 255, 255, .82); }
.entry > span:nth-child(2) { flex: 1; min-width: 0; display: grid; gap: 2px; }
.entry b { font-size: 17px; letter-spacing: -.01em; }
.entry small { font-size: 13px; color: var(--muted); }
.entry .tag { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: rgba(255, 255, 255, .22); justify-self: start; }
.entry .chev { flex: none; color: inherit; opacity: .6; }
.sec { display: flex; align-items: baseline; justify-content: space-between; font-size: 15px; color: var(--muted); font-weight: 600; margin: 26px 4px 10px; }
.sec small { font-weight: 400; font-size: 13px; }
.projects { display: grid; gap: 10px; }
.project-row { position: relative; }
.project { display: flex; align-items: center; gap: 14px; width: 100%; background: var(--card); border: 0; border-radius: 20px; padding: 12px 52px 12px 12px; text-align: left; cursor: pointer; box-shadow: var(--shadow); color: var(--ink); }
.project img { width: 64px; height: 64px; object-fit: contain; border-radius: 14px; background: var(--checker); flex: none; }
.project div { flex: 1; min-width: 0; display: grid; gap: 4px; }
.project b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project small { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.status { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.status.done { background: var(--green-soft); color: var(--green); }
.status.running { background: var(--accent-soft); color: var(--accent-ink); }
.status.review { background: #fff4e0; color: #9a5b00; }
@media (prefers-color-scheme: dark) { .status.review { background: #3a2a0a; color: #ffcc66; } }
.project-del { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); }
.project-del svg { width: 18px; height: 18px; color: var(--faint); }
.project-del:hover svg { color: var(--danger); }
.chev { color: var(--faint); font-size: 22px; }
.empty { color: var(--muted); text-align: center; padding: 36px 16px; background: var(--card); border-radius: var(--radius); }
.footer-links { text-align: center; margin-top: 28px; }

/* 步骤条 */
.stepper { list-style: none; display: flex; margin: 4px 0 18px; padding: 0; gap: 4px; }
.stepper li { flex: 1; display: grid; justify-items: center; gap: 4px; font-size: 12px; color: var(--faint); position: relative; }
.stepper li i { font-style: normal; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); font-weight: 700; font-size: 13px; color: var(--muted); }
.stepper li.done { color: var(--muted); }
.stepper li.done i { background: var(--accent-soft); color: var(--accent-ink); }
.stepper li.on { color: var(--ink); font-weight: 600; }
.stepper li.on i { background: var(--accent); color: #fff; }
.stepper li[data-step] { cursor: pointer; min-height: 44px; }

/* 照片 */
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photo { position: relative; aspect-ratio: 1; border-radius: 16px; overflow: hidden; background: var(--surface-2); }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo-view { display: block; width: 100%; height: 100%; border: 0; padding: 0; background: none; cursor: pointer; }
.photo .rm { position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .6); color: #fff; font-size: 14px; cursor: pointer; }
.photo.add { border: 1.5px dashed var(--accent-2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--accent); cursor: pointer; background: var(--accent-soft); }
.photo.add span { font-size: 30px; line-height: 1; }
.photo.add small { color: var(--muted); }

/* 风格 */
.cats { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cat { flex: none; min-height: 36px; border: 0; background: var(--surface-2); border-radius: 999px; padding: 6px 14px; font-size: 13px; cursor: pointer; }
.cat.on { background: var(--ink); color: var(--card); }
.styles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; max-height: 440px; overflow-y: auto; overscroll-behavior: contain; padding: 2px; }
.style { border: 2px solid transparent; background: var(--surface-2); border-radius: 18px; padding: 7px; cursor: pointer; display: grid; gap: 4px; }
.style.on { border-color: var(--accent); background: var(--accent-soft); }
.style .img { position: relative; display: block; aspect-ratio: 1; border-radius: 12px; background: #fff; overflow: hidden; }
.style .img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.style .nm { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zoom-btn { position: absolute; top: 4px; right: 4px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .9); color: #1d1d1f; font-style: normal; box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
.zoom-btn svg { width: 15px; height: 15px; }

/* 画风：上传参考图 */
.seg.mode { margin: 4px 0 12px; }
.style-upload { position: relative; display: grid; place-items: center; text-align: center; gap: 4px; min-height: 170px; border: 1.5px dashed var(--accent-2); border-radius: 18px; background: var(--accent-soft); color: var(--accent-ink); cursor: pointer; overflow: hidden; padding: 14px; }
.style-upload .plus { font-size: 34px; line-height: 1; }
.style-upload small { color: var(--muted); }
.style-upload img { max-width: 100%; max-height: 260px; border-radius: 12px; display: block; }
.style-upload .re { position: absolute; right: 8px; bottom: 8px; background: rgba(0, 0, 0, .55); color: #fff; border-radius: 999px; padding: 3px 10px; font-size: 12px; }

/* 角色主体 */
.hero { position: relative; width: min(100%, 340px); aspect-ratio: 1; margin: 0 auto; border-radius: 20px; background: var(--checker); overflow: hidden; display: grid; place-items: center; }
.hero.small { width: min(100%, 280px); }
.hero img { width: 100%; height: 100%; object-fit: contain; }
.hero.busy img { opacity: .3; }
.busy-mask { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px; padding: 20px; }
.busy-mask small { color: var(--muted); }
.elapsed { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; padding: 2px 10px; border-radius: 99px; background: var(--surface-2); }
.elapsed:empty { display: none; }
.versions { display: flex; gap: 8px; overflow-x: auto; padding: 12px 2px 2px; justify-content: center; }
.ver { flex: none; width: 54px; height: 54px; padding: 0; border: 2px solid var(--line); border-radius: 12px; background: var(--checker); overflow: hidden; cursor: pointer; }
.ver.on { border-color: var(--accent); }
.ver img { width: 100%; height: 100%; object-fit: contain; }
.ver-num { min-height: 34px; border: 0; background: var(--surface-2); border-radius: 999px; padding: 4px 14px; font-size: 13px; cursor: pointer; }
.ver-num.on { background: var(--ink); color: var(--card); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.chip { min-height: 34px; border: 1px solid var(--accent-2); background: var(--accent-soft); color: var(--accent-ink); border-radius: 999px; padding: 5px 12px; font-size: 13px; cursor: pointer; }
.chip:disabled { opacity: .5; }
.restyle { margin-top: 14px; }
.restyle summary { cursor: pointer; color: var(--muted); font-size: 14px; margin-bottom: 10px; min-height: 32px; }
.restyle .btn { margin-top: 10px; }

/* 表情模板 */
.kits { display: grid; gap: 8px; margin-top: 10px; }
.kit { display: flex; gap: 12px; align-items: center; text-align: left; border: 1px solid var(--line); background: var(--card); border-radius: 18px; padding: 14px; cursor: pointer; }
.kit.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.kit .em { font-size: 28px; }
.kit span:last-child { display: grid; gap: 2px; min-width: 0; }
.kit small { color: var(--muted); font-size: 12px; }
.kit .caps { color: var(--accent-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.custom-hint { margin: 12px 0 6px; }
.custom-captions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.custom-captions label { display: grid; gap: 4px; min-width: 0; font-size: 12px; color: var(--muted); }
.custom-captions input { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; background: var(--surface-2); color: var(--ink); }
.custom-captions input:focus { border-color: var(--accent); outline: none; }
.seg { display: flex; background: var(--surface-3); border-radius: 12px; padding: 3px; margin-top: 12px; }
.seg button { flex: 1; min-height: 38px; border: 0; background: none; border-radius: 9px; padding: 6px 8px; font-size: 14px; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.set-row { display: flex; justify-content: space-between; align-items: center; width: 100%; min-height: 48px; border: 0; border-top: 1px solid var(--line); background: none; padding: 12px 2px; cursor: pointer; text-align: left; }

/* 九宫格 */
.grid9 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.cell { position: relative; aspect-ratio: 1; border: 1px solid var(--line); padding: 0; border-radius: 14px; background: var(--checker); overflow: hidden; cursor: pointer; }
.cell img, .grid9.plain img { width: 100%; height: 100%; object-fit: contain; display: block; }
.grid9.plain img { aspect-ratio: 1; border-radius: 14px; background: var(--checker); -webkit-touch-callout: default; }
.cell-busy { position: absolute; inset: 0; background: color-mix(in srgb, var(--card) 60%, transparent); display: grid; place-items: center; }
.badge { position: absolute; top: 5px; left: 5px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 600; border-radius: 6px; padding: 1px 6px; }
.grid-canvas { width: min(100%, 340px); aspect-ratio: 1; border-radius: 16px; background: var(--checker); margin: 12px auto 0; display: block; }

/* spinner */
.spinner { width: 36px; height: 36px; border: 3.5px solid var(--line-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto; }
.spinner.sm { width: 22px; height: 22px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 底部弹层 */
dialog { color: var(--ink); }
dialog.sheet { border: 0; padding: 0; width: 100%; max-width: 600px; margin: auto auto 0; border-radius: 26px 26px 0 0; max-height: 92dvh; background: var(--card); overflow-y: auto; overscroll-behavior: contain; }
dialog.sheet[open] { animation: sheet-in .25s ease-out; }
@keyframes sheet-in { from { transform: translateY(40px); opacity: .6; } }
dialog::backdrop { background: var(--scrim); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.sheet-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; padding: 16px 16px 8px 20px; font-size: 17px; background: var(--card); }
.sheet-head .icon-btn { min-width: 34px; min-height: 34px; width: 34px; height: 34px; background: var(--surface-2); color: var(--muted); }
.sheet-head .icon-btn svg { width: 18px; height: 18px; }
.sheet-body { padding: 8px 20px calc(20px + env(safe-area-inset-bottom)); display: grid; gap: 14px; }
.sheet-body p { margin: 0; }
.reference-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.reference-thumb { display: grid; gap: 4px; min-width: 0; border: 0; padding: 0; background: none; color: var(--muted); font-size: 12px; text-align: center; cursor: pointer; }
.reference-thumb img { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 12px; background: var(--checker); }
.contact { background: var(--accent-soft); border-radius: 14px; padding: 12px 14px; white-space: pre-wrap; word-break: break-all; }
.costs { width: 100%; border-collapse: collapse; font-size: 14px; }
.costs td { padding: 10px 0; border-bottom: 1px solid var(--line); }
.costs td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
dialog.zoom { border: 0; padding: 10px; border-radius: 22px; width: min(520px, 94vw); background: var(--card); }
dialog.zoom img { width: 100%; max-height: 75dvh; object-fit: contain; display: block; background: var(--checker); border-radius: 14px; }
dialog.zoom p { text-align: center; margin: 10px 0 4px; font-weight: 600; }

#toast { position: fixed; left: 50%; bottom: calc(30px + env(safe-area-inset-bottom)); transform: translate(-50%, 8px); background: rgba(29, 29, 31, .94); color: #fff; padding: 10px 18px; border-radius: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 100; max-width: 90vw; text-align: center; font-size: 14px; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 440px) { .custom-captions { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 380px) {
  .screen { padding-inline: 12px; }
  .card { padding: 16px; }
  .actions.two { gap: 8px; }
  .actions.two .btn { padding-inline: 8px; }
  .stepper li { font-size: 11px; }
}
/* 电脑端完整展示分类；触屏手机继续横向滑动。 */
@media (min-width: 861px), (hover: hover) and (pointer: fine) { .cats { flex-wrap: wrap; overflow-x: visible; row-gap: 8px; } }
@media (min-width: 900px) {
  body { max-width: 820px; }
  .screen { padding-inline: 32px; }
  .bar { padding-inline: 24px; }
  .entries { grid-template-columns: 1fr 1fr; }
  .projects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .styles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* 一次生成的九个主体候选 */
.character-candidates { scroll-margin-top: calc(68px + env(safe-area-inset-top)); max-width: 540px; margin-inline: auto; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-block: 18px 12px; text-align: left; }
.candidate-tile { position: relative; min-width: 0; border: 2px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--card); }
.candidate-tile.selected { border-color: var(--accent); background: var(--accent-soft); }
.candidate-choose { display: block; width: 100%; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--ink); cursor: pointer; text-align: center; }
.candidate-image { display: block; position: relative; width: 100%; aspect-ratio: 1; background: var(--checker); }
.candidate-image img { display: block; width: 100%; height: 100%; object-fit: contain; }
.candidate-number, .candidate-check { position: absolute; top: 5px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; font-size: 12px; font-weight: 600; }
.candidate-number { left: 5px; background: var(--card); color: var(--muted); }
.candidate-check { right: 5px; background: var(--accent); color: #fff; }
.candidate-direction { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 5px 44px 5px 4px; font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.candidate-zoom { position: absolute; right: 0; bottom: 0; display: block; width: 44px; height: 44px; min-height: 44px; padding: 5px; border: 0; border-radius: 0; background: transparent; color: var(--accent-ink); cursor: pointer; font-size: 12px; }
.candidate-selection { font-size: 13px; line-height: 1.6; color: var(--accent-ink); }
.character-history { text-align: left; margin-top: 18px; }
.character-history summary { min-height: 44px; padding: 12px 0; cursor: pointer; color: var(--accent-ink); font-size: 14px; }
.character-history-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.character-history-item { min-width: 0; padding: 5px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); cursor: pointer; }
.character-history-item.on { border-color: var(--accent); }
.character-history-item img { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; background: var(--checker); border-radius: 8px; }
.character-history-item span { display: block; padding: 6px 0; font-size: 12px; overflow-wrap: anywhere; }
@media (max-width: 430px) { .character-candidates { gap: 6px; } .candidate-tile { border-radius: 12px; } .candidate-direction { font-size: 11px; } }
