* { box-sizing: border-box; }

:root {
  color-scheme: light;
  --ink: #172638;
  --muted: #4d6075;
  --accent: #234e86;
  --line: #c3ceda;
  --field: #f7f9fc;
  --desk: #e7edf5;
  font: 15px/1.5 "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  color: var(--ink);
  background: #fdfefe;
}

body { margin: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
button, input, select, textarea { border: 1px solid var(--line); border-radius: 6px; }
button { padding: .58rem .84rem; font-weight: 650; white-space: nowrap; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
h1, h2, p { margin: 0; }
.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.primary:hover:not(:disabled) { background: #173b6a; }
.secondary { background: var(--field); color: var(--accent); }
.secondary:hover:not(:disabled), .quiet:hover:not(:disabled) { background: var(--desk); }
.quiet { color: var(--accent); background: transparent; border-color: transparent; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 65px;
  padding: 8px clamp(16px, 3vw, 44px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 14px; font-weight: 650; }
.brand img { width: 115px; height: auto; display: block; }
.brand span { border-left: 1px solid var(--line); padding-left: 14px; }
.workspace { display: grid; grid-template-columns: minmax(350px, 5fr) minmax(0, 7fr); min-height: calc(100dvh - 65px); }
.editor { width: min(100%, 670px); justify-self: end; padding: clamp(18px, 4vw, 52px); }
.editor-intro { margin-bottom: 28px; }
h1 { font-size: clamp(1.65rem, 3vw, 2.25rem); line-height: 1.2; letter-spacing: -.035em; }
.editor-intro p { margin-top: 8px; color: var(--muted); }
fieldset { border: 0; padding: 10px 0 24px; margin: 0 0 12px; min-inline-size: 0; }
fieldset + fieldset { border-top: 1px solid var(--line); }
legend { padding: 0 12px 0 0; font-size: 1.06rem; font-weight: 700; }
label { display: block; min-width: 0; font-weight: 600; }
small, .hint { color: var(--muted); font-weight: 400; }
.hint { margin-top: 8px; font-size: .87rem; }
input, select, textarea {
  display: block;
  width: 100%;
  padding: .5rem .65rem;
  margin-top: 4px;
  background: var(--field);
  color: var(--ink);
}
input::placeholder, textarea::placeholder { color: var(--muted); }
textarea { resize: vertical; }
.fields { display: grid; gap: 11px; }
.payment { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }
.item {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(90px, 1fr) auto;
  align-items: start;
  gap: 8px;
  margin-bottom: 12px;
}
.remove { margin-top: 24px; padding-inline: .38rem; }
.item-actions { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
#total { color: var(--ink); font: 650 .94rem/1.5 Consolas, "Microsoft YaHei", monospace; }
.proof { min-width: 0; background: var(--desk); padding: clamp(18px, 3.4vw, 48px); }
.proof-content { position: sticky; top: 18px; max-width: 670px; margin-inline: auto; }
.proof-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.proof-heading h2 { font-size: 1.15rem; }
.proof-heading p { font: .86rem/1.5 Consolas, "Microsoft YaHei", monospace; color: var(--muted); }
#paper { display: block; width: 100%; height: auto; background: white; box-shadow: 0 10px 28px #27436823; }
.notice { padding: .6rem .75rem; margin-bottom: 12px; background: var(--field); border-left: 3px solid var(--accent); }
.notice:empty { display: none; }
.login { max-width: 420px; padding: 28px; margin: clamp(24px, 13vh, 130px) auto 0; }
.login h1 { margin: 18px 0 20px; }
.login button { width: 100%; margin-top: 14px; }
.login img { width: 140px; display: block; }
@media (max-width: 760px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .editor { justify-self: center; }
  .proof-content { position: static; }
}
@media (max-width: 370px) {
  .brand img { width: 85px; }
  .brand span { padding-left: 8px; }
  .brand { gap: 8px; }
}
