/* ═══════════════════════════════════════
   Navigation
═══════════════════════════════════════ */
.nav {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-height);
  background: rgb(255 255 255 / 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  letter-spacing: -0.4px;
  color: var(--color-text);
}
.nav-logo-icon {
  width: 28px; height: 28px;
  background: var(--color-accent);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.nav-logo-icon svg { color: #fff; }
.nav-tagline {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  font-weight: var(--weight-normal);
}


/* ═══════════════════════════════════════
   Buttons
═══════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  height: 38px;
  padding-inline: var(--sp-4);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background var(--duration-fast),
    color var(--duration-fast),
    border-color var(--duration-fast),
    box-shadow var(--duration-fast),
    transform var(--duration-fast);
  user-select: none;
  text-decoration: none;
}
.btn:active { transform: scale(0.98); }
.btn.disabled { pointer-events: none; opacity: 0.45; }

.btn-primary {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}
.btn-primary:hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
  box-shadow: var(--shadow-sm);
}

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text-secondary);
  border-color: var(--color-border);
}
.btn-secondary:hover {
  background: var(--color-surface-raised);
  color: var(--color-text);
  border-color: #d4d4d8;
}

.btn-sm { height: 32px; padding-inline: var(--sp-3); font-size: var(--text-xs); border-radius: var(--radius-sm); }
.btn-full { width: 100%; height: 42px; font-size: var(--text-base); }


/* ═══════════════════════════════════════
   Cards
═══════════════════════════════════════ */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}
.card-padded { padding: var(--sp-6); }

.section-title {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--color-text);
  margin-bottom: var(--sp-4);
}
.section-desc {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-top: -var(--sp-3);
  margin-bottom: var(--sp-4);
}


/* ═══════════════════════════════════════
   Upload Zone
═══════════════════════════════════════ */
.upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  min-height: 140px;
  padding: var(--sp-6);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-raised);
  cursor: pointer;
  transition:
    border-color var(--duration-base),
    background var(--duration-base),
    box-shadow var(--duration-base);
  text-align: center;
}
.upload-zone:hover,
.upload-zone:focus-visible {
  border-color: var(--color-accent);
  background: var(--color-accent-subtle);
  outline: none;
}
.upload-zone.drag-over {
  border-color: var(--color-accent);
  background: var(--color-accent-subtle);
  box-shadow: var(--shadow-accent);
}
.upload-zone.has-file {
  border-style: solid;
  border-color: var(--color-accent);
  background: var(--color-accent-subtle);
}
.upload-zone-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  background: var(--color-border);
  display: flex; align-items: center; justify-content: center;
  color: var(--color-text-secondary);
  transition: background var(--duration-base), color var(--duration-base);
}
.upload-zone:hover .upload-zone-icon,
.upload-zone.has-file .upload-zone-icon {
  background: var(--color-accent);
  color: #fff;
}
#upload-label {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--leading-normal);
}
.upload-zone.has-file #upload-label,
.upload-zone.has-file .upload-label {
  color: var(--color-accent);
  font-weight: var(--weight-medium);
}
.upload-hint {
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
}


/* ═══════════════════════════════════════
   Error / Status Messages
═══════════════════════════════════════ */
.error-msg {
  font-size: var(--text-sm);
  color: var(--color-error);
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  margin-top: var(--sp-2);
  line-height: var(--leading-relaxed);
}


/* ═══════════════════════════════════════
   Radio Group (pill-style)
═══════════════════════════════════════ */
.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}
.radio-option {
  position: relative;
}
.radio-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0; height: 0;
}
.radio-option label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--sp-2) var(--sp-3);
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-secondary);
  transition:
    background var(--duration-fast),
    border-color var(--duration-fast),
    color var(--duration-fast);
  user-select: none;
}
.radio-option label:hover {
  border-color: var(--color-accent-subtle-border);
  color: var(--color-text);
}
.radio-option input[type="radio"]:checked + label {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
}
.radio-option label .radio-desc {
  font-size: var(--text-xs);
  font-weight: var(--weight-normal);
  opacity: 0.75;
}
.radio-option input[type="radio"]:checked + label .radio-desc {
  opacity: 0.85;
}


/* ═══════════════════════════════════════
   Log Area
═══════════════════════════════════════ */
.log-wrapper {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border);
  animation: fadeUp var(--duration-slow) var(--ease-out) both;
}
.log-header {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  background: var(--color-surface-raised);
  border-bottom: 1px solid var(--color-border);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.log-dot {
  width: 6px; height: 6px;
  border-radius: var(--radius-full);
  background: var(--color-success);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}
#log-list {
  padding: var(--sp-3) var(--sp-4);
  background: var(--color-surface);
  max-height: 240px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  line-height: 1.8;
  color: var(--color-text-secondary);
}
#log-list li {
  padding-block: 1px;
  border-bottom: 1px solid var(--color-bg);
}
#log-list li:last-child { border-bottom: none; }


/* ═══════════════════════════════════════
   Result Section
═══════════════════════════════════════ */
.result-section {
  background: var(--color-success-subtle);
  border: 1px solid var(--color-success-border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5) var(--sp-6);
  animation: fadeUp var(--duration-slow) var(--ease-out) both;
}
.result-header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}
.result-icon {
  width: 36px; height: 36px;
  background: var(--color-success);
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  flex-shrink: 0;
}
.result-title {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--color-text);
}
.result-subtitle {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}


/* ═══════════════════════════════════════
   Feature Cards (homepage)
═══════════════════════════════════════ */
.feature-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  box-shadow: var(--shadow-xs);
  transition:
    box-shadow var(--duration-base),
    transform var(--duration-base),
    border-color var(--duration-base);
}
.feature-card:not(.coming-soon):hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--color-accent-subtle-border);
}
.feature-card.coming-soon {
  opacity: 0.55;
  cursor: default;
}
.feature-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-3);
}
.feature-name {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--color-text);
  line-height: var(--leading-tight);
}
.feature-desc {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
  flex: 1;
}
.feature-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-top: auto;
  padding-top: var(--sp-3);
  border-top: 1px solid var(--color-border);
}
.file-count {
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}


/* ═══════════════════════════════════════
   Badges
═══════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding-inline: var(--sp-2);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  border-radius: var(--radius-full);
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.badge-available {
  background: var(--color-success-subtle);
  color: var(--color-success);
  border: 1px solid var(--color-success-border);
}
.badge-coming-soon {
  background: var(--color-bg);
  color: var(--color-text-tertiary);
  border: 1px solid var(--color-border);
}


/* ═══════════════════════════════════════
   Back Link
═══════════════════════════════════════ */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  font-weight: var(--weight-medium);
  transition: color var(--duration-fast);
}
.back-link:hover { color: var(--color-accent); }


/* ═══════════════════════════════════════
   Hero
═══════════════════════════════════════ */
.hero {
  padding-block: var(--sp-16) var(--sp-12);
  text-align: center;
}
.hero-title {
  font-size: clamp(var(--text-2xl), 4vw, var(--text-4xl));
  font-weight: var(--weight-bold);
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--color-text);
  margin-bottom: var(--sp-4);
}
.hero-title span {
  color: var(--color-accent);
}
.hero-sub {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  max-width: 520px;
  margin-inline: auto;
  line-height: var(--leading-relaxed);
}
.hero-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: var(--sp-6);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}
.hero-step {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: var(--sp-2) var(--sp-4);
  box-shadow: var(--shadow-xs);
}
.hero-step-num {
  width: 20px; height: 20px;
  background: var(--color-accent);
  color: #fff;
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  flex-shrink: 0;
}
.hero-arrow {
  color: var(--color-text-tertiary);
  font-size: var(--text-lg);
}


/* ═══════════════════════════════════════
   Features Grid
═══════════════════════════════════════ */
.features-section {
  padding-bottom: var(--sp-20);
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-5);
}


/* ═══════════════════════════════════════
   Footer
═══════════════════════════════════════ */
.footer {
  border-top: 1px solid var(--color-border);
  padding-block: var(--sp-6);
  text-align: center;
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
}


/* ═══════════════════════════════════════
   Feature Page Layout
═══════════════════════════════════════ */
.feature-page {
  min-height: calc(100vh - var(--nav-height));
  padding-block: var(--sp-8) var(--sp-16);
}
.feature-page-header {
  margin-bottom: var(--sp-8);
}
.feature-page-title {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  letter-spacing: -0.03em;
  margin-top: var(--sp-3);
}
.feature-page-desc {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  margin-top: var(--sp-2);
}
.feature-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--sp-6);
  align-items: start;
}
.feature-panel {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}
.param-block {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.param-label {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-text);
}
.form-label {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-text);
}
.text-input,
.field-select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: var(--text-sm);
  padding: 0 var(--sp-3);
  outline: none;
}
.text-input:focus,
.field-select:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-accent) 14%, transparent);
}
.check-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-sm);
  color: var(--color-text);
}
.results-panel {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  position: sticky;
  top: calc(var(--nav-height) + var(--sp-6));
}


@media (max-width: 768px) {
  .feature-layout {
    grid-template-columns: 1fr;
  }
  .results-panel {
    position: static;
  }
  .hero { padding-block: var(--sp-10) var(--sp-8); }
  .hero-title { font-size: var(--text-2xl); }
}


/* ═══════════════════════════════════════
   Nav Admin Link
═══════════════════════════════════════ */
.nav-admin-link {
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
  font-weight: var(--weight-medium);
  transition: color var(--duration-fast);
}
.nav-admin-link:hover { color: var(--color-text-secondary); }


/* ═══════════════════════════════════════
   Admin Page
═══════════════════════════════════════ */
.admin-tab-nav {
  display: flex;
  gap: var(--sp-1);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--sp-5);
  overflow-x: auto;
}
.admin-tab-btn {
  flex-shrink: 0;
  height: 38px;
  padding-inline: var(--sp-4);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-secondary);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color var(--duration-fast), border-color var(--duration-fast);
  margin-bottom: -1px;
}
.admin-tab-btn:hover { color: var(--color-text); }
.admin-tab-btn.active {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}
.admin-add-form {
  display: flex;
  gap: var(--sp-3);
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: var(--sp-4);
}
.admin-add-form .text-input { flex: 1; min-width: 160px; }
.admin-add-form-tz .text-input { min-width: 110px; }
.admin-info-banner {
  font-size: var(--text-sm);
  color: var(--color-accent-hover);
  background: var(--color-accent-subtle);
  border: 1px solid var(--color-accent-subtle-border);
  border-radius: var(--radius-md);
  padding: var(--sp-3) var(--sp-4);
  margin-bottom: var(--sp-4);
}
.admin-warning {
  font-size: var(--text-sm);
  color: var(--color-warning);
  background: var(--color-warning-subtle);
  border: 1px solid #fde68a;
  border-radius: var(--radius-md);
  padding: var(--sp-2) var(--sp-4);
  margin-bottom: var(--sp-3);
}
.admin-tz-toggle {
  margin-bottom: var(--sp-3);
  font-size: var(--text-sm);
  color: var(--color-text);
}
.admin-tz-toggle label {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  cursor: pointer;
}
.admin-error {
  font-size: var(--text-sm);
  color: var(--color-error);
  margin-bottom: var(--sp-3);
}
.admin-empty {
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
  padding-block: var(--sp-4);
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  margin-top: var(--sp-3);
}
.admin-table th {
  text-align: left;
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--color-border);
}
.admin-table td {
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 1px solid var(--color-bg);
  color: var(--color-text);
  vertical-align: middle;
  word-break: break-all;
}
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover td { background: var(--color-surface-raised); }
.admin-table td:last-child { text-align: right; white-space: nowrap; word-break: normal; }

/* ─── Warehouse Config（合并视图：主从布局 + 完整度徽章）─────────────────────── */
.wc-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--sp-5);
  align-items: start;
}
.wc-list-pane {
  border-right: 1px solid var(--color-border);
  padding-right: var(--sp-4);
}
.wc-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-3);
  gap: var(--sp-2);
}
.wc-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  width: 100%;
  padding: var(--sp-2) var(--sp-3);
  margin-bottom: var(--sp-1);
  font-size: var(--text-sm);
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--duration-fast), border-color var(--duration-fast);
}
.wc-list-item:hover { background: var(--color-surface-raised); }
.wc-list-item.active {
  background: var(--color-accent-subtle);
  border-color: var(--color-accent-subtle-border);
}
.wc-code { font-weight: var(--weight-medium); color: var(--color-text); word-break: break-all; }
.wc-badges { display: flex; gap: 4px; flex-shrink: 0; }
.wc-badge {
  font-size: var(--text-xs);
  padding: 1px 6px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}
.wc-badge-ok { color: var(--color-success); background: var(--color-success-subtle); border: 1px solid var(--color-success-border); }
.wc-badge-err { color: var(--color-error); background: var(--color-error-subtle); border: 1px solid var(--color-error-border); }
.wc-badge-orphan { color: var(--color-warning); background: var(--color-warning-subtle); border: 1px solid #fde68a; }
.wc-badge-muted { color: var(--color-text-tertiary); background: var(--color-surface-raised); border: 1px solid var(--color-border); }
.wc-detail-pane { min-width: 0; }
.wc-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}
.wc-detail-code {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  word-break: break-all;
}
.wc-name-view {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--sp-2);
}
@media (max-width: 640px) {
  .wc-layout { grid-template-columns: 1fr; }
  .wc-list-pane { border-right: none; padding-right: 0; border-bottom: 1px solid var(--color-border); padding-bottom: var(--sp-4); }
}
