:root {
  --navy: #12141d;
  --navy-2: #162a4b;
  --navy-3: #223e6c;
  --navy-soft: #eef3fa;
  --blue-line: #c9d6e8;
  --red: #ff2e42;
  --red-deep: #c81e2e;
  --white: #ffffff;
  --bg-soft: #f5f7fa;
  --border: #e2e7ef;
  --border-strong: #d5dae4;
  --text: #555555;
  --heading: #000000;
  --muted: #7b8494;
  --primary: #27364f;
  --primary-dark: #16233a;
  --ok: #1f5c46;
  --danger: #c81e2e;
  --warning: #b7791f;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 12px 32px rgba(18, 20, 29, 0.07);
  --font-sans: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", system-ui, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  background: var(--white);
}

body {
  margin: 0;
  color: var(--text);
  background: var(--white);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3 {
  color: var(--heading);
  line-height: 1.2;
  font-weight: 900;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
  font-weight: 700;
}

a {
  color: var(--navy-3);
  font-weight: 700;
  text-decoration: none;
}

a:hover {
  color: var(--red-deep);
}

/* Top navigation */
.topbar {
  position: relative;
  z-index: 20;
  overflow: hidden;
  background: var(--navy);
  color: var(--white);
}

.topbar::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0 22%, transparent 22% 100%);
  pointer-events: none;
}

.topbar::after {
  content: "";
  position: absolute;
  top: -24px;
  right: -30px;
  width: 230px;
  height: 130px;
  background: linear-gradient(135deg, transparent 40%, var(--navy-3) 40%, var(--navy-3) 62%, transparent 62%);
  transform: skewX(-18deg);
  opacity: 0.9;
  pointer-events: none;
}

.topbar-inner {
  position: relative;
  z-index: 1;
  width: min(1200px, calc(100% - 40px));
  min-height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  position: relative;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  clip-path: polygon(0 0, 76% 0, 100% 24%, 100% 100%, 0 100%);
  background: linear-gradient(135deg, var(--navy-3), var(--navy-2));
  color: var(--white);
  font-size: 22px;
  font-weight: 900;
}

.brand-mark::after {
  content: "";
  position: absolute;
  right: 9px;
  bottom: 9px;
  width: 8px;
  height: 8px;
  background: var(--red);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.brand-name {
  margin: 0;
  color: var(--white);
  font-size: 18px;
  font-weight: 900;
}

.brand-sub {
  margin: 0;
  color: #a6b7cd;
  font-size: 13px;
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #31466b;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #dbe4f0;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(255, 46, 66, 0.16);
}

/* System switch */
.system-nav {
  width: min(1200px, calc(100% - 40px));
  margin: 18px auto 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
}

.system-nav-btn {
  min-height: 48px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: #6a7282;
  font-weight: 800;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.system-nav-btn:hover {
  background: #e9eef6;
  color: var(--navy);
}

.system-nav-btn.active {
  background: var(--primary);
  color: var(--white);
  box-shadow: 0 8px 18px rgba(18, 20, 29, 0.18);
}

/* Layout */
.shell {
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

/* Intro band */
.intro {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 28px;
  padding: 30px 32px;
  border-radius: var(--radius);
  background: linear-gradient(115deg, #0d1728 0%, var(--navy-2) 52%, var(--navy-3) 100%);
  color: var(--white);
  box-shadow: 0 18px 40px rgba(18, 20, 29, 0.16);
}

.intro::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 8px;
  background: var(--red);
}

.intro::after {
  content: "";
  position: absolute;
  right: -70px;
  top: -64px;
  width: 300px;
  height: 310px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.02) 100%);
  clip-path: polygon(24% 0, 100% 0, 100% 76%, 0 100%);
  pointer-events: none;
}

.intro-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  margin: 0 0 12px;
  padding: 5px 11px;
  background: var(--red);
  color: var(--white);
  font-size: 12px;
  font-weight: 800;
  clip-path: polygon(0 0, 100% 0, 93% 100%, 0 100%);
}

.intro h1 {
  margin: 0 0 10px;
  color: var(--white);
  font-size: clamp(26px, 3vw, 36px);
}

.intro-copy p:last-child {
  margin: 0;
  color: #c8d5e8;
  font-size: 15px;
}

.stats {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(100px, 1fr));
  min-width: 360px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: 0 12px 28px rgba(18, 20, 29, 0.16);
}

.stat {
  min-width: 0;
  padding: 16px 18px;
  border-right: 1px solid #e6eaf1;
}

.stat:last-child {
  border-right: 0;
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.stat strong {
  display: block;
  margin-top: 4px;
  color: var(--navy);
  font-size: 24px;
  font-weight: 900;
  line-height: 1.2;
}

/* Tabs */
.tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin-top: 26px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  overscroll-behavior-y: none;
  touch-action: pan-x;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: #6a7282;
  font-weight: 800;
  white-space: nowrap;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.tab:hover {
  background: #e9eef6;
  color: var(--navy);
}

.tab.active {
  background: var(--primary);
  color: var(--white);
  box-shadow: 0 8px 18px rgba(18, 20, 29, 0.18);
}

.view {
  margin-top: 24px;
}

.view[hidden] {
  display: none;
}

/* Forms and cards */
.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}

.form-section,
.info-section,
.query-band,
.result-area,
.payment-notice {
  position: relative;
  overflow: hidden;
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
}

.form-section::before,
.info-section::before,
.query-band::before,
.result-area::before,
.payment-notice::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--red) 0 24%, var(--navy-3) 24% 62%, var(--navy) 62% 100%);
}

.span-2 {
  grid-column: span 2;
}

.section-heading {
  position: relative;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding: 0 0 14px 14px;
  border-bottom: 1px solid #edf0f5;
}

.section-heading::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 15px;
  width: 5px;
  background: var(--red);
  transform: skewX(-14deg);
}

.section-heading h2 {
  margin: 0;
  font-size: 18px;
}

.section-heading span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field-stack {
  display: grid;
  gap: 16px;
}

.field {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.label,
.field label,
.query-field label {
  color: #333a45;
  font-size: 14px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: #2a2f38;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--navy-3);
  box-shadow: 0 0 0 3px rgba(34, 62, 108, 0.14);
}

input::placeholder,
textarea::placeholder {
  color: #a2a9b5;
}

.field-hint {
  color: var(--muted);
  font-size: 13px;
}

.photo-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
}

.photo-upload {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.photo-preview {
  width: 94px;
  height: 132px;
  display: grid;
  place-items: center;
  border: 1px dashed #b8c1cf;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  overflow: hidden;
}

.photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--white);
}

.radio-row {
  display: flex;
  gap: 10px;
  min-height: 44px;
  align-items: center;
}

.radio-option {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--white);
  cursor: pointer;
}

.radio-option input[type="radio"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--navy-3);
}

.radio-option span {
  font-size: 14px;
}

.radio-option:has(input:checked) {
  border-color: var(--navy-3);
  background: var(--navy-soft);
  color: var(--navy);
  font-weight: 800;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #3d434e;
  cursor: pointer;
}

.check-row input {
  width: 18px;
  min-height: 18px;
  margin-top: 3px;
  accent-color: var(--red);
}

.form-message {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid #f2c2c7;
  border-radius: var(--radius-sm);
  background: #fff1f2;
  color: var(--red-deep);
}

.form-message.success {
  border-color: #b8d2c6;
  background: #f0f7f3;
  color: var(--ok);
}

.quick-apply {
  margin-top: 14px;
}

.quick-apply .btn {
  width: 100%;
}

.quick-apply-top {
  grid-column: 1 / -1;
  margin: 0 0 2px;
}

.success-panel {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 36px 22px;
  border: 1px solid #b8d2c6;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #f0f7f3 0%, #ffffff 78%);
  text-align: center;
  box-shadow: var(--shadow);
}

.success-panel[hidden] {
  display: none;
}

.success-panel h2 {
  margin: 0;
  color: var(--ok);
  font-size: 24px;
}

.success-caption {
  margin: 0;
  color: var(--muted);
}

.success-regno {
  margin: 0;
  color: var(--navy);
  font-size: 22px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.success-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 10px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 22px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 800;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
  box-shadow: 0 8px 18px rgba(18, 20, 29, 0.14);
}

.btn.primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-1px);
}

.btn.secondary {
  background: var(--bg-soft);
  border-color: #d9dfe8;
  color: var(--text);
}

.btn.secondary:hover {
  background: #e9eef6;
  border-color: var(--navy-3);
  color: var(--navy);
}

.btn.danger {
  background: #fff1f2;
  border-color: #f2c2c7;
  color: var(--red-deep);
}

.btn.danger:hover {
  background: #ffe3e6;
}

.btn.danger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Query */
.query-band {
  display: flex;
  align-items: flex-end;
  gap: 14px;
}

.query-field {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 8px;
}

.result-area {
  margin-top: 18px;
}

.result-area[hidden] {
  display: none;
}

.result-record + .result-record {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid #edf0f5;
}

.result-empty {
  color: var(--danger);
  font-weight: 800;
}

.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.result-head h2 {
  margin: 0;
  font-size: 18px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 800;
}

.badge.pending {
  background: #fff1f2;
  border-color: #f2c2c7;
  color: var(--red-deep);
}

.badge.approved {
  background: var(--navy-soft);
  border-color: var(--blue-line);
  color: var(--primary-dark);
}

.badge.material {
  background: var(--navy-soft);
  border-color: var(--blue-line);
  color: var(--navy-3);
}

.badge.rejected {
  background: #fff1f2;
  border-color: #f2c2c7;
  color: var(--red-deep);
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 18px;
}

.result-row {
  min-width: 0;
  padding: 10px 0;
  border-bottom: 1px solid #edf0f5;
}

.result-row span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.result-row strong {
  display: block;
  margin-top: 3px;
  color: #2a2f38;
  overflow-wrap: anywhere;
}

.result-actions {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #edf0f5;
  text-align: right;
}

/* Payment notice */
.payment-notice {
  margin-top: 18px;
}

.payment-notice-list {
  display: grid;
  gap: 10px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
  counter-reset: payment-item;
}

.payment-notice-list li {
  position: relative;
  min-height: 30px;
  padding: 9px 14px 9px 44px;
  border: 1px solid #edf0f5;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  color: #3d434e;
  counter-increment: payment-item;
}

.payment-notice-list li::before {
  content: counter(payment-item);
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--navy-3);
  color: var(--white);
  font-size: 12px;
  font-weight: 800;
}

.payment-qr-card {
  max-width: 420px;
  margin: 0 auto;
  padding: 22px 18px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  text-align: center;
}

.payment-qr-card img {
  display: block;
  width: min(280px, 100%);
  height: auto;
  margin: 0 auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

.payment-qr-tip {
  margin: 14px 0 0;
  color: var(--danger);
  font-weight: 700;
}

.payment-qr-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}

.payment-qr-title {
  color: var(--heading);
  font-weight: 900;
}

.payment-icons {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pay-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  color: var(--white);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.pay-unionpay {
  background: linear-gradient(135deg, #e60012 0 48%, #00447c 48% 100%);
}

.pay-wechat {
  background: #07c160;
}

.pay-alipay {
  background: #1677ff;
}

/* Info */
.info-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 18px;
}

.timeline {
  display: grid;
}

.timeline-item {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid #edf0f5;
}

.timeline-item:last-child {
  border-bottom: 0;
}

.timeline-date {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.timeline-title {
  color: #2a2f38;
  font-weight: 800;
}

.timeline-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  background: var(--navy-soft);
  color: var(--navy);
  font-size: 13px;
  font-weight: 800;
}

.timeline-status::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--red);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.timeline-status.pending {
  background: #f1f3f7;
  color: var(--muted);
}

.timeline-status.pending::before {
  background: #a6aebb;
}

.material-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.material-list li {
  position: relative;
  padding: 9px 0 9px 22px;
  border-bottom: 1px solid #edf0f5;
  color: #3d434e;
}

.material-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  width: 9px;
  height: 9px;
  background: var(--navy-3);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.notice-content {
  white-space: pre-line;
  color: #3d434e;
}

.contact-box {
  position: relative;
  display: grid;
  gap: 4px;
  margin-top: 18px;
  padding: 16px 16px 16px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
}

.contact-box::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: var(--red);
  transform: skewX(-14deg);
}

.contact-box span {
  color: var(--muted);
  font-size: 13px;
}

.contact-box strong {
  color: var(--navy);
  font-size: 20px;
  font-weight: 900;
}

/* Footer */
.footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto;
  padding: 22px 0 34px;
  color: var(--muted);
  font-size: 13px;
}

.footer a {
  color: var(--navy-3);
  font-weight: 800;
}

@media (max-width: 860px) {
  .intro {
    flex-direction: column;
  }

  .stats {
    width: 100%;
    min-width: 0;
  }

  .form-grid,
  .info-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .span-2 {
    grid-column: span 1;
  }

  .field-grid,
  .result-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .photo-field {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  .topbar-inner,
  .shell,
  .footer {
    width: min(100% - 24px, 1200px);
  }

  .topbar-inner {
    min-height: 64px;
  }

  .brand-sub {
    display: none;
  }

  .status-pill {
    padding: 0 10px;
  }

  .intro {
    padding: 22px 20px;
  }

  .intro h1,
  h1 {
    font-size: 24px;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  .stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-right: 0;
    border-bottom: 1px solid #e6eaf1;
  }

  .stat:last-child {
    border-bottom: 0;
  }

  .stat strong {
    margin: 0;
  }

  .tabs {
    margin-top: 18px;
    gap: 6px;
    padding: 6px;
  }

  .tab {
    min-height: 42px;
    padding: 0 14px;
    font-size: 14px;
  }

  .form-section,
  .info-section,
  .query-band,
  .result-area {
    padding: 18px 16px;
  }

  .query-band {
    flex-direction: column;
    align-items: stretch;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .form-actions .btn {
    flex: 1;
  }

  .footer {
    flex-direction: column;
  }

  .result-actions .btn {
    width: 100%;
  }

  input,
  select,
  textarea {
    min-height: 48px;
    padding: 12px;
    font-size: 16px;
  }

  .btn {
    min-height: 48px;
  }

  .photo-preview {
    width: 88px;
    height: 123px;
  }
}
