
:root { color-scheme: light; --ink: #162b28; --muted: #4c655e; --green: #16453b; --deep: #10352e; --line: #d9e3dc; --paper: #f5f7f2; --white: #fff; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100dvh; background: var(--paper); color: var(--ink); font: 15px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; }
h1, h2, p { margin: 0; }
h1, h2 { line-height: 1.2; }
a { color: var(--green); text-underline-offset: .24em; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #688932; outline-offset: 3px; }
.shell { width: min(1120px, calc(100% - 56px)); margin-inline: auto; }
.topbar { background: var(--deep); color: #f4f8ee; }
.topbar-inner, .topbar nav { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.topbar-inner { min-height: 67px; }
.topbar a, .quiet { color: inherit; }
.brand { font: bold clamp(21px, 4vw, 28px)/1 Georgia, serif; letter-spacing: -.05em; text-decoration: none; white-space: nowrap; }
.topbar nav { font-size: 14px; }
.topbar nav a { white-space: nowrap; }
.quiet { border: 1px solid #749289; background: transparent; border-radius: 7px; padding: 6px 12px; cursor: pointer; }
.quiet:hover { background: #285347; }
.modules { border-bottom: 1px solid var(--line); background: var(--white); }
.modules .shell { display: flex; gap: clamp(12px, 3vw, 32px); }
.modules a { padding: 12px 3px 10px; color: var(--muted); font-weight: 700; text-decoration: none; border-bottom: 3px solid transparent; white-space: nowrap; }
.modules a:hover, .modules a[aria-current] { color: var(--deep); border-bottom-color: #4c775b; }
.workspace { padding-block: clamp(30px, 5vw, 62px) 60px; }
.heading { margin-bottom: 28px; }
.heading h1, .login-panel h1 { font-size: clamp(28px, 4vw, 41px); letter-spacing: -.06em; }
.heading p, .details, .hint, .login-panel > p { color: var(--muted); margin-top: 8px; }
.workspace-grid { display: grid; grid-template-columns: minmax(245px, 1fr) minmax(0, 2.2fr); gap: 24px; align-items: start; }
.list-title { font-size: 14px; color: var(--muted); margin: 3px 0 12px; }
.page-list { display: grid; gap: 8px; }
.page-link { display: flex; align-items: start; justify-content: space-between; gap: 8px; padding: 13px 12px; min-width: 0; color: var(--ink); background: var(--white); border: 1px solid var(--line); border-radius: 10px; text-decoration: none; }
.page-link:hover { border-color: #8fad99; }
.page-link[aria-current] { color: var(--deep); background: #e9f1e4; border-color: #7e9f87; }
.page-link strong, .page-link small { display: block; }
.page-link small { color: var(--muted); margin-top: 3px; }
.state { flex-shrink: 0; border-radius: 6px; font-size: 11px; font-weight: 650; padding: 2px 6px; background: #e8eee9; color: #405952; }
.state.draft { color: #694712; background: #f7e9cb; }
.editor, .login-panel { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: clamp(19px, 4vw, 34px); }
.editor-heading { display: flex; justify-content: space-between; align-items: start; gap: 8px 18px; flex-wrap: wrap; padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.editor-heading h2 { font-size: clamp(21px, 3vw, 27px); }
.editor-heading a, .details, .hint { font-size: 13px; }
label { display: block; font-weight: 700; margin: 19px 0 7px; }
label small { font-size: 12px; color: var(--muted); font-weight: 500; margin-left: 3px; }
input, textarea { display: block; width: 100%; padding: 10px 12px; border: 1px solid #a9bbaf; background: #fcfdfa; color: var(--ink); border-radius: 7px; }
textarea { resize: vertical; }
.editor-actions { display: flex; justify-content: flex-end; gap: 9px; flex-wrap: wrap; margin-top: 21px; padding-top: 16px; border-top: 1px solid var(--line); }
.primary, .secondary { min-height: 43px; padding: 8px 15px; border-radius: 7px; font-weight: 750; cursor: pointer; }
.primary { border: 1px solid var(--green); background: var(--green); color: var(--white); }
.primary:hover { background: #246154; }
.secondary { border: 1px solid #9db1a4; color: var(--green); background: var(--white); }
.secondary:hover { background: #edf4ea; }
.message { padding: 9px 12px; background: #e7f3e5; color: #225139; font-weight: 650; border-radius: 6px; margin-top: 16px; }
.message.error { background: #fbede4; color: #923b25; }
.login-view { background: #edf3e9; }
.login-panel { width: min(450px, calc(100% - 34px)); margin: clamp(35px, 11vh, 124px) auto 40px; box-shadow: 0 13px 35px #10352e10; }
.login-panel .primary { width: 100%; margin-top: 20px; }
@media (max-width: 720px) {
  .shell { width: calc(100% - 32px); }
  .workspace-grid { grid-template-columns: 1fr; gap: 18px; }
  .topbar nav { gap: 8px; font-size: 12px; }
  .topbar-inner { gap: 6px; }
}

.commerce h2 { font-size: clamp(18px, 2.5vw, 23px); }
.commerce-heading, .checkout-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.button-link { display: inline-flex; align-items: center; text-decoration: none; }
.back { display: inline-block; margin-bottom: 10px; font-size: 14px; }
.record-panel { border: 1px solid var(--line); border-radius: 12px; background: var(--white); min-width: 0; }
.checkout-card { padding: 18px 22px; }
.filters { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; padding: 16px 19px; border-bottom: 1px solid var(--line); }
.filters > div:first-child { flex: 1 1 190px; }
.filters label { margin-top: 0; }
.filters button, .filters select, .filters input { min-height: 43px; }
.filters select { font: inherit; border: 1px solid #a9bbaf; background: #fcfdfa; color: var(--ink); border-radius: 7px; padding: 8px 24px 8px 10px; }
.reset { align-self: center; padding-top: 24px; }
.table-scroll { overflow-x: auto; }
.table-scroll:focus-visible { outline-offset: -3px; }
.commerce table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; font-size: 14px; }
.commerce th, .commerce td { padding: 12px 17px; }
.commerce th { background: #f6f9f5; color: var(--muted); font-size: 12px; }
.commerce td { border-top: 1px solid var(--line); }
.commerce .buyer { max-width: 265px; overflow-wrap: anywhere; white-space: normal; }
.reference { font-family: ui-monospace, SFMono-Regular, monospace; font-size: .87em; overflow-wrap: anywhere; }
.empty { padding: 23px 18px; color: var(--muted); }
.pagination { display: flex; justify-content: end; gap: 15px; border-top: 1px solid var(--line); padding: 12px 18px; }
.order-state { display: inline-block; font-size: 12px; white-space: nowrap; }
.order-state.unpaid, .order-state.partial_refund { color: #694712; background: #f7e9cb; }
.order-state.paid, .order-state.fulfilled { color: #215239; background: #e1f1e5; }
.order-state.refunded { color: #644a64; background: #f1e9f0; }
.commerce-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 20px; }
.commerce-grid .editor { padding: clamp(18px, 3vw, 26px); }
.order-form { max-width: 680px; }
.facts { margin: 17px 0; }
.facts div { display: grid; grid-template-columns: 105px minmax(0, 1fr); gap: 10px; padding: 7px 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.order-note { white-space: pre-wrap; }
.handoff button { margin-top: 8px; }
.record-form { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 16px; }
.record-form h3 { margin: 0; font-size: 16px; }
.record-form button { margin-top: 14px; }
.payment-fields { display: grid; grid-template-columns: minmax(0, 2fr) minmax(100px, 1fr); gap: 9px; }
.history { margin-top: 18px; }
.history h2 { padding: 16px 19px; }
.commerce-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
.commerce-metrics > div { background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 15px; }
.commerce-metrics dt { color: var(--muted); font-size: 13px; }
.commerce-metrics dd { margin: 4px 0 0; font-size: clamp(19px, 4vw, 31px); font-weight: 700; overflow-wrap: anywhere; }
@media (max-width: 690px) {
  .commerce-grid { grid-template-columns: 1fr; }
}
@media (max-width: 460px) {
  .commerce-metrics { grid-template-columns: 1fr; gap: 6px; }
  .commerce-metrics > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .commerce-metrics dd { margin: 0; }
}
