:root {
  --primary: #17aaa0;
  --primary-dark: #0e6f68;
  --nav: #0c2f46;
  --nav-deep: #082338;
  --blue: #3c86f6;
  --orange: #f59b38;
  --red: #bd302c;
  --green: #19a463;
  --violet: #7c54e8;
  --bg: #f4f7fa;
  --panel: #ffffff;
  --text: #1f2a35;
  --muted: #778492;
  --border: #e3eaf0;
  --line: #e3eaf0;
  --soft: #e9f8f4;
  --shadow: 0 14px 34px rgba(23, 53, 74, .08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

body.auth-locked {
  overflow: hidden;
}

body.auth-locked .sidebar,
body.auth-locked .main {
  filter: blur(2px);
  pointer-events: none;
  user-select: none;
}

body:not(.auth-locked) .auth-screen {
  display: none;
}

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(244, 247, 250, .92);
}

.auth-card {
  width: min(420px, 100%);
  padding: 34px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(12, 47, 70, .18);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.auth-brand .brand-mark {
  padding: 0;
  border: 1px solid var(--border);
  box-shadow: none;
}

.auth-brand strong,
.auth-brand span {
  display: block;
}

.auth-brand strong {
  font-size: 22px;
}

.auth-brand span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.auth-card label {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  color: #465768;
  font-weight: 700;
}

.auth-card input {
  width: 100%;
  height: 46px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 14px;
  background: #f9fbfc;
  outline: none;
}

.auth-card input:focus {
  border-color: rgba(23, 170, 160, .55);
  box-shadow: 0 0 0 3px rgba(23, 170, 160, .12);
}

.auth-submit {
  width: 100%;
  height: 48px;
  margin-top: 8px;
}

.login-message {
  display: block;
  min-height: 20px;
  margin-top: 14px;
  color: #c08022;
  font-style: normal;
  font-weight: 700;
  line-height: 1.5;
}

.login-message.error,
.login-message.warn {
  color: var(--red);
}

.login-message.ok {
  color: var(--primary-dark);
}

button, input, select { font: inherit; }
h1, h2, p { margin: 0; }
h1 { font-size: 30px; line-height: 1.2; }
h2 { font-size: 17px; }
p { margin-top: 6px; color: var(--muted); }

.sidebar {
  min-height: 100vh;
  padding: 24px 16px;
  background: linear-gradient(180deg, var(--nav-deep), var(--nav));
  color: #fff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 28px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--primary-dark);
  font-weight: 900;
}

.brand strong,
.brand span { display: block; }
.brand strong { font-size: 20px; }
.brand span { margin-top: 3px; color: rgba(255,255,255,.66); font-size: 12px; }

.nav-group { margin-bottom: 22px; }
.nav-group p {
  margin: 0 0 8px 12px;
  color: rgba(255,255,255,.42);
  font-size: 12px;
  letter-spacing: 1px;
}

.nav {
  width: 100%;
  border: 0;
  border-radius: 8px;
  margin: 4px 0;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  background: transparent;
  color: rgba(255,255,255,.76);
  cursor: pointer;
}

.nav span {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.11);
  font-size: 12px;
  font-weight: 900;
}

.nav.active,
.nav:hover {
  background: #358df2;
  color: #fff;
}

.nav.disabled {
  opacity: .45;
  cursor: default;
}

.nav.disabled:hover { background: transparent; }

.roadmap-note {
  display: grid;
  gap: 6px;
  margin: 8px 8px 0;
  padding: 12px;
  border-radius: 8px;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.72);
  line-height: 1.5;
}

.roadmap-note span {
  color: rgba(255,255,255,.5);
  font-size: 12px;
}

.roadmap-note strong {
  color: rgba(255,255,255,.82);
  font-size: 13px;
}

.main {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.crumb {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.crumb span { color: var(--primary-dark); font-weight: 800; }

.top-actions,
.actions,
.panel-head,
.panel-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.admin-login {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255,255,255,.72);
}

.admin-account {
  min-width: 96px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--primary-dark);
  font-weight: 900;
}

.panel-head {
  justify-content: space-between;
  margin-bottom: 16px;
}

button {
  border: 0;
  border-radius: 7px;
  padding: 10px 16px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

button.ghost {
  background: #edf4f6;
  color: var(--primary-dark);
}

.admin-token-input {
  width: 150px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 12px;
  color: var(--text);
  background: #fff;
  outline: none;
}

.admin-user-input { width: 112px; }
.admin-password-input { width: 150px; }

button.compact {
  height: 40px;
  padding: 0 12px;
}

.admin-token-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(23, 171, 159, .12);
}

button.link {
  padding: 0;
  background: transparent;
  color: var(--primary-dark);
}

.primary { background: var(--primary); }
.muted {
  background: #eef3f2 !important;
  color: #7b8b8c !important;
}
.view { display: none; }
.view.active { display: block; }

.notice,
.panel,
.stats article {
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.notice {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 14px 18px;
  margin-bottom: 16px;
  border-radius: 8px;
}

.notice strong { color: var(--primary-dark); }
.notice span { color: var(--muted); }

.data-status {
  margin-left: auto;
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--muted);
  background: #f5f8f7;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.data-status.ok { color: var(--primary-dark); background: var(--soft); }
.data-status.warn { color: #8a640d; background: #fff3d6; }
.data-status.loading { color: #48646f; background: #edf7fb; }

.top-status {
  margin-left: 0;
  max-width: 420px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stats {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}

.stats.dense { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.stats article {
  min-height: 108px;
  padding: 20px;
  border-radius: 8px;
}

.stats article.clickable {
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.stats article.clickable:hover {
  transform: translateY(-2px);
  border-color: #acd6d1;
  box-shadow: 0 18px 36px rgba(12, 68, 62, .12);
}

.stats span {
  color: var(--primary);
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
}

.stats p { color: var(--text); font-weight: 800; }
.stats small { display: block; margin-top: 8px; color: var(--muted); }

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

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: 16px;
}

.recent-panel { grid-column: span 1; }

.panel {
  padding: 20px;
  border-radius: 8px;
}

.quick-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  padding: 12px 0 4px;
}

.quick-list button {
  min-height: 86px;
  display: grid;
  justify-items: center;
  gap: 10px;
  background: transparent;
  color: var(--text);
  border: 1px solid transparent;
}

.quick-list button:hover {
  background: #f7fbff;
  border-color: var(--border);
}

.quick-list i {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  font-style: normal;
  font-weight: 900;
}

.quick-list button:nth-child(1) i { background: #ff6b6b; }
.quick-list button:nth-child(2) i { background: #ff9838; }
.quick-list button:nth-child(3) i { background: #ef476f; }
.quick-list button:nth-child(4) i { background: #06a85f; }
.quick-list button:nth-child(5) i { background: #0fb3c8; }
.quick-list button:nth-child(6) i { background: #3e7ff0; }
.quick-list button:nth-child(7) i { background: #8f56e8; }
.quick-list button:nth-child(8) i { background: #d94972; }

.ops-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px 10px;
  padding-top: 8px;
}

.ops-grid div {
  min-height: 78px;
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 8px;
  background: #f8fbfc;
}

.ops-grid b {
  color: var(--text);
  font-size: 24px;
  line-height: 1;
}

.ops-grid span {
  margin-top: 9px;
  color: var(--muted);
  font-size: 13px;
}

.todo-list,
.health-list {
  display: grid;
  gap: 10px;
}

.todo-list div {
  display: grid;
  grid-template-columns: 120px 1fr 34px;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 8px;
  background: #f7faf8;
}

.todo-list span,
.health-list { color: var(--muted); }

.todo-list em {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--soft);
  color: var(--primary-dark);
  font-style: normal;
  font-weight: 900;
}

.funnel {
  min-height: 220px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 0;
}

.funnel-row {
  height: 72px;
  display: grid;
  place-items: center;
  align-content: center;
  color: #fff;
  clip-path: polygon(10% 0, 90% 0, 78% 100%, 22% 100%);
}

.funnel-row b {
  font-size: 28px;
  line-height: 1;
}

.funnel-row span {
  margin-top: 6px;
  font-size: 13px;
}

.funnel-row.top { width: 72%; background: #3c86f6; }
.funnel-row.mid { width: 58%; background: #13b6c8; }
.funnel-row.low { width: 44%; background: #68798d; }

.recent-orders {
  display: grid;
  gap: 10px;
}

.recent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border-radius: 8px;
  background: #f8fbfc;
  border: 1px solid transparent;
}

.recent-item:hover {
  border-color: rgba(24, 177, 160, .2);
  background: #fff;
}

.recent-main {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.recent-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.recent-item b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.recent-item p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.recent-item span {
  color: var(--muted);
  font-size: 12px;
}

.recent-item em {
  flex: 0 0 auto;
  font-style: normal;
  color: var(--primary-dark);
  font-weight: 900;
  font-size: 12px;
}

.recent-item em.pending { color: #8a640d; }
.recent-item em.paid { color: #d25a2a; }
.recent-item em.shipped { color: var(--primary-dark); }

.recent-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.recent-actions button {
  min-width: 0;
  padding: 7px 10px;
}

.health-list div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.health-list span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
}

.health-list span.warn { background: #d7a34c; }

.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.order-status-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.order-status-tabs button {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  box-shadow: 0 8px 20px rgba(26, 65, 82, .05);
}

.order-status-tabs button.active {
  border-color: rgba(24, 177, 160, .35);
  background: var(--soft);
  color: var(--primary-dark);
}

.order-status-tabs span {
  font-weight: 800;
}

.order-status-tabs b {
  min-width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #f2f6f7;
  color: var(--primary-dark);
}

.order-status-tabs button.active b {
  background: #fff;
  color: var(--primary);
}

.search {
  min-width: 460px;
  height: 46px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--border);
}

.search span {
  width: 18px;
  height: 18px;
  border: 3px solid var(--primary);
  border-radius: 50%;
  position: relative;
}

.search span::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 3px;
  right: -7px;
  bottom: -4px;
  border-radius: 3px;
  background: var(--primary);
  transform: rotate(45deg);
}

.search input,
.form-row input,
.form-row textarea,
.product-editor select,
select {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
}

.form-row textarea {
  min-height: 92px;
  padding: 10px 12px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  line-height: 1.6;
}

.batch-textarea {
  width: 100%;
  min-height: 180px;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: 0;
  background: #fff;
  color: var(--text);
  line-height: 1.7;
  resize: vertical;
}

.batch-hint {
  margin-top: 12px;
  padding: 12px;
  display: grid;
  gap: 6px;
  border-radius: 8px;
  background: #f7faf8;
  color: var(--muted);
  font-size: 13px;
}

.batch-hint b {
  color: var(--text);
}

select {
  width: 160px;
  height: 46px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
}

.order-board { display: grid; gap: 14px; }

.admin-order-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.order-card-top,
.order-card-main,
.order-address-box,
.order-card-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.order-card-top {
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.order-store {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.store-mark {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.copy-mini {
  min-width: 0;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--primary-dark);
  font-size: 12px;
}

.order-status {
  flex: 0 0 auto;
  font-weight: 900;
  color: var(--primary-dark);
}

.order-status.pending { color: #8a640d; }
.order-status.paid { color: #d25a2a; }
.order-status.shipped { color: var(--primary-dark); }

.order-card-main {
  align-items: flex-start;
  padding: 16px;
}

.order-thumb {
  width: 76px;
  height: 76px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: linear-gradient(135deg, #fff4d8, #d9f4ed);
  color: var(--primary-dark);
  font-size: 26px;
  font-weight: 900;
  overflow: hidden;
}

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

.product-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
}

.product-thumb {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  background: linear-gradient(135deg, #fff4d8, #d9f4ed);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 900;
}

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

.product-cell strong,
.product-cell small {
  display: block;
}

.product-cell small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.order-goods { min-width: 0; flex: 1; }
.order-goods h3 { margin: 0; font-size: 18px; }
.order-goods p { margin: 6px 0 0; color: var(--primary-dark); }

.order-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.order-money {
  min-width: 118px;
  display: grid;
  gap: 6px;
  justify-items: end;
  color: var(--muted);
  font-size: 13px;
}

.order-money b {
  color: var(--red);
  font-size: 22px;
}

.order-no {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.order-address-box {
  justify-content: space-between;
  margin: 0 16px 14px;
  padding: 12px;
  border-radius: 8px;
  background: #f7faf8;
}

.order-address-box span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.order-address-box p { margin-top: 4px; }

.order-deadline,
.order-logistics {
  margin: 0 16px 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff7eb;
  color: #c9532d;
  font-weight: 800;
}

.order-logistics {
  background: var(--soft);
  color: var(--primary-dark);
}

.order-card-actions {
  justify-content: flex-end;
  padding: 14px 16px 16px;
  border-top: 1px solid var(--border);
}

.refund-board {
  display: grid;
  gap: 14px;
}

.refund-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.refund-card-top,
.refund-card-main {
  padding: 14px 16px;
}

.refund-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--border);
}

.refund-card-top strong,
.refund-card-top span {
  margin-right: 8px;
}

.refund-card-top span {
  color: var(--muted);
  font-size: 13px;
}

.refund-card-top em {
  flex: 0 0 auto;
  padding: 5px 10px;
  border-radius: 999px;
  background: #fff3d6;
  color: #8a640d;
  font-style: normal;
  font-weight: 900;
}

.refund-card-top em.done {
  background: var(--soft);
  color: var(--primary-dark);
}

.refund-card-top em.rejected {
  background: #fff0f0;
  color: #9b3131;
}

.refund-card-main {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.refund-info {
  min-width: 0;
  flex: 1;
}

.refund-info h3 {
  margin: 0;
  font-size: 18px;
}

.refund-info p {
  margin: 6px 0 0;
  color: var(--text);
}

.refund-address {
  margin: 0 16px 14px;
  padding: 12px;
  border-radius: 8px;
  background: #f7faf8;
}

.refund-address span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.refund-address p {
  margin: 0;
}

.refund-detail-goods {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.refund-detail-goods p {
  margin-top: 6px;
  color: var(--muted);
}

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 14px;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-weight: 800;
  background: #f8fbfa;
}

.empty,
.empty-cell {
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: #8a640d;
  background: #fff3d6;
  font-weight: 800;
}

.tag.ok {
  color: var(--primary-dark);
  background: var(--soft);
}

.form-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.form-row label { color: var(--muted); }

.form-row input {
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(8, 24, 32, .42);
}

.modal-backdrop.hidden { display: none; }

.modal-card {
  width: min(860px, 100%);
  max-height: min(760px, 92vh);
  overflow: auto;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(7, 24, 32, .28);
}

.modal-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.modal-head h2 {
  font-size: 20px;
}

.modal-close {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  background: #f0f4f5;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
}

.modal-body {
  padding: 20px 22px 22px;
}

.modal-section {
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfdfd;
}

.modal-section h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

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

.detail-grid div {
  min-width: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #edf2f2;
}

.detail-grid span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
}

.detail-grid b {
  display: block;
  overflow-wrap: anywhere;
  font-size: 14px;
}

.modal-goods,
.address-copy,
.modal-actions,
.check-line {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-goods {
  align-items: flex-start;
}

.modal-goods p,
.muted-text {
  margin-top: 6px;
  color: var(--muted);
}

.address-copy {
  justify-content: space-between;
  align-items: flex-start;
}

.address-copy p {
  margin: 0;
  color: var(--text);
  line-height: 1.7;
}

.modal-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 18px;
}

.modal-notice {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff6df;
  color: #8a640d;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.5;
}

.modal-notice.ok {
  background: var(--soft);
  color: var(--primary-dark);
}

.modal-notice.error {
  background: #fff0f0;
  color: #9b3131;
}

.order-timeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.order-timeline div {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #edf2f2;
  border-radius: 8px;
  background: #fff;
}

.order-timeline span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.order-timeline b {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.ship-modal-head {
  background: linear-gradient(135deg, #f5fbf9, #fffaf0);
}

.ship-summary,
.ship-summary-title,
.ship-card-head,
.ship-goods-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ship-summary {
  justify-content: space-between;
}

.ship-summary-main {
  min-width: 0;
}

.ship-summary-title {
  min-width: 0;
}

.ship-summary-title b {
  overflow-wrap: anywhere;
  font-size: 17px;
}

.ship-summary-main p,
.ship-goods-row p,
.ship-goods-row span,
.ship-address-card p,
.ship-deadline {
  color: var(--muted);
}

.ship-summary-main p {
  margin: 7px 0 0;
}

.ship-summary-side {
  flex: 0 0 auto;
  display: grid;
  justify-items: end;
  gap: 6px;
}

.ship-summary-side em {
  font-style: normal;
  font-weight: 900;
}

.ship-summary-side strong {
  color: var(--danger);
  font-size: 22px;
}

.ship-deadline {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff6df;
  color: #b45422;
  font-weight: 800;
}

.ship-fulfillment-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 14px;
  margin-bottom: 16px;
}

.ship-address-card,
.ship-goods-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfdfd;
}

.ship-card-head {
  justify-content: space-between;
  margin-bottom: 12px;
}

.ship-card-head h3,
.ship-goods-card h3 {
  margin: 0;
  font-size: 16px;
}

.ship-address-card b {
  display: block;
  overflow-wrap: anywhere;
  font-size: 18px;
}

.ship-address-card p {
  margin: 8px 0 0;
  line-height: 1.7;
}

.ship-goods-row {
  align-items: flex-start;
}

.ship-goods-row > div:last-child {
  min-width: 0;
}

.ship-goods-row b {
  display: block;
  overflow-wrap: anywhere;
  font-size: 17px;
}

.ship-goods-row p {
  margin: 6px 0;
}

.ship-goods-row span {
  display: block;
  font-size: 13px;
}

.ship-form-card .form-row.compact {
  max-width: 620px;
}

.ship-company-line {
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(220px, 1fr);
  gap: 10px;
  align-items: center;
}

.ship-company-line .hidden {
  display: none;
}

@media (max-width: 720px) {
  .ship-company-line {
    grid-template-columns: 1fr;
  }
}

.ship-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0 12px;
}

.quick-chip {
  min-width: 0;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 800;
}

.form-row.compact {
  grid-template-columns: 110px 1fr;
  margin-top: 12px;
}

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

.product-editor select {
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.check-line {
  margin-top: 12px;
  color: var(--text);
  font-weight: 800;
}

.warn-text {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  color: #8a640d;
  background: #fff6df;
  line-height: 1.6;
}

.check-line input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.settings-save-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
}

.settings-save-panel h2 {
  margin: 0;
}

.settings-save-panel p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 1120px) {
  .stats.dense { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 920px) {
  body { grid-template-columns: 1fr; }
  .sidebar { min-height: auto; }
  .grid.two,
  .stats.dense { grid-template-columns: 1fr; }
  .quick-list,
  .ops-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .editor-grid { grid-template-columns: 1fr; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .search { min-width: 0; width: 100%; }
  .order-status-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar,
  .panel-head,
  .order-card-main,
  .order-address-box {
    align-items: stretch;
    flex-direction: column;
  }
  .order-money { justify-items: start; }
  .order-card-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  .detail-grid { grid-template-columns: 1fr; }
  .modal-backdrop { padding: 12px; }
  .modal-card { max-height: 94vh; }
  .ship-fulfillment-grid { grid-template-columns: 1fr; }
  .ship-summary { align-items: flex-start; flex-direction: column; }
  .ship-summary-side { justify-items: start; }
  .address-copy,
  .modal-actions { align-items: stretch; flex-direction: column; }
  .order-timeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
