/* ==========================================================================
   器材寄送中心 · 全局样式系统
   设计语言：Apple / Linear 风格，干净、现代、高质感、无侵入
   ========================================================================== */

:root {
  /* 色彩系统 - 靛蓝/深蓝主调 + 顺丰品牌红黑辅助 */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-active: #1e40af;
  --primary-light: #eff6ff;
  --primary-ring: rgba(37, 99, 235, 0.2);

  --sf-red: #dc2626;
  --sf-red-hover: #b91c1c;
  --sf-black: #111827;
  --sf-bg: #0f172a;

  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-hover: #f3f4f6;
  --bg-active: #e2e8f0;

  --text-main: #0f172a;
  --text-body: #334155;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --text-white: #ffffff;

  --border-subtle: #e2e8f0;
  --border-medium: #cbd5e1;
  --border-focus: #3b82f6;

  /* 状态色 */
  --status-pending-bg: #fef3c7;
  --status-pending-text: #92400e;
  --status-pending-border: #fde68a;

  --status-received-bg: #dbeafe;
  --status-received-text: #1e40af;
  --status-received-border: #bfdbfe;

  --status-shipped-bg: #dcfce7;
  --status-shipped-text: #166534;
  --status-shipped-border: #bbf7d0;

  --status-completed-bg: #f1f5f9;
  --status-completed-text: #475569;
  --status-completed-border: #cbd5e1;

  --status-cancelled-bg: #fee2e2;
  --status-cancelled-text: #991b1b;
  --status-cancelled-border: #fecaca;

  /* 投影系统 */
  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-card: 0 4px 6px -1px rgba(15, 23, 42, 0.05), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.05);

  /* 圆角 */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-card: 16px;
  --radius-full: 9999px;

  /* 动效 */
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 150ms;
  --duration-normal: 220ms;
  --transition-theme: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;

  /* 布局 */
  --container-max: 760px;
  --container-wide: 1100px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* 基础重置 */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, "Noto Sans Thai", "Leelawadee UI", "Tahoma", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text-body);
  background-color: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  font-size: 15px;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(100% 80% at 50% 0%, rgba(224, 238, 255, 0.45) 0%, rgba(248, 250, 252, 0) 100%), var(--bg-page);
  background-attachment: fixed;
}

/* 链接与排版 */
a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--duration-fast);
}
a:hover {
  color: var(--primary-hover);
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-main);
  font-weight: 600;
  line-height: 1.25;
}

p {
  margin: 0;
}

/* 顶部导航栏 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
}

.header-container {
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  text-decoration: none;
}

.brand-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  background: var(--bg-subtle);
  padding: 4px;
  border-radius: var(--radius-full);
  border-radius: var(--radius-full);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex-shrink: 0;
}

/* 紧凑型多语言切换器 */
.lang-switcher {
  position: relative;
  display: inline-flex;
  align-items: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0 6px 0 8px;
  height: 32px;
  transition: border-color var(--duration-fast), background-color var(--duration-fast);
}

.lang-switcher:hover, .lang-switcher:focus-within {
  border-color: var(--border-medium);
  background: #ffffff;
}

.lang-icon {
  color: var(--text-muted);
  flex-shrink: 0;
  margin-right: 4px;
  pointer-events: none;
}

.lang-select {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 0.8125rem;
  font-weight: 500;
  padding-right: 14px;
  cursor: pointer;
  outline: none;
  line-height: 30px;
  font-family: inherit;
}

.lang-arrow {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--text-muted);
  display: flex;
  align-items: center;
}
.nav-link {
  padding: 0.4rem 0.9rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: var(--radius-full);
  transition: all var(--duration-fast);
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--text-main);
}

.nav-link.active {
  background: #ffffff;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

/* 页面主要区域 */
.main-content {
  flex: 1;
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 1.75rem 1.25rem 3.5rem;
}

.main-content.wide {
  max-width: var(--container-wide);
}

/* 页头文案 */
.page-hero {
  margin-bottom: 1.5rem;
  text-align: center;
}

.page-hero h1 {
  font-size: 1.625rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.375rem;
}

.page-hero p {
  color: var(--text-muted);
  font-size: 0.925rem;
}

/* 卡片容器 */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  transition: box-shadow var(--duration-normal);
}

.card:hover {
  box-shadow: var(--shadow-lg);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.card-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-subtitle {
  font-size: 0.825rem;
  color: var(--text-muted);
  font-weight: normal;
}

/* 表单控件 */
.form-group {
  margin-bottom: 1.125rem;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-main);
  margin-bottom: 0.375rem;
}

.form-label .required {
  color: var(--sf-red);
  margin-left: 2px;
}

.form-label .label-tip {
  font-size: 0.8rem;
  font-weight: normal;
  color: var(--text-light);
  margin-left: 0.5rem;
}

.input-text, .input-textarea, .input-select {
  width: 100%;
  font-family: inherit;
  font-size: 0.9375rem;
  line-height: 1.4;
  padding: 0.65rem 0.875rem;
  color: var(--text-main);
  background-color: #ffffff;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  outline: none;
  transition: var(--transition-theme);
  min-height: 44px; /* 触控友好 */
}

.input-textarea {
  min-height: 80px;
  resize: vertical;
}

.input-text:focus, .input-textarea:focus, .input-select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

.input-text:disabled, .input-textarea:disabled, .input-select:disabled {
  background-color: var(--bg-subtle);
  color: var(--text-light);
  cursor: not-allowed;
}

.input-text::placeholder, .input-textarea::placeholder {
  color: var(--text-light);
}

.input-error {
  border-color: var(--sf-red) !important;
}

.error-hint {
  font-size: 0.8rem;
  color: var(--sf-red);
  margin-top: 0.25rem;
  display: none;
}
.error-hint.show {
  display: block;
}

/* 按钮规范 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1;
  padding: 0.65rem 1.125rem;
  min-height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  user-select: none;
  text-decoration: none;
  transition: all var(--duration-fast) var(--ease-spring);
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.98);
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-ring);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}
.btn-primary:active:not(:disabled) {
  background: var(--primary-active);
}

.btn-secondary {
  background: #ffffff;
  color: var(--text-main);
  border-color: var(--border-medium);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--bg-subtle);
  border-color: var(--border-medium);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--bg-subtle);
  color: var(--text-main);
}

.btn-danger {
  background: #fef2f2;
  color: var(--sf-red);
  border-color: #fecaca;
}
.btn-danger:hover:not(:disabled) {
  background: var(--sf-red);
  color: #ffffff;
  border-color: var(--sf-red);
}

.btn-sf {
  background: var(--sf-black);
  color: #ffffff;
  border: 1px solid #334155;
}
.btn-sf:hover:not(:disabled) {
  background: #1e293b;
  color: #ffffff;
}

.btn-sm {
  padding: 0.375rem 0.65rem;
  font-size: 0.8125rem;
  min-height: 32px;
  border-radius: 6px;
}

.btn-lg {
  padding: 0.875rem 1.5rem;
  font-size: 1.05rem;
  font-weight: 600;
  min-height: 48px;
  border-radius: var(--radius-md);
  width: 100%;
}

/* 状态徽章 Badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.775rem;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
}

.status-badge::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-pending {
  background: var(--status-pending-bg);
  color: var(--status-pending-text);
  border-color: var(--status-pending-border);
}
.status-pending::before { background: #d97706; }

.status-received {
  background: var(--status-received-bg);
  color: var(--status-received-text);
  border-color: var(--status-received-border);
}
.status-received::before { background: #2563eb; }

.status-shipped {
  background: var(--status-shipped-bg);
  color: var(--status-shipped-text);
  border-color: var(--status-shipped-border);
}
.status-shipped::before { background: #16a34a; }

.status-completed {
  background: var(--status-completed-bg);
  color: var(--status-completed-text);
  border-color: var(--status-completed-border);
}
.status-completed::before { background: #64748b; }

.status-cancelled {
  background: var(--status-cancelled-bg);
  color: var(--status-cancelled-text);
  border-color: var(--status-cancelled-border);
}
.status-cancelled::before { background: #dc2626; }

/* 步进器 Stepper */
.stepper {
  display: inline-flex;
  align-items: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.stepper-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-main);
  font-size: 1.1rem;
  font-weight: 500;
  transition: all var(--duration-fast);
  user-select: none;
}
.stepper-btn:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--border-medium);
}
.stepper-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.stepper-val {
  min-width: 36px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  padding: 0 4px;
}

/* 快捷配件标签 Chips */
.chips-scroll {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.875rem;
}

.chip-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-body);
  font-size: 0.8125rem;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all var(--duration-fast);
  user-select: none;
}

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

.chip-btn:active {
  transform: translateY(0);
}

/* 器材清单列表 */
.items-list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin-bottom: 0.875rem;
}

.item-row {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: border-color var(--duration-fast);
}

.item-row:hover {
  border-color: var(--border-medium);
}

.item-row .input-text {
  flex: 1;
  min-width: 0;
  min-height: 38px;
  padding: 0.4rem 0.7rem;
  background: #ffffff;
}

.item-row .btn-del {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: var(--text-light);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--duration-fast);
}
.item-row .btn-del:hover {
  background: #fee2e2;
  color: var(--sf-red);
}

.items-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.items-total {
  font-weight: 600;
  color: var(--text-main);
}

/* 照片上传区域 */
.upload-dropzone {
  border: 2px dashed var(--border-medium);
  border-radius: var(--radius-md);
  padding: 1.75rem 1rem;
  text-align: center;
  background: var(--bg-subtle);
  cursor: pointer;
  transition: all var(--duration-normal);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.upload-dropzone:hover, .upload-dropzone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.upload-icon {
  width: 44px;
  height: 44px;
  color: var(--primary);
  background: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.upload-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
}

.upload-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* 缩略图网格 */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.photo-cell {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.photo-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-cell .heic-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.25rem;
  color: var(--text-muted);
  font-size: 0.7rem;
  line-height: 1.2;
}

.photo-cell .btn-remove-photo {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  background: rgba(15, 23, 42, 0.75);
  color: #ffffff;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--duration-fast);
}

.photo-cell .btn-remove-photo:hover {
  background: var(--sf-red);
}

/* 上传进度条 */
.progress-wrap {
  margin-top: 1rem;
  display: none;
}
.progress-wrap.show {
  display: block;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.825rem;
  margin-bottom: 0.375rem;
  color: var(--text-muted);
}

.progress-track {
  width: 100%;
  height: 8px;
  background: var(--bg-subtle);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #3b82f6, #2563eb);
  border-radius: 4px;
  transition: width 0.15s ease-out;
}

/* 顺丰专属卡片 */
.sf-card {
  background: linear-gradient(135deg, #111827 0%, #1f2937 100%);
  color: #ffffff;
  border-radius: var(--radius-card);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
}

.sf-card::after {
  content: "";
  position: absolute;
  top: -40px;
  right: -40px;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(220, 38, 38, 0.25) 0%, transparent 70%);
  pointer-events: none;
}

.sf-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.sf-brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(220, 38, 38, 0.15);
  border: 1px solid rgba(220, 38, 38, 0.4);
  color: #fca5a5;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.775rem;
  font-weight: 600;
}

.sf-brand-badge .sf-dot {
  width: 6px;
  height: 6px;
  background: #ef4444;
  border-radius: 50%;
}

.sf-tracking-label {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-bottom: 0.25rem;
}

.sf-tracking-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.sf-tracking-no {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 1.625rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #ffffff;
}

.sf-actions {
  display: flex;
  gap: 0.625rem;
  flex-wrap: wrap;
}

.sf-actions .btn {
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  min-height: 38px;
}

.btn-sf-white {
  background: #ffffff;
  color: #0f172a;
}
.btn-sf-white:hover {
  background: #f1f5f9;
}

.btn-sf-outline {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
}
.btn-sf-outline:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* 顺丰卡片外链按钮与说明文字 */
.sf-actions .btn.is-disabled,
.sf-actions .btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.6);
}

.sf-external-hint {
  margin: 0.5rem 0 0;
  font-size: 0.75rem;
  line-height: 1.5;
  color: #94a3b8;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* 时间线与状态流程 */
.timeline {
  position: relative;
  padding-left: 1.75rem;
  margin-top: 1rem;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 7px;
  width: 2px;
  background: var(--border-medium);
}

.timeline-item {
  position: relative;
  padding-bottom: 1.25rem;
}

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

.timeline-dot {
  position: absolute;
  left: -1.75rem;
  top: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid var(--border-medium);
  box-shadow: 0 0 0 2px #fff;
  transition: all var(--duration-fast);
}

.timeline-item.active .timeline-dot {
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

.timeline-time {
  font-size: 0.775rem;
  color: var(--text-light);
  margin-bottom: 0.2rem;
  font-variant-numeric: tabular-nums;
}

.timeline-desc {
  font-size: 0.875rem;
  color: var(--text-body);
  line-height: 1.45;
}

.timeline-item.active .timeline-desc {
  font-weight: 600;
  color: var(--text-main);
}

.timeline-location {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* 状态步进流程条（查询页头部） */
.order-steps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 1.5rem 0 1rem;
  position: relative;
}

.order-steps::before {
  content: "";
  position: absolute;
  top: 18px;
  left: 30px;
  right: 30px;
  height: 3px;
  background: var(--border-subtle);
  z-index: 1;
}

.step-item {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
}

.step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--border-medium);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all var(--duration-fast);
}

.step-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
}

.step-item.done .step-circle {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.step-item.active .step-circle {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 0 0 4px var(--primary-ring);
}

.step-item.active .step-label {
  font-weight: 700;
  color: var(--primary);
}

.order-steps.is-cancelled .step-circle {
  border-color: var(--sf-red);
  color: var(--sf-red);
  background: #fee2e2;
}

/* Toast 提示 */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 9999;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: rgba(15, 23, 42, 0.9);
  color: #ffffff;
  padding: 0.65rem 1.125rem;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: toast-in 0.25s var(--ease-spring);
  backdrop-filter: blur(8px);
}

.toast.toast-error {
  background: rgba(220, 38, 38, 0.95);
}

.toast.toast-success {
  background: rgba(22, 101, 52, 0.95);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* 灯箱 Lightbox */
.lightbox-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(8px);
  z-index: 9998;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.lightbox-modal.show {
  display: flex;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-img {
  max-width: 100%;
  max-height: 85vh;
  border-radius: var(--radius-md);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: -44px;
  right: 0;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #ffffff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--duration-fast);
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* 抽屉 Drawer (用于管理后台订单详情) */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.drawer-backdrop.show {
  display: block;
  opacity: 1;
}

.drawer-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 580px;
  background: #ffffff;
  z-index: 101;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15);
  transform: translateX(100%);
  transition: transform 0.28s var(--ease-spring);
  display: flex;
  flex-direction: column;
}

.drawer-panel.show {
  transform: translateX(0);
}

.drawer-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

.drawer-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  background: var(--bg-subtle);
}

/* 空态与骨架加载 */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.empty-state-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  color: var(--text-light);
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border-medium);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

/* 表格样式 (Admin) */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  text-align: left;
}

.admin-table th {
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-weight: 600;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.admin-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-body);
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-table tbody tr {
  cursor: pointer;
  transition: background-color var(--duration-fast);
}

.admin-table tbody tr:hover {
  background: var(--bg-subtle);
}

/* 响应式调整 */
@media (max-width: 640px) {
  .main-content {
    padding: 1.25rem 1rem 3rem;
  }
  .card {
    padding: 1.125rem;
    border-radius: 14px;
  }
  .order-steps::before {
    left: 20px;
    right: 20px;
  }
  .step-circle {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
  }
  .step-label {
    font-size: 0.72rem;
  }
  .sf-tracking-no {
    font-size: 1.35rem;
  }
}

/* 粘贴地址智能识别区域 */
.smart-parser-box {
  background: var(--bg-subtle);
  border: 1px dashed var(--border-medium);
  border-radius: var(--radius-md);
  padding: 0.875rem 1rem;
  margin-bottom: 1.25rem;
  transition: border-color var(--duration-fast), background-color var(--duration-fast);
}

.smart-parser-box:focus-within {
  border-color: var(--primary);
  background: #ffffff;
}

.smart-parser-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
  gap: 0.5rem;
}

.smart-parser-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.smart-parser-badge {
  font-size: 0.68rem;
  font-weight: 500;
  padding: 1px 6px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-full);
}

.smart-parser-tip {
  font-size: 0.775rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.smart-parser-textarea {
  width: 100%;
  min-height: 60px;
  padding: 0.5rem 0.65rem;
  font-size: 0.8125rem;
  font-family: inherit;
  color: var(--text-main);
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  resize: vertical;
  line-height: 1.45;
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}

.smart-parser-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

.smart-parser-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

/* 智能填入高亮动效 */
@keyframes autofillHighlight {
  0% {
    background-color: rgba(37, 99, 235, 0.16);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
  }
  60% {
    background-color: rgba(37, 99, 235, 0.08);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
  }
  100% {
    background-color: transparent;
    box-shadow: none;
  }
}

.input-autofilled {
  animation: autofillHighlight 1.2s ease forwards;
}

@media (prefers-reduced-motion: reduce) {
  .input-autofilled {
    animation: none !important;
  }
}

/* 375px 超窄屏幕响应式保护 */
@media (max-width: 480px) {
  .header-container {
    padding: 0.6rem 0.75rem;
    gap: 0.5rem;
  }
  .brand {
    font-size: 0.9rem;
    gap: 0.4rem;
    min-width: 0;
    flex: 1 1 auto;
  }
  .brand span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .brand-icon {
    flex-shrink: 0;
  }
  .brand-icon {
    width: 28px;
    height: 28px;
  }
  .header-right {
    gap: 0.35rem;
  }
  .nav-link {
    padding: 0.32rem 0.6rem;
    font-size: 0.75rem;
  }
  .lang-switcher {
    height: 28px;
    padding: 0 4px 0 6px;
  }
  .lang-select {
    font-size: 0.75rem;
    padding-right: 12px;
    line-height: 26px;
  }
  .lang-arrow {
    right: 4px;
  }
  .step-item {
    max-width: 68px;
  }
  .step-label {
    font-size: 0.68rem;
    line-height: 1.2;
    word-break: break-word;
  }
  .search-inputs-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 400px) {
  .brand span {
    display: none;
  }
  .brand {
    flex: 0 0 auto;
  }
  /* 顺丰卡片按钮：窄屏允许换行、长文案可折行，避免横向溢出 */
  .sf-actions {
    gap: 0.5rem;
  }
  .sf-actions .btn {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    line-height: 1.25;
    padding: 0.5rem 0.75rem;
    text-align: center;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}

/* 用户状态栏 (Account & Submit) */
.user-profile-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.user-profile-info {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}
.user-avatar-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.user-profile-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* 通用模态弹窗 */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-dialog {
  background: #ffffff;
  border-radius: var(--radius-card);
  width: 100%;
  max-width: 460px;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  animation: modalSlideIn 0.22s var(--ease-spring);
  display: flex;
  flex-direction: column;
}
@keyframes modalSlideIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-body {
  padding: 1.25rem;
  overflow-y: auto;
  max-height: 80vh;
}
.modal-footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.625rem;
  background: var(--bg-subtle);
}

/* 照片选择/管理组件缩略图 */
.photo-thumb-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
}
.photo-thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-fast);
}
.photo-thumb-item:hover img {
  transform: scale(1.04);
}
.existing-photo.removed img {
  opacity: 0.35;
  filter: grayscale(80%);
}
.existing-photo-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
  pointer-events: none;
  z-index: 2;
}
.badge-kept {
  background: rgba(22, 101, 52, 0.9);
  color: #ffffff;
}
.badge-removed {
  background: rgba(220, 38, 38, 0.9);
  color: #ffffff;
}
.existing-photo-toggle {
  position: absolute;
  bottom: 4px;
  left: 4px;
  right: 4px;
  background: rgba(15, 23, 42, 0.78);
  color: #ffffff;
  border: none;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 500;
  padding: 3px 0;
  cursor: pointer;
  z-index: 2;
  text-align: center;
  transition: background var(--duration-fast);
}
.existing-photo-toggle:hover {
  background: rgba(15, 23, 42, 0.95);
}
.btn-remove-photo {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(220, 38, 38, 0.9);
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  transition: transform var(--duration-fast), background var(--duration-fast);
}
.btn-remove-photo:hover {
  background: #b91c1c;
  transform: scale(1.1);
}

/* 我的订单：卡片列表 */
.order-cards-grid {
  display: grid;
  gap: 0.875rem;
}
.order-card {
  display: flex;
  align-items: stretch;
  gap: 0.875rem;
  padding: 0.875rem;
  margin: 0;
  color: inherit;
  text-decoration: none;
  min-width: 0;
  flex-wrap: wrap;
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast);
}
.order-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.order-card-left {
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-subtle);
}
.order-card-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.order-card-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
}
.order-card-body {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.order-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.order-card-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-main);
  overflow-wrap: anywhere;
}
.order-card-preview {
  font-size: 0.85rem;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.order-card-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}
/* 我的订单：卡片底部物流面板 */
.order-ship {
  flex: 0 0 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  padding: 0.75rem 0.85rem;
  border-radius: 14px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  background: linear-gradient(135deg, #eff6ff 0%, #f8fbff 60%, #ffffff 100%);
}
.order-ship.is-pending {
  border-style: dashed;
  border-color: var(--border-medium);
  background: var(--bg-subtle);
}
.order-ship-icon {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), inset 0 0 0 1px rgba(37, 99, 235, 0.14);
}
.order-ship.is-pending .order-ship-icon {
  color: var(--text-muted);
  box-shadow: inset 0 0 0 1px var(--border-subtle);
}
.order-ship-info {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.order-ship-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-muted);
}
.order-ship-no {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.3;
  color: var(--text-main);
  overflow-wrap: anywhere;
}
.order-ship-pending {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-body);
}
.order-ship-recipient {
  font-size: 0.8rem;
  color: var(--text-body);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.order-ship-recipient-label {
  color: var(--text-muted);
  margin-right: 0.3rem;
}
.order-ship-recipient-name {
  font-weight: 600;
  color: var(--text-main);
}
.order-ship-copy {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 40px;
  padding: 0 1rem;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: #ffffff;
  background: var(--primary);
  border: none;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.25), 0 4px 10px -4px rgba(37, 99, 235, 0.45);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background var(--duration-fast), transform var(--duration-fast), box-shadow var(--duration-fast);
}
.order-ship-copy:hover {
  background: var(--primary-hover);
}
.order-ship-copy:active {
  transform: scale(0.97);
  background: var(--primary-active);
}
.order-ship-copy:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.order-ship-copy .icon-check {
  display: none;
}
.order-ship-copy.is-copied {
  background: #16a34a;
  box-shadow: 0 1px 2px rgba(22, 163, 74, 0.25), 0 4px 10px -4px rgba(22, 163, 74, 0.45);
}
.order-ship-copy.is-copied .icon-copy {
  display: none;
}
.order-ship-copy.is-copied .icon-check {
  display: inline;
}
@media (max-width: 420px) {
  .order-ship {
    gap: 0.6rem;
    padding: 0.65rem 0.7rem;
  }
  .order-ship-icon {
    display: none;
  }
  .order-ship-no {
    font-size: 0.98rem;
  }
  .order-ship-copy {
    padding: 0 0.8rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  .order-ship-copy, .order-ship-copy:active { transition: none; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .order-card, .order-card:hover { transition: none; transform: none; }
}

/* ≤375px 超窄屏幕保护 */
@media (max-width: 375px) {
  .header-container {
    padding: 0.45rem 0.5rem;
    gap: 0.25rem;
  }
  .brand-icon {
    width: 26px;
    height: 26px;
  }
  .nav-links {
    gap: 0.2rem;
  }
  .nav-link {
    padding: 0.25rem 0.4rem;
    font-size: 0.72rem;
    letter-spacing: -0.01em;
  }
  .lang-switcher {
    height: 26px;
    padding: 0 3px 0 5px;
  }
  .lang-select {
    font-size: 0.72rem;
    padding-right: 10px;
    line-height: 24px;
  }
  .step-item {
    max-width: 58px;
  }
}

/* ≤330px 极限窄屏保护 (无横向溢出) */
@media (max-width: 340px) {
  .header-container {
    padding: 0.35rem 0.35rem;
    gap: 0.2rem;
  }
  .brand-icon {
    width: 24px;
    height: 24px;
  }
  .nav-links {
    gap: 0.15rem;
  }
  .nav-link {
    padding: 0.2rem 0.3rem;
    font-size: 0.67rem;
  }
  .lang-switcher {
    height: 24px;
    padding: 0 2px 0 3px;
  }
  .lang-select {
    font-size: 0.67rem;
    padding-right: 6px;
    line-height: 22px;
  }
  .lang-arrow {
    display: none;
  }
  .main-content {
    padding: 0.75rem 0.35rem 2rem;
  }
  .card {
    padding: 0.75rem 0.6rem;
  }
  .step-item {
    max-width: 52px;
  }
  .step-circle {
    width: 26px;
    height: 26px;
    font-size: 0.68rem;
  }
  .step-label {
    font-size: 0.62rem;
  }
}

