:root {
  color-scheme: light;
  --ink: #151710;
  --night: #131610;
  --paper: #f3f4ed;
  --surface: #fff;
  --line: #dfe2d6;
  --muted: #5e6455;
  --lime: #d6fb66;
  --focus: #497507;
  --danger: #a12329;
  --mono: "Cascadia Mono", Consolas, monospace;
  font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
h1, h2, p { margin: 0; }
.eyebrow, .nav-number, .nav-count, .auth-note, .record-meta {
  font: 700 .75rem/1.5 var(--mono);
  letter-spacing: .085em;
}
.eyebrow { color: var(--muted); }
.brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  width: fit-content;
  color: #f8f8f3;
  font: 850 1.42rem/1 system-ui, sans-serif;
  letter-spacing: -.06em;
  text-decoration: none;
}
.brand-dot { color: var(--lime); }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; background: var(--lime); color: var(--ink); border-radius: 8px; }
.brand-mark svg { width: 28px; fill: currentColor; }
.auth-shell { min-height: 100svh; display: grid; grid-template-columns: 1.06fr 1fr; }
.auth-intro {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 5rem;
  padding: clamp(1.5rem, 4vw, 4rem);
  background:
    repeating-linear-gradient(132deg, transparent 0 19px, #d6fb6610 19px 20px, transparent 20px 41px) right / 56% 100% no-repeat,
    radial-gradient(ellipse at right bottom, #2a3520, transparent 67%),
    var(--night);
  color: #f8f8f3;
}
.auth-copy { padding-block: 3rem; }
.auth-copy .eyebrow { color: var(--lime); }
.signal { display: inline-block; width: .55rem; height: .55rem; margin-right: .3rem; border-radius: 50%; background: var(--lime); }
.auth-copy h1 { margin-block: 1.25rem 1.6rem; font-size: clamp(3rem, 7.8vw, 8.25rem); line-height: 1.03; letter-spacing: -.07em; }
.auth-copy > p:last-child { color: #d5dbca; line-height: 1.65; }
.auth-note { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .6rem; color: #d5dbca; border-top: 1px solid #ffffff32; padding-top: 1rem; }
.auth-form-area { display: grid; place-items: center; padding: 2rem clamp(1.25rem, 5vw, 5rem); }
.auth-form-panel { width: min(100%, 28rem); }
.auth-form-panel h2 { font-size: clamp(1.8rem, 3.6vw, 3.3rem); letter-spacing: -.055em; margin-block: .5rem; }
.auth-form-panel form { display: grid; gap: .65rem; margin-block: 2rem .5rem; }
.auth-form-panel label { font-weight: 700; }
.subtle { color: var(--muted); line-height: 1.7; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  min-height: 46px;
  padding: .65rem 1rem;
  border: 1px solid transparent;
  border-radius: 9px;
  font-weight: 750;
  line-height: 1.3;
  transition: background-color 160ms, border-color 160ms;
}
.primary { color: var(--ink); background: var(--lime); border-color: #b5d751; }
.primary:not(:disabled):hover { background: #e1ff8b; }
.secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.secondary:not(:disabled):hover { background: #eff2e9; border-color: #a9b29c; }
.button:disabled { color: #64685e; background: #e9ebe3; border-color: #dfe1d9; }
.login-submit { justify-content: space-between; margin-top: .45rem; }
.text-link { display: inline-flex; align-items: center; min-height: 44px; color: inherit; text-underline-offset: .27em; font-size: .9rem; font-weight: 650; }
.feedback { color: var(--muted); min-height: 1.4em; font-size: .9rem; line-height: 1.55; overflow-wrap: anywhere; }
.feedback[data-kind="error"], .field-error { color: var(--danger); }
.feedback[data-kind="success"] { color: #35620e; }
.console-shell { min-height: 100svh; display: grid; grid-template-columns: 15.75rem minmax(0, 1fr); }
.sidebar { display: flex; flex-direction: column; min-height: 100svh; position: sticky; top: 0; align-self: start; padding: 2rem 1.2rem 1rem; background: var(--night); color: #f4f5ef; }
.sidebar .brand { margin-inline: .5rem; }
.sidebar-label { margin: 3.5rem .55rem 1rem; color: #b6bdab; font-size: .85rem; }
.sidebar-nav { display: grid; gap: .35rem; }
.sidebar-nav button, .quiet {
  display: flex;
  align-items: center;
  gap: .65rem;
  min-height: 46px;
  padding: .7rem .65rem;
  border: 1px solid transparent;
  border-radius: 8px;
  color: inherit;
  background: transparent;
  text-align: left;
}
.sidebar-nav button:hover, .quiet:hover { background: #272c22; }
.sidebar-nav button[aria-current] { color: var(--lime); background: #28321e; border-color: #45523a; }
.sidebar :focus-visible, .auth-intro :focus-visible { outline-color: var(--lime); }
.nav-number { opacity: .85; }
.nav-count { margin-left: auto; }
.sidebar-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .25rem; margin-top: auto; padding: 1.3rem .5rem 0; color: #d5dbca; }
.quiet { font-size: .9rem; }
.workspace { width: min(100%, 92rem); margin-inline: auto; padding: clamp(1.2rem, 3.5vw, 3.8rem); min-width: 0; }
.workspace-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem 2rem; padding-bottom: 1.4rem; border-bottom: 1px solid #cfd5c5; }
.workspace-head h1 { margin-block: .45rem; font-size: clamp(2rem, 4.8vw, 3.9rem); letter-spacing: -.055em; }
.toolbar { display: flex; flex-wrap: wrap; gap: .6rem; }
.workspace-feedback { min-height: 3.1rem; padding-block: .75rem; }
.editor[inert] { opacity: .7; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .65rem; padding: 1.1rem 1.3rem; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 1.04rem; }
.panel-body { padding: 1.25rem 1.3rem; }
.settings-panel { max-width: 49rem; }
.collection-layout { display: grid; grid-template-columns: minmax(14.5rem, .76fr) minmax(0, 1.5fr); gap: 1rem; align-items: start; }
.record-list { display: grid; gap: .3rem; padding: .45rem; max-height: 38rem; overflow-y: auto; }
.record-row {
  width: 100%;
  min-width: 0;
  display: grid;
  gap: .2rem;
  min-height: 55px;
  padding: .55rem .8rem;
  background: transparent;
  color: var(--ink);
  border: 1px solid transparent;
  border-radius: 8px;
  text-align: left;
}
.record-row:focus-visible { outline-offset: -3px; }
.record-row:hover { background: #f0f2ec; }
.record-row[aria-pressed="true"] { background: #edf4db; border-color: #c8d7b0; }
.record-title, .record-meta { overflow-wrap: anywhere; }
.record-title { font-weight: 700; }
.record-meta { color: #4d5842; letter-spacing: .015em; }
.empty { color: var(--muted); padding: 1.15rem; line-height: 1.6; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; }
.field { display: grid; align-content: start; gap: .4rem; min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.field > label { font-size: .94rem; font-weight: 700; }
.field-hint, .field-error { font-size: .83rem; line-height: 1.5; }
.field-hint { color: var(--muted); }
input:not([type="checkbox"]), select, textarea {
  min-width: 0;
  width: 100%;
  min-height: 46px;
  padding: .65rem .75rem;
  border: 1px solid #cbd1c2;
  border-radius: 7px;
  color: var(--ink);
  background: #fbfcf8;
  font-size: 1rem;
  line-height: 1.55;
}
textarea { min-height: 6.7rem; resize: vertical; }
select { padding-right: 1.8rem; }
[aria-invalid="true"] { border-color: var(--danger) !important; }
.check-field { display: flex; align-items: center; gap: .65rem; width: fit-content; min-height: 44px; cursor: pointer; }
.check-field input { width: 1.1rem; height: 1.1rem; margin: 0; accent-color: var(--focus); }
.panel-foot { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .6rem; margin-top: 1.3rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.danger { color: var(--danger); background: #fff; border-color: #e7cbcb; }
.danger:hover { background: #fff1f1; border-color: #d0a6a6; }
.panel-foot .feedback { flex: 1 1 12rem; }

@media (max-width: 1024px) {
  .console-shell { grid-template-columns: 12rem minmax(0, 1fr); }
  .collection-layout { grid-template-columns: 1fr; }
  .record-list { max-height: 14rem; }
}
@media (max-width: 720px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-intro { gap: 1.7rem; }
  .auth-copy { padding-block: 0; }
  .auth-copy h1 { font-size: clamp(2.65rem, 10vw, 4.5rem); margin-block: .75rem; }
  .auth-copy br { display: none; }
  .auth-note { display: none; }
  .auth-form-area { padding-block: 2.2rem 3rem; }
  .console-shell { grid-template-columns: 1fr; }
  .sidebar { min-height: auto; position: static; padding: .9rem; }
  .sidebar-label { display: none; }
  .sidebar-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 1rem; }
  .sidebar-nav button { justify-content: center; font-size: .86rem; padding-inline: .35rem; }
  .nav-number, .nav-count { display: none; }
  .sidebar-footer { padding-top: .35rem; }
  .workspace { padding: 1rem; }
  .field-grid { gap: .95rem; }
  .panel-head, .panel-body { padding-inline: .9rem; }
}
@media (max-width: 365px) {
  .field-grid { grid-template-columns: 1fr; }
  .sidebar-nav button { font-size: .78rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
