:root {
  color-scheme: light;
  --paper: #faf3e4;
  --surface: #fffdf5;
  --ink: #33251e;
  --muted: #62544c;
  --line: #d9c8b3;
  --orange: #ed9c59;
  --orange-dark: #8b3b19;
  --yellow: #ffe4a0;
  --sage: #dce8d6;
  --error: #9f3038;
  --success: #2e5d41;
  --radius: 14px;
  --small-shadow: 2px 3px 0 var(--ink);
  font: 16px/1.6 system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
  scroll-padding-top: 1rem;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  min-width: 0;
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  background: radial-gradient(#9a704d19 .8px, transparent .9px) 0 0 / 9px 9px;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: .22em; }
button, input, select, textarea { font: inherit; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid #9a4624; outline-offset: 4px; }

.wrap {
  width: min(1120px, calc(100% - 64px));
  margin-inline: auto;
}

.header {
  background: var(--surface);
  border-bottom: 2px solid var(--ink);
}

.header-inner, .footer, .section-head, .actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-inner, .section-head { justify-content: space-between; }
.header-inner { min-height: 71px; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  font-size: 1.48rem;
  font-weight: 900;
  font-style: italic;
  letter-spacing: -.065em;
  line-height: 1;
}

.brand:hover { text-decoration: none; }
.mascot {
  display: block;
  width: 38px;
  height: 38px;
  background: var(--yellow) url("/duck-courier.jpg") 48% 13% / 126px auto no-repeat;
  border: 1.5px solid var(--ink);
  border-radius: 11px;
  box-shadow: 1px 2px 0 var(--ink);
  transform: rotate(-5deg);
}

nav { display: flex; gap: .48rem; font-weight: 750; font-size: .91rem; }
nav a { padding: .44rem .78rem; border: 1px solid transparent; border-radius: 8px; }
nav a[aria-current="page"] { background: var(--yellow); border-color: var(--ink); box-shadow: 1px 2px 0 var(--ink); }
nav a:hover { text-decoration: none; background: var(--paper); }
main { flex: 1; padding-block: clamp(1.45rem, 4.3vw, 3.6rem) 3.25rem; }
.loading { padding-block: 1rem; }
.footer { border-top: 1px solid var(--line); padding-block: 1.15rem; color: var(--muted); font-size: .88rem; font-weight: 750; }

h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3 { overflow-wrap: anywhere; line-height: 1.28; }
h1 { font-size: clamp(1.65rem, 4vw, 2.65rem); font-weight: 880; letter-spacing: -.045em; }
h2 { font-size: clamp(1.25rem, 3vw, 1.65rem); font-weight: 850; letter-spacing: -.025em; }
h3 { font-size: 1.08rem; font-weight: 780; }
p { overflow-wrap: anywhere; }

button, .button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  padding: .52rem 1rem;
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  color: var(--ink);
  background: var(--orange);
  box-shadow: var(--small-shadow);
  font-weight: 780;
  line-height: 1.3;
  text-align: center;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

button:hover:not(:disabled), .button:hover { background: #ffc58c; text-decoration: none; transform: translateY(-1px); }
button:active:not(:disabled), .button:active { box-shadow: 0 0 0 var(--ink); transform: translate(2px,3px); }
button:disabled { opacity: .55; cursor: wait; }
.secondary { background: var(--surface); }
.secondary:hover:not(:disabled), .button.secondary:hover { background: var(--yellow); }
.actions { justify-content: flex-start; flex-wrap: wrap; margin-top: 1rem; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  background: #fff2cd;
  border: 2px solid var(--ink);
  border-radius: 19px;
  box-shadow: 5px 6px 0 var(--ink);
  overflow: hidden;
  min-height: 390px;
  margin-bottom: 2.75rem;
}

.hero-copy {
  align-self: center;
  position: relative;
  z-index: 1;
  padding: 2rem clamp(1.35rem, 4.5vw, 3.4rem);
}

.hero h1 {
  font-size: clamp(3rem, 5.55vw, 5.25rem);
  letter-spacing: -.09em;
  line-height: 1.06;
}

.hero h1 span, .hero h1 strong { display: block; }
.hero h1 strong { color: var(--orange-dark); font-weight: 930; }
.hero p { max-width: 24em; color: var(--muted); margin-top: 1.25rem; }
.hero-actions { gap: .8rem; margin-top: 1.35rem; }
.hero-art {
  overflow: hidden;
  position: relative;
  background: var(--yellow);
  border-left: 2px solid var(--ink);
}

.hero-art img { display: block; width: 100%; height: 100%; object-fit: cover; }

.goods-heading { display: flex; align-items: center; gap: .65rem; margin-bottom: 1rem; }
.goods-heading span { color: var(--orange-dark); font-size: 1.35rem; line-height: 1; }
.goods-heading::after { content: ""; height: 1px; flex: 1; margin-left: .3rem; background: var(--line); }
.goods-heading h2 { font-size: clamp(1.45rem, 4vw, 1.9rem); }

.cards, .stats { display: grid; gap: 1rem; }
.cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.card, .panel, .empty, .stat {
  background: var(--surface);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--small-shadow);
}

.card { display: flex; flex-direction: column; overflow: hidden; }
.card .detail-image, .card-placeholder {
  display: grid;
  width: 100%;
  aspect-ratio: 16 / 10;
  margin: 0;
  border: 0;
  border-bottom: 1.5px solid var(--ink);
  border-radius: 0;
  background: #fbecd0;
  object-fit: cover;
}

.card-placeholder { place-items: center; background: repeating-linear-gradient(135deg,#f9e9c6 0 7px,#fbf0d6 7px 14px); color: var(--orange-dark); font-size: 1.8rem; }
.card-copy { display: flex; flex: 1; flex-direction: column; align-items: flex-start; gap: .6rem; padding: 1rem; }
.card-copy .button { margin-top: auto; }
.price { color: var(--orange-dark); font-size: .92rem; font-weight: 720; }
.price strong { font-size: 1.4rem; font-weight: 890; font-variant-numeric: tabular-nums; }
.empty { display: flex; align-items: center; gap: 1rem; padding: clamp(1rem, 3vw, 1.55rem); }
.empty-mark { display: grid; place-items: center; flex: 0 0 45px; height: 45px; background: var(--sage); border: 1.5px solid var(--ink); border-radius: 9px; transform: rotate(-6deg); }
.empty p { margin-top: .22rem; }

.narrow { max-width: 690px; margin-inline: auto; }
.panel { padding: clamp(1.1rem, 3.25vw, 1.85rem); }
.panel + .panel, .stats + .panel { margin-top: 1.15rem; }
.panel h1, .panel h2 { margin-bottom: .85rem; }
.section-head h1, .section-head h2 { margin-bottom: 0; }
.panel p + p { margin-top: .35rem; }
.panel > .button { margin-top: .85rem; }
.task-panel .price strong { font-size: 1.7rem; }
.back-link { display: inline-flex; min-height: 38px; align-items: center; margin-bottom: .55rem; font-weight: 750; }
.detail-image { display: block; width: 100%; max-height: 450px; object-fit: contain; background: #fbecd0; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 1.1rem; }
.login-panel { max-width: 520px; margin-top: clamp(.1rem, 3vw, 2.25rem); }
.login-panel h1 { padding-bottom: .8rem; border-bottom: 1px solid var(--line); }
.muted, .hint { color: var(--muted); }
.hint { font-size: .9rem; }
.instructions { white-space: pre-wrap; margin-top: 1rem; padding: .75rem 1rem; background: #fbefd0; border-left: 3px solid #c97442; border-radius: 4px; }

form { display: grid; gap: .95rem; }
label { display: grid; min-width: 0; align-content: start; gap: .3rem; font-size: .92rem; font-weight: 740; }
input, select, textarea {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: .56rem .7rem;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid #99836e;
  border-radius: 7px;
  font-size: 1rem;
  font-weight: 450;
}
select {
  appearance: none;
  padding-right: 1.85rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
input::file-selector-button {
  margin-right: .6rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: .16rem .45rem;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
}
textarea { resize: vertical; }
.fields { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,210px),1fr)); gap: .95rem; }
form .actions { margin-top: 0; }
.message { color: var(--error); overflow-wrap: anywhere; }
.message:empty { display: none; }
.success { color: var(--success); }

.admin-site .header { background: #f5f1da; }
.dashboard-heading { margin-bottom: 1.25rem; }
.stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat { padding: clamp(.7rem, 3vw, 1.25rem); }
.stat:nth-child(1) { background: #ffefc8; }
.stat:nth-child(2) { background: #fce0c6; }
.stat:nth-child(3) { background: var(--sage); }
.stat span { display: block; color: var(--muted); font-size: .9rem; font-weight: 700; }
.stat strong { font-size: clamp(1rem, 3.3vw, 1.75rem); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.row { border-top: 1px solid var(--line); padding-block: .9rem; overflow-wrap: anywhere; }
.row:last-child { padding-bottom: 0; }
.row p { margin-top: .25rem; }
.row .actions { margin-top: .7rem; gap: .65rem; }
#claims { margin-top: .85rem; }

.badge {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  width: fit-content;
  padding: .1rem .62rem;
  border: 1px solid #a88557;
  border-radius: 999px;
  background: #ffebaf;
  font-size: .875rem;
  font-weight: 750;
}
.badge.approved { background: #fddac0; border-color: #c5825a; }
.badge.paid { background: var(--sage); color: var(--success); border-color: #7c9d81; }
.badge.rejected { background: #f7dce0; color: var(--error); border-color: #b97c86; }
dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .35rem .95rem; margin: .85rem 0 0; }
dt { color: var(--muted); }
dd { margin: 0; overflow-wrap: anywhere; }
dialog {
  width: min(520px, calc(100% - 34px));
  max-height: calc(100% - 2rem);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: clamp(1rem, 4vw, 1.6rem);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 5px 6px 0 var(--ink);
}
dialog h2 { margin-bottom: .4rem; }
dialog form, dialog #account-content { margin-top: .85rem; }
dialog > button { margin-top: .85rem; }
dialog::backdrop { background: #30211c99; }

@media (max-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 340px; }
  .hero-copy { padding-inline: 1.45rem; }
  .hero h1 { font-size: clamp(2.65rem, 6.7vw, 4rem); }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .wrap { width: calc(100% - 34px); }
  .header-inner { min-height: 61px; gap: .35rem; }
  .brand { gap: .45rem; font-size: 1.28rem; }
  .mascot { width: 33px; height: 33px; border-radius: 8px; background-size: 112px auto; }
  nav { gap: .22rem; font-size: .88rem; }
  nav a { padding-inline: .43rem; white-space: nowrap; }
  .hero { grid-template-columns: minmax(0, 1fr); margin-bottom: 2rem; box-shadow: 4px 5px 0 var(--ink); }
  .hero-copy { padding: 1.4rem 1.15rem 1.5rem; }
  .hero h1 { font-size: clamp(2.5rem, 10vw, 3.8rem); }
  .hero p { margin-top: .78rem; }
  .hero-actions { margin-top: 1rem; }
  .hero-art { aspect-ratio: 3 / 2; border-left: 0; border-top: 2px solid var(--ink); }
  .stats { gap: .5rem; }
  .stat { padding-inline: .5rem; }
  .stat span { font-size: .85rem; }
}

@media (max-width: 440px) {
  .cards { grid-template-columns: minmax(0, 1fr); }
  .section-head { gap: .55rem; }
  .actions { gap: .7rem; }
}

@media (prefers-reduced-motion: reduce) {
  button, .button { transition: none; }
}
