:root {
  color-scheme: light;
  --ink: #163633;
  --muted: #546a64;
  --paper: #f6f7f3;
  --surface: #fff;
  --line: #dae3da;
  --teal: #145e51;
  --dark: #0c3732;
  --light: #e4f0e8;
  --clay: #8c422e;
  --clay-light: #f7e8df;
  font: 15px/1.55 "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 300px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.7rem, 3vw, 2.6rem); line-height: 1.22; letter-spacing: -.035em; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: wait; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 3px solid #7da897; outline-offset: 2px;
}
.btn { border: 1px solid transparent; background: var(--teal); color: #fff; border-radius: 7px; padding: 9px 15px; font-weight: 650; }
.btn:hover { background: #104b41; }
.btn.secondary { background: #fff; border-color: var(--line); color: var(--teal); }
.btn.secondary:hover { background: var(--light); }
.btn.danger { color: var(--clay); background: var(--clay-light); }
.text-btn { border: 0; padding: 4px 0; color: var(--teal); background: transparent; font-weight: 650; }
.text-btn:hover { text-decoration: underline; }
.muted, .small { color: var(--muted); }
.small { font-size: .86rem; }
.brand { display: flex; gap: 10px; align-items: center; font-size: 1.07rem; font-weight: 750; letter-spacing: .01em; }
.brand-mark { background: #d9e9dd; color: var(--dark); width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font: 750 13px system-ui; }
.auth-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(300px, .85fr) minmax(400px, 1fr); }
.auth-brand { display: flex; flex-direction: column; justify-content: space-between; gap: 80px; background: var(--dark); color: #fff; padding: clamp(34px, 7vw, 96px); }
.auth-brand h1 { max-width: 460px; font-size: clamp(2.5rem, 5.5vw, 5rem); line-height: 1.16; }
.auth-brand p { color: #d0e4da; max-width: 26em; margin-top: 20px; }
.auth-illustration { width: min(100%, 340px); aspect-ratio: 3 / 1; display: flex; gap: 10px; align-items: flex-end; border-bottom: 1px solid #618676; padding: 0 5px; }
.auth-illustration i { width: 23%; height: 25%; background: #4c8371; border-radius: 8px 8px 0 0; }
.auth-illustration i:nth-child(2) { height: 44%; background: #7eaa90; }
.auth-illustration i:nth-child(3) { height: 68%; background: #a9c8af; }
.auth-illustration i:nth-child(4) { height: 92%; background: #d3957d; }
.auth-main { display: grid; place-items: center; padding: 38px 24px; }
.auth-card { width: min(100%, 430px); padding: 32px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.auth-card > p { margin: 12px 0 24px; }
.auth-card .actions { margin-top: 18px; }
.auth-card .btn { width: 100%; }
.app-layout { min-height: 100vh; display: grid; grid-template-columns: 252px minmax(0, 1fr); }
.sidebar { background: var(--dark); color: #fff; display: flex; flex-direction: column; padding: 24px 18px; }
.sidebar .brand { padding: 0 9px 24px; }
.scope-box { border: 1px solid #476c5d; border-radius: 9px; padding: 12px; margin: 4px 0 20px; overflow-wrap: anywhere; }
.scope-box div { font-weight: 650; }
.scope-box p, .sidebar-note { color: #c8ddd2; font-size: .83rem; }
.sidebar nav { display: grid; gap: 5px; }
.nav-btn { text-align: left; padding: 10px 12px; border: 0; border-radius: 7px; background: none; color: #eff7f2; font-weight: 600; }
.nav-btn:hover { background: #23564c; }
.nav-btn[aria-current=page] { background: #dcefe3; color: #113e35; }
.sidebar-note { margin-top: auto; padding: 24px 8px 0; }
.main { min-width: 0; }
.topbar { min-height: 64px; display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--surface); padding: 10px clamp(16px, 4vw, 52px); border-bottom: 1px solid var(--line); }
.topbar .actions { margin: 0; }
.topbar strong { overflow-wrap: anywhere; }
.content { width: min(100%, 1390px); margin: 0 auto; padding: 26px clamp(16px, 4vw, 52px) 68px; }
.page-heading { margin-bottom: 23px; }
.page-heading p { color: var(--muted); margin-top: 8px; max-width: 62em; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 19px; margin-bottom: 16px; min-width: 0; }
.panel h2 { margin-bottom: 10px; }
.feature { background: #e8f2e9; border-color: #cbdfd0; padding: 22px; }
.feature p { max-width: 58em; color: var(--muted); }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.kpi { padding: 16px; border-radius: 9px; border: 1px solid var(--line); background: #fff; }
.kpi strong { display: block; margin-top: 5px; font-size: 1.9rem; letter-spacing: -.05em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpi p { color: var(--muted); font-size: .87rem; }
.kpi:first-child strong { color: var(--teal); }
.kpi:nth-child(2) strong { color: var(--clay); }
fieldset { border: 0; padding: 0; margin: 0; }
.fields { display: grid; gap: 13px; }
.fields.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field { display: grid; gap: 5px; min-width: 0; color: var(--ink); font-weight: 650; }
.field :is(input, select, textarea) { width: 100%; min-width: 0; color: var(--ink); background: #fff; border: 1px solid #b9c9bf; border-radius: 7px; padding: 9px 10px; font-weight: 400; }
textarea { min-height: 82px; resize: vertical; }
.actions { display: flex; gap: 9px 12px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 11px 10px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; vertical-align: middle; }
th { color: var(--muted); font-size: .86rem; font-weight: 650; background: #f2f6f1; }
td:last-child { min-width: 68px; }
tbody tr:last-child td { border-bottom: 0; }
td .actions { margin: 0; }
.pill { display: inline-block; border-radius: 99px; background: var(--light); color: #154d40; padding: 2px 8px; font-size: .78rem; font-weight: 650; white-space: nowrap; }
.pill.clay { color: var(--clay); background: var(--clay-light); }
.notice { padding: 10px 13px; background: var(--light); border-radius: 7px; margin: 0 0 14px; }
.notice.error { color: #742d1e; background: var(--clay-light); }
.empty { padding: 16px; background: #f6f8f5; border: 1px dashed #c8d5cb; border-radius: 8px; color: var(--muted); }
.workspace-list { display: grid; gap: 10px; }
.workspace-choice { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 12px; text-align: left; color: var(--ink); background: #fff; border: 1px solid var(--line); padding: 13px; border-radius: 8px; }
.workspace-choice:hover { background: var(--light); }
.document { white-space: pre-wrap; overflow-wrap: anywhere; background: #f5f7f3; padding: 16px; border-radius: 7px; margin: 12px 0; }
@media (max-width: 950px) {
  .app-layout { grid-template-columns: 200px minmax(0, 1fr); }
  .pair { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 680px) {
  .auth-layout, .app-layout { display: block; }
  .auth-brand { padding: 24px; gap: 20px; }
  .auth-brand h1, .auth-brand p, .auth-illustration { display: none; }
  .auth-main { padding: 18px; }
  .auth-card { padding: 22px; }
  .sidebar { padding: 14px 16px; }
  .sidebar .brand { padding: 0 0 10px; }
  .scope-box { margin: 0 0 10px; padding: 7px 9px; }
  .sidebar nav { display: flex; overflow-x: auto; }
  .nav-btn { white-space: nowrap; }
  .sidebar-note { display: none; }
  .topbar { min-height: 54px; }
  .fields.two, .kpis { grid-template-columns: minmax(0, 1fr); }
  .kpis { gap: 8px; }
  .kpi strong { font-size: 1.5rem; }
}
@media (prefers-reduced-motion: no-preference) {
  button, input, select, textarea { transition: background-color .16s ease, border-color .16s ease; }
}

.pagination { justify-content: flex-end; }
#operation-dialog {
  width: min(calc(100% - 32px), 500px);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: clamp(16px, 4vw, 25px);
}
#operation-dialog::backdrop { background: rgba(8, 35, 30, .56); }
#operation-dialog h2, #operation-dialog p { margin-bottom: 12px; }
#operation-dialog .fields { margin-top: 14px; }
#operation-dialog [data-action=close-dialog] { margin-top: 10px; }
tbody .btn { padding: 7px 11px; }

@media (max-width: 680px) {
  .table-wrap > table { min-width: 510px; }
  .demo-report .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pagination { justify-content: flex-start; }
  .topbar .actions { gap: 6px; }
  .topbar .btn { padding: 7px 9px; }
}
