:root {
  color-scheme: light;
  font: 15px/1.55 "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: #2c3b34;
  background: #f6f6ef;
  --ink: #283e34;
  --muted: #5d6a62;
  --border: #dce2d8;
  --green: #315c4d;
  --green-dark: #234638;
  --surface: #fffffb;
  --soft: #edf1e9;
  --danger: #872d2c;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible, .table-scroll:focus-visible {
  outline: 3px solid #598b70;
  outline-offset: 2px;
}
h1, h2, h3, p { margin: 0; }
h1 { color: var(--ink); font-size: clamp(1.65rem, 3vw, 2.25rem); line-height: 1.15; }
h2 { color: var(--ink); font-size: 1.35rem; }
h3 { margin-bottom: .5rem; color: var(--ink); font-size: 1rem; }
a { color: var(--green-dark); text-underline-offset: .2em; overflow-wrap: anywhere; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: .48rem .82rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap;
}
.button:hover:not(:disabled) { background: var(--soft); }
.button.primary { background: var(--green); border-color: var(--green); color: #fff; }
.button.primary:hover:not(:disabled) { background: var(--green-dark); }
.button.danger { color: var(--danger); border-color: #dfc3bf; }
.button.danger:hover:not(:disabled) { background: #faebe7; }

input, select, textarea {
  display: block;
  min-height: 39px;
  width: 100%;
  padding: .45rem .62rem;
  border: 1px solid #cbd6ca;
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
}
textarea { resize: vertical; min-height: 96px; }
label { display: grid; gap: .35rem; color: var(--muted); font-size: .87rem; }

.sign-in {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: radial-gradient(ellipse at 20% 10%, #e1e9db, #f6f6ef 66%);
}
.sign-in-form {
  display: grid;
  gap: .75rem;
  width: min(100%, 368px);
  padding: 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 11px;
  box-shadow: 0 14px 40px #223c2910;
}
.sign-in-form h1 { margin: .4rem 0 .5rem; font-size: 1.65rem; }
.sign-in-form .button { margin-top: .55rem; }
.sign-in-brand, .brand { display: flex; gap: .7rem; align-items: center; font-size: 1.2rem; font-weight: 700; }
.seal {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 33px;
  height: 36px;
  border: 1px solid currentColor;
  border-radius: 3px;
  color: #a66152;
  font: 700 1.3rem "Songti SC", SimSun, serif;
}

.console { display: grid; grid-template-columns: 214px minmax(0, 1fr); min-height: 100vh; }
.sidebar { padding: 1.7rem 1.15rem; background: #253d34; color: #f3f5ed; }
.sidebar .seal { color: #e6ab9a; }
.sidebar .brand { padding: 0 .65rem; margin-bottom: 2rem; }
.nav-label { margin: 1.1rem 0 .32rem; padding: 0 .65rem; color: #b1c3b4; font-size: .78rem; }
.sidebar nav button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .35rem;
  width: 100%;
  min-height: 41px;
  padding: .46rem .65rem;
  border: 0;
  border-radius: 6px;
  background: none;
  color: inherit;
  text-align: left;
}
.sidebar nav button:hover { background: #354d41; }
.sidebar nav button[aria-current="page"] { background: #dce8d9; color: #213a2f; font-weight: 700; }
.nav-note { color: #c0c9b9; font-size: .72rem; }
.sidebar nav button[aria-current="page"] .nav-note { color: #4b6152; }

.workspace { min-width: 0; }
.topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 67px;
  padding: .7rem clamp(1rem, 4vw, 3rem);
  background: #fdfdf7;
  border-bottom: 1px solid var(--border);
}
.topline p { color: var(--muted); font-weight: 600; font-size: .9rem; }
.account { display: flex; align-items: center; gap: .8rem; min-width: 0; }
#operator { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.workspace-body { max-width: 1450px; margin: auto; padding: 2.45rem clamp(1rem, 4vw, 3rem); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.45rem; }
.section-heading p { margin-top: .52rem; color: var(--muted); }
.panel { border: 1px solid var(--border); border-radius: 9px; background: var(--surface); overflow: hidden; }
.table-toolbar { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: .7rem; padding: 1rem 1.2rem; }
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: .62rem; }
.filters input { width: 220px; max-width: 100%; }
.filters select { min-width: 118px; }
.table-scroll { overflow: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: .7rem .94rem; vertical-align: middle; border-bottom: 1px solid #e7ece4; }
th:first-child, td:first-child { padding-left: 1.2rem; }
th:last-child, td:last-child { padding-right: 1.2rem; }
th { background: #edf1e9; color: #52675b; font-size: .83rem; white-space: nowrap; }
td { font-size: .88rem; }
tbody tr:hover { background: #fafbf6; }
td:first-child { width: 48%; }
.row-title { display: block; max-width: 38rem; overflow-wrap: anywhere; font-size: .98rem; font-weight: 700; }
.row-description { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--muted); overflow-wrap: anywhere; }
.record-cell { display: flex; align-items: center; gap: .64rem; min-width: 155px; }
.record-cell > div { min-width: 0; }
.thumbnail { width: 45px; height: 45px; flex: none; border-radius: 5px; background: var(--soft); object-fit: cover; }
.nowrap { white-space: nowrap; }
.status { display: inline-block; padding: .12rem .48rem; border-radius: 4px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.status-neutral { background: #edf0ec; color: #495b52; }
.status-pending { background: #f7efda; color: #765221; }
.status-good { background: #e6efe4; color: #305843; }
.status-bad { background: #f6e9e5; color: #853e35; }
.empty { padding: 2.35rem 1rem; color: var(--muted); text-align: center; }
.pagination { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .65rem; padding: .75rem 1.2rem; color: var(--muted); font-size: .88rem; }
.pagination > div { display: flex; gap: .45rem; }
.recognition { padding: 2rem; }
.recognition h2 { margin: .6rem 0 .4rem; }
.recognition p { color: var(--muted); }

.message { margin-bottom: 1rem; padding: .63rem .85rem; border-radius: 5px; overflow-wrap: anywhere; }
.message.error { background: #f8ece7; color: var(--danger); }
.message.success { background: #e6efe3; color: #2d5641; }
.sign-in-form .message { margin: 0; }
dialog {
  width: min(620px, calc(100% - 2rem));
  max-height: min(86vh, 810px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--ink);
  background: var(--surface);
}
dialog::backdrop { background: #152d25a3; }
.dialog-heading, .dialog-actions {
  position: sticky;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .6rem;
  background: var(--surface);
  padding: .84rem 1.25rem;
}
.dialog-heading { top: 0; border-bottom: 1px solid var(--border); }
.dialog-heading h2 { overflow-wrap: anywhere; }
.dialog-actions { bottom: 0; justify-content: flex-end; flex-wrap: wrap; border-top: 1px solid var(--border); }
.dialog-actions:empty { display: none; }
.dialog-body { padding: 1.15rem 1.25rem; }
.dialog-body section + section { margin-top: 1rem; }
.dialog-body .detail-copy { white-space: pre-wrap; overflow-wrap: anywhere; }
.dialog-body .record-fields { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .36rem .85rem; margin: 0 0 1rem; }
.record-fields dt { color: var(--muted); }
.record-fields dd { margin: 0; overflow-wrap: anywhere; }
.pictures { display: grid; grid-template-columns: repeat(auto-fit, minmax(105px, 1fr)); gap: .6rem; }
.pictures a { display: block; }
.pictures img { display: block; width: 100%; height: 110px; border-radius: 5px; background: var(--soft); object-fit: contain; }
.dialog-body form { display: grid; gap: .65rem; }
.dialog-body textarea { margin-top: .2rem; }
#detail-error { margin: 0 1.25rem .8rem; }

@media (max-width: 920px) {
  .console { grid-template-columns: 164px minmax(0, 1fr); }
  .sidebar { padding: 1.3rem .75rem; }
  .workspace-body { padding-top: 1.5rem; }
}
@media (max-width: 680px) {
  .console { display: block; }
  .sidebar { padding: .75rem 1rem; }
  .sidebar .brand { margin: 0 0 .6rem; }
  .sidebar nav { display: flex; flex-wrap: wrap; gap: .28rem; }
  .sidebar nav button { width: auto; min-height: 36px; font-size: .82rem; }
  .nav-label { display: none; }
  .topline { min-height: 54px; }
  .table-toolbar, .pagination { padding-left: .78rem; padding-right: .78rem; }
  .filters input { width: min(220px, 100%); }
  th, td { padding: .6rem .66rem; }
  .section-heading { align-items: start; }
}
