:root {
  --ink: #1f2933;
  --muted: #687582;
  --line: #d8dee5;
  --paper: #f7f5ef;
  --panel: #ffffff;
  --teal: #18756f;
  --teal-dark: #0f524e;
  --coral: #d96f52;
  --mustard: #b98524;
  --green: #2f7d4c;
  --red: #bb4b4b;
  --shadow: 0 18px 45px rgba(34, 43, 51, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: linear-gradient(135deg, #f7f5ef 0%, #eef5f2 54%, #f8efe8 100%);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: 100vh;
}

.sidebar {
  padding: 24px;
  background: rgba(255, 255, 255, 0.82);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

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

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: white;
  background: var(--teal);
  border-radius: 8px;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.brand-block h1 {
  font-size: 22px;
}

.brand-block p,
.eyebrow,
.panel label,
.summary-strip p,
.automation-card span {
  color: var(--muted);
}

.panel {
  padding: 18px;
  margin-bottom: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(31, 41, 51, 0.06);
}

.panel-title,
.section-heading,
.topbar,
.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-title {
  margin-bottom: 14px;
  font-weight: 700;
}

.mini-badge {
  padding: 4px 8px;
  color: var(--teal-dark);
  background: #e4f2ef;
  border-radius: 999px;
  font-size: 12px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 14px;
  padding: 4px;
  background: #edf1f0;
  border-radius: 8px;
}

.segmented button,
.quick-actions button {
  min-height: 36px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 7px;
}

.segmented button.active,
.quick-actions button.active {
  color: white;
  background: var(--teal);
}

label {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  font-size: 14px;
}

input,
select {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  color: var(--ink);
  background: #fbfcfc;
  border: 1px solid var(--line);
  border-radius: 7px;
}

input[type="range"] {
  padding: 0;
  accent-color: var(--teal);
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle-row input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--teal);
}

.primary-btn,
.secondary-btn {
  width: 100%;
  min-height: 42px;
  margin-top: 14px;
  border-radius: 7px;
  font-weight: 700;
}

.primary-btn {
  color: white;
  background: var(--teal);
  border: 1px solid var(--teal);
}

.secondary-btn {
  color: var(--teal-dark);
  background: #f1faf8;
  border: 1px solid #b9dcd6;
}

.file-label input {
  padding: 8px;
}

.icon-btn {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--ink);
  background: #f2f5f4;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.status-dot {
  width: 10px;
  height: 10px;
  background: var(--green);
  border-radius: 999px;
  box-shadow: 0 0 0 5px rgba(47, 125, 76, 0.14);
}

.workspace {
  padding: 28px;
  overflow: auto;
}

.topbar {
  margin-bottom: 22px;
}

.eyebrow {
  margin-bottom: 5px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.topbar h2 {
  font-size: 34px;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(3, 108px);
  gap: 10px;
}

.summary-strip div {
  padding: 12px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.summary-strip span {
  display: block;
  font-size: 22px;
  font-weight: 800;
}

.hero-board {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 380px);
  gap: 18px;
  align-items: stretch;
  padding: 22px;
  margin-bottom: 22px;
  color: white;
  background:
    linear-gradient(110deg, rgba(15, 82, 78, 0.94), rgba(31, 41, 51, 0.82)),
    url("https://images.unsplash.com/photo-1556742049-0cfed4f6a45d?auto=format&fit=crop&w=1400&q=80");
  background-position: center;
  background-size: cover;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero-copy p {
  max-width: 660px;
  margin-bottom: 16px;
  color: rgba(255, 255, 255, 0.86);
  line-height: 1.7;
}

.quick-actions {
  display: flex;
  gap: 10px;
}

.quick-actions button {
  min-width: 108px;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.automation-card {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 18px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 8px;
}

.automation-card strong {
  display: block;
  margin-bottom: 6px;
}

.automation-card span {
  display: block;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.5;
}

.pulse-ring {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border: 10px solid rgba(255, 255, 255, 0.25);
  border-top-color: var(--coral);
  border-radius: 50%;
  animation: rotate 1.8s linear infinite;
}

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

.recommendation-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.product-card {
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 26px rgba(31, 41, 51, 0.08);
}

.card-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.product-card h3 {
  font-size: 18px;
  line-height: 1.35;
}

.score-pill {
  display: grid;
  min-width: 58px;
  height: 58px;
  place-items: center;
  color: white;
  background: var(--teal);
  border-radius: 8px;
  font-weight: 800;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 14px 0;
}

.metric {
  padding: 10px;
  background: #f5f7f7;
  border-radius: 7px;
}

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

.metric strong {
  display: block;
  margin-top: 3px;
  font-size: 15px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 28px;
}

.tag {
  padding: 5px 8px;
  color: #26423f;
  background: #e8f2f0;
  border-radius: 999px;
  font-size: 12px;
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 14px;
}

.card-actions button {
  min-height: 36px;
  border-radius: 7px;
}

.detail-btn {
  color: white;
  background: var(--ink);
  border: 1px solid var(--ink);
}

.watch-btn {
  min-width: 42px;
  color: var(--mustard);
  background: #fff8e9;
  border: 1px solid #ebd39c;
}

.data-section {
  padding: 20px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.section-heading {
  margin-bottom: 14px;
}

.section-heading h3 {
  font-size: 24px;
}

.search-box {
  width: min(320px, 100%);
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 850px;
}

th,
td {
  padding: 13px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status.good {
  color: var(--green);
  background: #e7f4ec;
}

.status.medium {
  color: var(--mustard);
  background: #fff4d8;
}

.status.high {
  color: var(--red);
  background: #fae8e8;
}

dialog {
  width: min(680px, calc(100% - 28px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(24, 32, 38, 0.45);
}

.dialog-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

#dialogBody {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.detail-list {
  display: grid;
  gap: 10px;
}

.detail-list div {
  padding: 12px;
  background: #f6f8f8;
  border-radius: 7px;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .recommendation-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .sidebar,
  .workspace {
    padding: 16px;
  }

  .topbar,
  .section-heading,
  .hero-board {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar h2 {
    font-size: 26px;
  }

  .summary-strip,
  .recommendation-grid {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .summary-strip div {
    min-width: 0;
  }

  .quick-actions {
    flex-wrap: wrap;
  }
}
