:root {
  --bg: #f3f5f2;
  --surface: #ffffff;
  --ink: #1c241f;
  --muted: #667169;
  --line: #d8dfda;
  --green: #23684a;
  --green-soft: #e7f0eb;
  --red: #a84c3d;
  --red-soft: #f6ebe8;
  --blue: #36627c;
  --blue-soft: #e9f0f4;
  --shadow: 0 10px 30px rgba(28, 36, 31, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

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

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 22px 16px;
  background: #17251e;
  color: #f6faf7;
}

.brand-block {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 11px;
  align-items: center;
  padding: 0 4px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  background: #eff7f2;
  color: var(--green);
  font-weight: 800;
}

.brand-block strong,
.brand-block small {
  display: block;
}

.brand-block strong {
  font-size: 15px;
  line-height: 1.4;
}

.brand-block small {
  margin-top: 3px;
  color: #adc0b4;
}

nav {
  display: grid;
  gap: 5px;
  margin-top: 22px;
}

.nav-button {
  min-height: 42px;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 4px;
  padding: 9px 12px;
  background: transparent;
  color: #c6d4cc;
  text-align: left;
}

.nav-button:hover,
.nav-button.active {
  border-left-color: #75b893;
  background: rgba(255, 255, 255, 0.09);
  color: #ffffff;
}

.sidebar-status {
  display: grid;
  gap: 5px;
  margin-top: auto;
  padding: 14px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.sidebar-status span,
.sidebar-status small {
  color: #9db0a4;
  font-size: 12px;
  line-height: 1.5;
}

main {
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 90px;
  padding: 18px 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
}

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

.topbar h1 {
  margin: 0;
  font-size: 24px;
}

.secondary-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 13px;
  background: var(--surface);
  color: var(--ink);
}

.view {
  display: none;
  padding: 26px 32px 44px;
}

.view.active {
  display: block;
}

.release-note {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
  padding: 12px 16px;
  border-left: 4px solid var(--green);
  background: var(--green-soft);
  color: #355344;
  font-size: 13px;
  line-height: 1.5;
}

.release-note strong {
  color: var(--green);
  white-space: nowrap;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.7fr);
  gap: 18px;
}

.work-panel,
.record-list-section,
.answer-panel {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.work-panel,
.record-list-section {
  padding: 20px;
}

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

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

.section-heading h2 {
  margin: 0;
  font-size: 18px;
}

.section-index {
  color: var(--green);
  font-weight: 800;
  font-size: 13px;
}

.status-tag {
  border-radius: 999px;
  padding: 5px 9px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
}

.profile-form,
.record-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 10px 11px;
  background: #ffffff;
  color: var(--ink);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(35, 104, 74, 0.12);
}

textarea {
  min-height: 92px;
  resize: vertical;
}

.profile-form button,
.record-form button,
.consult-form button {
  min-height: 42px;
  border: 0;
  border-radius: 5px;
  padding: 10px 14px;
  background: var(--green);
  color: #ffffff;
  font-weight: 700;
}

.profile-form button {
  align-self: end;
}

.field-figure {
  position: relative;
  min-height: 360px;
  margin: 0;
  overflow: hidden;
  border-radius: 6px;
  background: #dce5df;
}

.field-figure img {
  width: 100%;
  height: 100%;
  min-height: 360px;
  object-fit: cover;
}

.field-figure figcaption {
  position: absolute;
  right: 12px;
  bottom: 12px;
  left: 12px;
  padding: 10px 12px;
  border-radius: 4px;
  background: rgba(23, 37, 30, 0.85);
  color: #ffffff;
  font-size: 13px;
}

.task-band {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr 1fr;
  gap: 0;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  overflow: hidden;
}

.task-column {
  min-width: 0;
  padding: 18px;
  border-right: 1px solid var(--line);
}

.task-column:last-child {
  border-right: 0;
}

.task-column span {
  display: block;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.task-column h3,
.task-column p {
  margin: 0;
}

.task-column h3 {
  font-size: 18px;
  line-height: 1.45;
}

.task-column p,
.task-column li {
  color: #465149;
  font-size: 14px;
  line-height: 1.65;
}

.task-column ul {
  margin: 0;
  padding-left: 19px;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 18px;
}

.metric-row > div {
  min-width: 0;
  padding: 16px 18px;
  border-left: 3px solid var(--blue);
  background: var(--blue-soft);
}

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

.metric-row span {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.metric-row strong {
  line-height: 1.45;
}

.page-heading {
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.notice-text {
  color: var(--muted);
  font-size: 13px;
}

.timeline {
  border-top: 1px solid var(--line);
}

.timeline-row {
  display: grid;
  grid-template-columns: 150px 190px minmax(0, 1fr) minmax(220px, 0.65fr);
  gap: 18px;
  align-items: start;
  padding: 18px 4px;
  border-bottom: 1px solid var(--line);
}

.timeline-row.current {
  border-left: 4px solid var(--green);
  padding-left: 16px;
  background: #edf4ef;
}

.timeline-month {
  color: var(--green);
  font-weight: 800;
}

.timeline-stage {
  font-weight: 700;
}

.timeline-row p {
  margin: 0;
  color: #4f5a52;
  line-height: 1.65;
}

.timeline-check {
  color: var(--blue);
  font-size: 13px;
}

.guide-intro {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 18px;
  margin-bottom: 18px;
  padding: 18px 20px;
  border-left: 4px solid var(--red);
  background: var(--red-soft);
}

.guide-intro strong {
  color: var(--red);
}

.guide-intro p {
  margin: 0;
  color: #594b47;
  line-height: 1.7;
}

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

.guide-card {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--green);
  border-radius: 6px;
  background: var(--surface);
}

.guide-card > span {
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.guide-card h3 {
  margin: 8px 0 11px;
  font-size: 18px;
}

.guide-card p,
.guide-card li {
  color: #475149;
  font-size: 14px;
  line-height: 1.65;
}

.guide-card p {
  margin: 0;
}

.guide-card ul {
  margin: 10px 0 12px;
  padding-left: 20px;
}

.guide-card small {
  display: block;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--blue);
  line-height: 1.55;
}

.guide-detail {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 18px;
  border: 1px solid var(--line);
  background: var(--line);
}

.guide-detail > div {
  padding: 18px;
  background: var(--surface);
}

.guide-detail h3 {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 15px;
}

.guide-detail p {
  margin: 0;
  color: #4c574f;
  font-size: 13px;
  line-height: 1.7;
}

.consult-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 18px;
}

.consult-main {
  min-width: 0;
}

.quick-questions,
.product-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.quick-question,
.filter-button {
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 8px 11px;
  background: var(--surface);
  color: var(--ink);
}

.filter-button.active,
.quick-question:hover {
  border-color: var(--green);
  color: var(--green);
}

.consult-form {
  display: grid;
  gap: 12px;
}

.answer-panel {
  min-height: 420px;
  padding: 24px;
  border-top: 4px solid var(--red);
  box-shadow: var(--shadow);
}

.answer-label {
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
}

.answer-panel h3 {
  margin: 10px 0 14px;
  font-size: 21px;
}

.answer-panel p,
.answer-panel li {
  color: #48534b;
  line-height: 1.72;
}

.answer-panel ul {
  padding-left: 20px;
}

.answer-block {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.answer-block strong {
  display: block;
  margin-bottom: 5px;
}

.product-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

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

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  line-height: 1.55;
}

th {
  background: #eef2ef;
  color: #566159;
  font-size: 12px;
}

td {
  font-size: 14px;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.product-status {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-region {
  background: var(--blue-soft);
  color: var(--blue);
}

.status-candidate {
  background: var(--red-soft);
  color: var(--red);
}

.status-check {
  background: var(--green-soft);
  color: var(--green);
}

.compliance-band {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 18px;
  margin-top: 18px;
  padding: 18px;
  border-left: 4px solid var(--red);
  background: var(--red-soft);
}

.compliance-band p {
  margin: 0;
  color: #5d4a46;
  line-height: 1.65;
}

.record-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
  gap: 18px;
}

.record-form .wide {
  grid-column: 1 / -1;
}

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

.record-item {
  display: grid;
  grid-template-columns: 95px 1fr auto;
  gap: 14px;
  align-items: start;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.record-item:last-child {
  border-bottom: 0;
}

.record-item time {
  color: var(--green);
  font-weight: 800;
}

.record-item strong,
.record-item small {
  display: block;
}

.record-item small {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.55;
}

.record-cost {
  color: var(--red);
  font-weight: 700;
  white-space: nowrap;
}

.empty-state {
  padding: 26px 0;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1080px) {
  .workspace-grid,
  .consult-layout,
  .record-layout,
  .guide-detail {
    grid-template-columns: 1fr;
  }

  .field-figure,
  .field-figure img {
    min-height: 300px;
    max-height: 420px;
  }

  .task-band {
    grid-template-columns: 1fr;
  }

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

  .task-column:last-child {
    border-bottom: 0;
  }

  .timeline-row {
    grid-template-columns: 120px 150px minmax(0, 1fr);
  }

  .timeline-check {
    grid-column: 3;
  }
}

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

  .sidebar {
    position: static;
    height: auto;
    padding: 14px;
  }

  .brand-block {
    padding-bottom: 12px;
  }

  nav {
    grid-template-columns: repeat(6, minmax(88px, 1fr));
    overflow-x: auto;
    margin-top: 12px;
  }

  .nav-button {
    border-left: 0;
    border-bottom: 3px solid transparent;
    text-align: center;
    white-space: nowrap;
  }

  .nav-button:hover,
  .nav-button.active {
    border-left-color: transparent;
    border-bottom-color: #75b893;
  }

  .sidebar-status {
    display: none;
  }

  .topbar,
  .view {
    padding-left: 16px;
    padding-right: 16px;
  }

  .topbar h1 {
    font-size: 20px;
  }

  .profile-form,
  .record-form,
  .metric-row {
    grid-template-columns: 1fr;
  }

  .record-form .wide {
    grid-column: auto;
  }

  .timeline-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .timeline-check {
    grid-column: auto;
  }

  .compliance-band {
    grid-template-columns: 1fr;
  }

  .guide-grid,
  .guide-intro {
    grid-template-columns: 1fr;
  }

  .record-item {
    grid-template-columns: 85px 1fr;
  }

  .record-cost {
    grid-column: 2;
  }
}

@media print {
  .sidebar,
  .topbar,
  .release-note,
  #printGuideButton {
    display: none !important;
  }

  body[data-print-view="manual"] .view {
    display: none !important;
  }

  body[data-print-view="manual"] #manualView {
    display: block !important;
    padding: 0;
  }

  .app-shell {
    display: block;
  }

  .guide-card,
  .guide-detail > div {
    break-inside: avoid;
  }
}
