/* Product UI polish layer for the ecommerce operations console. */
:root {
  --surface-soft: #f8fafb;
  --line-strong: #cfd8de;
  --focus-ring: rgba(15, 118, 110, 0.28);
  --shadow: 0 8px 18px rgba(23, 33, 43, 0.06);
}

html {
  scroll-behavior: smooth;
}

body {
  background: #f4f6f8;
  text-rendering: optimizeLegibility;
}

body.is-rendering::after {
  content: "页面正在刷新...";
  position: fixed;
  right: 18px;
  top: 18px;
  z-index: 1200;
  padding: 9px 12px;
  border: 1px solid rgba(15, 118, 110, 0.2);
  border-radius: 8px;
  background: #ffffff;
  color: #21302f;
  box-shadow: 0 10px 24px rgba(23, 33, 43, 0.12);
  font-size: 13px;
}

body.is-rendered::after {
  content: "页面已更新";
  position: fixed;
  right: 18px;
  top: 18px;
  z-index: 1200;
  padding: 9px 12px;
  border: 1px solid rgba(15, 118, 110, 0.2);
  border-radius: 8px;
  background: #ffffff;
  color: #0f766e;
  box-shadow: 0 10px 24px rgba(23, 33, 43, 0.12);
  font-size: 13px;
}

.app-shell {
  background: linear-gradient(90deg, #17212b 0 260px, transparent 260px);
}

.sidebar {
  position: sticky;
  top: 0;
  max-height: 100vh;
  overflow: auto;
}

.workspace {
  max-width: 1680px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  margin: -22px -22px 18px;
  padding: 16px 22px;
  border-bottom: 1px solid rgba(207, 216, 222, 0.9);
  background: rgba(244, 246, 248, 0.94);
  backdrop-filter: blur(14px);
}

.topbar h2 {
  font-size: clamp(22px, 2vw, 28px);
  line-height: 1.2;
}

.eyebrow {
  color: #47615f;
}

button,
.file-button,
.nav-tab,
.section-jump-button,
summary {
  transition: background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, color 0.16s ease, transform 0.12s ease;
}

button:active,
.file-button:active,
.section-jump-button:active {
  transform: translateY(1px);
}

button:focus-visible,
.file-button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

button.primary,
button.secondary,
button.danger,
.file-button,
form button[type="submit"] {
  border: 1px solid transparent;
  font-weight: 650;
}

button.primary,
form button[type="submit"],
.file-button:not(.secondary-file) {
  box-shadow: 0 6px 14px rgba(15, 118, 110, 0.16);
}

button.secondary,
.file-button.secondary-file,
.top-more summary {
  border-color: #d4dedb;
  background: #eef4f1;
}

button.secondary:hover,
.file-button.secondary-file:hover,
.top-more summary:hover {
  border-color: #b9cbc6;
  background: #e1ebe7;
}

button.primary:hover,
form button[type="submit"]:hover,
.file-button:not(.secondary-file):hover {
  background: #0b675f;
}

button[disabled],
button.is-busy-feedback {
  cursor: wait;
  opacity: 0.78;
}

button.is-busy-feedback::before {
  content: "";
  width: 0.78em;
  height: 0.78em;
  margin-right: 7px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  animation: cpa-spin 0.78s linear infinite;
}

.is-click-feedback {
  outline: 3px solid rgba(15, 118, 110, 0.32);
  outline-offset: 2px;
  transform: translateY(0);
}

.action-feedback-toast {
  right: 22px;
  bottom: 22px;
  max-width: min(460px, calc(100vw - 32px));
  padding: 12px 15px;
  border-color: rgba(15, 118, 110, 0.3);
  background: #10231f;
  box-shadow: 0 18px 42px rgba(16, 35, 31, 0.28);
  line-height: 1.45;
}

.startup-progress {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 1150;
  display: grid;
  gap: 3px;
  width: min(420px, calc(100vw - 32px));
  padding: 13px 15px;
  border: 1px solid rgba(15, 118, 110, 0.24);
  border-radius: 8px;
  background: #ffffff;
  color: #21302f;
  box-shadow: 0 18px 42px rgba(23, 33, 43, 0.16);
  transform: translateX(-50%);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

.startup-progress strong {
  font-size: 14px;
}

.startup-progress span {
  color: #5d6b75;
  font-size: 13px;
  line-height: 1.45;
}

.startup-progress.is-hidden {
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(10px);
}

.panel,
.metric,
.quote-panel,
.daily-ops-platform-card,
.daily-page-slim-card,
.daily-confirm-item,
.daily-confirm-batch-card,
.daily-feature-navigator-card,
.daily-button-coach-card,
.daily-workflow-relay-card,
.daily-profit-guard-card,
.daily-step-card {
  box-shadow: var(--shadow);
}

.panel {
  border-color: var(--line-strong);
}

.panel-head {
  align-items: flex-start;
  gap: 12px;
}

.panel-head p,
.muted,
td,
th {
  line-height: 1.55;
}

.badge {
  border: 1px solid transparent;
}

.table-wrap {
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #ffffff;
}

table {
  border-collapse: separate;
  border-spacing: 0;
}

thead th {
  position: sticky;
  top: 73px;
  z-index: 10;
  background: #f9fbfc;
  box-shadow: inset 0 -1px 0 var(--line);
}

tbody tr:hover td {
  background: #f7fbfa;
}

.view-directory-panel,
.daily-feature-navigator-panel,
.daily-page-slim-board {
  background: #fbfcfd;
  border-color: #d6e0e5;
}

.section-jump-button {
  border-color: #d8e2e8;
  background: #ffffff;
}

.section-jump-button:hover,
.section-jump-button.is-current {
  border-color: rgba(15, 118, 110, 0.45);
  background: #f1f8f5;
}

.is-section-focus {
  outline: 3px solid rgba(15, 118, 110, 0.24);
  outline-offset: 4px;
}

input,
select,
textarea {
  border-color: #cfd8de;
  background: #ffffff;
}

input::placeholder,
textarea::placeholder {
  color: #71808b;
}

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

@media (max-width: 1100px) {
  .app-shell {
    background: #f4f6f8;
  }

  .sidebar {
    position: static;
    max-height: none;
  }

  .topbar {
    top: 0;
    margin: -22px -22px 16px;
  }
}

@media (max-width: 720px) {
  .workspace {
    padding: 14px;
  }

  .topbar {
    margin: -14px -14px 14px;
    padding: 14px;
  }

  .top-actions {
    justify-content: flex-start;
  }

  button.primary,
  button.secondary,
  button.danger,
  .file-button,
  form button[type="submit"] {
    min-height: 40px;
  }

  body.is-rendering::after,
  body.is-rendered::after {
    right: 12px;
    top: 12px;
  }
}
