:root {
  color-scheme: light;
  --ink: #182f2b;
  --muted: #50665d;
  --paper: #f3f5f0;
  --sheet: #fff;
  --line: #d7e0d7;
  --mast: #133c32;
  --green: #17664a;
  --mint: #e2eee2;
  --lime: #c8ee81;
  --orange: #964225;
  --pale: #fae9de;
  --focus: #b67b10;
  font: 15px/1.5 system-ui, "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, input:not([type="checkbox"]):not([type="radio"]), select, textarea {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--sheet);
}
button { padding: .5rem .8rem; cursor: pointer; text-align: center; font-weight: 620; }
button:hover { border-color: var(--green); background: var(--mint); }
button:disabled { cursor: default; opacity: .62; }
button.primary { background: var(--mast); color: var(--sheet); border-color: var(--mast); }
button.primary:hover { background: var(--green); }
button.quiet { background: transparent; border-color: transparent; color: var(--green); }
button.quiet:hover { background: var(--mint); }
button.warning { color: var(--orange); border-color: #ebcabe; }
button.warning:hover { background: var(--pale); }
button[data-loading] { cursor: progress; }
input, select, textarea { padding: .55rem .65rem; max-width: 100%; }
input[type="checkbox"], input[type="radio"] { width: 1.05rem; height: 1.05rem; margin: 0; accent-color: var(--green); flex: none; }
input, select, textarea, button { overflow-wrap: anywhere; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }

h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.75rem, 3.3vw, 2.45rem); font-weight: 760; line-height: 1.15; letter-spacing: -.04em; }
h2 { font-size: 1.15rem; line-height: 1.3; letter-spacing: -.019em; }
h3 { font-size: 1rem; line-height: 1.4; }
small, .muted { color: var(--muted); }
a { color: var(--green); }
.page-loading { padding: 2rem; text-align: center; color: var(--muted); }
.mast {
  background: var(--mast);
  min-height: 68px;
  color: #f3f9ef;
  display: flex;
  align-items: center;
  gap: .9rem;
  justify-content: space-between;
  padding: .7rem clamp(.85rem, 3.3vw, 2rem);
}
.brand-group, .mast-actions, .brand { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.brand { font-size: 1.45rem; line-height: 1.08; letter-spacing: -.065em; font-weight: 780; flex: none; }
.mark {
  display: inline-block;
  width: 1.55rem;
  height: 1.55rem;
  background: repeating-linear-gradient(116deg, transparent 0 4px, var(--lime) 4px 8px, transparent 8px 11px);
  border-radius: .25rem;
  transform: skew(-8deg);
}
.workspace-label { font-size: .92rem; padding-inline-start: .85rem; border-inline-start: 1px solid #608473; color: #dfeddf; }
.mast-actions { justify-content: flex-end; }
.session-name { font-size: .87rem; line-height: 1.25; text-align: end; }
.session-name small { display: block; color: #c8decc; }
.mast button { min-height: 38px; padding: .35rem .55rem; border-color: #648677; color: #f3f9ef; background: transparent; white-space: nowrap; }
.mast button:hover { background: #285346; }
.workspace { max-width: 1500px; display: grid; grid-template-columns: 205px minmax(0, 1fr); margin: auto; min-height: calc(100vh - 68px); }
.rail { padding: 1.35rem .65rem; background: var(--sheet); border-inline: 1px solid var(--line); }
.rail ul, .mobile-nav ul { list-style: none; padding: 0; margin: 0; }
.rail ul { display: grid; gap: .25rem; }
.nav-button {
  display: flex; align-items: center; justify-content: flex-start;
  gap: .6rem; width: 100%; text-align: left; border-color: transparent;
  color: var(--muted); font-size: .91rem; line-height: 1.3;
}
.nav-button[aria-current="page"] { color: var(--green); background: var(--mint); font-weight: 740; }
.nav-mark { width: .7rem; height: .7rem; border: 1px solid currentColor; border-radius: 2px; flex: none; }
.nav-button[aria-current="page"] .nav-mark { background: var(--green); }
.mobile-nav { display: none; }
.main { min-width: 0; width: 100%; padding: 1.6rem clamp(.9rem, 3.1vw, 2.4rem) 2.2rem; }
.content { min-width: 0; display: grid; align-content: start; gap: 1rem; }
.heading { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: .75rem; }
.heading p { margin-top: .4rem; color: var(--muted); }
.panel {
  min-width: 0; background: var(--sheet); border: 1px solid var(--line); border-radius: 12px;
  padding: clamp(.9rem, 2.1vw, 1.25rem); display: grid; align-content: start; gap: .8rem;
}
.columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.form { display: grid; align-content: start; gap: .75rem; }
.field { display: grid; gap: .3rem; min-width: 0; align-content: start; }
.field > span { font-size: .87rem; font-weight: 650; }
.field input, .field select, .field textarea { width: 100%; }
.actions, .search-line { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.actions-end { justify-content: flex-end; }
.search-line { align-items: end; }
.search-line .field { flex: 1 1 235px; }
.search-line select { flex: 0 1 auto; }
.status { color: var(--muted); font-size: .91rem; }
.message { padding: .7rem .85rem; border-radius: 7px; background: var(--mint); color: var(--green); overflow-wrap: anywhere; }
.message.error { background: var(--pale); color: var(--orange); }
.message a { display: inline-block; margin-top: .3rem; }
.choice { min-height: 43px; display: flex; align-items: center; gap: .55rem; cursor: pointer; }
.row-list { display: grid; }
.item {
  min-width: 0; display: flex; gap: .7rem; align-items: center; justify-content: space-between;
  padding: .65rem 0; border-bottom: 1px solid var(--line);
}
.item:last-child { border-bottom: 0; }
.item-body { display: grid; min-width: 0; gap: .18rem; overflow-wrap: anywhere; }
.item .actions { justify-content: flex-end; flex-shrink: 1; }
.item-title { display: block; overflow-wrap: anywhere; }
.badge {
  display: inline-flex; align-items: center; width: fit-content; background: var(--mint); color: var(--green);
  border-radius: 5px; padding: .15rem .45rem; font-size: .78rem; font-weight: 640;
}
.badge.neutral { background: var(--paper); color: var(--muted); }
.badge.warning { background: var(--pale); color: var(--orange); }
.details { display: grid; gap: .1rem; margin: 0; }
.details > div { display: grid; grid-template-columns: minmax(100px, 1fr) minmax(130px, 2fr); align-items: start; gap: .6rem; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.details > div:last-child { border: 0; }
.details dt { color: var(--muted); }
.details dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.filter-group { align-self: start; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; min-height: 34px; }
.config { display: grid; gap: .55rem; }
.slot { display: grid; gap: .75rem; align-content: start; }
.slot .item { padding: 0 0 .7rem; }
.editor { border-top: 1px solid var(--line); padding-top: .8rem; margin-top: .15rem; }
.auth-main { padding: clamp(1.35rem, 6vw, 4rem) 1rem; min-height: calc(100vh - 68px); }
.auth-card { max-width: 440px; margin: 0 auto; padding: clamp(1.15rem, 3.3vw, 2rem); gap: 1rem; box-shadow: 0 12px 35px #18382b10; }
.auth-card .form { gap: .85rem; }
.auth-card h1 { font-size: clamp(1.65rem, 5.8vw, 2rem); }
.password-dialog {
  width: min(28rem, calc(100% - 2rem)); max-height: calc(100% - 2rem);
  border: 1px solid var(--line); border-radius: 12px; padding: 1.25rem;
  color: var(--ink); background: var(--sheet); overflow-wrap: anywhere;
}
.password-dialog[open] { display: grid; gap: .8rem; }
.password-dialog::backdrop { background: #112d2780; }
.full { width: 100%; }

@media (max-width: 750px) {
  button, input:not([type="checkbox"]):not([type="radio"]), select, textarea { min-height: 44px; }
  input:not([type="checkbox"]):not([type="radio"]), select, textarea { font-size: 16px; }
  .mast { min-height: 60px; gap: .5rem; padding: .55rem .8rem; flex-wrap: wrap; }
  .brand { font-size: 1.3rem; }
  .mark { width: 1.25rem; height: 1.25rem; }
  .brand-group, .brand, .mast-actions { gap: .4rem; }
  .workspace-label { font-size: .78rem; padding-inline-start: .45rem; }
  .session-name { display: none; }
  .mast button { min-height: 44px; }
  .workspace { display: block; min-height: calc(100vh - 60px); }
  .rail { display: none; }
  .main { padding: 1.1rem .85rem max(5.55rem, calc(4.85rem + env(safe-area-inset-bottom))); }
  .mobile-nav {
    display: block; position: fixed; inset-inline: 0; bottom: 0;
    border-top: 1px solid var(--line); background: var(--sheet); z-index: 2;
    padding: .35rem .5rem calc(.35rem + env(safe-area-inset-bottom)); overflow-x: auto;
  }
  .mobile-nav ul { display: flex; gap: .25rem; min-width: max-content; }
  .mobile-nav .nav-button { min-height: 44px; padding: .35rem .65rem; flex-direction: column; justify-content: center; gap: .15rem; font-size: .77rem; }
  .mobile-nav .nav-mark { width: .53rem; height: .53rem; }
  .columns { grid-template-columns: minmax(0, 1fr); }
  .item { flex-wrap: wrap; }
  .item .actions { justify-content: flex-start; }
  .details > div { grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); }
}
@media (max-width: 390px) {
  .workspace-label { display: none; }
}
