:root {
  color-scheme: light;
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  color: #1b3028;
  background: #f5f7f3;
  --ink: #1b3028;
  --muted: #596d62;
  --line: #dce5dc;
  --primary: #216340;
  --primary-hover: #1a5135;
  --soft: #edf4ec;
  --surface: #fff;
  --danger: #9b3434;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; }
button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 39px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
button:hover, .button:hover { background: var(--soft); }
button:disabled { cursor: default; opacity: .52; }
button.primary, .button.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
button.primary:not(:disabled):hover, .button.primary:hover { background: var(--primary-hover); }
button.danger { color: var(--danger); }
input:not([type="checkbox"], [type="radio"], [type="file"]), select, textarea {
  width: 100%;
  min-width: 0;
  min-height: 43px;
  border: 1px solid #d5dfd6;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  outline: none;
  font-size: 14px;
}
textarea { display: block; min-height: 111px; resize: vertical; line-height: 1.65; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid #47835c; outline-offset: 2px; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); width: 16px; height: 16px; margin: 0; flex: 0 0 auto; }
input::placeholder, textarea::placeholder { color: #667970; }
a { color: var(--primary); }
code, .mono { font-family: "Cascadia Mono", Consolas, monospace; overflow-wrap: anywhere; font-size: 12px; }

.shell { min-height: 100vh; display: grid; grid-template-columns: 226px minmax(0, 1fr); }
.sidebar {
  grid-column: 1;
  position: sticky;
  height: 100vh;
  top: 0;
  display: flex;
  flex-direction: column;
  padding: 27px 16px 20px;
  background: #152f26;
  color: #f2f8f3;
  overflow: auto;
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: inherit; }
.sidebar .brand { padding: 0 9px 28px; }
.brand strong { display: block; font-size: 16px; overflow-wrap: anywhere; }
.brand small { display: block; color: #a9c0b2; font-size: 11px; margin-top: 3px; }
.brand-mark { display: grid; place-items: center; flex: 0 0 36px; height: 36px; border-radius: 10px; background: #c9ebac; color: #193e29; font-weight: 800; font-size: 25px; line-height: 1; }
.nav-label { padding: 13px 11px 7px; color: #a9c0b2; font-size: 11px; }
.nav-item { display: flex; align-items: center; gap: 11px; margin: 2px 0; padding: 10px 11px; border: 1px solid transparent; border-radius: 8px; color: #e3eee5; text-decoration: none; font-size: 14px; }
.nav-item:hover { background: #244438; }
.nav-item[aria-current="page"] { border-color: #588168; background: #315542; color: #f1ffe7; font-weight: 700; }
.nav-icon { display: inline-grid; place-items: center; width: 20px; font-size: 17px; line-height: 1; color: #b7d7bf; }
.sidebar-footer { margin-top: auto; padding: 18px 8px 0; display: grid; gap: 10px; }
.sidebar-footer a { font-size: 13px; color: #e3eee5; text-decoration: none; }
.sidebar-footer button { justify-self: start; }
.side-mode { border-top: 1px solid #365247; margin-top: 2px; padding-top: 12px; font-size: 12px; color: #c0d6c8; display: flex; align-items: center; gap: 8px; }
.side-mode i, .state-dot { width: 8px; height: 8px; border-radius: 50%; background: #87c294; display: inline-block; }

.workspace { min-width: 0; }
.topbar { height: 65px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding: 0 32px; background: #fff; font-size: 13px; color: var(--muted); }
.topbar strong { color: var(--ink); }
.crumb { padding: 0 8px; color: #74877b; }
#main { width: min(100%, 1500px); margin: 0 auto; padding: 29px 32px 46px; outline: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 22px; margin-bottom: 23px; flex-wrap: wrap; }
.page-head h1, .catalog h1 { font-size: clamp(27px, 3vw, 37px); line-height: 1.22; letter-spacing: -.035em; }
.page-head p, .catalog-intro p { margin-top: 8px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 9px; background: var(--soft); color: #2b613d; font-size: 12px; white-space: nowrap; }
.badge.warning { color: #724b16; background: #f9f1de; }
.badge.error { background: #f8e9e9; color: var(--danger); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 17px; border-bottom: 1px solid var(--line); }
.tabs button { border: 0; border-radius: 7px 7px 0 0; border-bottom: 2px solid transparent; min-height: 42px; background: transparent; color: var(--muted); }
.tabs button:hover { background: var(--soft); }
.tabs button[aria-selected="true"] { border-bottom-color: var(--primary); color: var(--primary); background: #e9f1e7; }
.grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.grid.equal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stack { display: grid; gap: 18px; }
.below, .grid + .stack { margin-top: 14px; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: 0 2px 5px #213e2810; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.panel-heading h2, .dialog-head h2 { font-size: 17px; }
.panel-heading p, .dialog-head p { margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.panel-body { padding: 17px 20px; }
.panel + .panel, .grid + .panel, .grid + .grid { margin-top: 18px; }
.stack > .panel + .panel { margin-top: 0; }
.panel-body > .table-wrap { margin: 0 -20px; }
.fields { display: grid; gap: 14px; }
.two-fields { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field { display: grid; gap: 7px; align-content: start; min-width: 0; }
.field > span:first-child { font-size: 13px; font-weight: 700; }
.hint { color: var(--muted); font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.actions.end { justify-content: flex-end; }
.actions.split { justify-content: space-between; }
.choice-list { display: grid; gap: 3px; margin-top: 10px; max-height: 351px; min-height: 72px; overflow: auto; }
.choice { display: flex; gap: 11px; align-items: center; min-height: 53px; padding: 7px 9px; border: 1px solid transparent; border-radius: 8px; cursor: pointer; font-size: 13px; min-width: 0; }
.choice:hover { background: #f3f7f2; }
.choice:has(input:checked) { background: #f0f6ed; border-color: #cddfcf; }
.choice strong { display: block; overflow-wrap: anywhere; }
.choice small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.avatar { display: inline-grid; place-items: center; flex: 0 0 33px; height: 33px; border-radius: 9px; color: #2c6441; background: #e2f0dc; font-size: 13px; font-weight: 700; }
.choice:nth-child(3n+2) .avatar { background: #e9eef7; color: #3b5879; }
.choice:nth-child(3n) .avatar { background: #f6eedc; color: #725521; }
.selection-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.selection-tools button { min-height: 30px; padding: 5px 8px; font-size: 12px; }
.image-field { padding: 12px; background: #f9fbf8; border: 1px dashed #bacfbd; border-radius: 8px; }
.image-field input { max-width: 100%; font-size: 12px; }
.image-field input::file-selector-button { background: #e9f1e8; border: 0; color: var(--ink); padding: 6px 8px; border-radius: 5px; cursor: pointer; margin-right: 10px; }
.photo-preview { display: block; max-height: 100px; max-width: 100%; border-radius: 5px; margin-top: 8px; }
.search-line { display: flex; gap: 8px; }
.lookup { min-height: 28px; }
.lookup strong { display: block; margin: 4px 0; overflow-wrap: anywhere; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; text-align: left; }
th, td { padding: 12px 16px; border-bottom: 1px solid #e9eee9; }
th { background: #f7faf7; color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; }
td { overflow-wrap: anywhere; }
tr:last-child td { border-bottom: 0; }
td small { display: block; font-size: 11px; color: var(--muted); margin-top: 3px; }
td button { min-height: 32px; padding: 5px 9px; }
.empty { text-align: center; padding: 28px 14px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.compact-list { list-style: none; margin: 0; padding: 0; }
.compact-list li { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.compact-list li:first-child { padding-top: 0; }
.compact-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 19px; }
.metric { display: grid; gap: 9px; padding: 18px 19px; border: 1px solid var(--line); border-radius: 12px; background: #fff; text-decoration: none; color: var(--muted); font-size: 13px; }
.metric:hover { border-color: #8ab095; }
.metric strong { color: var(--primary); font-size: 28px; }
.note { padding: 12px; background: #edf5ec; border: 1px solid #dce9dd; border-radius: 8px; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.note.error { background: #f9eded; border-color: #eed7d7; color: var(--danger); }
.guide-list { padding-left: 23px; margin: 0; display: grid; gap: 15px; line-height: 1.65; font-size: 14px; }

.startup { display: grid; min-height: 100vh; padding: 20px; place-items: center; }
.startup .panel { width: min(100%, 430px); }
dialog { width: min(calc(100% - 24px), 580px); max-height: calc(100% - 32px); border-radius: 13px; padding: 0; border: 1px solid var(--line); color: var(--ink); background: white; }
dialog::backdrop { background: #142e25a0; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 19px; border-bottom: 1px solid var(--line); }
.dialog-head button { width: 35px; padding: 0; font-size: 18px; }
.toast { position: fixed; bottom: 18px; right: 18px; z-index: 10; max-width: min(420px, calc(100% - 36px)); padding: 12px 15px; border-radius: 8px; color: white; background: #234735; box-shadow: 0 5px 16px #152f2630; font-size: 14px; overflow-wrap: anywhere; }
.toast.error { background: #762f2f; }

.catalog-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #152f26; color: white; padding: 16px max(20px, calc((100% - 1080px) / 2)); }
.catalog-main { width: min(100% - 34px, 1080px); margin: 24px auto 48px; }
.catalog-intro { border-radius: 13px; background: #e7f1e3; padding: 25px; margin-bottom: 16px; }
.catalog-note { margin-bottom: 13px; }
.catalog-tools { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr) minmax(130px, 210px); padding: 16px 20px 0; }
.catalog-list { padding: 16px 20px; display: grid; gap: 13px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.catalog-list .empty { grid-column: 1 / -1; }
.catalog-card { padding: 15px; border: 1px solid var(--line); border-radius: 10px; display: grid; gap: 9px; }
.catalog-card h3 { font-size: 16px; }
.catalog-card p, #contact { font-size: 13px; line-height: 1.65; color: var(--muted); white-space: pre-line; }
#contact { margin-top: 17px; }

@media (max-width: 1000px) {
  .shell { grid-template-columns: 176px minmax(0, 1fr); }
  #main, .topbar { padding-left: 19px; padding-right: 19px; }
}
@media (max-width: 800px) {
  .grid, .grid.equal { grid-template-columns: minmax(0, 1fr); }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .shell { display: block; }
  .sidebar { position: static; height: auto; padding: 12px; }
  .sidebar .brand { padding: 0 4px 9px; }
  .sidebar nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .nav-label { display: none; }
  .nav-item { padding: 5px 7px; font-size: 12px; gap: 3px; margin: 0; }
  .nav-icon { width: 14px; font-size: 12px; }
  .sidebar-footer { display: flex; align-items: center; justify-content: space-between; padding: 8px 4px 0; }
  .side-mode { border: 0; padding: 0; }
  .topbar { height: 47px; }
  .topbar button { min-height: 32px; }
  #main { padding: 19px 12px 30px; }
  .page-head { margin-bottom: 14px; }
  .panel-heading, .panel-body { padding: 13px; }
  .panel-body > .table-wrap { margin: 0 -13px; }
  .table-wrap table { min-width: 530px; }
  .two-fields, .catalog-list, .catalog-tools { grid-template-columns: minmax(0, 1fr); }
}
