:root {
  --bg: #fffbf5;
  --panel: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #ead9c3;
  --primary: #b07636;
  --primary-dark: #8f5f2e;
  --danger: #dc2626;
  font-family: "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.page-shell {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0;
}

.page-shell.wide {
  width: min(1180px, calc(100% - 32px));
}

.app-header,
.topbar,
.section-head,
.panel-title,
.actions-row,
.export-bar,
.history-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-header {
  justify-content: center;
  gap: 14px;
  margin-bottom: 36px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 24px;
  font-weight: 800;
}

.app-header h1,
.topbar h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.25;
}

.app-header p,
.topbar p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

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

.section-head span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}

.panel-title span {
  width: 5px;
  height: 22px;
  border-radius: 999px;
  background: var(--primary);
}

.section-head h2,
.panel-title h2,
.history-title h2 {
  margin: 0;
  font-size: 16px;
}

.entry-grid,
.skill-grid {
  display: grid;
  gap: 14px;
  margin-bottom: 28px;
}

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

.entry-card,
.skill-card,
.history-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
  color: inherit;
  text-align: left;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.entry-card {
  min-height: 150px;
  align-items: flex-start;
  padding: 22px;
}

.entry-card:hover,
.skill-card:hover,
.history-item:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 22px rgb(31 41 55 / 8%);
  transform: translateY(-1px);
}

.entry-icon,
.skill-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 14%, white);
  color: var(--accent);
  font-weight: 800;
}

.entry-icon {
  width: 54px;
  height: 54px;
  font-size: 20px;
}

.entry-copy,
.skill-copy {
  min-width: 0;
  flex: 1;
}

.entry-copy h3,
.skill-copy h3 {
  margin: 0;
  font-size: 18px;
}

.entry-copy h3 {
  font-size: 20px;
}

.entry-copy p,
.skill-copy p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.entry-copy p {
  margin-top: 8px;
  line-height: 1.65;
}

.record-pill,
.history-title span {
  border-radius: 999px;
  padding: 3px 10px;
  background: #fbf0e3;
  color: var(--primary-dark);
  font-size: 12px;
}

.history-panel,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 20px;
}

.history-title {
  justify-content: space-between;
  margin-bottom: 14px;
}

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

.history-item {
  justify-content: space-between;
  padding: 14px;
}

.history-item strong,
.history-item span {
  display: block;
}

.history-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.empty-state {
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.topbar {
  margin-bottom: 20px;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.form-panel,
.preview-panel {
  display: grid;
  gap: 18px;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field {
  display: grid;
  gap: 6px;
}

.field span {
  color: #374151;
  font-size: 13px;
  font-weight: 600;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 11px;
  background: #fff;
  outline: none;
}

.field textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.65;
}

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

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgb(201 144 71 / 15%);
}

.skill-note {
  border: 1px solid #d7ebe8;
  border-radius: 8px;
  padding: 10px 12px;
  background: #f2fbf8;
  color: #246764;
  font-size: 13px;
  font-weight: 700;
}

.actions-row,
.export-bar {
  flex-wrap: wrap;
}

.primary-button,
.secondary-button,
.danger-button,
.ghost-button,
.icon-button {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 700;
}

.primary-button {
  background: var(--primary);
  color: #fff;
}

.primary-button:hover {
  background: var(--primary-dark);
}

.secondary-button,
.ghost-button {
  border-color: var(--line);
  background: #fff;
  color: var(--primary-dark);
}

.secondary-button:hover,
.ghost-button:hover {
  background: #fff7ed;
}

.danger-button {
  background: var(--danger);
  color: #fff;
}

.icon-button {
  width: 32px;
  height: 32px;
  padding: 0;
}

.icon-button.danger {
  background: #fff;
  border-color: #fee2e2;
  color: var(--danger);
}

.report-placeholder {
  display: grid;
  min-height: 360px;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fffaf3;
}

.report {
  display: grid;
  gap: 18px;
  border-radius: 8px;
  background: #fff;
}

.report-cover {
  border-radius: 8px;
  padding: 24px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 18%, white), #fff);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, white);
}

.report-cover span {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 10px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.report-cover h2 {
  margin: 12px 0 6px;
  font-size: 24px;
}

.report-cover p {
  margin: 0;
  color: var(--muted);
}

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

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

.metric-card,
.phase-card,
.kpi-card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px;
  background: #f9fafb;
}

.metric-card strong,
.metric-card span,
.kpi-card strong,
.kpi-card span {
  display: block;
}

.metric-card strong,
.kpi-card strong {
  font-size: 16px;
}

.metric-card span,
.kpi-card span,
.phase-card p,
.phase-card span {
  color: var(--muted);
  font-size: 12px;
}

.phase-index {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.phase-card h3 {
  margin: 10px 0 4px;
  font-size: 14px;
}

.phase-card p,
.phase-card span {
  display: block;
  margin: 0;
}

.report-section {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 18px;
}

.report-section h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 17px;
}

.report-section h3 span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #fbf0e3;
  color: var(--primary-dark);
  font-size: 12px;
}

.section-body {
  color: #374151;
  line-height: 1.75;
}

.section-body p,
.section-body ul {
  margin: 0 0 10px;
}

.section-body ul {
  padding-left: 18px;
}

.strategy-brief {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fcfcfd;
}

.strategy-brief p {
  margin: 0;
  color: #111827;
  font-size: 15px;
  font-weight: 700;
}

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

.brief-grid div,
.budget-summary,
.insight-list div,
.review-list div {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

.brief-grid div {
  padding: 11px 12px;
}

.brief-grid span,
.budget-summary span,
.action-card span,
.keyword-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.brief-grid strong {
  display: block;
  margin-top: 4px;
  color: #1f2937;
  font-size: 13px;
  line-height: 1.5;
}

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

.insight-list div {
  display: flex;
  gap: 8px;
  padding: 12px;
  font-size: 13px;
  line-height: 1.65;
}

.insight-list span {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  margin-top: 8px;
  border-radius: 999px;
  background: var(--primary);
}

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

.phase-block {
  display: grid;
  gap: 9px;
  min-width: 0;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 14px;
  background: linear-gradient(180deg, #fff, #fafafa);
}

.phase-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.phase-top span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.phase-top strong {
  font-size: 15px;
}

.phase-date {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.phase-block h4 {
  margin: 0;
  color: #111827;
  font-size: 14px;
}

.phase-block ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.55;
}

.phase-kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.phase-kpis b {
  border-radius: 999px;
  padding: 4px 8px;
  background: #fbf0e3;
  color: var(--primary-dark);
  font-size: 12px;
}

.budget-summary {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  margin-bottom: 12px;
  background: #fcfcfd;
}

.budget-summary strong {
  display: block;
  margin-top: 4px;
  color: #111827;
  font-size: 22px;
}

.budget-summary p {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.6;
}

.budget-bars {
  display: grid;
  gap: 10px;
}

.budget-row {
  display: grid;
  gap: 7px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px;
}

.budget-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
}

.budget-label span {
  color: var(--muted);
  white-space: nowrap;
}

.bar-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #f3f4f6;
}

.bar-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}

.budget-row p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.keyword-grid,
.action-grid,
.review-list {
  display: grid;
  gap: 10px;
}

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

.keyword-card,
.action-card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.keyword-card strong,
.action-card span {
  color: #111827;
  font-weight: 800;
}

.keyword-card p,
.action-card p {
  margin: 6px 0;
  color: #374151;
  font-size: 13px;
  line-height: 1.6;
}

.keyword-card span {
  display: inline-flex;
  border-radius: 999px;
  padding: 3px 8px;
  background: #f3f4f6;
}

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

.action-card p {
  margin-bottom: 0;
}

.review-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 10px;
}

.review-list div {
  padding: 10px 12px;
  color: #374151;
  font-size: 13px;
  font-weight: 700;
}

.skill-callout {
  display: grid;
  gap: 5px;
  margin-top: 12px;
  border: 1px solid #d7ebe8;
  border-radius: 8px;
  padding: 13px 14px;
  background: #f2fbf8;
}

.skill-callout span,
.dimension-card span {
  color: var(--muted);
  font-size: 12px;
}

.skill-callout strong {
  color: #246764;
  font-size: 16px;
}

.skill-callout p {
  margin: 0;
  color: #374151;
  font-size: 13px;
  line-height: 1.6;
}

.problem-list,
.dimension-grid,
.opportunity-list {
  display: grid;
  gap: 10px;
}

.problem-item {
  display: flex;
  gap: 12px;
  border: 1px solid #e5e7eb;
  border-left: 5px solid #9ca3af;
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.problem-item.priority-high {
  border-left-color: #dc2626;
}

.problem-item.priority-medium {
  border-left-color: #f59e0b;
}

.problem-item.priority-low {
  border-left-color: #22a699;
}

.problem-item > span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  background: #f3f4f6;
  color: #111827;
  font-size: 12px;
  font-weight: 800;
}

.problem-item strong {
  display: block;
  color: #111827;
  font-size: 14px;
}

.problem-item p {
  margin: 5px 0 0;
  color: #4b5563;
  font-size: 13px;
  line-height: 1.65;
}

.diagnosis-table-wrap {
  overflow-x: auto;
  margin-bottom: 12px;
}

.diagnosis-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
  font-size: 13px;
}

.diagnosis-table th,
.diagnosis-table td {
  border: 1px solid #e5e7eb;
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

.diagnosis-table th {
  background: #f9fafb;
  color: #111827;
}

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

.dimension-card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.dimension-card strong {
  color: #111827;
}

.dimension-card p {
  margin: 6px 0;
  color: #374151;
  font-size: 13px;
  line-height: 1.6;
}

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

.opportunity-list div {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px;
  background: #fcfcfd;
  color: #374151;
  font-size: 13px;
  line-height: 1.65;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 10px;
}

.data-table th,
.data-table td {
  border: 1px solid #e5e7eb;
  padding: 9px 10px;
  text-align: left;
}

.data-table th {
  background: #f9fafb;
}

.muted,
.report-footer {
  color: var(--muted);
  font-size: 13px;
}

.report-footer {
  border-top: 1px solid #e5e7eb;
  padding-top: 12px;
  text-align: center;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 20;
  border-radius: 999px;
  padding: 10px 18px;
  background: #111827;
  color: #fff;
  box-shadow: 0 12px 24px rgb(0 0 0 / 18%);
}

@media (max-width: 900px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .metric-grid,
  .phase-grid,
  .kpi-grid,
  .phase-board,
  .keyword-grid,
  .action-grid,
  .review-list,
  .dimension-grid,
  .opportunity-list {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 620px) {
  .entry-grid,
  .field-grid,
  .metric-grid,
  .phase-grid,
  .kpi-grid,
  .phase-board,
  .brief-grid,
  .insight-list,
  .keyword-grid,
  .action-grid,
  .review-list,
  .dimension-grid,
  .opportunity-list,
  .budget-summary {
    grid-template-columns: 1fr;
  }

  .budget-label {
    display: grid;
  }

  .app-header {
    justify-content: flex-start;
  }
}
