:root {
  --ink: #1d2323;
  --muted: #64706d;
  --line: #dce2df;
  --paper: #fbfbf8;
  --surface: #ffffff;
  --soft: #eef5f1;
  --teal: #0f766e;
  --teal-strong: #0b5f58;
  --red: #bb3b3b;
  --amber: #b7791f;
  --green: #287a48;
  --shadow: 0 18px 45px rgba(24, 36, 32, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px;
  background: #ffffff;
  border-right: 1px solid var(--line);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 2px solid var(--ink);
  background: var(--teal);
  color: #fff;
  font-weight: 800;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--teal-strong);
  font-size: 12px;
  font-weight: 700;
}

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

h1 {
  margin-bottom: 0;
  font-size: 17px;
  line-height: 1.35;
}

h2 {
  margin-bottom: 0;
  font-size: 28px;
  line-height: 1.2;
}

h3 {
  margin-bottom: 10px;
  font-size: 20px;
  line-height: 1.3;
}

.side-nav {
  display: grid;
  gap: 8px;
}

.nav-item,
.primary-button,
.ghost-button,
.icon-button,
.seg-button,
.small-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
}

.nav-item {
  justify-content: flex-start;
  width: 100%;
  padding: 10px 12px;
}

.nav-item.active {
  border-color: rgba(15, 118, 110, 0.28);
  background: var(--soft);
  color: var(--teal-strong);
}

.icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 21px;
  height: 21px;
}

.icon.sm {
  width: 17px;
  height: 17px;
}

.icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.compliance-box {
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(187, 59, 59, 0.2);
  border-radius: 8px;
  background: #fff7f4;
}

.compliance-box strong {
  display: block;
  margin-bottom: 8px;
  color: var(--red);
}

.compliance-box p {
  margin: 0;
  color: #70403b;
  font-size: 13px;
  line-height: 1.6;
}

.main-stage {
  min-width: 0;
  padding: 24px 32px 40px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.topbar-actions,
.modal-actions,
.button-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.primary-button {
  padding: 0 16px;
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

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

.ghost-button,
.small-action {
  padding: 0 14px;
}

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

.notice-band {
  display: grid;
  grid-template-columns: 212px minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  margin-bottom: 24px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.notice-media {
  position: relative;
  height: 130px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  overflow: hidden;
  background: #d8efe9;
}

.film-strip {
  position: absolute;
  inset: 0 auto 0 0;
  display: grid;
  align-content: center;
  gap: 8px;
  width: 34px;
  padding: 10px 7px;
  background: #262d2c;
}

.film-strip span {
  height: 12px;
  border-radius: 3px;
  background: #fff;
}

.scene-frame {
  position: absolute;
  inset: 0 0 0 34px;
  background:
    linear-gradient(#bce5df 0 52%, #83c9aa 52% 100%);
}

.scene-sun {
  position: absolute;
  top: 18px;
  right: 28px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #f2b84b;
}

.scene-person {
  position: absolute;
  left: 54px;
  bottom: 22px;
  width: 34px;
  height: 54px;
  border-radius: 18px 18px 6px 6px;
  background: #294947;
}

.scene-person::before {
  content: "";
  position: absolute;
  top: -20px;
  left: 7px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #f0c6a7;
}

.scene-board {
  position: absolute;
  right: 26px;
  bottom: 26px;
  width: 66px;
  height: 42px;
  border: 3px solid #2d3937;
  background: #ffffff;
}

.scene-board::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 12px;
  width: 44px;
  height: 3px;
  background: var(--red);
  box-shadow: 0 10px 0 var(--teal);
}

.notice-copy p {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.7;
}

.notice-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(92px, 1fr));
  gap: 10px;
}

.notice-metrics div,
.stat-card,
.path-card,
.panel,
.task-card,
.job-card,
.day-card,
.admin-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.notice-metrics div {
  padding: 12px;
  text-align: center;
}

.notice-metrics strong {
  display: block;
  font-size: 24px;
  line-height: 1.1;
}

.notice-metrics span {
  color: var(--muted);
  font-size: 12px;
}

.view-root {
  display: grid;
  gap: 20px;
}

.portal-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
  align-items: stretch;
  gap: 20px;
  min-height: 390px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.portal-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
}

.portal-copy h3 {
  max-width: 720px;
  margin-bottom: 0;
  font-size: 42px;
  line-height: 1.12;
}

.portal-copy p {
  max-width: 700px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
}

.company-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.company-strip span {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid rgba(15, 118, 110, 0.24);
  border-radius: 8px;
  background: var(--soft);
  color: var(--teal-strong);
  font-weight: 800;
}

.portal-visual {
  position: relative;
  min-height: 330px;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.16), rgba(242, 184, 75, 0.16)),
    #e7f3ef;
}

.shooting-frame {
  position: absolute;
  inset: 34px;
  border: 2px solid #1f2928;
  border-radius: 8px;
  background:
    linear-gradient(#bfe5df 0 48%, #7fc1a4 48% 100%);
}

.camera-body {
  position: absolute;
  left: 34px;
  top: 72px;
  width: 120px;
  height: 78px;
  border-radius: 8px;
  background: #253332;
}

.camera-body::before {
  content: "";
  position: absolute;
  right: -36px;
  top: 18px;
  width: 0;
  height: 0;
  border-top: 21px solid transparent;
  border-bottom: 21px solid transparent;
  border-left: 42px solid #253332;
}

.camera-lens {
  position: absolute;
  left: 70px;
  top: 94px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 5px solid #8ed2c6;
  background: #111817;
}

.prompt-card {
  position: absolute;
  right: 32px;
  top: 48px;
  width: 170px;
  height: 120px;
  border: 2px solid #1f2928;
  border-radius: 8px;
  background: #fff;
}

.prompt-card::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 24px;
  width: 120px;
  height: 5px;
  background: var(--red);
  box-shadow: 0 24px 0 var(--teal), 0 48px 0 #f2b84b;
}

.timeline-bars {
  position: absolute;
  left: 34px;
  right: 34px;
  bottom: 30px;
  display: grid;
  grid-template-columns: 1fr 0.7fr 1.2fr;
  gap: 10px;
}

.timeline-bars span {
  height: 16px;
  border-radius: 999px;
  background: #fff;
  border: 2px solid #1f2928;
}

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

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

.panel {
  padding: 20px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.panel-head p,
.muted {
  color: var(--muted);
}

.path-card,
.task-card,
.job-card,
.day-card,
.admin-card,
.stat-card {
  padding: 16px;
}

.path-card {
  display: grid;
  gap: 12px;
  min-height: 256px;
}

.path-card.active {
  border-color: rgba(15, 118, 110, 0.5);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.11);
}

.path-price {
  font-size: 30px;
  font-weight: 850;
}

.tag-row,
.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.status-pill.good {
  border-color: rgba(40, 122, 72, 0.25);
  background: #ecf8ef;
  color: var(--green);
}

.status-pill.warn {
  border-color: rgba(183, 121, 31, 0.25);
  background: #fff7e6;
  color: var(--amber);
}

.status-pill.danger {
  border-color: rgba(187, 59, 59, 0.22);
  background: #fff0ee;
  color: var(--red);
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edea;
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
  transition: width 220ms ease;
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

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

.step-dot {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e8edea;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.timeline-item.done .step-dot {
  background: var(--teal);
  color: #fff;
}

.timeline-item.current .step-dot {
  background: var(--amber);
  color: #fff;
}

.segmented {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.seg-button {
  min-height: 38px;
  padding: 0 12px;
}

.seg-button.active {
  border-color: var(--teal);
  background: var(--soft);
  color: var(--teal-strong);
}

.job-content {
  display: grid;
  gap: 14px;
}

.deliverables {
  display: grid;
  gap: 8px;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.7;
}

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

.day-card {
  min-height: 164px;
}

.day-card strong {
  display: block;
  margin-bottom: 8px;
}

.day-card p {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

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

label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

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

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

textarea {
  min-height: 118px;
  resize: vertical;
  line-height: 1.6;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.18);
  outline-offset: 2px;
}

.check-line {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 16px 0;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.5;
}

.check-line input {
  width: 18px;
  min-height: 18px;
  margin-top: 2px;
}

.modal {
  width: min(820px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.modal::backdrop {
  background: rgba(20, 28, 27, 0.48);
}

.modal-card {
  padding: 22px;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.modal-actions {
  justify-content: flex-end;
}

.account-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
}

.token-meter {
  display: grid;
  gap: 10px;
}

.token-row,
.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.token-row:last-child,
.summary-row:last-child {
  border-bottom: 0;
}

.admin-table {
  min-width: 860px;
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.admin-table th,
.admin-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 13px;
}

.admin-table th {
  background: var(--soft);
  color: var(--teal-strong);
}

.admin-table tr:last-child td {
  border-bottom: 0;
}

.table-scroll {
  overflow-x: auto;
  border-radius: 8px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 32px));
  padding: 14px 16px;
  border: 1px solid rgba(15, 118, 110, 0.24);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  color: var(--teal-strong);
  font-weight: 700;
}

.hidden {
  display: none !important;
}

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

  .sidebar {
    position: static;
    height: auto;
  }

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

  .notice-band,
  .portal-hero,
  .account-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 760px) {
  html,
  body,
  .app-shell {
    max-width: 100%;
    overflow-x: hidden;
  }

  .app-shell {
    display: block;
  }

  body {
    background: #fffdfa;
  }

  .main-stage,
  .sidebar {
    padding: 14px;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
    gap: 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 10px 28px rgba(24, 36, 32, 0.08);
  }

  .brand-block {
    gap: 10px;
    min-width: 0;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
  }

  .brand-block .eyebrow {
    margin-bottom: 3px;
    font-size: 11px;
  }

  h1 {
    font-size: 16px;
  }

  h2 {
    font-size: 28px;
  }

  .side-nav {
    display: flex;
    gap: 8px;
    width: 100vw;
    max-width: 100vw;
    margin: 0 -14px;
    padding: 2px 14px 6px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  .side-nav::-webkit-scrollbar {
    display: none;
  }

  .nav-item {
    flex: 0 0 auto;
    width: auto;
    min-height: 38px;
    padding: 8px 11px;
    white-space: nowrap;
  }

  .nav-item .icon {
    width: 18px;
    height: 18px;
  }

  .compliance-box {
    margin-top: 0;
    padding: 10px 11px;
  }

  .compliance-box strong {
    margin-bottom: 4px;
    font-size: 13px;
  }

  .compliance-box p {
    font-size: 12px;
    line-height: 1.45;
    overflow-wrap: anywhere;
  }

  .main-stage {
    padding-top: 16px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: row;
    margin-bottom: 14px;
  }

  .topbar .eyebrow {
    margin-bottom: 2px;
    font-size: 11px;
  }

  .topbar-actions {
    justify-content: flex-end;
    gap: 8px;
  }

  .topbar-actions .ghost-button,
  .topbar-actions .primary-button {
    min-height: 38px;
    padding: 0 11px;
  }

  .notice-band {
    display: none;
  }

  .grid-3,
  .grid-2,
  .form-grid,
  .day-list,
  .notice-metrics {
    grid-template-columns: 1fr;
  }

  .notice-media {
    height: 120px;
  }

  .portal-hero {
    gap: 16px;
    min-height: auto;
    padding: 18px;
  }

  .portal-copy,
  .portal-visual,
  .path-card,
  .panel {
    min-width: 0;
  }

  .portal-copy h3 {
    font-size: 28px;
    line-height: 1.16;
    overflow-wrap: anywhere;
  }

  .portal-copy p {
    font-size: 14px;
    line-height: 1.65;
    overflow-wrap: anywhere;
  }

  .company-strip {
    gap: 8px;
  }

  .company-strip span {
    flex: 1 1 calc(50% - 8px);
    justify-content: center;
    min-height: 34px;
    padding: 0 8px;
    font-size: 13px;
  }

  .portal-copy .button-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .portal-copy .primary-button,
  .portal-copy .ghost-button {
    width: 100%;
    min-height: 46px;
  }

  .portal-visual {
    min-height: 176px;
  }

  .shooting-frame {
    inset: 14px;
  }

  .camera-body {
    left: 18px;
    top: 54px;
    width: 72px;
    height: 50px;
  }

  .camera-body::before {
    right: -24px;
    top: 12px;
    border-top-width: 13px;
    border-bottom-width: 13px;
    border-left-width: 26px;
  }

  .camera-lens {
    left: 41px;
    top: 67px;
    width: 23px;
    height: 23px;
  }

  .prompt-card {
    right: 14px;
    top: 32px;
    width: 118px;
    height: 86px;
  }

  .timeline-bars {
    left: 18px;
    right: 18px;
    bottom: 18px;
    gap: 7px;
  }

  .path-card {
    min-height: auto;
    padding: 14px;
  }

  .path-price {
    font-size: 27px;
  }

  .path-card .ghost-button,
  .path-card .primary-button {
    width: 100%;
  }

  .panel,
  .task-card,
  .job-card,
  .day-card,
  .admin-card,
  .stat-card {
    padding: 16px;
  }

  .panel-head {
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
  }

  .button-row {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .button-row .primary-button,
  .button-row .ghost-button {
    width: 100%;
  }

  .modal {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
    overflow: auto;
  }

  .modal-card {
    padding: 16px;
  }

  .modal-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .modal-actions .primary-button,
  .modal-actions .ghost-button {
    width: 100%;
  }

  .timeline-item {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .timeline-item .status-pill {
    grid-column: 2;
    justify-self: start;
  }
}
