:root {
  --primary: #2563eb;
  --warm: #f59e0b;
  --success: #10b981;
  --bg: #f8fafc;
  --card: #ffffff;
  --text-main: #334155;
  --text-sub: #64748b;
  --text-muted: #94a3b8;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --soft-blue: #eff6ff;
  --soft-warm: #fff7ed;
  --soft-green: #ecfdf5;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  --radius-card: 12px;
  --radius-btn: 6px;
  --workspace-width: 1440px;
  --transition: 0.24s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent 28%),
    linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  color: var(--text-main);
  font-size: 14px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

body.modal-open {
  overflow: hidden;
}

a,
button,
input {
  font: inherit;
}

button {
  border: 0;
  background: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
.text-link,
.btn {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
.text-link:focus-visible,
.btn:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.28);
  outline-offset: 2px;
}

.workspace-page {
  min-height: 100vh;
  padding: 40px 24px 64px;
}

.workspace-main {
  width: min(var(--workspace-width), 100%);
  margin: 0 auto;
  display: grid;
  gap: 20px;
}

.card {
  background: var(--card);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
}

.page-header {
  padding: 24px 28px;
}

.page-header-top,
.page-header-body,
.section-head,
.material-head,
.benchmark-toolbar,
.table-head,
.table-row,
.modal-head,
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.page-header-top {
  margin-bottom: 24px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 12px;
}

.breadcrumb a:hover {
  color: var(--primary);
}

.text-link {
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.text-link-muted {
  font-size: 12px;
  color: var(--text-muted);
}

.page-header-body {
  align-items: stretch;
}

.page-title-wrap {
  flex: 1;
  min-width: 0;
  text-align: center;
  display: grid;
  place-content: center;
  gap: 10px;
}

.page-title-wrap h1 {
  font-size: clamp(28px, 2.5vw, 36px);
  line-height: 1.25;
  color: #0f172a;
  font-weight: 800;
}

.section-label {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--soft-blue);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}

.asset-card {
  width: min(360px, 100%);
  padding: 18px 18px 16px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.asset-card p {
  color: var(--text-main);
  font-size: 14px;
  line-height: 1.6;
}

.asset-card strong {
  color: #0f172a;
}

.asset-card span,
.subtle-note,
.stats-line,
.review-summary {
  color: var(--text-muted);
  font-size: 12px;
}

.asset-card span {
  display: block;
  margin-top: 8px;
}

.section-head {
  margin-bottom: 20px;
}

.section-head h2 {
  color: #0f172a;
  font-size: 22px;
  line-height: 1.35;
  margin-top: 10px;
}

.section-head-stack {
  align-items: flex-start;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 18px;
  border-radius: var(--radius-btn);
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  transition:
    transform var(--transition),
    box-shadow var(--transition),
    background var(--transition),
    border-color var(--transition),
    color var(--transition);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 10px 18px -12px rgba(37, 99, 235, 0.8);
}

.btn-secondary {
  background: #ffffff;
  color: var(--primary);
  border-color: rgba(37, 99, 235, 0.22);
}

.btn-ghost {
  background: #f8fafc;
  color: var(--text-main);
  border-color: var(--line);
}

.btn-warm {
  background: var(--warm);
  color: #ffffff;
  box-shadow: 0 10px 18px -12px rgba(245, 158, 11, 0.75);
}

.btn-success {
  background: var(--success);
  color: #ffffff;
  box-shadow: 0 10px 18px -12px rgba(16, 185, 129, 0.75);
}

.btn-small {
  min-height: 34px;
  padding: 0 14px;
  font-size: 13px;
}

.btn-full {
  width: 100%;
}

.badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.badge-blue {
  background: rgba(37, 99, 235, 0.12);
  color: var(--primary);
}

.badge-warm {
  background: rgba(245, 158, 11, 0.14);
  color: #c47a00;
}

.badge-muted {
  background: #f1f5f9;
  color: var(--text-muted);
}

.board-card,
.library-wrap,
.quick-create,
.benchmark-card,
.review-card {
  padding: 24px 28px;
}

.state-switch {
  display: inline-flex;
  gap: 8px;
  padding: 4px;
  background: #f1f5f9;
  border-radius: 10px;
}

.state-chip {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 8px;
  color: var(--text-sub);
  font-size: 13px;
  font-weight: 600;
}

.state-chip.active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.recommend-state {
  position: relative;
  min-height: 160px;
}

.recommend-state-filled {
  display: grid;
  grid-template-columns: 4px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 22px 22px 18px 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #eff6ff 0%, #ffffff 68%);
}

.recommend-accent {
  height: 100%;
  border-radius: 999px;
  background: var(--primary);
}

.recommend-copy h3,
.empty-copy h3,
.material-card h3,
.diagnosis-block h3,
.modal-head h2 {
  color: #0f172a;
}

.recommend-copy h3 {
  margin: 10px 0 8px;
  font-size: 24px;
  line-height: 1.3;
}

.recommend-copy p,
.empty-copy p,
.material-text,
.locked-state p,
.diagnosis-block li,
.modal-block p,
.modal-block li,
.modal-tip {
  color: var(--text-sub);
}

.topic-pills,
.keyword-list,
.create-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.topic-pills {
  margin-top: 14px;
}

.topic-pills span,
.keyword-list span {
  padding: 8px 12px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 500;
}

.recommend-side {
  display: grid;
  justify-items: end;
  gap: 18px;
}

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

.mini-metrics div {
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(37, 99, 235, 0.12);
}

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

.mini-metrics strong {
  color: #0f172a;
  font-size: 18px;
}

.recommend-note {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 14px;
  color: var(--text-muted);
  font-size: 12px;
}

.recommend-state-empty {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  min-height: 160px;
  padding: 22px;
  border: 2px dashed var(--line-strong);
  border-radius: 12px;
  background: #ffffff;
}

.empty-radar {
  position: relative;
  width: 84px;
  height: 84px;
  display: grid;
  place-items: center;
}

.empty-radar span,
.empty-radar i {
  position: absolute;
  border-radius: 50%;
}

.empty-radar span:nth-child(1) {
  inset: 0;
  border: 2px solid rgba(37, 99, 235, 0.18);
}

.empty-radar span:nth-child(2) {
  inset: 14px;
  border: 2px solid rgba(37, 99, 235, 0.16);
}

.empty-radar span:nth-child(3) {
  inset: 28px;
  border: 2px solid rgba(37, 99, 235, 0.14);
}

.empty-radar i {
  width: 12px;
  height: 12px;
  background: var(--primary);
  box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.12);
}

.library-summary {
  display: grid;
  gap: 4px;
}

.library-summary p {
  color: var(--text-main);
}

.library-summary span {
  color: var(--text-muted);
  font-size: 12px;
}

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

.material-card {
  display: grid;
  gap: 18px;
  min-height: 220px;
  padding: 22px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.material-head {
  align-items: flex-start;
}

.material-head > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.material-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #f8fafc;
  font-size: 18px;
}

.material-card h3 {
  font-size: 18px;
}

.material-text {
  min-height: 72px;
  font-size: 15px;
  line-height: 1.75;
}

.material-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
}

.material-card-locked {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.locked-state {
  display: grid;
  place-content: center;
  min-height: 94px;
  padding: 18px;
  border-radius: 10px;
  border: 1px dashed var(--line-strong);
  background: #f8fafc;
  text-align: center;
}

.locked-state strong {
  margin-bottom: 8px;
  color: #475569;
  font-size: 16px;
}

.quick-create .create-actions {
  margin-bottom: 16px;
}

.benchmark-toolbar {
  align-items: stretch;
  margin-bottom: 14px;
}

.input-wrap {
  flex: 1;
}

.input-wrap input {
  width: 100%;
  height: 40px;
  padding: 0 14px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  background: #ffffff;
  color: var(--text-main);
}

.input-wrap input::placeholder {
  color: var(--text-muted);
}

.table-card {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.table-head,
.table-row {
  display: grid;
  grid-template-columns: 1.3fr 1.1fr 1.7fr 120px;
  gap: 16px;
  padding: 14px 18px;
}

.table-head {
  background: #f8fafc;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}

.table-row {
  align-items: center;
  border-top: 1px solid var(--line);
  color: var(--text-main);
}

.status {
  font-size: 13px;
}

.status-pending {
  color: #b45309;
}

.status-done {
  color: #047857;
}

.review-layout {
  display: grid;
  grid-template-columns: minmax(260px, 30%) minmax(0, 70%);
  gap: 24px;
  align-items: stretch;
}

.gauge-panel,
.review-diagnosis,
.diagnosis-block {
  border-radius: 12px;
}

.gauge-panel {
  display: grid;
  place-items: center;
  padding: 18px;
  background: #f8fafc;
  border: 1px solid var(--line);
}

.gauge-shell {
  position: relative;
  width: min(100%, 280px);
  aspect-ratio: 2 / 1.2;
  overflow: hidden;
}

.gauge-fill {
  position: absolute;
  left: 50%;
  top: 100%;
  width: 220px;
  height: 220px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: conic-gradient(from 180deg, var(--primary) 0deg 114deg, var(--warm) 114deg 142deg, var(--success) 142deg 180deg, #e2e8f0 180deg 360deg);
}

.gauge-fill::after {
  content: "";
  position: absolute;
  inset: 22px;
  border-radius: 50%;
  background: #f8fafc;
}

.gauge-inner {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 4px;
  width: 100%;
  text-align: center;
}

.gauge-inner strong {
  color: #0f172a;
  font-size: 32px;
  line-height: 1;
}

.gauge-inner span {
  color: var(--text-main);
  font-size: 14px;
  font-weight: 600;
}

.gauge-inner small {
  width: min(220px, 100%);
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.6;
}

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

.diagnosis-block {
  padding: 20px;
  border: 1px solid var(--line);
  background: #f8fafc;
}

.diagnosis-block h3 {
  margin-bottom: 12px;
  font-size: 18px;
}

.diagnosis-block ul,
.modal-block ul,
.modal-block ol {
  padding-left: 18px;
}

.diagnosis-block li + li,
.modal-block li + li {
  margin-top: 10px;
}

.review-summary {
  margin-top: 16px;
}

.subtle-note {
  margin-top: 8px;
  line-height: 1.65;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
}

.modal.is-open {
  display: block;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(4px);
}

.modal-dialog {
  position: relative;
  z-index: 1;
  width: min(860px, calc(100% - 32px));
  max-height: calc(100vh - 48px);
  margin: 24px auto;
  overflow: auto;
  padding: 24px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.16);
}

.modal-head {
  align-items: flex-start;
  margin-bottom: 18px;
}

.modal-head h2 {
  margin-top: 10px;
  font-size: 24px;
  line-height: 1.4;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #f8fafc;
  color: var(--text-main);
  font-size: 24px;
  line-height: 1;
}

.modal-body {
  display: grid;
  gap: 16px;
}

.modal-block {
  padding: 18px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #ffffff;
}

.modal-block-warning {
  background: #fffdf7;
  border-color: rgba(245, 158, 11, 0.2);
}

.modal-block h3 {
  margin-bottom: 10px;
  color: #0f172a;
  font-size: 18px;
}

.modal-block p + p,
.modal-tip {
  margin-top: 10px;
}

.modal-foot {
  margin-top: 20px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1200px) {
  .page-header-body,
  .recommend-state-filled,
  .recommend-state-empty,
  .review-layout {
    grid-template-columns: 1fr;
  }

  .page-title-wrap {
    text-align: left;
    place-content: start;
  }

  .asset-card {
    width: 100%;
  }

  .recommend-side {
    justify-items: start;
  }

  .recommend-note {
    position: static;
    margin-top: 12px;
  }

  .review-diagnosis {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .workspace-page {
    padding: 20px 14px 40px;
  }

  .page-header,
  .board-card,
  .library-wrap,
  .quick-create,
  .benchmark-card,
  .review-card,
  .modal-dialog {
    padding: 18px;
  }

  .page-header-top,
  .section-head,
  .benchmark-toolbar,
  .modal-head,
  .modal-foot {
    flex-direction: column;
    align-items: flex-start;
  }

  .state-switch {
    width: 100%;
    justify-content: space-between;
  }

  .state-chip {
    flex: 1;
  }

  .library-grid,
  .review-diagnosis {
    grid-template-columns: 1fr;
  }

  .table-head {
    display: none;
  }

  .table-row {
    grid-template-columns: 1fr;
    gap: 8px;
    align-items: start;
  }
}

@media (max-width: 640px) {
  .page-title-wrap h1 {
    font-size: 24px;
  }

  .section-head h2,
  .recommend-copy h3,
  .modal-head h2 {
    font-size: 20px;
  }

  .create-actions,
  .material-actions {
    flex-direction: column;
  }

  .btn,
  .btn-small {
    width: 100%;
  }

  .topic-pills,
  .keyword-list {
    gap: 8px;
  }

  .mini-metrics {
    grid-template-columns: 1fr;
  }

  .modal-dialog {
    width: calc(100% - 20px);
    margin: 10px auto;
    max-height: calc(100vh - 20px);
  }
}

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

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
