:root {
  color-scheme: light;
  --brand: #bd9a60;
  --brand-hover: #a9844a;
  --primary: #bd9a60;
  --primary-hover: #a9844a;
  --text: #232323;
  --muted: #8b8985;
  --border: #d9d5cd;
  --rule: #ece9e3;
  --warning-bg: #fbf5e7;
  --danger: #9a312c;
  --page-width: 1160px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: #f7f6f3; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: #f7f6f3;
  font-size: 16px;
  line-height: 1.7;
}

button, input, select, textarea { font: inherit; }
button, label, input[type="radio"], input[type="checkbox"] { cursor: pointer; }

.site-header { height: 66px; border-bottom: 1px solid #2b2b2b; background: #000; color: #fff; }
.header-inner {
  width: min(var(--page-width), calc(100% - 64px));
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--brand); text-decoration: none; }
.official-logo {
  display: inline-block;
  width: 134px;
  height: 35px;
  flex: 0 0 auto;
  background-image: url("./assets/qianxun-logo.png");
  background-repeat: no-repeat;
  background-position: -17px -66px;
  background-size: 167px 167px;
}
.brand-divider { width: 1px; height: 20px; margin: 0 8px; background: rgba(189,154,96,.58); }
.brand-subtitle { color: #f2f2f2; font-size: 18px; font-weight: 500; letter-spacing: .06em; }
.page-shell { width: min(var(--page-width), calc(100% - 64px)); min-height: calc(100vh - 154px); margin: 0 auto; padding: 1px 44px 0; background: #fff; box-shadow: 0 1px 12px rgba(0,0,0,.025); }
.view { display: none; }
.view.is-active { display: block; }
.page-title { margin: 30px 0 30px; padding-left: 15px; border-left: 4px solid var(--primary); font-size: 31px; line-height: 1.35; }

.notice-panel { max-width: 1030px; margin: 82px auto 0; padding-bottom: clamp(36px, 5vw, 64px); }
.notice-panel h1 { margin: 0 0 42px; color: #1f1f1f; text-align: center; font-size: 34px; }
.notice-panel h1::after { content: ""; display: block; width: 54px; height: 3px; margin: 14px auto 0; background: var(--brand); }
.notice-panel p { margin: 0 0 24px; }
.notice-copy { padding-bottom: 14px; border-bottom: 1px solid var(--rule); }
.notice-copy h2 { margin: 0; font-size: 1.125rem; }
.notice-copy ol, .notice-copy ul { margin: 12px 0 24px; padding-left: 28px; }
.notice-copy li { padding: 3px 0 3px 8px; }
.confirm-row { display: flex; align-items: flex-start; gap: 10px; margin: 28px 0 28px; font-size: 18px; }
.confirm-row input { width: 20px; height: 20px; margin-top: 5px; accent-color: var(--primary); }

.button {
  min-width: 108px;
  height: 42px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 2px;
  background: #fff;
}
.button-primary { color: #111; background: var(--primary); border-color: var(--primary); font-weight: 600; }
.button-primary:hover:not(:disabled) { color: #fff; background: var(--primary-hover); border-color: var(--primary-hover); }
.button-primary:disabled { color: #aaa; background: #f2f1ee; border-color: #d8d5ce; font-weight: 400; cursor: not-allowed; }
.button-secondary { border-color: #cfcac0; color: #333; }
.button-secondary:hover { color: var(--primary); border-color: var(--primary); }

.form-section { margin-bottom: 50px; }
.form-section h2 { margin: 0 0 14px 20px; font-size: 18px; font-weight: 700; }
.section-rule { height: 1px; margin-bottom: 27px; background: linear-gradient(90deg, var(--primary) 0 46px, var(--rule) 46px 100%); }
.inline-options { display: flex; flex-wrap: wrap; gap: 24px; margin: 0 20px 22px; padding: 0; border: 0; }
.inline-options label { display: inline-flex; align-items: center; gap: 7px; }
.inline-options input { width: 17px; height: 17px; margin: 0; accent-color: var(--primary); }
.anonymous-tip { margin: -4px 20px 26px; padding: 8px 16px; border-left: 3px solid var(--primary); background: var(--warning-bg); color: #4f4f4f; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 58px; padding: 0 28px; }
.reporter-fields { min-width: 0; margin: 0; border: 0; }
.reporter-fields[hidden] { display: none; }
.field { position: relative; display: flex; min-width: 0; flex-direction: column; gap: 7px; }
.field > span { min-height: 27px; }
.required-marker { margin-right: 5px; color: var(--danger); font-style: normal; }
.field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field input, .field select { height: 40px; padding: 0 12px; }
.field select {
  appearance: none;
  padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, #9b8b70 50%), linear-gradient(135deg, #9b8b70 50%, transparent 50%);
  background-position: calc(100% - 15px) 17px, calc(100% - 10px) 17px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.field textarea { min-height: 168px; padding: 10px 12px 30px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: #b3b3b3; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(189,154,96,.13); }
.field.has-error input, .field.has-error textarea { border-color: var(--danger); }
.field-help { min-height: 20px; margin-top: -8px; color: var(--muted); font-size: 14px; }
.field-error { min-height: 18px; color: var(--danger); font-size: 14px; }
.full-width { margin: 0 28px 24px; }
.incident-fields { margin-bottom: 24px; }
.counter-field { position: relative; }
.counter { position: absolute; right: 10px; bottom: 26px; color: #4e4e4e; font-size: 14px; }
.counter-field:has(textarea) .counter { bottom: 28px; }

.repeat-list { display: grid; gap: 18px; }
.repeat-card { position: relative; padding: 0 0 20px; }
.repeat-card + .repeat-card { padding-top: 20px; border-top: 1px dashed #d8d8d8; }
.repeat-card-heading { display: none; align-items: center; justify-content: space-between; margin: 0 28px 13px; }
.repeat-card-title { color: #666; font-weight: 600; }
.remove-row-button { border: 0; color: #999; background: transparent; }
.remove-row-button:hover { color: var(--danger); }
.repeat-list.has-multiple .repeat-card-heading { display: flex; }
.add-row-button { width: calc(100% - 56px); height: 38px; margin: 0 28px; border: 1px dashed #cfc7b9; color: #333; background: #fff; }
.add-row-button:hover { color: var(--primary); border-color: var(--primary); }

.upload-field { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin: 0 28px; }
.upload-button { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border: 1px solid var(--border); border-radius: 2px; background: #fff; }
.upload-button:hover { color: var(--primary); border-color: var(--primary); }
.upload-button input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.upload-help { max-width: 1000px; margin: 0; color: var(--muted); font-size: 14px; }
.file-list { margin: 0; padding: 0; list-style: none; }
.file-list li { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.file-list button { border: 0; color: var(--muted); background: transparent; }

.form-actions { display: flex; gap: 20px; margin: 20px 0 80px; }
.site-footer { display: flex; justify-content: center; align-items: center; gap: 18px; min-height: 92px; padding: 25px 20px 32px; color: #c6c6c6; background: #000; text-align: center; font-size: 14px; letter-spacing: .08em; }
.site-footer .footer-logo { width: 160px; height: 42px; background-position: -20px -79px; background-size: 200px 200px; }
.site-footer .footer-title { padding-left: 18px; border-left: 1px solid #555; }

.success-dialog { width: min(480px, calc(100% - 32px)); padding: 34px; border: 0; border-radius: 8px; text-align: center; box-shadow: 0 16px 50px rgba(0,0,0,.18); }
.success-dialog::backdrop { background: rgba(0,0,0,.42); }
.success-dialog h2 { margin: 12px 0 8px; }
.success-dialog p { margin: 0 0 24px; color: #666; }
.success-icon { width: 54px; height: 54px; margin: 0 auto; border-radius: 50%; color: #111; background: var(--primary); font-size: 34px; line-height: 54px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 760px) {
  .site-header { height: 58px; }
  .header-inner, .page-shell { width: calc(100% - 32px); }
  .page-shell { padding-left: 18px; padding-right: 18px; }
  .brand { gap: 12px; }
  .brand .official-logo { width: 56px; height: 33px; background-image: url("./assets/qianxun-mark.png"); background-position: -7px -19px; background-size: 70px 70px; }
  .brand-divider, .brand-subtitle { display: none; }
  .notice-panel { margin-top: 48px; }
  .notice-panel h1 { font-size: 28px; }
  .page-title { font-size: 28px; }
  .form-grid { grid-template-columns: 1fr; gap: 18px; padding: 0; }
  .form-section h2, .inline-options, .anonymous-tip, .repeat-card-heading, .upload-field { margin-left: 0; margin-right: 0; }
  .full-width { margin-left: 0; margin-right: 0; }
  .add-row-button { width: 100%; margin-left: 0; margin-right: 0; }
  .form-actions { margin-bottom: 48px; }
}

@media print {
  .site-header, .site-footer, .form-actions, .add-row-button, .remove-row-button, .upload-button { display: none !important; }
  .page-shell { width: 100%; }
}
