/* ============================================================
   小日子 Tiny Life — 界面样式
   暖色调 / 圆润 / 半透明玻璃面板
   ============================================================ */

:root {
  --ink:        #4a3a2e;
  --ink-soft:   #6d5a4b;
  --muted:      #93806f;
  --line:       rgba(120, 92, 64, 0.16);
  --line-strong:rgba(120, 92, 64, 0.28);
  --panel:      rgba(255, 252, 246, 0.90);
  --panel-solid:#fffcf6;
  --panel-sunk: rgba(120, 92, 64, 0.07);
  --shadow-sm:  0 2px 6px rgba(94, 68, 44, 0.10);
  --shadow-md:  0 10px 24px rgba(94, 68, 44, 0.16);
  --shadow-lg:  0 26px 60px rgba(70, 48, 30, 0.28);
  --accent:     #e2785c;
  --accent-dk:  #c9634a;
  --sage:       #6fa07a;
  --honey:      #e0b04f;
  --blue:       #7d94c4;
  --lilac:      #b08cc4;
  --radius:     18px;
  --radius-sm:  12px;
  --radius-lg:  26px;
  --ui-font: "PingFang SC", "HarmonyOS Sans SC", "Hiragino Sans GB",
             "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(0.32, 0.72, 0.24, 1);
}

* { box-sizing: border-box; }

/* 让 [hidden] 一定能盖住组件自己的 display */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #e9dcc9;
  color: var(--ink);
  font-family: var(--ui-font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

button, input, select { font-family: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; padding: 0; }

#app { position: fixed; inset: 0; }

#stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}

#stage3d {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}
#stage3d[hidden] { display: none !important; }
#stage.is-dragging { cursor: grabbing; }
#stage.is-placing  { cursor: crosshair; }

/* ------------------------------------------------------------
   HUD 容器
   ------------------------------------------------------------ */
.hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  user-select: none;
}
.hud > * { pointer-events: auto; }

.topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
}

/* 被嵌在 dramanest 这类站点里时，左上角有宿主的返回条 */
#app.has-site-nav .topbar { padding-top: 58px; }
#app.has-site-nav .toasts { top: 268px; }
#app.has-site-nav .sidepanel { top: 58px; }
.cluster { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.cluster-center { align-items: center; flex: 0 1 auto; }
.cluster-right { align-items: flex-end; }

/* ------------------------------------------------------------
   玻璃面板
   ------------------------------------------------------------ */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
}

/* ------------------------------------------------------------
   家庭成员卡片
   ------------------------------------------------------------ */
.household {
  display: flex;
  gap: 8px;
  padding: 8px;
  max-width: 60vw;
  overflow-x: auto;
  scrollbar-width: none;
}
.household::-webkit-scrollbar { display: none; }

.simcard {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 12px 6px 6px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: transparent;
  transition: background .18s var(--ease), border-color .18s var(--ease), transform .18s var(--ease);
  text-align: left;
}
.simcard:hover { background: var(--panel-sunk); }
.simcard.is-active {
  background: #fff;
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}
.simcard-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  overflow: hidden;
  flex: none;
  background: linear-gradient(180deg,#ffe9cf,#f6d6b6);
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--ring, var(--sage));
  display: grid; place-items: center;
}
.simcard-avatar canvas { width: 100%; height: 100%; display: block; }
.simcard-meta { min-width: 0; }
.simcard-name {
  font-size: 13.5px; font-weight: 650; letter-spacing: .01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 88px;
}
.simcard-mood { font-size: 11px; color: var(--muted); white-space: nowrap; }
.simcard-badge {
  position: absolute; top: -3px; right: -3px;
  min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: 10px; background: var(--accent); color: #fff;
  font-size: 10.5px; font-weight: 700; display: grid; place-items: center;
  box-shadow: 0 2px 6px rgba(226,120,92,.5);
}

.addsim {
  width: 44px; height: 44px; flex: none;
  border-radius: 50%;
  border: 1.5px dashed var(--line-strong);
  color: var(--muted);
  font-size: 20px; line-height: 1;
  display: grid; place-items: center;
  transition: all .18s var(--ease);
}
.addsim:hover { color: var(--accent); border-color: var(--accent); background: #fff; }

/* ------------------------------------------------------------
   需求面板
   ------------------------------------------------------------ */
.needs {
  width: 268px;
  padding: 12px 14px 13px;
}
.needs-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 9px;
}
.needs-name { font-size: 14px; font-weight: 700; }
.needs-mood {
  font-size: 12px; font-weight: 650; color: #fff;
  padding: 2px 10px; border-radius: 999px;
  background: var(--sage);
  box-shadow: var(--shadow-sm);
}
.needrow {
  display: grid;
  grid-template-columns: 22px 1fr 34px;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  cursor: default;
  border-radius: 8px;
}
.needrow:hover { background: var(--panel-sunk); }
.needrow-icon { font-size: 14px; text-align: center; line-height: 1; }
.needrow-track {
  height: 9px; border-radius: 999px;
  background: rgba(120, 92, 64, 0.13);
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(94, 68, 44, .12);
}
.needrow-fill {
  height: 100%; width: 50%;
  border-radius: 999px;
  background: var(--sage);
  transition: width .35s linear, background .35s linear;
}
.needrow-val {
  font-size: 11px; color: var(--muted);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* ------------------------------------------------------------
   状态面板：时间 / 金钱 / 速度
   ------------------------------------------------------------ */
.status {
  width: 236px;
  padding: 12px 14px 13px;
}
.status-clock { display: flex; align-items: baseline; gap: 8px; }
.status-time {
  font-size: 26px; font-weight: 700; letter-spacing: .01em;
  font-variant-numeric: tabular-nums; line-height: 1.1;
}
.status-day { font-size: 12px; color: var(--muted); }
.status-money {
  display: flex; align-items: center; gap: 7px;
  margin-top: 7px; padding-top: 9px;
  border-top: 1px dashed var(--line);
}
.status-money .sym { font-size: 15px; }
.status-money .amt {
  font-size: 19px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--sage);
}
.status-money .amt.is-low { color: var(--accent); }
.status-bills { margin-left: auto; font-size: 11px; color: var(--muted); }

.speedrow { display: flex; gap: 5px; margin-top: 10px; }
.speedbtn {
  flex: 1;
  height: 32px;
  border-radius: 10px;
  background: var(--panel-sunk);
  color: var(--ink-soft);
  font-size: 12px; font-weight: 650;
  display: grid; place-items: center;
  transition: all .16s var(--ease);
}
.speedbtn:hover { background: rgba(120,92,64,.14); }
.speedbtn.is-on { background: var(--ink); color: #fff; box-shadow: var(--shadow-sm); }
.speedbtn svg { width: 15px; height: 15px; fill: currentColor; }

.toggleline {
  display: flex; align-items: center; gap: 8px;
  margin-top: 10px; padding-top: 9px;
  border-top: 1px dashed var(--line);
  font-size: 12px; color: var(--ink-soft);
  cursor: pointer;
}
.switch {
  margin-left: auto;
  width: 36px; height: 21px; border-radius: 999px;
  background: rgba(120,92,64,.2);
  position: relative; transition: background .2s var(--ease);
  flex: none;
}
.switch::after {
  content: ""; position: absolute; top: 2.5px; left: 2.5px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25);
  transition: transform .2s var(--ease);
}
.switch.is-on { background: var(--sage); }
.switch.is-on::after { transform: translateX(15px); }

/* ------------------------------------------------------------
   行动队列
   ------------------------------------------------------------ */
.queue {
  width: 268px;
  display: flex; flex-direction: column; gap: 6px;
}
.queue-item {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(14px);
  animation: pop .22s var(--ease);
}
.queue-item.is-current { border-color: rgba(111,160,122,.55); }
.queue-item.is-done { opacity: .45; }
.queue-ico { font-size: 15px; flex: none; }
.queue-label { font-size: 12.5px; font-weight: 600; flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.queue-prog { height: 3px; border-radius: 2px; background: rgba(120,92,64,.15); width: 42px; flex: none; overflow: hidden; }
.queue-prog i { display: block; height: 100%; background: var(--sage); width: 0; border-radius: 2px; }
.queue-x {
  width: 20px; height: 20px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  color: var(--muted); font-size: 13px; line-height: 1;
  transition: all .15s var(--ease);
}
.queue-x:hover { background: rgba(226,120,92,.16); color: var(--accent-dk); }

@keyframes pop {
  from { opacity: 0; transform: translateY(-6px) scale(.96); }
  to   { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------
   通知
   ------------------------------------------------------------ */
.toasts {
  position: absolute;
  top: 224px; left: 50%;
  transform: translateX(-50%);
  width: 300px;
  display: flex; flex-direction: column; gap: 8px;
  align-items: stretch;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--panel-solid);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  animation: toastIn .3s var(--ease);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.toast.is-out { animation: toastOut .28s var(--ease) forwards; }
.toast-ico { font-size: 17px; line-height: 1.2; }
.toast-text { font-size: 12.5px; line-height: 1.45; }
.toast-text b { display: block; font-size: 12.5px; font-weight: 700; margin-bottom: 1px; }
.toast-text span { color: var(--muted); }
.toast.good { border-left: 3px solid var(--sage); }
.toast.warn { border-left: 3px solid var(--honey); }
.toast.bad  { border-left: 3px solid var(--accent); }

@keyframes toastIn  { from { opacity: 0; transform: translateX(24px) scale(.95); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to   { opacity: 0; transform: translateX(24px) scale(.95); } }

/* ------------------------------------------------------------
   底部工具条
   ------------------------------------------------------------ */
.bottombar {
  position: absolute;
  left: 50%; bottom: 16px;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 4px;
  padding: 7px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px) saturate(1.25);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
  max-width: calc(100vw - 24px);
}
.tabbtn {
  display: flex; align-items: center; gap: 7px;
  height: 42px; padding: 0 17px;
  border-radius: 999px;
  font-size: 13.5px; font-weight: 650;
  color: var(--ink-soft);
  transition: all .18s var(--ease);
  white-space: nowrap;
}
.tabbtn svg { width: 17px; height: 17px; fill: currentColor; flex: none; }
.tabbtn:hover { background: var(--panel-sunk); color: var(--ink); }
.tabbtn.is-on { background: var(--ink); color: #fff; box-shadow: var(--shadow-sm); }
.tabbtn.is-on:hover { background: var(--ink); color: #fff; }
.tab-div { width: 1px; height: 24px; background: var(--line); margin: 0 4px; flex: none; }

@media (max-width: 720px) {
  .tabbtn { padding: 0 12px; font-size: 12.5px; }
  .tabbtn span { display: none; }
  .tabbtn svg { width: 19px; height: 19px; }
  .tabbtn.is-on span { display: inline; }
}

/* ------------------------------------------------------------
   侧边面板（购买 / 建造）
   ------------------------------------------------------------ */
.sidepanel {
  position: absolute;
  top: 14px; right: 18px; bottom: 84px;
  width: 320px;
  display: flex; flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  overflow: hidden;
  animation: slideIn .26s var(--ease);
}
@keyframes slideIn { from { opacity: 0; transform: translateX(26px); } to { opacity: 1; transform: none; } }

.sidepanel-head { padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.sidepanel-title { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.sidepanel-sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.sidepanel-body { flex: 1; overflow-y: auto; padding: 12px; }
.sidepanel-body::-webkit-scrollbar { width: 8px; }
.sidepanel-body::-webkit-scrollbar-thumb { background: rgba(120,92,64,.22); border-radius: 4px; }

.cattabs {
  display: flex; gap: 5px; overflow-x: auto; padding-bottom: 10px;
  scrollbar-width: none;
}
.cattabs::-webkit-scrollbar { display: none; }
.cattab {
  padding: 6px 11px; border-radius: 999px;
  background: var(--panel-sunk); font-size: 12px; font-weight: 600;
  color: var(--ink-soft); white-space: nowrap;
  transition: all .16s var(--ease);
}
.cattab:hover { background: rgba(120,92,64,.15); }
.cattab.is-on { background: var(--accent); color: #fff; }

.itemgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.itemcard {
  display: flex; flex-direction: column;
  padding: 8px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
  text-align: left;
  transition: all .16s var(--ease);
}
.itemcard:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.itemcard.is-on { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(226,120,92,.28); }
.itemcard.is-poor { opacity: .45; }
.itemthumb {
  height: 62px; border-radius: 10px;
  background: linear-gradient(180deg,#f7f2ea,#efe6d8);
  display: grid; place-items: center; overflow: hidden;
  margin-bottom: 7px;
}
.itemthumb canvas { display: block; }
.itemname { font-size: 12px; font-weight: 650; line-height: 1.3; }
.itemprice { font-size: 11.5px; color: var(--sage); font-weight: 650; margin-top: 2px;
  font-variant-numeric: tabular-nums; }
.itemcard.is-poor .itemprice { color: var(--accent); }

.toolgrid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.toolbtn {
  padding: 11px 6px 9px;
  border-radius: 14px;
  background: #fff; border: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600;
  transition: all .16s var(--ease);
}
.toolbtn svg { width: 20px; height: 20px; fill: var(--ink-soft); }
.toolbtn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.toolbtn.is-on { border-color: var(--accent); background: #fff6f2; box-shadow: 0 0 0 2px rgba(226,120,92,.24); }
.toolbtn.is-on svg { fill: var(--accent); }

.swatchgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 4px; }
.swatch {
  aspect-ratio: 1; border-radius: 11px;
  border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
  transition: all .14s var(--ease);
  position: relative; overflow: hidden;
}
.swatch:hover { transform: scale(1.05); }
.swatch.is-on { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(226,120,92,.3); }
.swatch-label {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,.85); font-size: 9px; text-align: center;
  padding: 2px 0; color: var(--ink-soft); font-weight: 600;
}

.sect-title {
  font-size: 11.5px; font-weight: 700; color: var(--muted);
  letter-spacing: .06em; margin: 14px 0 7px;
}
.sect-title:first-child { margin-top: 0; }

/* ------------------------------------------------------------
   检视面板（点选角色）
   ------------------------------------------------------------ */
.inspector {
  position: absolute;
  left: 18px; bottom: 84px;
  width: 286px;
  padding: 13px 15px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  animation: slideUp .24s var(--ease);
  max-height: calc(100vh - 178px);
  overflow-y: auto;
}
@keyframes slideUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.insp-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.insp-avatar {
  width: 46px; height: 46px; border-radius: 50%; overflow: hidden; flex: none;
  background: linear-gradient(180deg,#ffe9cf,#f6d6b6); border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--sage);
}
.insp-avatar canvas { width: 100%; height: 100%; display: block; }
.insp-name { font-size: 15px; font-weight: 700; }
.insp-sub { font-size: 11.5px; color: var(--muted); }
.insp-close {
  margin-left: auto; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; color: var(--muted); font-size: 15px;
  transition: all .15s var(--ease);
}
.insp-close:hover { background: var(--panel-sunk); color: var(--ink); }

.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip {
  font-size: 11px; font-weight: 600;
  padding: 3px 9px; border-radius: 999px;
  background: var(--panel-sunk); color: var(--ink-soft);
}
.chip.good { background: rgba(111,160,122,.16); color: #4e7d59; }
.chip.bad  { background: rgba(226,120,92,.16); color: var(--accent-dk); }

.skillrow { display: grid; grid-template-columns: 60px 1fr 26px; gap: 8px; align-items: center; padding: 3px 0; }
.skillgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px 14px; }
.skillgrid .skillrow { grid-template-columns: 48px 1fr 16px; gap: 6px; }
.skillrow-name { font-size: 11.5px; color: var(--ink-soft); }
.skillrow-track { height: 6px; border-radius: 4px; background: rgba(120,92,64,.13); overflow: hidden; }
.skillrow-track i { display: block; height: 100%; background: var(--honey); border-radius: 4px; transition: width .3s; }
.skillrow-lv { font-size: 11px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }

.meterrow { display: grid; grid-template-columns: 52px 1fr; gap: 8px; align-items: center; padding: 2px 0; }
@media (min-width: 861px) { .insp-needs { display: none; } }
.meterrow-name { font-size: 11.5px; color: var(--ink-soft); }
.meterrow-track { height: 6px; border-radius: 4px; background: rgba(120,92,64,.13); overflow: hidden; }
.meterrow-track i { display: block; height: 100%; border-radius: 4px; background: var(--lilac); }

.jobcard {
  margin-top: 10px; padding: 10px 11px;
  background: var(--panel-sunk); border-radius: 13px;
}
.jobcard-top { display: flex; align-items: center; gap: 8px; }
.jobcard-title { font-size: 12.5px; font-weight: 700; }
.jobcard-pay { margin-left: auto; font-size: 11.5px; color: var(--sage); font-weight: 700;
  font-variant-numeric: tabular-nums; }
.jobcard-actions { display: flex; gap: 6px; margin-top: 9px; flex-wrap: wrap; }

/* ------------------------------------------------------------
   按钮
   ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 17px;
  border-radius: 999px;
  font-size: 13px; font-weight: 650;
  border: 1px solid transparent;
  transition: all .16s var(--ease);
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 4px 14px rgba(226,120,92,.34); }
.btn-primary:hover { background: var(--accent-dk); }
.btn-sage { background: var(--sage); color: #fff; box-shadow: 0 4px 14px rgba(111,160,122,.3); }
.btn-sage:hover { background: #5f8f6b; }
.btn-ghost { background: var(--panel-sunk); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: rgba(120,92,64,.15); }
.btn-white { background: #fff; color: var(--ink); border-color: var(--line); box-shadow: var(--shadow-sm); }
.btn-white:hover { border-color: var(--line-strong); }
.btn-sm { height: 29px; padding: 0 12px; font-size: 11.5px; }
.btn-lg { height: 48px; padding: 0 26px; font-size: 15px; }
.btn[disabled] { opacity: .42; pointer-events: none; }

/* ------------------------------------------------------------
   转盘菜单（点击物体）
   ------------------------------------------------------------ */
.radial {
  position: absolute;
  width: 0; height: 0;
  pointer-events: none;
}
.radial-item {
  position: absolute;
  width: 48px; height: 48px;
  margin: -24px 0 0 -24px;
  border-radius: 50%;
  background: var(--panel-solid);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  display: grid; place-items: center;
  font-size: 21px;
  pointer-events: auto;
  transition: transform .16s var(--ease), box-shadow .16s var(--ease), border-color .16s var(--ease);
  animation: radialIn .24s var(--ease) backwards;
}
@keyframes radialIn { from { opacity: 0; transform: scale(.3); } to { opacity: 1; } }
.radial-item:hover {
  transform: scale(1.16);
  border-color: var(--accent);
  box-shadow: 0 8px 22px rgba(94,68,44,.28);
  z-index: 2;
}
.radial-item.is-blocked { opacity: .5; filter: grayscale(.7); }
.radial-core {
  position: absolute;
  transform: translate(-50%, -50%);
  min-width: 132px; max-width: 190px;
  padding: 9px 14px;
  border-radius: 15px;
  background: rgba(74, 58, 46, 0.93);
  color: #fff;
  text-align: center;
  box-shadow: var(--shadow-md);
  pointer-events: none;
}
.radial-core b { display: block; font-size: 13px; font-weight: 700; }
.radial-core span { display: block; font-size: 11px; opacity: .72; margin-top: 1px; }
.radial-core.is-empty { opacity: .85; }

/* ------------------------------------------------------------
   提示气泡 / 底部提示条
   ------------------------------------------------------------ */
.tooltip {
  position: absolute;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(74, 58, 46, 0.93);
  color: #fff; font-size: 11.5px;
  pointer-events: none;
  box-shadow: var(--shadow-md);
  transform: translate(-50%, -100%);
  white-space: nowrap;
  z-index: 40;
}

.hintbar {
  position: absolute;
  left: 50%; bottom: 78px;
  transform: translateX(-50%);
  padding: 7px 15px;
  border-radius: 999px;
  background: rgba(74, 58, 46, 0.86);
  color: #fff; font-size: 12px;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-md);
  white-space: nowrap;
  max-width: calc(100vw - 32px);
  overflow: hidden; text-overflow: ellipsis;
}
.hintbar kbd {
  background: rgba(255,255,255,.18); border-radius: 5px;
  padding: 1px 5px; font-size: 10.5px; font-family: inherit; margin: 0 2px;
}

/* ------------------------------------------------------------
   全屏层：开始 / 捏人 / 加载
   ------------------------------------------------------------ */
.screen {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  z-index: 60;
}
.screen[hidden] { display: none; }

.start-screen {
  background:
    radial-gradient(1100px 620px at 68% 16%, rgba(255, 224, 178, .85), transparent 62%),
    radial-gradient(900px 560px at 18% 84%, rgba(178, 214, 190, .72), transparent 60%),
    linear-gradient(160deg, #fdf3e3 0%, #f3e0c8 48%, #e6d3bd 100%);
  backdrop-filter: blur(2px);
}
.start-card {
  width: min(560px, calc(100vw - 40px));
  padding: 34px 36px 28px;
  background: rgba(255, 252, 246, .9);
  border: 1px solid var(--line);
  border-radius: 30px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: slideUp .4s var(--ease);
}
.brand { display: flex; align-items: center; gap: 16px; }
.brand-mark { width: 62px; height: 62px; flex: none; filter: drop-shadow(0 6px 12px rgba(201,99,74,.28)); }
.brand-text h1 {
  margin: 0; font-size: 34px; font-weight: 800; letter-spacing: .04em;
  color: #4a3a2e;
}
.brand-text p { margin: 3px 0 0; font-size: 12.5px; color: var(--muted); letter-spacing: .02em; }

.start-points { list-style: none; margin: 24px 0 0; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.start-points li {
  display: flex; align-items: flex-start; gap: 11px;
  font-size: 13px; color: var(--ink-soft); line-height: 1.55;
}
.start-points li span {
  width: 30px; height: 30px; flex: none; border-radius: 10px;
  background: var(--panel-sunk); display: grid; place-items: center; font-size: 15px;
}
.start-points li .ptext { font-style: normal; }

.lang-row {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; margin-top: 20px;
}
.lang-label { font-size: 11.5px; color: var(--muted); }
.langbtn {
  padding: 5px 13px; border-radius: 999px;
  background: var(--panel-sunk); font-size: 12px; font-weight: 650;
  color: var(--ink-soft); border: 1px solid transparent;
  transition: all .16s var(--ease);
}
.langbtn:hover { background: rgba(120,92,64,.15); }
.langbtn.is-on { background: var(--ink); color: #fff; box-shadow: var(--shadow-sm); }
.start-actions { display: flex; gap: 10px; margin-top: 26px; flex-wrap: wrap; }
.start-actions .btn { flex: 1 1 auto; }
.start-foot { margin: 14px 0 0; font-size: 11px; color: var(--muted); text-align: center; }

/* 捏人 */
.cas-screen {
  background: rgba(60, 44, 32, .42);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.cas-card {
  width: min(680px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  display: flex; flex-direction: column;
  background: var(--panel-solid);
  border-radius: 28px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: slideUp .32s var(--ease);
}
.cas-head { padding: 22px 26px 12px; }
.cas-head h2 { margin: 0; font-size: 21px; font-weight: 750; }
.cas-head p { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); }
.cas-body { display: flex; gap: 22px; padding: 8px 26px 0; overflow-y: auto; }
.cas-preview {
  width: 220px; flex: none;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.cas-preview canvas {
  width: 220px; height: 300px;
  border-radius: 20px;
  background: linear-gradient(180deg, #fdf6e9 0%, #f0e2ce 100%);
  box-shadow: inset 0 0 0 1px var(--line);
}
.cas-name {
  width: 100%; height: 40px;
  text-align: center; font-size: 15px; font-weight: 700;
  border-radius: 12px; border: 1px solid var(--line);
  background: #fff; outline: none;
}
.cas-name:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(226,120,92,.16); }
.cas-controls { flex: 1; min-width: 0; padding-bottom: 8px; }
.cas-row { margin-bottom: 14px; }
.cas-row-label { font-size: 11.5px; font-weight: 700; color: var(--muted); letter-spacing: .05em; margin-bottom: 7px; }
.swatch-row { display: flex; gap: 7px; flex-wrap: wrap; }
.dots { display: flex; gap: 7px; flex-wrap: wrap; }
.dot {
  width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgba(0,0,0,.1);
  transition: all .14s var(--ease);
}
.dot:hover { transform: scale(1.1); }
.dot.is-on { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(226,120,92,.22); }
.optbtn {
  padding: 7px 13px; border-radius: 11px;
  background: var(--panel-sunk); font-size: 12px; font-weight: 600;
  border: 2px solid transparent;
  transition: all .14s var(--ease);
}
.optbtn:hover { background: rgba(120,92,64,.15); }
.optbtn.is-on { background: #fff; border-color: var(--accent); color: var(--accent-dk); }
.traitnote { font-size: 11px; color: var(--muted); margin-top: 5px; line-height: 1.5; }
.cas-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 26px 20px;
  border-top: 1px solid var(--line);
  margin-top: 8px;
}

/* 加载 */
.toast-screen { background: #fdf3e3; }
#loadingScreen[hidden] { display: none; }
.loading-inner { text-align: center; color: var(--muted); font-size: 13px; }
.loading-bulb {
  width: 46px; height: 46px; margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--honey);
  box-shadow: 0 0 0 0 rgba(224,176,79,.55);
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(224,176,79,.5); transform: scale(.94); }
  70%  { box-shadow: 0 0 0 26px rgba(224,176,79,0); transform: scale(1.06); }
  100% { box-shadow: 0 0 0 0 rgba(224,176,79,0); transform: scale(.94); }
}

/* ------------------------------------------------------------
   响应式
   ------------------------------------------------------------ */
@media (max-width: 1020px) {
  .sidepanel { width: 288px; }
}

@media (max-width: 860px) {
  .topbar { padding: 10px 12px; gap: 8px; }
  .cluster-center { display: none; }
  .status { width: 160px; padding: 9px 11px; }
  .status-time { font-size: 19px; }
  .status-day { font-size: 10.5px; }
  .status-money { margin-top: 5px; padding-top: 7px; }
  .status-money .amt { font-size: 15px; }
  .status-bills { font-size: 10px; }
  .speedrow { margin-top: 8px; }
  .speedbtn { height: 28px; }
  .toggleline { font-size: 11px; margin-top: 7px; padding-top: 7px; }
  .household { max-width: 42vw; }
  .household { padding: 6px; gap: 6px; }
  .simcard { padding: 5px; }
  .simcard-meta { display: none; }
  .simcard-avatar { width: 38px; height: 38px; }
  .inspector { left: 12px; right: 12px; width: auto; bottom: 76px; }
  .sidepanel {
    left: 12px; right: 12px; width: auto;
    top: auto; bottom: 76px; max-height: 46vh;
  }
  .toasts { width: min(280px, calc(100vw - 24px)); top: 150px; }
  .bottombar { bottom: 12px; padding: 5px; }
  .cas-body { flex-direction: column; align-items: center; }
  .cas-preview { width: 100%; }
  .cas-preview canvas { width: 160px; height: 218px; }
  .start-card { padding: 26px 22px 22px; border-radius: 24px; }
  .brand-text h1 { font-size: 27px; }
  .brand-mark { width: 50px; height: 50px; }
}

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