/* Student work-order form (/order). Uses the home page palette. */
:root {
  --paper: #F2F3EF;
  --paper-2: #E5E8E3;
  --panel: #FFFFFF;
  --ink: #1A1F26;
  --ink-2: #56606B;
  --rule: #D3D8D2;
  --red: #C8372D;
  --red-deep: #7C1F18;
  --red-ink: #FFF4EE;
  --red-soft: #F8E3DF;
  --brass: #E3A93C;
  --warn: #9A5B0C;
  --bad: #B3261E;
  --f-body: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

.wo-wrap {
  max-width: 760px;
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* header */
.wo-top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  padding-top: env(safe-area-inset-top, 0px);
}
.wo-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 60px; }
.wo-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 900; font-size: 18px; letter-spacing: .04em; }
.wo-brand i { display: block; width: 24px; height: 24px; background: var(--red); border-radius: 7px 7px 7px 2px; position: relative; }
.wo-brand i::after { content: ""; position: absolute; left: 6px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--red-ink); }
.wo-lang { display: flex; gap: 2px; background: var(--paper-2); border-radius: 8px; padding: 3px; }
.wo-lang button { border: 0; background: none; padding: 4px 12px; border-radius: 6px; color: var(--ink-2); font-size: 14px; cursor: pointer; }
.wo-lang button[aria-pressed="true"] { background: var(--panel); color: var(--ink); font-weight: 500; }

/* page head */
.wo-main { padding-top: 24px; padding-bottom: calc(48px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 16px; }
.wo-head { display: grid; gap: 6px; }
.wo-steps { margin: 0; font-size: 13px; color: var(--ink-2); display: flex; gap: 6px; }
.wo-steps [aria-current="step"] { color: var(--red); font-weight: 700; }
.wo-head h1 { margin: 0; font-size: clamp(24px, 5vw, 32px); line-height: 1.25; text-wrap: balance; }
.wo-sub { margin: 0; color: var(--ink-2); font-size: 15px; }

/* WeChat strip */
.wo-wx { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; background: var(--red-soft); border-radius: 12px; padding: 12px 16px; }
.wo-wx span { color: var(--red-deep); font-size: 14px; flex: 1 1 260px; }
.wo-wx b { font-size: 19px; }
.wo-wx--strong { background: var(--red); }
.wo-wx--strong span, .wo-wx--strong b { color: var(--red-ink); }

/* panels */
.wo-panel { background: var(--panel); border: 1px solid var(--rule); border-radius: 14px; padding: clamp(16px, 4vw, 28px); }
.wo-rules { margin: 0; padding-left: 24px; display: grid; gap: 10px; font-size: 15px; }
.wo-rules li::marker { color: var(--red); font-weight: 700; }
.wo-ack { margin: 20px 0 0; padding: 16px 0 0; border: 0; border-top: 1px solid var(--rule); display: grid; gap: 10px; min-width: 0; }
.wo-ack legend { font-weight: 700; padding: 0; float: left; width: 100%; margin-bottom: 10px; }
.wo-ack .wo-row { clear: both; }

/* form */
.wo-form { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 16px; }
.wo-full { grid-column: 1 / -1; }
.wo-field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.wo-field label, .wo-choice legend { font-size: 14px; font-weight: 500; color: var(--ink); }
.wo-input {
  width: 100%;
  border: 1px solid var(--rule);
  background: var(--paper);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 16px; /* keeps iOS from zooming in */
}
.wo-input:focus { border-color: var(--red); background: var(--panel); outline: none; box-shadow: 0 0 0 3px var(--red-soft); }
textarea.wo-input { resize: vertical; min-height: 84px; }
.wo-choice { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; min-width: 0; align-content: start; }
.wo-choice legend { padding: 0; margin-bottom: 8px; }
.wo-row { display: flex; flex-wrap: wrap; gap: 8px; }
.wo-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--rule);
  background: var(--paper);
  border-radius: 10px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 15px;
  line-height: 1.4;
}
.wo-opt input { accent-color: var(--red); margin: 0; }
.wo-opt:has(input:checked) { border-color: var(--red); background: var(--red-soft); }
.wo-account { margin: 0; font-size: 13px; color: var(--ink-2); background: var(--paper-2); border-radius: 8px; padding: 8px 12px; }
.wo-err { margin: 0; color: var(--bad); font-size: 14px; }
.wo-warn { color: var(--warn); font-size: 13px; }
.wo-mail { border: 1px solid var(--rule); border-radius: 12px; padding: 14px 16px 16px; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; background: var(--paper-2); min-width: 0; }
.wo-mail legend { font-size: 14px; font-weight: 500; padding: 0 6px; }
.wo-mail .wo-input { background: var(--panel); }
.wo-box-tip { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; border: 1px dashed var(--red); border-radius: 10px; padding: 10px 12px; background: var(--red-soft); }
.wo-box-tip p { margin: 0; font-size: 14px; color: var(--ink); flex: 1 1 240px; }
.wo-box-tip b { color: var(--red); }
.wo-mail-quote { margin: 0; font-size: 14px; color: var(--ink-2); }
.wo-mail-quote b { color: var(--red); font-size: 18px; margin: 0 2px; }
@media (max-width: 640px) { .wo-mail { grid-template-columns: 1fr; padding: 12px; } }
.wo-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* buttons */
.wo-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.wo-form .wo-actions { margin-top: 4px; }
.wo-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--rule);
  background: var(--panel);
  border-radius: 10px;
  padding: 0 20px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}
.wo-btn--primary { background: var(--red); border-color: var(--red); color: var(--red-ink); }
.wo-btn--primary:hover { background: var(--red-deep); border-color: var(--red-deep); }
.wo-btn--small { min-height: 32px; padding: 0 12px; font-size: 14px; }
.wo-btn:disabled { opacity: .45; cursor: not-allowed; }
.wo-btn--primary:disabled:hover { background: var(--red); border-color: var(--red); }

/* done */
.wo-done { display: grid; gap: 14px; }
.wo-done h2 { margin: 0; font-size: 22px; }
.wo-done p { margin: 0; }
.wo-done-no b { font-size: 20px; }
.wo-done .wo-actions { margin-top: 0; }

.wo-toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  background: var(--ink);
  color: var(--paper);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 20;
}

@media (max-width: 640px) {
  .wo-form { grid-template-columns: 1fr; }
  .wo-actions .wo-btn { flex: 1 1 auto; }
}
