:root {
  --ink: #12181f;
  --steel: #2f5f8a;
  --copper: #c47a3a;
  --paper: #f3f5f8;
  --text: #182029;
  --muted: #5a6b7a;
  --line: rgba(18, 24, 31, 0.12);
  --font-display: "Sora", "Noto Sans SC", sans-serif;
  --font-body: "Noto Sans SC", sans-serif;
  --max: 720px;
  --header-h: 72px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(800px 420px at 90% -10%, rgba(47, 95, 138, 0.14), transparent 55%),
    radial-gradient(640px 360px at 0% 30%, rgba(196, 122, 58, 0.08), transparent 50%),
    linear-gradient(180deg, #eef2f6 0%, var(--paper) 50%, #e7ebf0 100%);
  line-height: 1.65;
  min-height: 100vh;
}

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

.code-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: stretch;
}

.code-row input {
  min-width: 0;
}

.code-row .btn {
  white-space: nowrap;
  min-height: 46px;
}

.user-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 16px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--muted);
  font-size: 0.92rem;
}

.user-bar strong {
  color: var(--text);
  font-weight: 600;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 4vw, 48px);
  backdrop-filter: blur(14px);
  background: rgba(243, 245, 248, 0.86);
  border-bottom: 1px solid var(--line);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
}

.logo-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.nav {
  display: flex;
  gap: 24px;
}

.nav a {
  color: var(--muted);
  font-size: 0.95rem;
}

.nav a:hover {
  color: var(--ink);
}

.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  background: none;
  border: 0;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
}

.menu-toggle.is-open span:first-child {
  transform: translateY(4.5px) rotate(45deg);
}

.menu-toggle.is-open span:last-child {
  transform: translateY(-4.5px) rotate(-45deg);
}

.mobile-nav {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  z-index: 39;
  display: flex;
  flex-direction: column;
  padding: 16px 20px 24px;
  background: rgba(243, 245, 248, 0.97);
  border-bottom: 1px solid var(--line);
}

.mobile-nav[hidden] {
  display: none;
}

.mobile-nav a {
  padding: 12px 4px;
}

.page {
  max-width: var(--max);
  margin: 0 auto;
  padding: calc(var(--header-h) + 48px) clamp(20px, 4vw, 48px) 64px;
}

.panel {
  padding: clamp(28px, 5vw, 40px);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--steel);
  font-weight: 700;
}

h1 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  line-height: 1.2;
}

.lead-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.lead {
  margin: 0;
  color: var(--muted);
  max-width: 36ch;
}

.info-form {
  display: grid;
  gap: 18px;
}

.address-list {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
}

.list-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin: 0;
}

.list-toolbar[hidden] {
  display: none;
}

.btn-manage {
  min-height: 44px;
  min-width: 88px;
  padding: 0 20px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn-manage:hover {
  border-color: var(--ink);
  background: rgba(18, 24, 31, 0.04);
}

.btn-manage[hidden] {
  display: none;
}

.btn-confirm {
  border-color: rgba(47, 95, 138, 0.45);
  color: var(--steel);
}

.btn-confirm:hover {
  border-color: var(--steel);
  background: rgba(47, 95, 138, 0.08);
}

.btn-cancel {
  border-color: rgba(196, 59, 46, 0.35);
  color: #c43b2e;
}

.btn-cancel:hover {
  border-color: #c43b2e;
  background: rgba(196, 59, 46, 0.06);
}

.address-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: stretch;
  padding: 16px;
  border: 1px solid var(--line);
  background: #fff;
}

.address-body {
  min-width: 0;
}

.address-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin-bottom: 8px;
}

.address-top strong {
  font-family: var(--font-display);
  line-height: 1.4;
}

.address-top span {
  color: var(--muted);
  margin: 0;
  line-height: 1.4;
}

.address-body p {
  color: var(--muted);
  margin: 0;
}

.ship-tag {
  font-style: normal;
  color: #c43b2e;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.4;
}

.address-ops {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-top: 12px;
}

.address-delete,
.address-move {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--steel);
  cursor: pointer;
  font-size: 0.88rem;
}

.address-delete:hover,
.address-move:hover:not(:disabled) {
  color: var(--ink);
}

.address-move:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.address-delete.is-marked {
  color: #c43b2e;
  font-weight: 700;
}

.ship-choice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  color: var(--steel);
  font-size: 0.88rem;
  cursor: pointer;
}

.ship-choice input {
  width: 16px;
  height: 16px;
  accent-color: var(--steel);
}

.address-card.is-pending-delete {
  border-color: rgba(196, 59, 46, 0.35);
  background: rgba(196, 59, 46, 0.04);
}

.address-edit {
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.9rem;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.address-edit:hover {
  border-color: var(--ink);
  background: rgba(18, 24, 31, 0.04);
}

.empty-tip {
  margin: 0 0 20px;
  color: var(--muted);
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-size: 0.9rem;
  color: var(--muted);
}

.field-hint {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: #fff;
  outline: none;
  resize: vertical;
  transition: border-color 0.2s ease;
  font: inherit;
  color: var(--text);
  border-radius: 12px;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--steel);
}

.field input.is-error,
.field textarea.is-error,
.field select.is-error {
  border-color: #c45c3a;
}

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

@media (max-width: 720px) {
  .region-row {
    grid-template-columns: 1fr;
  }
}

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

.actions[hidden] {
  display: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border: 0;
  cursor: pointer;
  font-weight: 500;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--copper);
  color: #fff;
}

.btn-primary:hover {
  background: #d48945;
}

.btn-ghost {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
}

.btn-ghost:hover {
  border-color: var(--ink);
}

.form-tip {
  margin: 18px 0 0;
  color: var(--steel);
  font-size: 0.95rem;
}

.form-tip.is-error {
  color: #c45c3a;
}

.site-footer {
  padding: 28px clamp(20px, 4vw, 48px) 40px;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
}

.footer-meta {
  margin-top: 8px;
  font-size: 0.82rem;
  opacity: 0.8;
}

.progress-panel {
  margin-top: 20px;
}

.progress-title {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 1.9rem);
}

.order-progress-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.order-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.7);
}

.order-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.order-meta {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.order-ship {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.progress-track {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
}

.progress-track li {
  position: relative;
  text-align: center;
  font-size: 0.72rem;
  color: var(--muted);
  padding-top: 18px;
  z-index: 1;
}

.progress-track li::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  transform: translateX(-50%);
  background: #d7dde6;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #d7dde6;
  z-index: 2;
}

/* 节点之间的横线 */
.progress-track li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 5px;
  left: calc(50% + 8px);
  width: calc(100% - 16px);
  height: 3px;
  border-radius: 2px;
  background: #d7dde6;
  z-index: 0;
}

/* 已走完的段：整段深色 */
.progress-track li.is-link-full:not(:last-child)::after {
  background: var(--steel);
}

/* 当前段：一半深色表示正在向下一步 */
.progress-track li.is-link-half:not(:last-child)::after {
  background: linear-gradient(to right, var(--steel) 0 50%, #d7dde6 50% 100%);
}

.progress-track li.is-done {
  color: var(--steel);
  font-weight: 600;
}

.progress-track li.is-done::before {
  background: var(--steel);
  box-shadow: 0 0 0 1px var(--steel);
}

.progress-track li.is-current {
  color: var(--ink);
}

.progress-track li.is-current::before {
  background: var(--steel);
  box-shadow: 0 0 0 1px var(--steel);
}

/* 已签收为终点：与已完成步骤同色，不再用强调黑字 */
.progress-track li.is-current:last-child {
  color: var(--steel);
  font-weight: 600;
}

@media (max-width: 720px) {
  .progress-track {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
  }

  .progress-track li {
    font-size: 0.62rem;
  }
}

@media (max-width: 720px) {
  .nav {
    display: none;
  }

  .menu-toggle {
    display: flex;
  }

  .actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }
}
