:root {
  color-scheme: light;
  --paper: #f7f6ef;
  --surface: #fffef9;
  --ink: #182823;
  --muted: #596961;
  --line: #dedfd3;
  --pine: #162c26;
  --green: #245c44;
  --leaf: #c4e68b;
  --display: "Noto Serif SC", "Songti SC", SimSun, Georgia, serif;
  --body: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 14px/1.6 var(--body); }
h1, h2, h3, p { margin: 0; }
button, input, select { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #779748; outline-offset: 3px; }

.brand { display: flex; align-items: center; gap: 11px; font-size: 17px; font-weight: 700; letter-spacing: .07em; }
.mark { height: 34px; width: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 2px; border-radius: 9px; background: var(--leaf); }
.mark i { width: 2px; background: var(--pine); border-radius: 4px; }
.mark i:nth-child(1) { height: 8px; }
.mark i:nth-child(2) { height: 16px; }
.mark i:nth-child(3) { height: 11px; }
.mark i:nth-child(4) { height: 6px; }
.login-layout { min-height: 100svh; display: grid; grid-template-columns: 1fr 1fr; }
.login-brand { background: var(--pine); color: #f2f6e9; padding: clamp(32px, 7vw, 102px); display: grid; align-content: space-between; gap: 64px; overflow: hidden; }
.login-brand h1 { font: 700 clamp(56px, 8vw, 112px)/1.02 var(--display); letter-spacing: -.08em; }
.login-brand p { color: #c4d3c7; margin-top: 21px; }
.signal { width: 100%; height: 46px; opacity: .55; background: repeating-linear-gradient(90deg, var(--leaf) 0 2px, transparent 2px 11px); clip-path: polygon(0% 45%,12% 38%,19% 9%,24% 42%,29% 31%,37% 45%,44% 13%,48% 0,52% 32%,59% 17%,64% 43%,72% 47%,81% 10%,87% 40%,100% 49%,100% 53%,87% 60%,81% 90%,72% 53%,64% 57%,59% 83%,52% 68%,48% 100%,44% 87%,37% 55%,29% 69%,24% 58%,19% 91%,12% 62%,0 55%); }
.login-form-wrap { display: grid; place-items: center; padding: 40px; }
.login-form { width: min(100%, 354px); display: grid; gap: 18px; }
.login-form h2, .dialog-header h2 { font: 700 32px/1.3 var(--display); margin-bottom: 10px; }
label { display: grid; gap: 5px; color: var(--ink); font-weight: 600; }
input, select { width: 100%; border: 1px solid #cdd2c6; background: var(--surface); color: var(--ink); padding: 10px 12px; min-height: 43px; border-radius: 7px; }
.primary, .secondary { border: 1px solid transparent; padding: 9px 16px; border-radius: 8px; font-weight: 700; min-height: 42px; }
.primary { background: var(--green); color: white; }
.primary:hover { background: #184532; }
.secondary { background: var(--surface); border-color: var(--line); color: var(--ink); }
.secondary:hover { background: #eef2e7; }
button:disabled { opacity: .55; cursor: wait; }
.form-error { color: #a9362b; font-weight: 600; }
.form-error:empty { display: none; }

.shell { min-height: 100svh; display: grid; grid-template-columns: 224px minmax(0, 1fr); }
.sidebar { background: var(--pine); color: #eef5e6; padding: 28px 18px 18px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100svh; }
.sidebar .brand { padding: 0 7px; }
.space-name { color: #a7b9a9; margin: 48px 10px 11px; font-size: 13px; overflow-wrap: anywhere; }
nav { display: grid; gap: 5px; }
.nav-item { background: none; color: #e4ede2; border: 0; padding: 11px 13px; border-radius: 8px; text-align: left; display: flex; align-items: center; gap: 11px; white-space: nowrap; }
.nav-item:hover { background: #263e34; }
.nav-item[aria-current="page"] { background: #294739; color: var(--leaf); font-weight: 700; }
.nav-symbol { color: currentColor; width: 20px; text-align: center; font: 17px/1 Georgia, serif; }
.identity { margin-top: auto; border-top: 1px solid #3a5045; padding: 16px 3px 0; display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #365643; color: #d9ebc7; font-family: var(--display); }
.identity strong, .identity small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.identity small { color: #a7b9a9; }
.logout { background: none; border: 0; color: #d4e0d4; padding: 7px 3px; }
.logout:hover { text-decoration: underline; }
.main-area { width: min(100%, 1480px); margin: 0 auto; padding: clamp(24px, 4vw, 58px); }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); padding-bottom: 24px; margin-bottom: 27px; }
.page-heading h1 { font: 700 clamp(31px, 4.4vw, 57px)/1.14 var(--display); letter-spacing: -.045em; }
.page-heading p { margin-top: 10px; color: var(--muted); }
.page-actions, .toolbar { display: flex; align-items: end; gap: 10px; }
.page-actions { flex-shrink: 0; }
.toolbar { margin: 0 0 15px; }
.toolbar .search { flex: 1; max-width: 365px; }
.toolbar select { min-width: 118px; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 28px; }
.metric, .panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.metric { min-width: 0; padding: 18px 20px; }
.metric span { display: block; color: var(--muted); }
.metric strong { display: block; font: 700 44px/1.2 Georgia, serif; margin: 6px 0 0; }
.metric.emphasis { background: #e8f0d9; border-color: #dce7cb; }
.panel-title { padding: 18px 20px 14px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.panel-title h2 { font: 700 24px/1.25 var(--display); }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { background: #f1f2e9; color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; }
th, td { padding: 13px 16px; border-bottom: 1px solid #eeeee5; vertical-align: middle; }
td { overflow-wrap: anywhere; }
tr:last-child td { border-bottom: 0; }
tr:hover td { background: #fbfcf5; }
.nowrap { white-space: nowrap; }
.row-title { color: var(--ink); font-weight: 700; }
.row-subtitle { display: block; max-width: 44ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12px; }
.text-button { background: none; border: 0; padding: 4px 0; color: var(--green); font-weight: 700; white-space: nowrap; }
.text-button:hover { text-decoration: underline; }
.badge { display: inline-block; border-radius: 999px; padding: 3px 9px; background: #efece3; color: #685e44; white-space: nowrap; font-size: 12px; }
.badge.success { background: #e5f0de; color: #2a5c3c; }
.badge.failed { background: #f6e6e1; color: #8b362c; }
.empty { padding: 35px 22px; text-align: center; color: var(--muted); }
.empty strong { display: block; font-size: 16px; color: var(--ink); margin-bottom: 4px; }
.notice { margin-bottom: 15px; padding: 9px 13px; background: #e5efda; border-radius: 7px; color: #235338; }
.notice.is-error { background: #f7e6e0; color: #8b362c; }
dialog { width: min(670px, calc(100vw - 32px)); max-height: 86svh; border: 1px solid var(--line); border-radius: 14px; padding: 0; color: var(--ink); background: var(--surface); }
dialog::backdrop { background: #102a23a8; }
.dialog-header { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center; padding: 18px 23px 12px; background: var(--surface); border-bottom: 1px solid var(--line); }
.dialog-header h2 { font-size: 27px; margin: 0; }
#dialog-content { padding: 20px 23px 24px; }
.close { width: 37px; height: 37px; background: #f0f1e8; border: 0; border-radius: 8px; font-size: 24px; color: var(--ink); line-height: 1; }
.dialog-form { display: grid; gap: 14px; }
.dialog-form p:not(.form-error), .muted { color: var(--muted); }
.dialog-form .primary { justify-self: start; }
.record-meta { color: var(--muted); display: flex; flex-wrap: wrap; gap: 5px 16px; margin-bottom: 15px; overflow-wrap: anywhere; }
.segment { border-top: 1px solid var(--line); padding: 13px 0; }
.segment small { color: var(--muted); }
.segment p { white-space: pre-wrap; overflow-wrap: anywhere; }

@media (max-width: 850px) {
  .shell { grid-template-columns: 184px minmax(0, 1fr); }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-heading { align-items: start; }
}
@media (max-width: 640px) {
  .login-layout, .shell { display: block; }
  .login-brand { padding: 24px 26px; gap: 28px; }
  .login-brand h1 { font-size: 49px; }
  .login-brand h1 br, .signal { display: none; }
  .login-brand p { margin-top: 8px; }
  .login-form-wrap { padding: 32px 26px; }
  .sidebar { height: auto; position: static; padding: 16px; display: grid; gap: 11px; }
  .sidebar .brand { grid-row: 1; grid-column: 1; }
  .space-name { margin: 0 7px; }
  nav { display: flex; overflow: auto; }
  .nav-item { padding: 7px 9px; gap: 4px; }
  .identity { grid-row: 1; grid-column: 1; justify-self: end; border: 0; padding: 0; grid-template-columns: auto; }
  .identity .avatar, .identity div { display: none; }
  .main-area { padding: 23px 16px; }
  .page-heading { flex-wrap: wrap; }
  .toolbar { flex-wrap: wrap; }
  .metric { padding: 13px 15px; }
  th, td { padding: 9px 12px; }
}
