:root {
  color-scheme: light;
  --paper: #f7f4ee;
  --ink: #18222c;
  --muted: #5e6872;
  --line: #d8d3c8;
  --panel: #ffffff;
  --teal: #0b7c77;
  --teal-soft: #d9f0ec;
  --coral: #d75a4a;
  --amber: #b7791f;
  --blue: #3867b7;
  --green: #3d7a45;
  --pending: #be6c1f;
  --shadow: 0 16px 40px rgba(24, 34, 44, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  overflow-x: hidden;
  background: linear-gradient(180deg, rgba(11, 124, 119, 0.08), transparent 340px), var(--paper);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

button, input { font: inherit; }

.app-header, .app-shell, .graph-section, .bottom-section, .disclaimer {
  width: min(1440px, calc(100% - 28px));
  margin-inline: auto;
}

.app-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0 10px;
  align-items: end;
}

.app-header h1 {
  margin: 0;
  font-size: clamp(25px, 3vw, 42px);
  line-height: 1.05;
}

.eyebrow { margin: 0 0 3px; color: var(--teal); font-size: 11px; font-weight: 900; }

.status-strip {
  min-width: 250px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
}
.status-strip strong { display: block; font-size: 22px; line-height: 1.1; }

.disclaimer {
  border: 1px solid #c84536;
  background: #fff8f5;
  color: #7d241b;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 800;
}

.app-footer {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  padding: 22px 12px 56px;
  margin-top: 18px;
  border-top: 1px solid var(--line);
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 400px);
  grid-template-areas:
    "workbench library"
    "insight library";
  gap: 14px;
  margin-top: 12px;
  align-items: start;
}
.workbench-panel { grid-area: workbench; }
.insight-panel { grid-area: insight; }
.library-panel { grid-area: library; position: sticky; top: 12px; }
.path-results { max-height: 300px; overflow: auto; padding-right: 4px; }
.cabinet-grid { max-height: 520px; overflow: auto; padding-right: 4px; }

.library-panel, .workbench-panel, .insight-panel, .graph-section,
.change-board, .radar-wrap, .effect-wrap, .lifestyle-panel {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.library-panel, .workbench-panel, .insight-panel, .graph-section {
  padding: 12px;
  min-width: 0;
}

.panel-heading, .section-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

h2, h3 { margin: 0; line-height: 1.2; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }

.count-pill, .status-pill, .effect-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  background: var(--teal-soft);
  color: #075a56;
  white-space: nowrap;
}
.status-pill.pending { background: #fff0df; color: var(--pending); }

.ghost-button, .primary-button, .icon-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  min-height: 34px;
  padding: 5px 10px;
  cursor: pointer;
  font-weight: 900;
}
.primary-button { background: var(--teal); color: #fff; border-color: var(--teal); }
.icon-button { width: 34px; padding: 0; font-size: 22px; line-height: 1; }
.ghost-button:hover { border-color: var(--teal); color: var(--teal); }
.workbench-actions { display: flex; gap: 8px; align-items: center; }
.mobile-only { display: none; }

.search-box { display: grid; gap: 5px; margin: 10px 0; color: var(--muted); font-size: 12px; font-weight: 800; }
.search-box input { width: 100%; min-height: 36px; padding: 7px 9px; border: 1px solid var(--line); background: #fff; color: var(--ink); outline: none; }
.search-box input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(11, 124, 119, 0.14); }

.filter-tabs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin: 8px 0; }
.filter-tab, .filter-option {
  border: 1px solid #d7dedb;
  background: #fff;
  color: var(--muted);
  min-height: 30px;
  padding: 4px 7px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}
.filter-tab.active, .filter-option.active {
  border-color: var(--teal);
  background: #e9f6f2;
  color: #075a56;
}
.filter-options {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  margin: 0 0 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.filter-option { flex: 0 0 auto; border-radius: 999px; min-height: 28px; }

.cabinet-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.herb-group { display: grid; gap: 7px; padding: 9px; border: 1px solid #e0d8c8; background: linear-gradient(180deg, #fffdf8, #fff); }
.herb-group-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--muted); }
.herb-group-head strong { color: #8a6736; font-size: 15px; }
.herb-group-head span { font-size: 12px; font-weight: 900; }
.herb-pill-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(172px, 1fr)); gap: 8px; }
.herb-pill {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  min-height: 64px;
  padding: 7px 8px;
  border: 1px solid #e0d8c8;
  border-radius: 999px;
  background: #f8f8f6;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.herb-pill:hover { border-color: var(--teal); background: #edf7f4; }
.pill-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: #fff; background: radial-gradient(circle at 32% 24%, #e8cc83, #0b7c77 62%); font-size: 16px; font-weight: 900; }
.pill-main { min-width: 0; display: grid; gap: 1px; }
.pill-main b { overflow: visible; text-overflow: clip; white-space: normal; font-size: 14px; line-height: 1.18; }
.pill-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 11px; }
.pill-status {
  position: static;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--teal-soft);
  color: #075a56;
  font-size: 11px;
  font-weight: 900;
}
.pill-status.pending { background: #fff0df; color: var(--pending); }
.pill-detail {
  position: absolute;
  right: 8px;
  bottom: 5px;
  color: var(--teal);
  font-size: 11px;
  font-weight: 900;
}
.herb-card { border: 1px solid #cbbf9d; background: linear-gradient(180deg, #fffaf0, #fff); padding: 9px; cursor: pointer; transition: transform 0.16s ease, box-shadow 0.16s ease; }
.herb-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(24, 34, 44, 0.1); }
.drawer-face { display: grid; grid-template-columns: 50px 1fr; gap: 9px; align-items: center; }
.herb-illustration { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; color: #fff; background: radial-gradient(circle at 30% 25%, #f2d38c, #0b7c77 58%, #075a56); font-size: 21px; font-weight: 900; box-shadow: inset 0 0 0 3px rgba(255,255,255,.4); }
.herb-illustration.large { width: 92px; height: 92px; font-size: 38px; margin: 0 auto 8px; }
.herb-topline { display: flex; justify-content: space-between; gap: 8px; align-items: start; }
.herb-name { font-size: 17px; font-weight: 900; }
.herb-meta { margin: 4px 0 6px; color: var(--muted); font-size: 12px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.effect-chip { background: #eef5ff; color: var(--blue); }
.drawer-actions { display: flex; gap: 7px; justify-content: end; margin-top: 8px; }

.furnace-stage { margin-top: 10px; display: grid; grid-template-columns: 150px 1fr; gap: 12px; align-items: center; }
.furnace-core { position: relative; min-height: 150px; display: grid; place-items: center; border: 1px solid var(--line); background: radial-gradient(circle at center, rgba(215,90,74,.14), rgba(11,124,119,.06) 58%, #fff); overflow: hidden; }
.furnace-glow { position: absolute; width: 108px; height: 108px; border-radius: 50%; background: radial-gradient(circle, rgba(215,90,74,.55), rgba(183,121,31,.18), transparent 72%); animation: pulse 2.4s ease-in-out infinite; }
.furnace-mouth { z-index: 1; display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; background: #18222c; color: #ffe8bd; font-size: 31px; font-weight: 900; border: 5px solid #b7791f; }
@keyframes pulse { 0%,100% { transform: scale(.96); opacity: .75; } 50% { transform: scale(1.08); opacity: 1; } }

.slot-grid { display: grid; grid-template-columns: repeat(5, minmax(86px, 1fr)); gap: 10px; }
.slot { min-height: 96px; border: 2px dashed #b8c7c5; background: linear-gradient(135deg, rgba(11,124,119,.08), rgba(215,90,74,.07)), #fbfcfb; display: grid; place-items: center; padding: 7px; position: relative; }
.slot.drag-over { border-color: var(--teal); background: #eefaf8; }
.slot-empty { color: #71807e; text-align: center; font-size: 13px; font-weight: 900; }
.slot-herb { width: 100%; min-height: 76px; display: grid; align-content: center; gap: 4px; text-align: center; background: #fff; border: 1px solid rgba(11,124,119,.28); padding: 8px 7px; }
.slot-herb strong { font-size: 16px; }
.remove-slot { position: absolute; top: 5px; right: 5px; width: 26px; height: 26px; border: 0; background: var(--coral); color: #fff; cursor: pointer; font-weight: 900; }

.conflict-panel { margin-top: 10px; }
.conflict-alert { padding: 9px; border: 1px solid #c84536; background: #fff6f2; color: #7d241b; font-size: 13px; }
.conflict-alert strong { display: block; color: #7d241b; }
.conflict-alert p { margin: 6px 0; }

.change-board { margin-top: 10px; padding: 10px; display: grid; grid-template-columns: 118px 1fr; gap: 10px; align-items: start; }
.delta-log { color: var(--muted); }
.delta-token { display: inline-flex; margin: 0 6px 6px 0; padding: 4px 8px; background: #eef5ff; color: var(--blue); font-weight: 900; }
.delta-token.down { background: #fff0df; color: var(--pending); }
.delta-token.new { background: var(--teal-soft); color: #075a56; }

.visual-band { display: grid; grid-template-columns: 380px 1fr; gap: 10px; margin-top: 10px; }
.radar-wrap, .effect-wrap { padding: 10px; }
#radarCanvas { width: 100%; max-width: 360px; height: auto; display: block; margin: 8px auto 0; }
.effect-bars { display: grid; gap: 8px; margin-top: 8px; max-height: 285px; overflow: auto; padding-right: 4px; }
.effect-bar { display: grid; grid-template-columns: 76px 1fr 36px; gap: 8px; align-items: center; font-size: 13px; }
.bar-track { height: 12px; background: #e8e4da; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--teal), var(--blue)); }
.bar-source { grid-column: 2 / 4; color: var(--muted); font-size: 12px; display: none; }
.effect-bar:hover .bar-source { display: block; }

.lifestyle-panel { margin-top: 10px; padding: 10px; }
.lifestyle-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 8px; margin-top: 8px; }
.lifestyle-card {
  display: grid;
  gap: 4px;
  min-height: 92px;
  padding: 9px;
  border: 1px solid #cfe4dd;
  background: linear-gradient(180deg, #fbfdfb, #edf7f4);
}
.lifestyle-card.movement { border-color: #d4d0e8; background: linear-gradient(180deg, #fdfcff, #f0eef9); }
.lifestyle-card.rest { border-color: #e3d2b6; background: linear-gradient(180deg, #fffdf8, #f7efe1); }
.lifestyle-card span { color: var(--teal); font-size: 11px; font-weight: 900; }
.lifestyle-card strong { color: var(--ink); font-size: 14px; line-height: 1.25; }
.lifestyle-card small, .lifestyle-card em { color: var(--muted); font-size: 12px; font-style: normal; }

.quick-symptoms { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.symptom-button { border: 1px solid #ccd7d6; background: #fff; padding: 5px 8px; cursor: pointer; color: var(--ink); font-size: 13px; }
.symptom-button:hover { border-color: var(--teal); background: var(--teal-soft); }
.path-results { display: grid; gap: 10px; }
.association-cards { display: grid; gap: 10px; }
.path-card { border: 1px solid var(--line); background: #fff; padding: 9px; }
.path-card strong { display: block; margin-bottom: 6px; }
.path-line { color: var(--muted); font-size: 14px; }

.graph-section { margin-top: 12px; }
.graph-scroll { width: 100%; overflow-x: auto; border: 1px solid var(--line); background: #fcfdfb; }
.graph-legend { display: flex; gap: 12px; flex-wrap: wrap; margin: 8px 0; color: var(--muted); font-size: 12px; }
.legend { display: inline-block; width: 11px; height: 11px; margin-right: 5px; border-radius: 999px; vertical-align: -1px; background: #c5cbd0; }
.legend.source-ok { background: var(--green); }
.legend.source-pending { background: var(--amber); }
.knowledge-graph { width: 100%; min-width: 900px; min-height: 520px; display: block; background: linear-gradient(90deg, rgba(11,124,119,.07) 1px, transparent 1px), linear-gradient(180deg, rgba(11,124,119,.07) 1px, transparent 1px), #fcfdfb; background-size: 36px 36px; }
.graph-edge { fill: none; stroke: #0b7c77; stroke-width: 1.7; opacity: .5; stroke-linecap: round; }
.node-circle { stroke: #fff; stroke-width: 3; fill: #0b7c77; }
.node-circle.herb { fill: var(--coral); }
.node-circle.pending { stroke: var(--amber); }
.node-circle.verified { stroke: var(--green); }
.node-label { font-size: 13px; font-weight: 900; fill: var(--ink); text-anchor: middle; }
.node-kind { font-size: 10px; fill: var(--muted); text-anchor: middle; }

.bottom-section { background: rgba(255,255,255,.88); border: 1px solid var(--line); box-shadow: var(--shadow); padding: 12px; margin-top: 12px; }
.assoc-group { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.assoc-kind { color: var(--teal); font-size: 11px; font-weight: 900; min-width: 36px; }
.assoc-chip { display: inline-flex; align-items: center; min-height: 28px; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 900; border: 2px solid var(--green); background: #edf8f0; color: #1d5a2a; white-space: nowrap; }
.assoc-chip.pending { border-color: var(--amber); background: #fff8ed; color: #82440f; }
.empty-state { color: var(--muted); border: 1px dashed var(--line); padding: 9px; background: rgba(255,255,255,.68); font-size: 13px; }

.mini-workbench { display: none; }
.assistant-toggle { position: fixed; right: 18px; bottom: 18px; z-index: 45; width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--teal); color: #fff; box-shadow: 0 12px 30px rgba(24,34,44,.24); font-size: 18px; letter-spacing: .5px; font-weight: 900; cursor: pointer; }
.assistant-panel { position: fixed; right: 18px; bottom: 82px; z-index: 44; width: min(370px, calc(100% - 36px)); max-height: 68vh; overflow: auto; padding: 11px; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 18px 44px rgba(24,34,44,.2); transform: translateY(18px); opacity: 0; pointer-events: none; transition: .18s ease; font-size: 12px; line-height: 1.5; }
.assistant-panel.is-open { transform: translateY(0); opacity: 1; pointer-events: auto; }
.assistant-head { display: flex; justify-content: space-between; gap: 10px; align-items: start; }
.assistant-head h2 { font-size: 18px; }
.assistant-body { display: grid; gap: 7px; color: var(--muted); }
.assistant-context { display: grid; grid-template-columns: 38px 1fr; gap: 8px; align-items: baseline; min-width: 0; margin-bottom: 4px; }
.assistant-context span { color: var(--teal); font-size: 12px; font-weight: 900; }
.assistant-context b { min-width: 0; color: var(--ink); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assistant-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.assistant-tags span { display: inline-flex; align-items: center; min-height: 22px; padding: 2px 7px; background: #eef7f4; border: 1px solid #cfe4dd; color: #075a56; font-size: 12px; font-weight: 900; }
.assistant-options-title { display: flex; align-items: center; gap: 8px; color: var(--teal); font-size: 12px; font-weight: 900; }
.assistant-options-title::after { content: ""; height: 1px; flex: 1; background: linear-gradient(90deg, var(--line), transparent); }
.assistant-guides { display: flex; flex-wrap: wrap; gap: 6px; }
.guide-button { border: 1px solid #c8d8d4; background: linear-gradient(180deg, #fbfdfb, #edf7f4); color: var(--ink); padding: 5px 9px; cursor: pointer; font-size: 13px; font-weight: 900; box-shadow: inset 0 -1px 0 rgba(11,124,119,.08); }
.guide-button:hover { border-color: var(--teal); color: #075a56; background: #e8f5f1; }
.assistant-form { display: grid; gap: 8px; }
.assistant-form label { display: grid; gap: 5px; font-size: 12px; font-weight: 900; color: var(--muted); }
.assistant-question { width: 100%; resize: vertical; min-height: 58px; border: 1px solid var(--line); padding: 7px 8px; color: var(--ink); outline: none; font-size: 12px; line-height: 1.42; }
.assistant-question:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(11, 124, 119, 0.14); }
.guide-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.assistant-panel .primary-button, .assistant-panel .ghost-button { min-height: 32px; padding: 5px 12px; font-size: 13px; }
.assistant-submit[disabled] { opacity: .58; cursor: wait; }
.assistant-status { font-size: 12px; font-weight: 900; color: var(--muted); }
.assistant-status.loading { color: var(--blue); }
.assistant-status.ok { color: var(--teal); }
.assistant-status.fallback, .assistant-status.error { color: var(--pending); }
.assistant-answer, .assistant-placeholder { border: 1px solid var(--line); background: #fff; padding: 9px; }
.assistant-answer { color: var(--ink); white-space: normal; font-size: 12px; line-height: 1.5; }
.assistant-answer h3, .assistant-answer h4, .assistant-answer h5 { margin: 8px 0 4px; color: var(--ink); font-size: 14px; }
.assistant-answer h3:first-child, .assistant-answer h4:first-child, .assistant-answer h5:first-child { margin-top: 0; }
.assistant-answer p { margin: 0 0 8px; }
.assistant-answer p:last-child { margin-bottom: 0; }
.assistant-answer ul, .assistant-answer ol { margin: 0 0 10px; padding-left: 22px; }
.assistant-answer li { margin: 4px 0; }
.assistant-answer strong { color: var(--ink); }
.assistant-answer code { padding: 1px 4px; background: #f3f0e8; border: 1px solid var(--line); font-family: Consolas, monospace; font-size: 90%; }
.markdown-table-wrap { width: 100%; overflow-x: auto; margin: 8px 0 12px; border: 1px solid var(--line); }
.assistant-answer table { width: 100%; min-width: 390px; border-collapse: collapse; background: #fff; font-size: 12px; }
.assistant-answer th, .assistant-answer td { border-bottom: 1px solid var(--line); padding: 6px 7px; text-align: left; vertical-align: top; }
.assistant-answer th { background: #f7f4ee; color: var(--ink); font-weight: 900; white-space: nowrap; }
.assistant-answer tr:last-child td { border-bottom: 0; }
.assistant-placeholder { border-style: dashed; }
.assistant-review-alert { border: 1px solid var(--pending); background: #fff8ef; color: #82440f; padding: 10px; font-size: 12px; font-weight: 900; }

.herb-modal { position: fixed; inset: 0; z-index: 60; display: none; place-items: center; padding: 18px; background: rgba(24,34,44,.55); }
.herb-modal.is-open { display: grid; }
.herb-orbit { position: relative; width: min(760px, 100%); min-height: 520px; background: radial-gradient(circle at center, #fff 0 25%, #fffaf1 26% 100%); border: 1px solid var(--line); box-shadow: 0 30px 80px rgba(0,0,0,.22); padding: 28px; overflow: hidden; }
.modal-close { position: absolute; right: 14px; top: 14px; z-index: 3; }
.orbit-center { position: absolute; left: 50%; top: 50%; width: 230px; transform: translate(-50%, -50%); text-align: center; z-index: 2; }
.orbit-center p { color: var(--muted); }
.orbit-items { position: absolute; inset: 0; }
.orbit-item { position: absolute; width: 210px; min-height: 84px; padding: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.92); box-shadow: 0 10px 24px rgba(24,34,44,.08); }
.orbit-item b { display: block; color: var(--teal); margin-bottom: 4px; }
.orbit-item span { color: var(--muted); font-size: 13px; }
.orbit-0 { left: 40px; top: 40px; }
.orbit-1 { right: 40px; top: 40px; }
.orbit-2 { left: 26px; top: 220px; }
.orbit-3 { right: 26px; top: 220px; }
.orbit-4 { left: 95px; bottom: 34px; }
.orbit-5 { right: 95px; bottom: 34px; }

.library-actions { display: flex; gap: 8px; align-items: center; }

/* ---- 中药柜弹窗 ---- */
.cabinet-modal {
  position: fixed; inset: 0; z-index: 75;
  background: rgba(24,34,44,.72);
  display: none; place-items: center; padding: 24px;
}
.cabinet-modal.is-open { display: grid; }
.cabinet-close {
  position: fixed; top: 18px; right: 18px; z-index: 76;
  width: 42px; height: 42px; border-radius: 50%;
  background: #fff; color: var(--ink);
  border: 2px solid var(--line);
  box-shadow: 0 6px 20px rgba(0,0,0,.3);
  font-size: 22px; cursor: pointer;
}
.cabinet-drawers {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 4px; padding: 28px;
  background: linear-gradient(135deg, #5c2d1a, #7a4228 28%, #94603a 55%, #7a4228);
  border: 10px solid #3e1c0e;
  outline: 3px solid #d4a96a;
  box-shadow: 0 0 0 6px #2e1208, 0 28px 60px rgba(0,0,0,.55);
  border-radius: 4px;
  max-width: 860px; width: 100%;
  max-height: 84vh; overflow: auto;
}
.cabinet-drawer {
  display: grid; place-items: center; align-content: center;
  min-height: 80px;
  background: linear-gradient(180deg, rgba(255,245,215,.20), rgba(0,0,0,.08));
  border: 2px solid #2e1208;
  border-radius: 2px;
  color: #ffe8c0;
  cursor: pointer;
  font-weight: 900;
  text-shadow: 0 1px 2px rgba(0,0,0,.5);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.10), inset 0 -3px 0 rgba(0,0,0,.35);
  transition: .12s ease;
  user-select: none;
}
.cabinet-drawer:hover {
  background: rgba(255,245,215,.38);
  border-color: #d4a96a;
  color: #fff;
  transform: scale(1.06);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.18), inset 0 -3px 0 rgba(0,0,0,.20), 0 4px 14px rgba(0,0,0,.4);
}
.cabinet-drawer .drawer-char { font-size: 24px; line-height: 1.1; }
.cabinet-drawer .drawer-name { font-size: 12px; margin-top: 2px; opacity: .9; }

@media (max-width: 1180px) {
  .visual-band, .furnace-stage { grid-template-columns: 1fr; }
  .cabinet-grid { max-height: none; }
}

@media (max-width: 860px) {
  .app-shell { display: flex; flex-direction: column; }
  .workbench-panel, .insight-panel, .library-panel { grid-row: auto; }
  .library-panel { position: static; }
  .workbench-panel { order: 1; }
  .library-panel { order: 2; }
  .insight-panel { order: 3; }
}

@media (max-width: 760px) {
  .app-header, .app-shell, .graph-section, .bottom-section, .disclaimer { width: auto; max-width: none; margin-left: 16px; margin-right: 16px; overflow-wrap: anywhere; }
  .app-header { display: block; padding: 10px 0 8px; }
  .app-header h1 { font-size: 25px; }
  .status-strip { margin-top: 8px; min-width: 0; padding: 7px 9px; }
  .status-strip strong { font-size: 20px; }
  .disclaimer { padding: 6px 9px; font-size: 11px; }
  .mobile-only { display: inline-flex; }
  .library-panel, .workbench-panel, .insight-panel, .graph-section, .bottom-section { width: auto; max-width: 100%; padding: 10px; overflow: hidden; }
  .slot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); overflow-x: hidden; max-width: 100%; gap: 8px; }
  .slot { min-height: 88px; }
  .visual-band { gap: 8px; }
  #radarCanvas { max-width: 280px; }
  .effect-bars { max-height: 238px; }
  .effect-bar { grid-template-columns: 58px 1fr 32px; gap: 7px; font-size: 13px; }
  .knowledge-graph { width: 100%; min-width: 0; min-height: 260px; height: 300px; }
  .graph-scroll { max-height: 340px; overflow-x: hidden; }
  .mini-workbench { position: fixed; right: 10px; bottom: 12px; left: auto; z-index: 50; display: flex; gap: 8px; align-items: center; min-height: 40px; padding: 6px 12px; border: 1px solid rgba(11,124,119,.28); border-radius: 999px; background: rgba(255,255,255,.96); color: var(--ink); box-shadow: 0 8px 24px rgba(24,34,44,.18); opacity: 0; transform: translateY(90px); pointer-events: none; transition: .18s ease; text-align: left; max-width: 72vw; }
  .mini-workbench.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
  .mini-count { display: inline-grid; place-items: center; min-width: 36px; height: 28px; border-radius: 999px; background: var(--teal); color: #fff; font-size: 12px; font-weight: 900; }
  .mini-herbs { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 900; font-size: 12px; }
  .mini-action { color: var(--teal); font-size: 11px; font-weight: 900; white-space: nowrap; }
  .assistant-toggle { bottom: 76px; right: 12px; width: 46px; height: 46px; font-size: 16px; }
  .assistant-panel { right: 10px; bottom: 128px; width: calc(100% - 20px); max-height: 64vh; padding: 10px; font-size: 12px; }
  .assistant-head h2 { font-size: 16px; }
  .assistant-guides { gap: 5px; }
  .guide-button { padding: 4px 8px; font-size: 12px; }
  .assistant-panel .primary-button, .assistant-panel .ghost-button { min-height: 30px; padding: 4px 10px; font-size: 12px; }
  .herb-orbit { min-height: 480px; max-height: 92vh; padding: 14px; }
  .orbit-center { width: 150px; }
  .herb-illustration.large { width: 64px; height: 64px; font-size: 28px; }
  .orbit-center h2 { font-size: 16px; }
  .orbit-center p { font-size: 12px; }
  .orbit-item { width: 140px; min-height: 52px; padding: 7px; font-size: 11px; }
  .orbit-item b { font-size: 11px; margin-bottom: 2px; }
  .orbit-item span { font-size: 10px; }
  .orbit-0 { left: 6px; top: 8px; }
  .orbit-1 { right: 6px; top: 8px; }
  .orbit-2 { left: 2px; top: 170px; }
  .orbit-3 { right: 2px; top: 170px; }
  .orbit-4 { left: 28px; bottom: 18px; }
  .orbit-5 { right: 28px; bottom: 18px; }
  .cabinet-drawers { grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); padding: 16px; gap: 3px; }
  .cabinet-drawer { min-height: 64px; }
  .cabinet-drawer .drawer-char { font-size: 18px; }
  .cabinet-drawer .drawer-name { font-size: 10px; }
}
