:root {
  color-scheme: light;
  --background: #f3f5f7;
  --panel: #fff;
  --ink: #17212b;
  --muted: #526371;
  --line: #d7dfe5;
  --accent: #095b56;
  --accent-dark: #06453f;
  --accent-soft: #e5f1ee;
  --danger: #983b34;
  font: 16px/1.5 "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--background); }
a { color: var(--accent); text-underline-offset: .2em; }
button, .button, input, textarea, select { font: inherit; }
button, .button {
  background: var(--accent);
  color: white;
  border: 1px solid transparent;
  border-radius: .45rem;
  padding: .53rem .85rem;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
}
button:hover, .button:hover { background: var(--accent-dark); }
button:disabled { opacity: .53; cursor: default; }
.quiet { color: var(--accent); background: white; border-color: var(--line); }
.quiet:hover { background: var(--accent-soft); }
.danger { color: var(--danger); background: #fff; border-color: #e9c4c0; }
.danger:hover { background: #fff0ef; }
:focus-visible { outline: 3px solid #347fbb; outline-offset: 3px; }
.topbar { background: var(--panel); border-bottom: 1px solid var(--line); }
nav, main, footer { width: min(1200px, calc(100% - 3rem)); margin: auto; }
nav { min-height: 4.25rem; display: flex; align-items: center; gap: 1.65rem; }
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 750; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand-mark { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: .35rem; background: var(--accent); color: white; font-size: .79rem; letter-spacing: .03em; }
.pilot, .badge { background: var(--accent-soft); color: var(--accent-dark); border-radius: .35rem; padding: .18rem .45rem; font-size: .875rem; white-space: nowrap; }
.nav-link { color: var(--muted); text-decoration: none; white-space: nowrap; }
.nav-link:hover, .nav-link[aria-current] { color: var(--accent); text-decoration: underline; }
.account { margin-left: auto; display: flex; align-items: center; gap: .65rem; font-size: .9rem; }
main { min-height: 74vh; padding: 2.4rem 0 4rem; }
footer { color: var(--muted); padding: 1.25rem 0 2rem; border-top: 1px solid var(--line); font-size: .9rem; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(2rem, 3vw, 2.8rem); line-height: 1.1; letter-spacing: -.04em; overflow-wrap: anywhere; }
h2 { font-size: 1.12rem; margin-bottom: .85rem; }
h2 small { margin-left: .35rem; color: var(--muted); font-size: .85rem; }
.heading { display: flex; justify-content: space-between; gap: 1rem; align-items: center; margin-bottom: 1.45rem; }
.heading p, .welcome p { color: var(--muted); margin-top: .55rem; }
.crumb { display: inline-block; margin-bottom: .45rem; font-size: .9rem; }
.grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 1.2rem; align-items: start; }
.column { display: grid; gap: 1.2rem; min-width: 0; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: .7rem; padding: 1.2rem; min-width: 0; }
.description { margin-bottom: 1.2rem; }
.written { white-space: pre-wrap; overflow-wrap: anywhere; }
.stack { display: grid; gap: .8rem; align-content: start; }
.stack > button { justify-self: start; }
label { display: grid; gap: .35rem; color: var(--ink); font-size: .9rem; font-weight: 650; }
input, textarea, select { width: 100%; color: var(--ink); background: #fff; border: 1px solid #b8c5ce; border-radius: .4rem; padding: .48rem .6rem; font-size: 1rem; }
textarea { resize: vertical; }
input[type=file] { min-width: 0; }
.record { display: flex; align-items: center; justify-content: space-between; gap: .6rem; border-bottom: 1px solid var(--line); padding: .7rem .2rem; text-decoration: none; color: var(--ink); }
a.record:hover { background: var(--accent-soft); }
.record-copy { display: block; color: var(--muted); font-size: .9rem; }
.record > div { min-width: 0; overflow-wrap: anywhere; }
.file-actions { display: flex; flex-wrap: wrap; gap: .3rem; justify-content: end; }
.empty { padding: .8rem; color: var(--muted); background: var(--background); border-radius: .35rem; }
details { margin-top: .8rem; }
details:first-child { margin-top: 0; }
summary { color: var(--accent); cursor: pointer; font-weight: 650; }
details[open] > summary { margin-bottom: .85rem; }
.delete-form, .upload, .comment + form { margin-top: 1rem; }
.notice { padding: .8rem 1rem; margin-bottom: .9rem; background: var(--accent-soft); border-radius: .4rem; }
.secondary, .comment time { color: var(--muted); font-size: .9rem; }
.comment { border-bottom: 1px solid var(--line); padding: .65rem 0; }
.comment p { margin-top: .35rem; }
.chat-list { list-style: none; background: var(--background); padding: .7rem; min-height: 12rem; height: 17rem; margin: .55rem 0 .85rem; overflow: auto; border-radius: .35rem; }
.chat-list li { padding: .55rem .25rem; border-bottom: 1px solid var(--line); }
.chat-list p { white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-list time { display: block; color: var(--muted); font-size: .8rem; }
.actions { display: flex; flex-wrap: wrap; gap: .65rem; align-items: end; }
progress { width: 100%; accent-color: var(--accent); }
.data-table { overflow: auto; }
table { width: 100%; border-collapse: collapse; margin: .8rem 0; text-align: left; }
th, td { padding: .5rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.diagnostics { margin-bottom: 1.2rem; }
.diagnostics > .secondary { margin-top: .8rem; }
.welcome { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 1.5rem; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 1rem; padding: clamp(1.3rem, 5vw, 4rem); }
.welcome h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); }
.welcome p { max-width: 44ch; }
.welcome .button, .welcome .notice, .error .button { margin-top: 1.15rem; }
.welcome-aside { padding: 1.25rem; background: var(--accent-soft); border-radius: .55rem; }
.secondary-link { display: block; width: fit-content; margin-top: .85rem; }
@media (max-width: 760px) {
  nav, main, footer { width: min(100% - 1.4rem, 1200px); }
  nav { padding: .55rem 0; gap: .55rem 1rem; flex-wrap: wrap; }
  .account { margin-left: 0; }
  .account span { display: none; }
  main { padding-top: 1.3rem; }
  .grid, .welcome { grid-template-columns: 1fr; }
  .heading { align-items: flex-start; }
  .panel { padding: .85rem; }
}

.language-switch {
  display: flex;
  gap: .12rem;
  margin-left: auto;
  border: 1px solid var(--line);
  padding: .18rem;
  border-radius: .4rem;
  white-space: nowrap;
}
.language-switch a {
  color: var(--muted);
  font-size: .875rem;
  font-weight: 650;
  text-decoration: none;
  padding: .24rem .44rem;
  border-radius: .25rem;
}
.language-switch a:hover, .language-switch a[aria-current] {
  color: var(--accent-dark);
  background: var(--accent-soft);
}
.account { margin-left: 0; }
@media (max-width: 760px) {
  .language-switch { margin-left: 0; }
}
