:root {
  --bg: #f4f7fb;
  --card: #ffffff;
  --text: #1f2a37;
  --subtext: #637083;
  --line: #dbe3ef;
  --primary: #1668dc;
  --danger: #cf1322;
  --ok: #237804;
  --warn: #d46b08;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #f8fbff 0%, var(--bg) 100%);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.brand {
  font-weight: 700;
}

.topbar nav a {
  margin-left: 14px;
  color: var(--primary);
  text-decoration: none;
}

.topbar nav a:hover {
  text-decoration: underline;
}

.container {
  max-width: 1200px;
  margin: 20px auto;
  padding: 0 16px 30px;
}

.page-wide .container {
  max-width: min(1680px, calc(100vw - 32px));
  padding-left: 12px;
  padding-right: 12px;
}

.buyer-detail-page .container {
  max-width: min(1760px, calc(100vw - 24px));
  padding-left: 8px;
  padding-right: 8px;
}

.supplier-detail-page .container {
  max-width: min(1760px, calc(100vw - 24px));
  padding-left: 8px;
  padding-right: 8px;
}

.login-page .container {
  max-width: min(1380px, calc(100vw - 84px));
  margin: 12px auto;
  padding: 0 12px 12px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 14px;
}

.button-link-secondary {
  background: #f4f9ff;
  color: var(--primary);
  border: 1px solid #cfe0ff;
}

.narrow {
  max-width: 420px;
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(300px, 0.84fr) minmax(340px, 420px);
  gap: 18px;
  align-items: stretch;
}

.login-page-stack {
  display: grid;
  gap: 12px;
}

.login-brand-panel {
  min-height: 408px;
  padding: 20px;
  border: 1px solid #c8d8ea;
  border-radius: 18px;
  background:
    radial-gradient(circle at top left, rgba(76, 204, 214, 0.22), transparent 34%),
    radial-gradient(circle at 78% 22%, rgba(19, 69, 108, 0.08), transparent 24%),
    linear-gradient(135deg, #e6f4fb 0%, #d7edf6 48%, #cae7f4 100%);
  color: #17324a;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 18px 44px rgba(24, 43, 67, 0.08);
}

.login-brand-panel-soft {
  background:
    radial-gradient(circle at top left, rgba(76, 204, 214, 0.18), transparent 36%),
    linear-gradient(135deg, #edf8fc 0%, #e2f3f9 50%, #d5edf7 100%);
}

.brand-mark {
  display: inline-block;
  padding: 18px 20px;
  border-radius: 16px;
  background: rgba(27, 49, 74, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(4px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.brand-stage {
  display: grid;
  gap: 12px;
}

.brand-scene {
  display: block;
}

.scene-card {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(24, 57, 89, 0.1);
  background: rgba(255, 255, 255, 0.58);
  backdrop-filter: blur(6px);
  box-shadow: 0 12px 30px rgba(28, 72, 112, 0.08);
}

.scene-card-main {
  min-height: 158px;
  padding: 14px 18px 16px;
  display: grid;
  align-content: start;
  gap: 22px;
}

.scene-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.scene-checklist {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: nowrap;
  margin-top: 18px;
}

.scene-checklist span {
  display: inline-block;
  font-size: 17px;
  line-height: 1.08;
  font-weight: 700;
  color: #244968;
  white-space: nowrap;
}

.scene-dot {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: linear-gradient(135deg, #25b9cb 0%, #62d7df 100%);
  box-shadow: 0 0 0 8px rgba(37, 185, 203, 0.12);
  flex: 0 0 auto;
}

.scene-label {
  display: inline-flex;
  width: fit-content;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
}

.scene-label {
  background: rgba(23, 50, 74, 0.08);
  color: #2d5574;
}

.brand-cn {
  font-size: clamp(44px, 6vw, 84px);
  line-height: 0.95;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #50d2dd;
}

.brand-en {
  margin-top: 10px;
  font-size: clamp(20px, 2.6vw, 42px);
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #50d2dd;
}

.brand-story {
  display: grid;
  gap: 8px;
}

.brand-pillars {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.brand-pillar {
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid rgba(24, 57, 89, 0.1);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.brand-pillar strong {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 15px;
  white-space: nowrap;
}

.brand-pillar strong span {
  display: inline-block;
  color: #2a6fd2;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.brand-pillar small {
  display: block;
  color: #4f6880;
  font-size: 13px;
  line-height: 1.45;
  margin-top: 0;
}

.login-card {
  min-height: 408px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 20px;
  box-shadow: 0 16px 36px rgba(25, 57, 96, 0.08);
}

.export-agreement-card {
  border-radius: 18px;
  border-color: #cfe0f2;
  background:
    linear-gradient(180deg, rgba(245, 250, 255, 0.98) 0%, rgba(255, 255, 255, 0.98) 100%);
  box-shadow: 0 16px 36px rgba(25, 57, 96, 0.06);
  padding: 16px 18px;
  margin-bottom: 0;
}

.export-agreement-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.export-agreement-head h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.15;
}

.export-agreement-intro {
  margin: 0;
  padding: 10px 12px;
  border-radius: 14px;
  background: #f4f9ff;
  border: 1px solid #dbe7f6;
  color: #36506a;
  font-size: 12px;
  line-height: 1.45;
}

.export-agreement-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.export-rule-block {
  padding: 12px 12px 10px;
  border-radius: 16px;
  border: 1px solid #dbe7f6;
  background: #fbfdff;
}

.export-rule-block h3 {
  margin: 0 0 8px;
  font-size: 15px;
  line-height: 1.2;
}

.export-rule-block p {
  margin: 0 0 8px;
  color: #445d76;
  font-size: 11px;
  line-height: 1.4;
}

.export-rule-block ol,
.export-rule-block ul {
  margin: 0;
  padding-left: 18px;
  color: #445d76;
  font-size: 11px;
  line-height: 1.4;
}

.export-rule-block li + li {
  margin-top: 6px;
}

.login-card h1 {
  margin: 0 0 14px;
  font-size: 42px;
  line-height: 1;
}

.login-eyebrow {
  margin: 0 0 10px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.login-intro {
  margin: 0 0 14px;
  color: var(--subtext);
  font-size: 13px;
  line-height: 1.5;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
}

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

.stat strong {
  font-size: 24px;
}

.stat-overdue {
  border-color: #ffccc7;
  background: #fff2f0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.filters input,
.filters select {
  min-width: 180px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  padding: 8px;
}

th {
  background: #f9fbff;
}

input,
textarea,
select,
button {
  width: 100%;
  padding: 8px;
  border: 1px solid #c8d4e5;
  border-radius: 6px;
  margin-top: 4px;
}

button {
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  width: auto;
  padding: 8px 14px;
}

.form-grid {
  display: grid;
  gap: 10px;
}

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

.compact-grid-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.upload-grid-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.upload-grid-single {
  grid-template-columns: 1fr;
}

.po-sign-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(320px, 1fr);
  gap: 12px;
}

.po-download-card {
  background: #f4f9ff;
  border-color: #b9d5ff;
}

.po-download-button {
  margin: 6px 0 8px;
  background: var(--primary);
}

.field-card {
  display: block;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfdff;
}

.field-card-wide {
  grid-column: 1 / -1;
}

.field-title {
  display: block;
  font-weight: 700;
  margin-bottom: 2px;
}

.field-note {
  display: block;
  color: var(--subtext);
  font-size: 12px;
  line-height: 1.4;
  margin-bottom: 4px;
}

.supplier-workspace {
  display: grid;
  grid-template-columns: minmax(320px, 1.05fr) minmax(560px, 1.6fr);
  gap: 14px;
  align-items: start;
}

.buyer-detail-shell {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(560px, 1.45fr);
  gap: 14px;
  align-items: start;
}

.detail-stack {
  display: grid;
  gap: 14px;
}

.summary-card,
.form-card {
  margin-bottom: 0;
}

.summary-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.summary-kicker {
  color: var(--subtext);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.summary-title {
  margin: 4px 0 0;
  font-size: 28px;
  line-height: 1.15;
}

.summary-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.summary-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eef3fb;
  color: var(--subtext);
  font-size: 12px;
}

.summary-badge-danger {
  background: #fff1f0;
  color: var(--danger);
}

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

.summary-item {
  padding: 10px 12px;
  border-radius: 10px;
  background: #f8fbff;
  border: 1px solid #e7eef8;
}

.summary-item span {
  display: block;
  color: var(--subtext);
  font-size: 12px;
  margin-bottom: 4px;
}

.summary-item strong {
  display: block;
  font-size: 14px;
  line-height: 1.45;
  word-break: break-word;
}

.summary-item strong a {
  color: var(--primary);
  text-decoration: none;
}

.summary-item strong a:hover {
  text-decoration: underline;
}

.file-link-list {
  margin: 8px 0 0;
  padding-left: 18px;
}

.file-link-list li + li {
  margin-top: 6px;
}

.file-link-list a {
  color: var(--primary);
  text-decoration: none;
}

.file-link-list a:hover {
  text-decoration: underline;
}

.summary-item-wide {
  grid-column: 1 / -1;
}

.shipment-summary-box {
  margin-bottom: 4px;
}

.form-section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-top: 2px;
}

.section-gap-top {
  margin-top: 12px;
}

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

.stage-card {
  border-radius: 14px;
  overflow: hidden;
}

.stage-card .section-head {
  margin: -14px -14px 14px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid #e8eef7;
}

.stage-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.stage-color-chip {
  width: 12px;
  height: 28px;
  border-radius: 999px;
  background: #91caff;
  box-shadow: 0 0 0 6px rgba(145, 202, 255, 0.2);
  flex: 0 0 auto;
}

.stage-card .section-head h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1;
}

.stage-card-waiting_po_sign .section-head {
  background: linear-gradient(180deg, #eef6ff 0%, #f8fbff 100%);
}

.stage-card-waiting_po_sign .stage-color-chip {
  background: #2f80ed;
  box-shadow: 0 0 0 6px rgba(47, 128, 237, 0.16);
}

.stage-card-waiting_shipment .section-head {
  background: linear-gradient(180deg, #ecfdf5 0%, #f7fffb 100%);
}

.stage-card-waiting_shipment .stage-color-chip {
  background: #19a974;
  box-shadow: 0 0 0 6px rgba(25, 169, 116, 0.14);
}

.stage-card-waiting_invoice .section-head {
  background: linear-gradient(180deg, #fff7ed 0%, #fffdfa 100%);
}

.stage-card-waiting_invoice .stage-color-chip {
  background: #f08c2e;
  box-shadow: 0 0 0 6px rgba(240, 140, 46, 0.14);
}

.section-head h3 {
  margin: 0 0 4px;
}

.section-head .hint {
  margin: 0;
}

.section-head-meta {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  color: var(--subtext);
}

.section-head-meta strong {
  font-size: 24px;
  color: var(--text);
}

.pagination {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.dashboard-actions,
.shipment-create-toolbar,
.shipment-entry-banner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.dashboard-actions {
  margin-bottom: 14px;
}

.shipment-entry-banner {
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid #d8e6f7;
  border-radius: 12px;
  background: linear-gradient(180deg, #f4f9ff 0%, #fbfdff 100%);
}

.shipment-entry-banner strong {
  display: block;
  margin-bottom: 4px;
}

.shipment-save-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #d8e6f7;
  background: linear-gradient(180deg, #f7fbff 0%, #ffffff 100%);
}

.shipment-save-strip strong {
  display: block;
  margin-bottom: 4px;
}

.shipment-save-strip .hint {
  margin: 0;
}

.table-wrap {
  overflow-x: auto;
}

.sku-line {
  min-height: 28px;
  padding: 4px 0;
  border-bottom: 1px solid #edf1f7;
}

.sku-line:last-child {
  border-bottom: none;
}

.shipment-select-cell {
  width: 60px;
  text-align: center;
}

.shipment-select-cell input {
  width: auto;
  margin-top: 0;
}

.tiny-hint {
  color: var(--subtext);
  font-size: 12px;
  line-height: 1.4;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.form-actions .hint {
  margin: 0;
}

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filters input,
.filters select {
  width: auto;
  min-width: 180px;
}

.flash {
  padding: 10px 12px;
  border-radius: 6px;
  margin-bottom: 10px;
}

.flash-error {
  background: #fff1f0;
  color: var(--danger);
  border: 1px solid #ffa39e;
}

.flash-success {
  background: #f6ffed;
  color: var(--ok);
  border: 1px solid #b7eb8f;
}

.flash-info {
  background: #e6f4ff;
  color: var(--primary);
  border: 1px solid #91caff;
}

.status {
  display: inline-block;
  min-width: 82px;
  text-align: center;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
}

.status-pending {
  background: #fff7e6;
  color: var(--warn);
}

.status-in_progress {
  background: #e6f4ff;
  color: var(--primary);
}

.status-need_more {
  background: #fff1f0;
  color: var(--danger);
}

.status-completed {
  background: #f6ffed;
  color: var(--ok);
}

.status-cancelled {
  background: #f5f5f5;
  color: #666;
}

.row-overdue td {
  background: #fff2f0;
}

.button-link {
  display: inline-flex;
  align-items: center;
  color: #fff;
  background: #595959;
  border-radius: 6px;
  padding: 8px 14px;
  text-decoration: none;
}

.button-link-danger {
  background: #d93444;
}

.button-link-danger:hover {
  background: #bf2d3b;
}

.button-link-disabled {
  background: #bfbfbf;
  cursor: not-allowed;
  color: #fff;
}

button.button-link-danger {
  background: #d93444;
}

button.button-link-danger:hover {
  background: #bf2d3b;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.checkbox-stack {
  display: grid;
  gap: 6px;
  margin-top: 6px;
}

.checkbox-label input {
  width: auto;
  margin-top: 0;
}

.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.secondary-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.secondary-link:hover {
  text-decoration: underline;
}

.login-help-strip {
  margin-top: 14px;
  display: grid;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.login-help-strip span {
  display: block;
  margin-bottom: 4px;
  color: var(--subtext);
  font-size: 12px;
}

.login-help-strip strong {
  font-size: 12px;
  line-height: 1.35;
}

.inline-form {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.inline-form input {
  flex: 1;
}

.table-col-date {
  min-width: 168px;
}

.table-col-name {
  width: 360px;
  max-width: 360px;
  white-space: normal;
  word-break: break-word;
}

.table-inline-form {
  display: flex;
  align-items: center;
  gap: 6px;
}

.table-inline-form input {
  min-width: 118px;
  margin-top: 0;
  padding: 6px 8px;
}

.table-inline-form button {
  flex: 0 0 auto;
  margin-top: 0;
  padding: 6px 10px;
  font-size: 12px;
  white-space: nowrap;
}

.hint {
  color: var(--subtext);
}

.danger-text {
  color: var(--danger);
  font-weight: 700;
}

@media (max-width: 768px) {
  .login-shell,
  .supplier-workspace,
  .buyer-detail-shell,
  .compact-grid,
  .compact-grid-three,
  .upload-grid,
  .po-sign-grid,
  .upload-grid-three,
  .summary-grid,
  .export-agreement-head,
  .export-agreement-grid {
    grid-template-columns: 1fr;
  }

  .login-brand-panel,
  .login-card {
    min-height: auto;
  }

  .brand-scene,
  .brand-pillars {
    grid-template-columns: 1fr;
  }

  .scene-checklist {
    flex-wrap: wrap;
    gap: 10px 16px;
  }

  .scene-checklist span {
    font-size: 20px;
  }

  .scene-label {
    font-size: 24px;
  }

  .field-card-wide {
    grid-column: auto;
  }

  .summary-header,
  .form-actions,
  .login-options,
  .dashboard-actions,
  .shipment-create-toolbar,
  .shipment-entry-banner,
  .shipment-save-strip {
    flex-direction: column;
    align-items: stretch;
  }

  .table-inline-form {
    flex-direction: column;
    align-items: stretch;
  }
}
