:root {
  font: 16px/1.55 "Instrument Sans", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: #1d2a23;
  background: #f4f6f2;
  --green: #215c45;
  --forest: #192b24;
  --mint: #dfede3;
  --muted: #5d6b62;
  --line: #dfe5dd;
  --white: #fff;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, textarea, select { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
a { color: var(--green); }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
:focus-visible { outline: 2px solid #398269; outline-offset: 3px; }
[hidden] { display: none !important; }
.layout { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--forest); color: white; padding: 29px 17px 18px; display: flex; flex-direction: column; gap: 32px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 12px; width: max-content; padding: 0 8px; }
.brand-mark { display: grid; place-items: center; width: 38px; aspect-ratio: 1; border-radius: 11px; color: #132e23; background: #bce3aa; font-size: 17px; font-weight: 800; letter-spacing: -.08em; }
.brand-name { font-size: 1.2rem; font-weight: 750; letter-spacing: -.035em; }
.brand-subtitle { color: #bacbc0; font-size: .75rem; }
.nav { display: grid; gap: 5px; }
.nav button { display: flex; align-items: center; gap: 11px; padding: 11px 13px; text-align: left; border-radius: 8px; background: transparent; color: #d6e1d9; border: 1px solid transparent; font-size: .91rem; }
.nav button:hover { background: #263c32; }
.nav button[aria-current="page"] { background: #314a3e; border-color: #476353; color: white; font-weight: 650; }
.icon { width: 1.25rem; height: 1.25rem; flex: 0 0 auto; vertical-align: -.22em; stroke-width: 1.65; }
.profile { margin-top: auto; padding: 14px 7px 0; border-top: 1px solid #3a5045; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .86rem; }
.profile button { background: transparent; border: 0; color: #c3d0c7; padding: 4px 5px; }
.main { min-width: 0; }
.topbar { height: 68px; padding: 0 34px; border-bottom: 1px solid var(--line); background: var(--white); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.location { display: flex; align-items: center; gap: 11px; font-size: .9rem; }
.location span { color: var(--muted); }
.content { padding: 30px 34px 44px; margin: auto; max-width: 1440px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.7rem, 3vw, 2.15rem); line-height: 1.22; letter-spacing: -.05em; }
h2 { font-size: 1.13rem; letter-spacing: -.025em; }
h3 { font-size: 1rem; }
.heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 23px; }
.heading p { color: var(--muted); margin-top: 6px; }
.primary, .secondary, .danger { border: 1px solid transparent; border-radius: 8px; padding: 9px 14px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; text-decoration: none; font-size: .9rem; font-weight: 650; white-space: nowrap; }
.primary { background: var(--green); color: white; }
.primary:hover { background: #174733; }
.secondary { background: white; color: #2d4336; border-color: #cfd9cf; }
.secondary:hover { background: #edf4ed; }
.danger { background: #fff3ed; color: #87372a; border-color: #ecd6cb; }
.link { color: var(--green); background: none; border: 0; padding: 2px 0; font-weight: 650; font-size: .9rem; text-align: left; }
.link:hover { text-decoration: underline; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 19px; }
.stat, .panel { border: 1px solid var(--line); border-radius: 12px; background: white; }
.stat { padding: 16px 17px; }
.stat-name { display: flex; align-items: center; justify-content: space-between; gap: 4px; color: var(--muted); font-size: .88rem; }
.stat-name .icon { color: var(--green); }
.stat-value { font-family: "Instrument Sans", system-ui, sans-serif; font-size: 2.06rem; font-weight: 680; line-height: 1.2; letter-spacing: -.05em; margin-top: 7px; }
.review { padding: 19px 22px; margin-bottom: 19px; background: #e7efe1; border: 1px solid #d5e3d1; border-radius: 12px; display: flex; gap: 13px; align-items: flex-start; }
.review > .icon { margin-top: 2px; color: var(--green); }
.review p { margin-top: 4px; color: #4c5f52; font-size: .91rem; }
.review .secondary { margin-left: auto; align-self: center; }
.grid { display: grid; grid-template-columns: minmax(0, 2.3fr) minmax(236px, 1fr); gap: 16px; align-items: start; }
.panel { min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 19px; }
.panel-body { padding: 19px; }
.panel-head + .panel-body { padding-top: 0; }
.table-wrap { overflow: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; font-size: .9rem; }
thead { background: #f5f7f3; color: #536257; font-size: .82rem; }
th, td { padding: 11px 14px; border-bottom: 1px solid #edf0eb; vertical-align: top; }
th:first-child, td:first-child { padding-left: 19px; }
tr:last-child td { border-bottom: 0; }
.file { display: flex; align-items: center; gap: 10px; min-width: 160px; }
.file-type { display: grid; place-items: center; flex: 0 0 35px; height: 35px; border-radius: 7px; background: #eaf1e7; color: #3d674c; font-size: .67rem; font-weight: 750; }
.file-info { display: grid; gap: 1px; }
.meta { color: var(--muted); font-size: .8rem; }
.pill { display: inline-flex; white-space: nowrap; background: var(--mint); color: #28583d; border-radius: 100px; padding: 3px 9px; font-size: .81rem; }
.pill.review-state { background: #f8eed6; color: #734d13; }
.pill.draft, .pill.archived { background: #ebeeeb; color: #4d5950; }
.stack { display: grid; gap: 14px; }
.activity { list-style: none; margin: 0; padding: 0 19px 4px; }
.activity li { padding: 11px 0; border-top: 1px solid #edf0eb; }
.activity p { font-size: .87rem; margin-top: 2px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 15px; }
input:not([type="checkbox"]), select, textarea { width: 100%; min-width: 0; padding: 9px 11px; border: 1px solid #cfd9cf; background: white; color: #1d2a23; border-radius: 8px; }
.toolbar input { flex: 1 1 260px; }
.toolbar select { width: auto; }
label { display: grid; gap: 5px; min-width: 0; font-size: .9rem; font-weight: 600; }
textarea { resize: vertical; min-height: 95px; }
.form { display: grid; gap: 13px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.empty { color: var(--muted); padding: 24px 20px; }
.notice { padding: 11px 13px; border-radius: 8px; background: #eef4ec; color: #3b5142; font-size: .88rem; }
.notice.alert { background: #fff3de; color: #6e451a; }
.error { color: #992b26; font-size: .87rem; overflow-wrap: anywhere; }
.error:empty { display: none; }
.answer { white-space: pre-wrap; overflow-wrap: anywhere; margin: 8px 0; }
.sources { display: grid; gap: 4px; margin-top: 9px; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.faq-item { padding: 15px 0; border-bottom: 1px solid var(--line); }
.faq-item:last-child { border: none; }
.faq-item summary { cursor: pointer; font-weight: 650; }
.faq-item p { white-space: pre-wrap; margin-top: 9px; }
.diff td { overflow-wrap: anywhere; }
.diff .prior { background: #fdf4ef; color: #813928; white-space: pre-wrap; }
.diff .next { background: #eff8ee; color: #28533a; white-space: pre-wrap; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
dialog { width: min(860px, calc(100% - 24px)); max-height: calc(100vh - 32px); background: white; border: 1px solid var(--line); border-radius: 14px; padding: 0; color: inherit; box-shadow: 0 20px 70px #142c2152; }
dialog.narrow { max-width: 570px; }
dialog::backdrop { background: #13282083; }
.dialog-head { padding: 17px 21px; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; border-bottom: 1px solid var(--line); }
.dialog-body { padding: 19px 21px; display: grid; gap: 14px; }
.close { background: transparent; border: 0; color: var(--muted); font-size: 1.32rem; line-height: 1; padding: 3px 7px; }
.entry { min-height: 100vh; display: grid; place-items: center; padding: 22px; background: radial-gradient(ellipse at top left, #dfebd4, #f4f6f2 65%); }
.entry .panel { width: min(100%, 460px); padding: 27px; display: grid; gap: 22px; }
.entry .brand { padding: 0; }
.entry .brand-subtitle { color: var(--muted); }
.mobile-layout { max-width: 670px; min-height: 100vh; margin: 0 auto; }
.mobile-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: calc(15px + env(safe-area-inset-top)) 16px 15px; background: var(--white); border-bottom: 1px solid var(--line); }
.mobile-top .brand { padding: 0; }
.mobile-top .brand-subtitle { color: var(--muted); }
.mobile-top .link { min-height: 44px; padding: 8px 5px; }
.mobile-content { padding: 22px 16px calc(88px + env(safe-area-inset-bottom)); }
.mobile-content h1 { font-size: 1.65rem; }
.mobile-nav { position: fixed; z-index: 1; bottom: 0; left: 50%; transform: translateX(-50%); width: min(100%, 670px); display: grid; grid-template-columns: repeat(4, 1fr); background: var(--white); border-top: 1px solid var(--line); padding: 3px 5px calc(3px + env(safe-area-inset-bottom)); }
.mobile-nav button { display: grid; justify-items: center; align-content: center; gap: 4px; padding: 6px 1px; min-height: 52px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; font-size: .85rem; }
.mobile-nav button[aria-current="page"] { color: var(--green); background: #edf4eb; font-weight: 700; }
.mobile-shortcuts { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; margin-bottom: 20px; }
.mobile-shortcuts button { display: flex; align-items: center; gap: 10px; padding: 14px 12px; min-height: 55px; background: white; border: 1px solid var(--line); color: var(--green); border-radius: 10px; font-weight: 650; text-align: left; }
.mobile-shortcuts button:hover { background: #edf4eb; }
.mobile-files { list-style: none; margin: 0; padding: 0 14px; }
.mobile-files li { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding: 11px 0; }
.mobile-files .link { display: block; min-height: 28px; }
.mobile-files .meta { display: block; }
.mobile-files li > .meta { white-space: nowrap; }
.mobile-file-info { min-width: 0; overflow-wrap: anywhere; }
.loading { padding: 30px; color: var(--muted); }
#toast { position: fixed; right: 16px; bottom: 16px; z-index: 2; background: var(--forest); color: white; padding: 11px 16px; border-radius: 9px; box-shadow: 0 8px 32px #22382c3d; }
@media (max-width: 1020px) {
  .grid { grid-template-columns: 1fr; }
  .layout { grid-template-columns: 180px minmax(0, 1fr); }
  .content { padding-inline: 23px; }
  .topbar { padding-inline: 23px; }
}
@media (max-width: 700px) {
  .layout { display: block; }
  .sidebar { position: static; height: auto; padding: 13px 12px 8px; gap: 10px; }
  .brand-mark { width: 34px; }
  .nav { display: flex; overflow: auto; padding-bottom: 4px; }
  .nav button { white-space: nowrap; padding: 7px 9px; }
  .nav .icon { display: none; }
  .profile { position: absolute; top: 16px; right: 12px; border: 0; padding: 0; }
  .topbar { height: 55px; padding-inline: 13px; }
  .location span { display: none; }
  .content { padding: 19px 13px 30px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stat { padding: 11px; }
  .review { padding: 12px; align-items: center; flex-wrap: wrap; }
  .review .secondary { margin-left: 0; }
  .panel-head { padding-inline: 13px; }
  th:first-child, td:first-child { padding-left: 13px; }
  .pair { grid-template-columns: 1fr; }
}
