:root {
  --ink: #2b3a36;
  --muted: #71807b;
  --soft: #f0f7f3;
  --paper: #f8fbf8;
  --white: #ffffff;
  --line: #dbe9e1;
  --green: #397c63;
  --green-dark: #225746;
  --green-soft: #e4f3e9;
  --yellow: #f3c95f;
  --yellow-soft: #fff8dc;
  --red: #c65e62;
  --red-soft: #fcebed;
  --blue: #64a7c4;
  --blue-soft: #e8f5fa;
  --pink: #e49aaa;
  --shadow: 0 14px 34px rgba(52, 91, 76, .10);
  --radius: 8px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 15px;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .46; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.app-shell { min-height: 100vh; }
.topbar {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px clamp(20px, 4vw, 60px);
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; }
.brand-mark {
  position: relative; width: 42px; height: 42px; display: grid; place-items: center;
  background: var(--green); color: white; border: 3px solid #d9f0df; border-radius: 7px;
  box-shadow: inset 0 -5px 0 rgba(0,0,0,.08);
  font-family: Georgia, serif; font-size: 24px; font-weight: 700;
}
.brand-mark::before, .brand-mark::after { content: ""; position: absolute; top: -7px; width: 10px; height: 7px; background: #79ae69; border-radius: 8px 8px 1px 8px; }
.brand-mark::before { left: 7px; transform: rotate(-24deg); }
.brand-mark::after { right: 7px; transform: scaleX(-1) rotate(-24deg); }
.brand-mark span { transform: translateY(1px); }
.brand strong { display: block; font-size: 16px; letter-spacing: 0; }
.brand small { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; letter-spacing: 1.8px; }
.topbar-actions, .head-actions, .welcome-actions, .modal-actions { display: flex; align-items: center; gap: 10px; }
.local-badge { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #4ea778; box-shadow: 0 0 0 3px #e4f3ea; }

.button {
  min-height: 38px; display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 15px; border: 1px solid transparent; border-radius: 6px;
  font-weight: 600; color: var(--ink); background: transparent;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button-primary { background: var(--green); color: white; border-color: var(--green); box-shadow: inset 0 -3px 0 rgba(0,0,0,.10); }
.button-primary:hover:not(:disabled) { background: var(--green-dark); }
.button-secondary { background: var(--white); border-color: #ccd6d0; }
.button-secondary:hover:not(:disabled), .button-ghost:hover:not(:disabled) { background: var(--soft); }
.button-ghost { color: var(--muted); }
.button-large { min-height: 50px; padding: 12px 22px; }
.button-block { width: 100%; }
.text-button { padding: 3px 0; border: 0; background: none; color: var(--green); font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }

.welcome {
  min-height: calc(100vh - 74px);
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
  align-items: center;
  gap: clamp(50px, 8vw, 130px);
  padding: clamp(48px, 8vw, 110px) clamp(22px, 8vw, 130px);
  background:
    linear-gradient(rgba(248,251,248,.93), rgba(248,251,248,.97)),
    linear-gradient(90deg, transparent 50%, rgba(100,167,196,.08) 50%),
    linear-gradient(transparent 50%, rgba(57,124,99,.07) 50%);
  background-size: auto, 32px 32px, 32px 32px;
}
.eyebrow, .kicker { margin: 0 0 8px; color: var(--green); font-size: 11px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; }
.welcome h1 { margin: 0; max-width: 720px; font-family: Georgia, "Microsoft YaHei", serif; font-size: clamp(48px, 6vw, 88px); line-height: 1.02; font-weight: 500; letter-spacing: 0; }
.welcome h1 span { color: var(--green); }
.lead { max-width: 650px; margin: 26px 0 30px; color: #53625e; font-size: 18px; line-height: 1.8; }
.welcome-copy > .text-button { margin-top: 18px; }
.sprite-parade { display: flex; align-items: center; gap: 8px; margin: 0 0 26px; }
.sprite-bubble { width: 52px; height: 52px; display: grid; place-items: center; flex: 0 0 auto; border: 2px solid rgba(43,58,54,.08); border-radius: 50%; box-shadow: inset 0 -5px 0 rgba(43,58,54,.05); }
.sprite-bubble img { width: 42px; height: 42px; object-fit: contain; image-rendering: pixelated; }
.sprite-bubble-parsnip { background: #e7f4df; transform: rotate(-6deg); }
.sprite-bubble-strawberry { background: #fde8ec; transform: rotate(5deg); }
.sprite-bubble-chicken { background: #fff4c9; transform: rotate(-3deg); }
.sprite-bubble-star { background: #e5f3fb; transform: rotate(6deg); }
.sprite-caption { display: grid; gap: 2px; margin-left: 5px; }
.sprite-caption strong { font-size: 12px; color: var(--green); }
.sprite-caption small { font-size: 11px; color: var(--muted); }
.welcome-panel { position: relative; padding: 34px 28px 28px; background: var(--green-dark); color: white; border-radius: var(--radius); box-shadow: var(--shadow); border: 3px solid #dcefe4; }
.panel-ribbon { position: absolute; top: -15px; left: 24px; padding: 7px 13px; background: var(--yellow); color: #5c481c; border: 2px solid #fff4cf; border-radius: 5px; box-shadow: 0 4px 0 rgba(44,68,57,.12); font-size: 12px; font-weight: 800; }
.panel-heading { display: flex; align-items: center; gap: 15px; }
.panel-heading strong, .panel-heading small { display: block; }
.panel-heading small { margin-top: 4px; color: #b9cdc6; font-size: 12px; }
.step-number { width: 40px; color: var(--yellow); font-family: Georgia, serif; font-size: 24px; }
.welcome-panel code { display: block; margin: 18px 0 0 55px; padding: 10px 12px; overflow-wrap: anywhere; background: rgba(255,255,255,.09); color: #e4ece8; border-radius: 3px; }
.rule { height: 1px; margin: 22px 0; background: rgba(255,255,255,.13); }
.safety-note { display: grid; gap: 5px; margin-top: 25px; padding: 15px; background: rgba(242,191,73,.12); border-left: 3px solid var(--yellow); }
.safety-note strong { color: var(--yellow); font-size: 12px; }
.safety-note span { color: #d7e2dd; font-size: 12px; line-height: 1.6; }

.editor { min-height: calc(100vh - 74px); display: grid; grid-template-columns: 238px minmax(0, 1fr); }
.sidebar { min-height: calc(100vh - 74px); display: flex; flex-direction: column; background: var(--green-dark); color: white; }
.save-identity { display: flex; align-items: center; gap: 12px; padding: 24px 20px; border-bottom: 1px solid rgba(255,255,255,.1); }
.avatar { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; background: var(--yellow); color: #4a3811; border: 2px solid rgba(255,255,255,.45); border-radius: 7px; box-shadow: inset 0 -4px 0 rgba(0,0,0,.08); font-weight: 800; }
.save-identity strong, .save-identity span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 145px; }
.save-identity span { margin-top: 4px; color: #b9cdc6; font-size: 12px; }
.nav { padding: 14px 10px; }
.nav-item { position: relative; width: 100%; min-height: 44px; display: flex; align-items: center; gap: 12px; padding: 8px 10px; border: 0; border-radius: 4px; color: #c4d3ce; background: none; text-align: left; }
.nav-item:hover { background: rgba(255,255,255,.06); color: white; }
.nav-item.active { background: rgba(255,255,255,.12); color: white; }
.nav-item.active::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; background: var(--yellow); }
.nav-item > span { width: 25px; height: 25px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.22); border-radius: 3px; font-size: 11px; }
.nav-item b { margin-left: auto; min-width: 22px; padding: 2px 5px; background: rgba(255,255,255,.12); border-radius: 10px; color: #d9e3df; font-size: 10px; text-align: center; }
.sidebar-footer { margin-top: auto; padding: 18px 20px; border-top: 1px solid rgba(255,255,255,.1); }
.sidebar-footer div { display: flex; justify-content: space-between; gap: 10px; margin: 8px 0; color: #adc1ba; font-size: 11px; }
.sidebar-footer strong { color: white; font-weight: 500; }

.workspace { min-width: 0; padding: 36px clamp(20px, 4vw, 60px) 70px; background: linear-gradient(180deg, var(--blue-soft) 0, var(--paper) 210px); }
.workspace-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; max-width: 1200px; margin: 0 auto 28px; }
.workspace-head h2 { margin: 0; font-family: Georgia, "Microsoft YaHei", serif; font-size: 32px; font-weight: 500; letter-spacing: 0; }
.content-section { display: none; max-width: 1200px; margin: 0 auto; }
.content-section.active { display: block; animation: sectionIn .2s ease; }
@keyframes sectionIn { from { opacity: .5; transform: translateY(4px); } }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 14px; }
.metric { position: relative; min-height: 128px; padding: 20px; overflow: hidden; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 5px 0 rgba(43,58,54,.035); }
.metric::after { content: ""; position: absolute; right: -14px; bottom: -18px; width: 55px; height: 55px; border-radius: 50%; background: rgba(100,167,196,.10); }
.metric:nth-child(2)::after { background: rgba(228,154,170,.13); }
.metric:nth-child(3)::after { background: rgba(57,124,99,.11); }
.metric:nth-child(4)::after { background: rgba(243,201,95,.18); }
.metric span, .metric small { display: block; color: var(--muted); font-size: 12px; }
.metric strong { display: block; margin: 15px 0 8px; font-family: Georgia, "Microsoft YaHei", serif; font-size: 24px; font-weight: 500; letter-spacing: 0; }
.metric-money { background: var(--yellow-soft); border-color: #eddda9; }
.overview-grid { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(280px,.75fr); gap: 14px; }
.section-block { margin-bottom: 14px; padding: 24px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 5px 0 rgba(43,58,54,.025); }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section-heading h3 { margin: 0; font-size: 18px; font-weight: 650; letter-spacing: 0; }
.section-note { margin: -8px 0 20px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.kicker { margin-bottom: 5px; font-size: 10px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.field { min-width: 0; }
.field label { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 7px; color: #52605c; font-size: 12px; font-weight: 600; }
.field label small { color: #8a9591; font-weight: 400; }
.field input, .field select, .search-field input, .table-input {
  width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid #cfd8d2; border-radius: 4px; background: var(--white); color: var(--ink); outline: none;
}
.field input:focus, .field select:focus, .search-field input:focus, .table-input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(29,90,73,.1); }
.field input:invalid, .table-input:invalid { border-color: var(--red); }
.field-note { display: block; min-height: 16px; margin-top: 5px; color: var(--muted); font-size: 11px; }
.field.unavailable { opacity: .55; }
.field.unavailable input, .field.unavailable select { background: var(--soft); }

.status-label { padding: 5px 8px; border-radius: 3px; font-size: 11px; font-weight: 700; }
.status-label.ok { background: var(--green-soft); color: var(--green); }
.status-label.error { background: var(--red-soft); color: var(--red); }
.file-facts { margin: 0 0 20px; }
.file-facts div { display: grid; grid-template-columns: 78px minmax(0,1fr); gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.file-facts dt { color: var(--muted); font-size: 12px; }
.file-facts dd { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 600; text-align: right; }
.changes-block { margin-top: 0; }
.change-list { display: grid; }
.change-item { display: grid; grid-template-columns: minmax(120px,.8fr) minmax(0,1.4fr) auto; align-items: center; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.change-item:first-child { border-top: 0; }
.change-item strong { font-size: 13px; }
.change-values { min-width: 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.change-values del { color: #9b716b; }
.change-values ins { margin-left: 8px; color: var(--green); text-decoration: none; font-weight: 600; }
.mini-button { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 3px; background: white; color: var(--muted); }

.skill-list { display: grid; gap: 6px; }
.skill-row { display: grid; grid-template-columns: 130px 1fr 130px 130px; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.skill-row:last-child { border-bottom: 0; }
.skill-name { display: flex; align-items: center; gap: 10px; font-weight: 650; }
.skill-symbol { width: 32px; height: 32px; display: grid; place-items: center; background: var(--green-soft); color: var(--green); border: 2px solid #d3eadb; border-radius: 7px; box-shadow: inset 0 -3px 0 rgba(57,124,99,.08); }
.progress-track { height: 7px; overflow: hidden; background: #e8ece9; border-radius: 5px; }
.progress-track span { display: block; height: 100%; background: var(--yellow); border-radius: inherit; transition: width .2s; }
.skill-row .field label { display: none; }

.search-field { width: min(260px, 46vw); }
.inventory-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.inventory-item { min-width: 0; padding: 12px; background: linear-gradient(145deg, #f7fbf8, #eef7f2); border: 1px solid #d8e9df; border-radius: 8px; box-shadow: 0 4px 0 rgba(57,124,99,.05); transition: transform .15s ease, border-color .15s ease; }
.inventory-item:hover { transform: translateY(-2px); border-color: #a9cdb9; }
.inventory-top { display: grid; grid-template-columns: 58px minmax(0,1fr); align-items: center; gap: 10px; margin-bottom: 12px; }
.item-icon { position: relative; width: 58px; height: 58px; display: grid; place-items: center; background: #fff7d8; border: 2px solid #ead99e; border-radius: 8px; box-shadow: inset 0 -5px 0 rgba(118,90,29,.06); }
.item-icon img { width: 48px; height: 48px; object-fit: contain; image-rendering: pixelated; }
.item-icon .image-fallback { display: none; color: #987f42; font: 700 24px Georgia, serif; }
.item-icon.missing img { display: none; }
.item-icon.missing .image-fallback { display: block; }
.quality-mark { position: absolute; right: -5px; bottom: -5px; min-width: 21px; height: 21px; display: none; place-items: center; padding: 0 4px; background: var(--yellow); color: #624b14; border: 2px solid white; border-radius: 50%; font-size: 10px; font-weight: 800; }
.quality-mark.show { display: grid; }
.inventory-title { min-width: 0; }
.inventory-title strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; color: #315647; }
.inventory-title span { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }
.inventory-title small { display: block; min-height: 15px; margin-top: 2px; color: #94a39d; font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.item-fields label { min-width: 0; color: var(--muted); font-size: 10px; }
.item-fields input, .item-fields select { min-height: 34px; margin-top: 4px; padding: 6px 7px; }
.item-fields .table-input { width: 100%; min-width: 0; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; }
td { font-size: 13px; }
.table-input { width: 120px; min-height: 34px; }
.hearts { color: #b64b48; letter-spacing: 1px; white-space: nowrap; }
.relationship-badge { display: inline-block; padding: 4px 7px; background: var(--soft); border-radius: 3px; color: var(--muted); font-size: 11px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 7px; max-height: 330px; overflow-y: auto; }
.tag { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; padding: 6px 8px; border: 1px solid #d6e9de; border-radius: 6px; background: var(--soft); color: #47534f; font-size: 11px; }
.tag span { overflow-wrap: anywhere; }
.tag button { width: 18px; height: 18px; padding: 0; border: 0; background: none; color: var(--muted); font-size: 15px; line-height: 1; }
.code-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; color: var(--muted); font-size: 11px; }
.xml-preview { max-height: 410px; margin: 0; padding: 16px; overflow: auto; border-radius: 4px; background: #16201e; color: #cfe0d9; font: 11px/1.65 Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }

.cheat-switch-block { display: flex; align-items: center; justify-content: space-between; gap: 28px; border-color: #cde4d7; background: linear-gradient(120deg, #f3fbf6, #edf8fb); }
.cheat-switch-copy h3 { margin: 0; font-size: 20px; }
.cheat-switch-copy p { max-width: 680px; margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.toggle-control { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; cursor: pointer; }
.toggle-control input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-track { width: 50px; height: 28px; display: flex; align-items: center; padding: 3px; background: #b7c6c0; border-radius: 16px; transition: background .16s; }
.toggle-track span { width: 22px; height: 22px; background: white; border-radius: 50%; box-shadow: 0 2px 5px rgba(20,50,40,.18); transition: transform .16s; }
.toggle-control input:checked + .toggle-track { background: var(--green); }
.toggle-control input:checked + .toggle-track span { transform: translateX(22px); }
.toggle-control input:focus-visible + .toggle-track { outline: 3px solid rgba(57,124,99,.22); outline-offset: 2px; }
.toggle-control strong { min-width: 48px; color: var(--green); font-size: 13px; }
.cheat-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 14px; }
.command-type-field select { width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid #cfd8d2; border-radius: 4px; background: white; color: var(--ink); }
.command-fields { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; margin-top: 16px; }
.command-item-preview { display: grid; grid-template-columns: 52px minmax(0,1fr); align-items: center; gap: 10px; grid-column: 1 / -1; padding: 10px; background: var(--yellow-soft); border-radius: 6px; }
.command-item-preview img { width: 48px; height: 48px; object-fit: contain; image-rendering: pixelated; }
.command-item-preview strong, .command-item-preview small { display: block; }
.command-item-preview small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.command-result { margin-top: 18px; padding: 16px; background: #173f35; color: white; border-radius: 7px; }
.command-result-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; color: #c4d8d0; font-size: 11px; }
.command-result code { display: block; min-height: 45px; margin-bottom: 12px; padding: 12px; overflow-x: auto; background: rgba(255,255,255,.09); color: #fff3b8; border-radius: 4px; white-space: nowrap; }
.command-guide { align-self: start; }
.mobile-steps { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.mobile-steps li { display: flex; align-items: center; gap: 11px; }
.mobile-steps li > span { width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 auto; background: var(--yellow); color: #5c481c; border-radius: 50%; font-weight: 800; }
.mobile-steps strong, .mobile-steps small { display: block; }
.mobile-steps strong { font-size: 13px; }
.mobile-steps small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.command-warning { margin-bottom: 0; }
.quick-command-list { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.quick-command-list button { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 68px; padding: 12px; border: 1px solid #d8e9df; border-radius: 7px; background: #f5faf7; color: var(--ink); text-align: left; }
.quick-command-list button:hover { border-color: #9fc8b1; transform: translateY(-1px); }
.quick-command-list span, .quick-command-list strong, .quick-command-list small { display: block; }
.quick-command-list strong { font-size: 12px; }
.quick-command-list small { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.quick-command-list b { color: var(--green); font-size: 11px; }

.empty-state { padding: 35px 20px; color: var(--muted); background: var(--soft); border-radius: 4px; text-align: center; }
.empty-state.compact { padding: 18px; font-size: 12px; }
#messageArea { max-width: 1200px; margin: 0 auto; }
.message { margin-bottom: 14px; padding: 12px 14px; border-left: 3px solid var(--blue); background: #edf4f8; color: #31536a; font-size: 13px; }
.message.error { border-left-color: var(--red); background: var(--red-soft); color: #7d342c; }

.modal-backdrop { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; background: rgba(10,24,20,.64); }
.modal { position: relative; width: min(540px, 100%); padding: 30px; background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); }
.modal h2 { margin: 0 0 20px; font-family: Georgia, "Microsoft YaHei", serif; font-size: 28px; font-weight: 500; letter-spacing: 0; }
.modal-close { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border: 0; background: var(--soft); border-radius: 3px; color: var(--muted); font-size: 22px; }
.validation-list { display: grid; gap: 8px; }
.validation-item { display: flex; align-items: center; gap: 10px; padding: 10px; background: var(--soft); border-radius: 4px; font-size: 13px; }
.validation-icon { width: 22px; height: 22px; display: grid; place-items: center; flex: 0 0 auto; background: var(--green-soft); color: var(--green); border-radius: 50%; font-size: 12px; font-weight: 700; }
.validation-item.fail .validation-icon { background: var(--red-soft); color: var(--red); }
.warning-box { display: grid; gap: 5px; margin: 18px 0; padding: 13px; border-left: 3px solid var(--yellow); background: var(--yellow-soft); }
.warning-box strong { font-size: 13px; }
.warning-box span { color: var(--muted); font-size: 12px; line-height: 1.5; }
.modal-actions { justify-content: flex-end; }
.modal-info-download { display: block; margin: 14px auto 0; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 30; max-width: min(360px, calc(100vw - 48px)); padding: 12px 16px; transform: translateY(20px); opacity: 0; pointer-events: none; background: var(--green-dark); color: white; border-radius: 4px; box-shadow: var(--shadow); transition: opacity .2s, transform .2s; font-size: 13px; }
.toast.show { transform: translateY(0); opacity: 1; }

@media (max-width: 1050px) {
  .welcome { grid-template-columns: 1fr; gap: 45px; }
  .welcome-panel { max-width: 620px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .overview-grid { grid-template-columns: 1fr; }
  .inventory-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .skill-row { grid-template-columns: 120px 1fr 110px 110px; }
  .quick-command-list { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 760px) {
  .topbar { padding: 10px 16px; }
  .local-badge { display: none; }
  .editor { display: block; }
  .sidebar { min-height: auto; }
  .save-identity, .sidebar-footer { display: none; }
  .nav { display: flex; overflow-x: auto; padding: 8px; border-bottom: 1px solid rgba(255,255,255,.1); }
  .nav-item { width: auto; min-width: max-content; }
  .nav-item.active::before { left: 10px; right: 10px; top: auto; bottom: -8px; width: auto; height: 3px; }
  .nav-item > span, .nav-item b { display: none; }
  .workspace { padding: 25px 16px 55px; }
  .workspace-head { align-items: flex-start; }
  .workspace-head h2 { font-size: 27px; }
  .head-actions .button-ghost { display: none; }
  .form-grid.three { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .inventory-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .skill-row { grid-template-columns: 1fr 1fr; }
  .skill-row .progress-track { grid-column: 1 / -1; order: 3; }
  .cheat-layout { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .brand small { display: none; }
  .brand strong { font-size: 14px; }
  .brand-mark { width: 34px; height: 34px; }
  .topbar-actions .button-ghost { display: none; }
  .welcome { padding: 48px 18px; }
  .welcome h1 { font-size: 44px; }
  .lead { font-size: 16px; }
  .sprite-parade { flex-wrap: wrap; }
  .sprite-bubble { width: 46px; height: 46px; }
  .sprite-bubble img { width: 38px; height: 38px; }
  .sprite-caption { width: 100%; margin: 3px 0 0; grid-template-columns: auto auto; justify-content: start; gap: 8px; }
  .welcome-actions { align-items: stretch; flex-direction: column; }
  .welcome-panel { padding: 22px 18px; }
  .metric-grid { grid-template-columns: 1fr; }
  .metric { min-height: 110px; }
  .section-block { padding: 18px; }
  .section-heading { flex-direction: column; }
  .section-heading .search-field { width: 100%; }
  .form-grid, .form-grid.three { grid-template-columns: 1fr; }
  .inventory-grid { grid-template-columns: 1fr; }
  .workspace-head { flex-direction: column; }
  .head-actions { width: 100%; }
  .head-actions .button-primary { width: 100%; }
  .change-item { grid-template-columns: 1fr auto; }
  .change-values { grid-column: 1 / -1; grid-row: 2; }
  .modal { padding: 26px 20px; }
  .modal-actions { align-items: stretch; flex-direction: column-reverse; }
  .cheat-switch-block { align-items: flex-start; flex-direction: column; }
  .command-fields { grid-template-columns: 1fr; }
  .quick-command-list { grid-template-columns: 1fr; }
  [data-panel="animals"] .table-wrap { overflow: visible; }
  [data-panel="animals"] table, [data-panel="animals"] tbody { display: block; }
  [data-panel="animals"] thead { display: none; }
  [data-panel="animals"] tr { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px 8px; padding: 15px 0; border-bottom: 1px solid var(--line); }
  [data-panel="animals"] tr:last-child { border-bottom: 0; }
  [data-panel="animals"] td { display: grid; min-width: 0; gap: 5px; padding: 0; border: 0; }
  [data-panel="animals"] td::before { color: var(--muted); font-size: 10px; font-weight: 700; }
  [data-panel="animals"] td:nth-child(1), [data-panel="animals"] td:nth-child(2) { grid-column: span 3; }
  [data-panel="animals"] td:nth-child(n+3) { grid-column: span 2; }
  [data-panel="animals"] td:nth-child(1)::before { content: "名字"; }
  [data-panel="animals"] td:nth-child(2)::before { content: "类型"; }
  [data-panel="animals"] td:nth-child(3)::before { content: "好感度"; }
  [data-panel="animals"] td:nth-child(4)::before { content: "心情"; }
  [data-panel="animals"] td:nth-child(5)::before { content: "饱食度"; }
  [data-panel="animals"] .table-input { width: 100%; min-width: 0; }
}
