:root {
  --bg: #f5f8fc;
  --surface: rgba(255, 255, 255, .9);
  --surface-strong: #ffffff;
  --surface-tint: #f7fbff;
  --line: #dce6f2;
  --line-strong: #c7d6e8;
  --ink: #162033;
  --muted: #66758a;
  --dim: #95a3b8;
  --blue: #3370ff;
  --blue-soft: #e8f0ff;
  --mint: #12c2a3;
  --mint-soft: #e7f8f4;
  --amber: #f5a623;
  --amber-soft: #fff4df;
  --rose: #f05f7a;
  --violet: #7b61ff;
  --panel-radius: 8px;
  --shadow: 0 14px 38px rgba(37, 58, 92, .11);
  --shadow-soft: 0 8px 24px rgba(37, 58, 92, .08);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Aptos", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    linear-gradient(180deg, rgba(255,255,255,.72), rgba(245,248,252,.96) 36%, #eef4fb),
    var(--bg);
  overflow-x: hidden;
}

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

button {
  border: 0;
}

button,
select {
  cursor: pointer;
}

#mesh {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: .68;
}

.scanline {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(51,112,255,.045) 1px, transparent 1px),
    linear-gradient(rgba(18,194,163,.035) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, #000, #000 62%, transparent);
}

.app-shell {
  position: relative;
  z-index: 2;
  width: min(1540px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 18px 0 26px;
}

.topbar,
.metric-rail,
.mission-panel,
.submit-panel,
.stats-panel {
  border: 1px solid rgba(210, 222, 238, .9);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.topbar {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border-radius: var(--panel-radius);
}

.identity-block {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.signal-mark {
  position: relative;
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  border: 1px solid #c7dcff;
  background: linear-gradient(145deg, #f9fcff, #edf5ff);
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.9), 0 10px 24px rgba(51,112,255,.13);
}

.signal-mark::before,
.signal-mark::after {
  content: "";
  position: absolute;
  border-radius: 10px;
}

.signal-mark::before {
  inset: 11px;
  border: 1px solid rgba(51,112,255,.2);
  background: linear-gradient(135deg, rgba(51,112,255,.14), rgba(18,194,163,.12));
}

.signal-mark::after {
  inset: 22px;
  background: var(--blue);
  box-shadow: 0 0 0 5px rgba(51,112,255,.1);
}

.signal-mark span {
  position: absolute;
  z-index: 1;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 4px rgba(18,194,163,.12);
}

.signal-mark span:nth-child(1) { left: 14px; top: 14px; }
.signal-mark span:nth-child(2) { right: 13px; top: 19px; background: var(--amber); box-shadow: 0 0 0 4px rgba(245,166,35,.14); }
.signal-mark span:nth-child(3) { left: 18px; bottom: 13px; background: var(--violet); box-shadow: 0 0 0 4px rgba(123,97,255,.12); }

.eyebrow {
  margin: 0 0 5px;
  color: var(--blue);
  font-size: 11px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  font-size: clamp(24px, 2.15vw, 38px);
  line-height: 1.12;
  letter-spacing: 0;
}

h2 {
  font-size: clamp(18px, 1.24vw, 22px);
  line-height: 1.18;
  letter-spacing: 0;
}

h3 {
  font-size: 18px;
  line-height: 1.3;
  letter-spacing: 0;
}

.deadline-panel {
  display: grid;
  grid-template-columns: repeat(2, max-content);
  gap: 10px;
  align-items: stretch;
}

.deadline-panel > div,
.metric-tile,
.target-control {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, #f8fbff);
  border-radius: var(--panel-radius);
}

.deadline-panel > div {
  min-width: 158px;
  padding: 11px 13px;
}

.deadline-panel span,
.metric-tile span,
.target-control span,
label > span,
.mission-meta span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.deadline-panel strong {
  display: block;
  margin-top: 6px;
  font-size: 15px;
  line-height: 1.2;
}

.analysis-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(92px, .8fr);
  gap: 8px;
  margin-bottom: 14px;
}

.analysis-strip article,
.analysis-strip label {
  min-height: 64px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--panel-radius);
  background: #fff;
}

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

.analysis-strip strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.analysis-strip input {
  height: 28px;
  margin-top: 7px;
  padding: 0 8px;
}

.metric-rail {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(128px, .55fr);
  gap: 10px;
  margin-top: 10px;
  padding: 10px;
  border-radius: var(--panel-radius);
}

.metric-tile,
.target-control {
  min-height: 78px;
  padding: 12px 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.95);
}

.metric-tile strong {
  display: block;
  margin-top: 7px;
  color: var(--ink);
  font-size: 29px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.metric-tile small {
  display: block;
  margin-top: 7px;
  color: var(--dim);
  font-size: 12px;
}

.target-control {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

.target-control input {
  width: 100%;
  height: 34px;
  color: var(--ink);
  border: 1px solid #cbd8ea;
  border-radius: 6px;
  background: #fff;
  padding: 0 10px;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(320px, .9fr) minmax(390px, 1.08fr) minmax(330px, .92fr);
  gap: 12px;
  margin-top: 12px;
  align-items: stretch;
}

.mission-panel,
.submit-panel,
.stats-panel {
  min-height: 626px;
  border-radius: var(--panel-radius);
  padding: 16px;
  overflow: hidden;
}

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

.compact-heading {
  align-items: center;
}

.orbit {
  position: relative;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border: 1px solid #cfe1f6;
  border-radius: 12px;
  background: #f8fbff;
}

.orbit::before,
.orbit::after {
  content: "";
  position: absolute;
  border-radius: 50%;
}

.orbit::before {
  inset: 11px;
  border: 1px dashed rgba(51,112,255,.34);
}

.orbit::after {
  inset: 20px;
  background: var(--mint);
  box-shadow: 0 0 0 5px rgba(18,194,163,.12);
}

.orbit span {
  position: absolute;
  top: 8px;
  left: 30px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(245,166,35,.14);
}

.mission-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 12px;
}

.mission-tab {
  min-height: 52px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  display: grid;
  place-items: center;
  gap: 2px;
  transition: border-color .2s ease, color .2s ease, background .2s ease, box-shadow .2s ease;
}

.mission-tab strong {
  color: #35445b;
  font-size: 18px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.mission-tab span {
  font-size: 11px;
}

.mission-tab.active {
  color: var(--blue);
  border-color: #aac4ff;
  background: linear-gradient(180deg, #f9fbff, var(--blue-soft));
  box-shadow: inset 0 -2px 0 var(--blue), 0 8px 20px rgba(51,112,255,.08);
}

.mission-tab.active strong {
  color: var(--blue);
}

.mission-detail {
  position: relative;
  min-height: 474px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--panel-radius);
  background: linear-gradient(180deg, rgba(247,251,255,.92), rgba(255,255,255,.96)), #fff;
}

.mission-detail::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--blue), var(--mint));
  border-radius: 8px 0 0 8px;
}

.mission-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.mission-meta span,
.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 6px 9px;
  border: 1px solid #bfddf5;
  border-radius: 999px;
  background: #edf8ff;
  color: #1768b5;
  font-size: 12px;
  white-space: nowrap;
}

#missionIntro {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.58;
  font-size: 14px;
}

.requirement-list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.requirement-list li {
  position: relative;
  padding: 10px 12px 10px 32px;
  color: #334155;
  font-size: 13px;
  line-height: 1.42;
  border: 1px solid #e1e9f3;
  border-radius: 7px;
  background: #fff;
}

.requirement-list li::before {
  content: "";
  position: absolute;
  top: 14px;
  left: 13px;
  width: 8px;
  height: 8px;
  background: var(--mint);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(18,194,163,.12);
}

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

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

.identity-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--panel-radius);
  background: linear-gradient(180deg, #fff, #f7fbff);
}

.avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--mint));
  background-size: cover;
  background-position: center;
  box-shadow: 0 8px 18px rgba(51,112,255,.18);
}

.identity-card span,
.task-choice > span,
.upload-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.identity-card small {
  display: block;
  margin-top: 6px;
  color: var(--dim);
  font-size: 12px;
}

.name-field {
  min-width: 0;
}

.name-field input {
  width: 100%;
  height: 34px;
  margin-top: 6px;
  padding: 0 10px;
  color: var(--ink);
  border: 1px solid #cbd8ea;
  border-radius: 7px;
  background: #fff;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.name-field input:focus {
  border-color: #8fb0ff;
  box-shadow: 0 0 0 3px rgba(51,112,255,.12);
}

.task-choice {
  display: grid;
  gap: 8px;
}

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

.task-option {
  min-height: 74px;
  padding: 11px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.task-option span {
  display: block;
  color: var(--dim);
  font-size: 11px;
  line-height: 1.2;
}

.task-option strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.2;
}

.task-option small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.task-option.active {
  border-color: #9db9ff;
  background: linear-gradient(180deg, #fff, var(--blue-soft));
  box-shadow: inset 3px 0 0 var(--blue), 0 8px 20px rgba(51,112,255,.09);
}

.task-option.active strong {
  color: var(--blue);
}

label {
  display: grid;
  gap: 7px;
}

input,
select,
textarea {
  width: 100%;
  color: var(--ink);
  border: 1px solid #ccd8e8;
  border-radius: 7px;
  background: #fff;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

input::placeholder,
textarea::placeholder {
  color: #9aa8ba;
}

input,
select {
  height: 40px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  min-height: 80px;
  padding: 10px 12px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #87aaff;
  box-shadow: 0 0 0 3px rgba(51,112,255,.12);
  background: #fff;
}

.image-trigger {
  display: flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  color: #334155;
  font-size: 13px;
}

.image-trigger input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--blue);
}

.upload-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid #bfe6dd;
  border-radius: var(--panel-radius);
  background: var(--mint-soft);
}

.upload-summary[hidden] {
  display: none;
}

.upload-summary strong {
  display: block;
  margin-top: 4px;
  color: #087965;
  font-size: 14px;
}

.form-actions,
.showcase-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.primary-action,
.secondary-action,
.ghost-action,
.icon-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  border-radius: 7px;
  color: var(--ink);
  transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
  will-change: transform;
}

.primary-action {
  padding: 0 16px;
  background: var(--blue);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(51,112,255,.22);
}

.secondary-action,
.ghost-action {
  padding: 0 13px;
  border: 1px solid #cbd8ea;
  background: #fff;
}

.ghost-action.danger {
  color: #b42343;
  border-color: #ffd1db;
  background: #fff7f9;
}

.icon-action {
  width: 38px;
  border: 1px solid #cbd8ea;
  background: #fff;
}

.primary-action:hover,
.secondary-action:hover,
.ghost-action:hover,
.icon-action:hover {
  border-color: #9db9f8;
  box-shadow: 0 8px 18px rgba(51,112,255,.12);
}

.mission-tab,
.task-option,
.identity-card,
.analysis-strip article,
.analysis-strip label,
.progress-core,
.submission-card,
.mission-detail {
  will-change: transform;
}

button svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.2;
}

.progress-core {
  display: grid;
  grid-template-columns: 134px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-bottom: 15px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--panel-radius);
  background: linear-gradient(180deg, #fff, #f7fbff);
}

.progress-ring {
  position: relative;
  width: 124px;
  height: 124px;
  display: grid;
  place-items: center;
}

.progress-ring svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-track,
.ring-value {
  fill: none;
  stroke-width: 10;
}

.ring-track {
  stroke: #e5edf7;
}

.ring-value {
  stroke: var(--blue);
  stroke-linecap: round;
  stroke-dasharray: 301.59;
  stroke-dashoffset: 301.59;
  filter: drop-shadow(0 4px 6px rgba(51,112,255,.2));
}

.progress-ring div {
  position: relative;
  text-align: center;
}

.progress-ring strong {
  display: block;
  font-size: 27px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.progress-ring span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.risk-copy span {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 10px;
  color: #8a5600;
  font-size: 12px;
  font-weight: 800;
  border-radius: 999px;
  background: var(--amber-soft);
  border: 1px solid #ffe0a6;
}

.risk-copy p {
  margin-top: 11px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.task-bars {
  display: grid;
  gap: 10px;
  margin-bottom: 15px;
}

.task-bar {
  display: grid;
  gap: 7px;
}

.task-bar header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.task-bar strong {
  color: #39475c;
  font-variant-numeric: tabular-nums;
}

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

.bar-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--mint));
}

.showcase {
  min-height: 250px;
  border: 1px solid var(--line);
  border-radius: var(--panel-radius);
  background: var(--surface-tint);
  padding: 13px;
}

.showcase-head {
  justify-content: space-between;
  margin-bottom: 11px;
}

.submission-list {
  display: grid;
  gap: 9px;
  max-height: 332px;
  overflow: auto;
  padding-right: 4px;
}

.submission-card {
  position: relative;
  padding: 11px 12px;
  border: 1px solid #e0e8f3;
  border-radius: 7px;
  background: #fff;
}

.submission-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 11px;
  bottom: 11px;
  width: 3px;
  border-radius: 0 999px 999px 0;
  background: var(--blue);
}

.submission-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.submission-card strong {
  display: block;
  font-size: 14px;
  line-height: 1.3;
}

.submission-card span {
  color: var(--dim);
  font-size: 12px;
}

.submission-card p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  word-break: break-word;
}

.submission-card a {
  color: var(--blue);
  text-decoration: none;
}

.toast {
  position: fixed;
  z-index: 10;
  right: 24px;
  bottom: 24px;
  max-width: min(360px, calc(100vw - 48px));
  padding: 12px 14px;
  color: #fff;
  font-weight: 800;
  border-radius: 7px;
  background: var(--blue);
  box-shadow: 0 18px 46px rgba(51,112,255,.26);
  transform: translateY(24px);
  opacity: 0;
  pointer-events: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(22, 32, 51, .28);
  backdrop-filter: blur(8px);
}

.modal-backdrop[hidden] {
  display: none;
}

.image-modal {
  width: min(640px, 100%);
  max-height: min(720px, calc(100vh - 48px));
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--panel-radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.image-modal header,
.image-modal footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.image-modal footer {
  margin-top: 14px;
  justify-content: flex-end;
}

.dropzone {
  display: grid;
  place-items: center;
  gap: 8px;
  margin-top: 16px;
  min-height: 168px;
  padding: 18px;
  text-align: center;
  border: 1px dashed #9db9ff;
  border-radius: var(--panel-radius);
  background: #f7fbff;
}

.dropzone svg {
  width: 30px;
  height: 30px;
  color: var(--blue);
}

.dropzone strong {
  font-size: 16px;
}

.dropzone span {
  max-width: 420px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.image-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.image-preview {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.image-preview img {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: block;
  object-fit: cover;
  background: var(--surface-tint);
}

.image-preview figcaption {
  padding: 7px 8px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

  .stats-panel {
    grid-column: 1 / -1;
    min-height: auto;
  }
}

@media (max-width: 860px) {
  .app-shell {
    width: min(100% - 22px, 760px);
    padding-top: 12px;
  }

  .topbar,
  .identity-block,
  .deadline-panel {
    align-items: stretch;
  }

  .topbar,
  .deadline-panel,
  .metric-rail,
  .analysis-strip,
  .workspace-grid,
  .field-grid,
  .progress-core {
    grid-template-columns: 1fr;
  }

  .topbar,
  .metric-rail,
  .workspace-grid {
    display: grid;
  }

  .signal-mark {
    width: 52px;
    height: 52px;
  }

  .mission-panel,
  .submit-panel,
  .stats-panel {
    min-height: auto;
  }

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

  .task-picker,
  .image-preview-grid {
    grid-template-columns: 1fr;
  }

  .progress-core {
    justify-items: center;
    text-align: center;
  }

  .form-actions {
    justify-content: stretch;
  }

  .primary-action,
  .secondary-action {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
