/*
 * Mobile-first convention: base rules below target a narrow (phone) viewport.
 * Progressive enhancement for larger screens happens exclusively through
 * `@media (min-width: 640px)` blocks placed right after the base rule they
 * enhance. 640px is the one and only breakpoint used across this file.
 */
:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --text: #1f2a37;
  --muted: #6b7280;
  --border: #e3e7ec;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --accent-2: #0ea5a4;
  --ok: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;
}
* { box-sizing: border-box; }
html[lang="zh-CN"] body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", "Segoe UI", Arial, sans-serif;
}
html[lang="zh-CN"] input,
html[lang="zh-CN"] select,
html[lang="zh-CN"] button { font-family: inherit; }
html[lang="zh-CN"] .row > div,
html[lang="zh-CN"] .status-grid > a { min-width: 0; }
html[lang="zh-CN"] p,
html[lang="zh-CN"] label { line-height: 1.6; }
.lang-switch-menu a.lang-switch-item { text-decoration: none; }
.lang-switch-item:disabled { color: var(--muted); cursor: default; }
.lang-switch-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}
.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 16px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.topbar a { color: var(--text); text-decoration: none; font-weight: 600; }
.topbar .right { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.topbar .right a { font-weight: 400; color: var(--muted); }
.admin-lang { display: inline-flex; align-items: center; gap: 6px; }
.admin-lang-btn {
  display: inline-block;
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  background: var(--card);
  font-size: 12px;
  text-decoration: none;
}
.admin-lang .admin-lang-btn.is-active { color: var(--accent); border-color: var(--accent); font-weight: 700; }
.admin-lang-login { display: flex; justify-content: flex-end; margin-bottom: 14px; }
.admin-lang-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
}
h1 { font-size: 22px; margin: 0 0 8px; }
h2 { font-size: 17px; margin: 0 0 14px; }
p.lead { color: var(--muted); margin-top: 0; }
.lead-steps {
  color: var(--muted);
  margin: 0 0 20px;
  padding-left: 22px;
}
.lead-steps li { margin-bottom: 6px; }
.lead-steps li::marker { font-weight: 600; color: var(--text); }
.lead-steps li:last-child { margin-bottom: 0; }
label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 14px 0 6px;
}
label.inline { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; margin: 6px 10px 0 0; white-space: normal; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel], input[type=date], select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  /* 16px minimum keeps iOS Safari from auto-zooming the page on focus */
  font-size: 16px;
  background: #fff;
  color: var(--text);
  transition: border-color .15s ease, box-shadow .15s ease;
}
input[type=text]:focus, input[type=email]:focus, input[type=password]:focus,
input[type=number]:focus, input[type=tel]:focus, input[type=date]:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
input[type=file] { margin-top: 4px; }
.file-upload { position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.file-upload .file-upload-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.file-upload .btn { margin-top: 0; }
.file-upload-label { cursor: pointer; }
.file-upload-input:focus-visible + .file-upload-label { outline: 2px solid var(--accent); outline-offset: 3px; }
.file-upload-name { min-width: 0; max-width: 100%; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }

.field-icon { position: relative; }
.field-icon svg {
  position: absolute;
  left: 13px;
  top: 41px;
  width: 17px;
  height: 17px;
  stroke: var(--muted);
  pointer-events: none;
}
.field-icon input { padding-left: 38px; }

.field-error {
  display: block;
  color: var(--danger);
  font-size: 12px;
  margin-top: 5px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: opacity .15s ease, max-height .15s ease;
}
.field-error.show { max-height: 20px; opacity: 1; }
.field-icon input.invalid { border-color: var(--danger); }
.input-hint {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 5px;
}

.row { display: flex; flex-direction: column; gap: 14px; }
.row > div { width: 100%; }
@media (min-width: 640px) {
  .row { flex-direction: row; }
  .row > div { width: auto; flex: 1; }
}
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 11px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  margin-top: 18px;
  transition: background .15s ease, opacity .15s ease, transform .15s ease;
}
.btn:hover { background: var(--accent-dark); }
.btn.secondary { background: #fff; color: var(--text); border: 1px solid var(--border); }
.btn.small { padding: 7px 12px; font-size: 13px; margin-top: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-gradient {
  display: inline-block;
  background-image: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent));
  background-size: 200% 100%;
  background-position: 0% 0%;
  color: #fff;
  border: none;
  padding: 11px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  margin-top: 18px;
  transition: background-position .4s ease, transform .15s ease;
}
.btn-gradient:hover { background-position: 100% 0%; transform: translateY(-1px); }
.btn-gradient:disabled { opacity: .5; cursor: not-allowed; }
.btn-lg { padding: 15px 30px; font-size: 16px; margin-top: 26px; }

/* custom checkbox */
.check-row { display: flex; align-items: flex-start; gap: 10px; margin: 12px 0; }
.check-row input[type=checkbox] {
  position: absolute;
  opacity: 0;
  width: 20px;
  height: 20px;
  margin: 0;
}
.check-row .check-box {
  flex: 0 0 auto;
  position: relative;
  width: 20px;
  height: 20px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s ease, border-color .15s ease;
}
.check-row input[type=checkbox]:checked + .check-box {
  background: var(--accent);
  border-color: var(--accent);
}
.check-row .check-box svg {
  width: 13px;
  height: 13px;
  stroke: #fff;
  opacity: 0;
  transition: opacity .1s ease;
}
.check-row input[type=checkbox]:checked + .check-box svg { opacity: 1; }
.check-row input[type=checkbox]:focus-visible + .check-box {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}
.check-row label {
  margin: 0;
  font-weight: 400;
  font-size: 14px;
  cursor: pointer;
}
.error {
  background: #fef2f2;
  color: var(--danger);
  border: 1px solid #fecaca;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}
.notice {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}
.status-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 640px) {
  .status-grid { grid-template-columns: 1fr 1fr; }
}
.status-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  text-decoration: none;
  color: var(--text);
  display: block;
}
.status-card:hover { border-color: var(--accent); }
.status-card .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.dot.ok { background: var(--ok); }
.dot.pending { background: var(--warn); box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.15); }
.dot.missing { background: #d1d5db; }
.status-card .title { font-weight: 600; margin-bottom: 4px; }
.status-card .sub { font-size: 13px; color: var(--muted); }
.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { background: #f9fafb; font-weight: 600; }
.axle-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
  padding: 10px;
  background: #f9fafb;
  border-radius: 8px;
}
.axle-row > div { width: 100%; }
.axle-row .remove { flex: 0 0 auto; }
@media (min-width: 640px) {
  .axle-row { flex-direction: row; align-items: flex-end; gap: 10px; }
  .axle-row > div { width: auto; flex: 1; }
}
.axle-row-detailed { flex-wrap: wrap; }
.axle-row-detailed > .axle-heading { flex-basis: 100%; font-size: 14px; font-weight: 600; margin: 0 0 4px; }
.axle-row-detailed > .axle-measure { min-width: 0; }
.axle-row-detailed > .axle-flags { display: flex; flex-wrap: wrap; gap: 8px 14px; flex-basis: 100%; }
.axle-flags .inline { margin: 6px 0 0; }
@media (min-width: 640px) {
  .axle-row-detailed > .axle-measure { flex: 1 1 calc(50% - 10px); }
}
.muted { color: var(--muted); font-size: 13px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.ok { background: #dcfce7; color: #166534; }
.badge.pending { background: #fef3c7; color: #92400e; }
.badge.missing { background: #f3f4f6; color: #6b7280; }
.link-plain { color: var(--accent); text-decoration: none; }
.link-plain:hover { text-decoration: underline; }

.form-nav { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.form-nav .btn, .form-nav .btn-gradient {
  margin-top: 0;
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
@media (min-width: 640px) {
  .form-nav { flex-direction: row; flex-wrap: wrap; }
  .form-nav .btn, .form-nav .btn-gradient { width: auto; display: inline-flex; }
}

.card.highlight { border-color: var(--accent); }

.edit-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  margin-left: 6px;
  vertical-align: middle;
}
.edit-link:hover { color: var(--accent); }

.revision-list { margin: 4px 0 0; padding-left: 18px; font-size: 13px; color: var(--muted); }
.revision-list li { margin-bottom: 2px; }

.icon-btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--danger);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  line-height: 1;
  font-size: 15px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.icon-btn:hover { background: #fef2f2; border-color: var(--danger); }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 20px;
}
.modal-box {
  background: var(--card);
  border-radius: 14px;
  padding: 24px 20px;
  text-align: center;
  width: 100%;
  max-width: 320px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}
@media (min-width: 640px) {
  .modal-box { padding: 28px 32px; }
}
.modal-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 18px;
}

/* header */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.site-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.logo {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
  flex: 0 0 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.header-right { display: flex; align-items: center; gap: 8px; min-width: 0; }
.header-btn {
  margin-top: 0;
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 8px 12px;
  font-size: 13px;
}
.header-logout { font-size: 12px; flex: 0 0 auto; }

.lang-switch { position: relative; flex: 0 0 auto; }
.lang-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}
@media (min-width: 640px) {
  .site-header-inner { padding: 16px 20px; gap: 16px; }
  .logo { font-size: 19px; }
  .header-right { gap: 14px; }
  .header-btn { max-width: none; font-size: 14px; padding: 11px 20px; }
  .header-logout { font-size: 13px; }
  .lang-switch-btn { gap: 6px; padding: 8px 10px; font-size: 13px; }
}
.lang-switch-btn:hover { border-color: var(--accent); }
.lang-switch-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
  min-width: 130px;
  overflow: hidden;
  z-index: 40;
}
.lang-switch-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 9px 14px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}
.lang-switch-item:hover { background: var(--bg); }
.lang-switch-item.is-active { font-weight: 700; color: var(--accent); }

/* footer */
.site-footer {
  background: #fff;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}
.site-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.footer-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
@media (min-width: 640px) {
  .site-footer-inner {
    padding: 28px 20px;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 28px;
    justify-content: space-between;
  }
  .footer-col { min-width: 180px; }
}
.footer-logo { font-weight: 800; font-size: 15px; }
.footer-muted { color: var(--muted); font-size: 13px; margin: 0; }
.footer-link { color: var(--muted); font-size: 13px; text-decoration: none; }
.footer-link:hover { color: var(--accent); text-decoration: underline; }
.footer-contact {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
  text-decoration: none;
}
.footer-contact svg { stroke: var(--accent); flex: 0 0 auto; }

/* landing */
.hero {
  max-width: 820px;
  margin: 0 auto;
  padding: 32px 16px 16px;
  text-align: left;
}
.hero h1 { font-size: 22px; line-height: 1.3; margin: 0 0 16px; }
.hero .pitch { font-size: 15px; font-weight: 600; color: var(--text); margin: 0 0 20px; }
.steps { list-style: none; margin: 0 0 24px; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.steps li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}
.step-num {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}
.steps p { margin: 0; color: var(--text); }
.steps strong { font-weight: 700; }
.hero .closing { font-size: 15px; font-weight: 600; margin: 22px 0 4px; }
.hero .cta-row { margin-bottom: 20px; }
@media (min-width: 640px) {
  .hero { padding: 56px 20px 20px; }
  .hero h1 { font-size: 30px; margin: 0 0 18px; }
  .hero .pitch { font-size: 17px; margin: 0 0 22px; }
  .steps { gap: 16px; }
  .steps li { gap: 14px; padding: 16px 18px; }
  .step-num { width: 30px; height: 30px; font-size: 14px; }
  .hero .closing { font-size: 16px; margin: 24px 0 4px; }
}
