:root {
  color-scheme: light;
  --bg: #f5f7f3;
  --panel: #ffffff;
  --ink: #17211b;
  --muted: #637066;
  --line: #d9e0da;
  --accent: #176b5b;
  --accent-strong: #0d4f43;
  --soft: #e8f2ee;
  --warn: #a85f00;
  --warn-bg: #fff5df;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

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

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  gap: 18px;
}

.admin-shell {
  grid-template-columns: minmax(0, 1.3fr) 360px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  box-shadow: 0 12px 34px rgba(23, 33, 27, 0.07);
}

.topbar,
.result-head,
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-hint {
  margin-top: 12px;
}

.sound-btn {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.sound-btn.enabled {
  background: #dcfce7;
  color: #166534;
  border-color: #86efac;
}

.new-task-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  border: 2px solid #ef4444;
  border-radius: 8px;
  padding: 12px;
  background: #fef2f2;
  color: #b91c1c;
  font-weight: 700;
}

.new-task-notice strong {
  color: #dc2626;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 22px;
}

.admin-link,
button {
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  min-height: 42px;
  padding: 0 16px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

button:hover,
.admin-link:hover {
  background: var(--accent-strong);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

form {
  display: grid;
  gap: 18px;
  margin-top: 20px;
}

.field {
  display: grid;
  gap: 8px;
  border: 0;
  padding: 0;
  margin: 0;
}

legend,
label,
.settings span,
.option-row span,
.contact-grid span {
  font-size: 14px;
  font-weight: 700;
}

.type-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}

.type-grid label {
  min-height: 50px;
}

.type-grid input {
  position: absolute;
  opacity: 0;
}

.type-grid span {
  height: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fbfcfb;
  cursor: pointer;
}

.type-grid input:checked + span {
  border-color: var(--accent);
  background: var(--soft);
  color: var(--accent-strong);
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfb;
  color: var(--ink);
  font: inherit;
  padding: 11px 12px;
}

textarea {
  resize: vertical;
  line-height: 1.65;
}

.hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.file-list {
  display: grid;
  gap: 8px;
}

.file-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.file-tools button,
.file-item button {
  min-height: 30px;
  padding: 0 10px;
  background: #eef3ef;
  color: var(--accent-strong);
  font-size: 13px;
}

.file-tools button:hover,
.file-item button:hover {
  background: #dce8e1;
}

.file-item,
.task-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfb;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.file-item span {
  min-width: 0;
  flex: 1;
  overflow-wrap: anywhere;
}

.option-row,
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  align-items: end;
  gap: 12px;
}

.contact-grid {
  grid-template-columns: 1fr 1fr;
  margin-top: 16px;
}

.check {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.check input {
  width: auto;
}

.actions {
  display: flex;
  gap: 10px;
}

.actions button {
  flex: 1;
}

.supplement-public {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.supplement-public summary {
  cursor: pointer;
  color: var(--accent-strong);
  font-weight: 700;
}

.supplement-form {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.supplement-form label {
  display: grid;
  gap: 6px;
}

.badge {
  border-radius: 999px;
  background: var(--soft);
  color: var(--accent-strong);
  padding: 7px 11px;
  font-size: 13px;
  font-weight: 700;
}

.warning {
  margin-top: 14px;
  padding: 12px;
  border-radius: 6px;
  background: var(--warn-bg);
  color: var(--warn);
  font-size: 14px;
}

.hidden {
  display: none;
}

.empty,
.intent-grid {
  margin-top: 16px;
  color: var(--muted);
  line-height: 1.7;
}

.intent-grid {
  display: grid;
  gap: 12px;
}

.intent-section {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.intent-section strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
}

.intent-section ul {
  margin: 0;
  padding-left: 18px;
}

.intent-danger {
  border-top-color: #fecaca;
  background: #fff1f2;
  border-radius: 8px;
  padding: 12px;
}

.intent-danger strong,
.intent-danger li,
.intent-danger span {
  color: #b91c1c;
}

.project-evaluation {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfb;
}

.eval-title {
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
}

.eval-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}

.eval-row strong {
  color: var(--ink);
  white-space: nowrap;
}

.eval-meter {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8f2ee;
}

.eval-meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f59e0b, #22c55e);
}

.stars {
  color: #f59e0b !important;
  letter-spacing: 1px;
}

.project-evaluation p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  max-width: min(560px, calc(100vw - 32px));
  border-radius: 8px;
  background: #17211b;
  color: white;
  padding: 12px 16px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
}

.task-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

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

.new-task-card {
  border-color: #ef4444;
  box-shadow: 0 10px 28px rgba(239, 68, 68, 0.16);
}

.new-task-card h3,
.new-task-card pre {
  color: #b91c1c;
}

.new-task-mark {
  display: inline-flex;
  align-items: center;
  margin-right: 8px;
  border-radius: 999px;
  padding: 3px 8px;
  background: #dc2626;
  color: #ffffff;
  font-size: 12px;
  vertical-align: middle;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.quote-eval {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
  padding: 12px;
  border-radius: 8px;
  background: linear-gradient(135deg, #fff7ed, #eefcf5);
  border: 1px solid #fde3b1;
}

.quote-eval div {
  display: grid;
  gap: 4px;
}

.quote-eval span,
.quote-eval small {
  color: var(--muted);
  font-size: 12px;
}

.quote-eval strong {
  color: var(--ink);
  font-size: 17px;
}

.quote-eval small {
  grid-column: 1 / -1;
  line-height: 1.5;
}

.task-card pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: #f1f5f2;
  padding: 12px;
  border-radius: 6px;
  line-height: 1.6;
}

.task-files {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.task-files a {
  color: var(--accent-strong);
  font-weight: 700;
}

.file-chip {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 9px 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  max-width: 100%;
}

.file-chip span {
  overflow-wrap: anywhere;
}

.file-chip small {
  color: var(--muted);
  font-weight: 400;
  white-space: nowrap;
}

.file-chip.deleted {
  color: var(--muted);
  background: #f1f3f1;
}

.task-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 12px;
}

.supplement-box {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  margin-top: 12px;
  padding: 12px;
}

.supplement-box p {
  margin: 8px 0;
  color: var(--muted);
  line-height: 1.6;
}

.supplement-item + .supplement-item {
  border-top: 1px solid var(--line);
  margin-top: 10px;
  padding-top: 10px;
}

.refresh-status {
  color: var(--muted);
  font-size: 13px;
}

.settings form {
  gap: 14px;
}

.settings label {
  display: grid;
  gap: 6px;
}

.settings-fold {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  background: #fbfcfb;
  overflow: hidden;
}

.settings-fold + .settings-fold {
  margin-top: 10px;
}

.settings-fold > summary {
  min-height: 48px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  cursor: pointer;
  color: var(--accent-strong);
  background: #eef7f3;
  font-weight: 800;
  list-style: none;
}

.settings-fold > summary::-webkit-details-marker {
  display: none;
}

.settings-fold > summary::after {
  content: "展开";
  margin-left: auto;
  border-radius: 999px;
  padding: 4px 8px;
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
}

.settings-fold[open] > summary::after {
  content: "收起";
}

.settings-fold > :not(summary) {
  margin: 12px;
}

.settings-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.settings-actions.single-action {
  grid-template-columns: 1fr;
}

.settings-divider {
  border-top: 1px solid var(--line);
  margin-top: 6px;
  padding-top: 8px;
}

.auto-push-switch {
  border: 1px solid #bdebd8;
  border-radius: 8px;
  padding: 12px;
  background: #f0fdf4;
}

.switch-note {
  border-radius: 6px;
  padding: 10px 12px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.switch-note.good {
  background: #dcfce7;
  color: #166534;
  font-weight: 700;
}

.settings-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: end;
}

.setting-check {
  min-height: 44px;
}

.advanced-mail {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  background: #fbfcfb;
}

.advanced-mail summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.advanced-mail label {
  margin-top: 12px;
}

.ai-test-result {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  background: #fbfcfb;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.ai-test-result.good {
  border-color: #91c8a8;
  background: #eef8f1;
  color: #17613a;
}

.ai-test-result.bad {
  border-color: #f0b5aa;
  background: #fff1ef;
  color: var(--danger);
}

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

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

  .option-row,
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

body.front-page {
  background:
    radial-gradient(circle at 8% 10%, rgba(255, 199, 44, 0.38), transparent 26%),
    radial-gradient(circle at 88% 8%, rgba(56, 189, 248, 0.32), transparent 30%),
    linear-gradient(135deg, #fff7d6 0%, #e8fbff 48%, #fff0f6 100%);
}

.front-page .shell {
  width: min(1220px, calc(100vw - 28px));
  gap: 22px;
}

.front-page .panel {
  border: 0;
  border-radius: 18px;
  box-shadow: 0 22px 50px rgba(49, 75, 93, 0.14);
}

.front-page .intake {
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    linear-gradient(135deg, #ffb703, #fb7185, #22c55e, #38bdf8) border-box;
  border: 3px solid transparent;
}

.front-page .result {
  background: linear-gradient(180deg, rgba(240, 249, 255, 0.95), rgba(255, 255, 255, 0.99));
  border: 2px solid rgba(56, 189, 248, 0.32);
}

.front-page .topbar {
  position: relative;
  margin: -22px -22px 20px;
  padding: 26px 28px;
  min-height: 132px;
  align-items: flex-end;
  border-radius: 16px 16px 24px 24px;
  overflow: hidden;
  background: linear-gradient(135deg, #ffb703, #fb7185 52%, #0ea5e9);
  color: #ffffff;
}

.front-page .topbar::after {
  content: "";
  position: absolute;
  right: -42px;
  top: -54px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.24);
}

.front-page .topbar::before {
  content: "1 选类型  2 传资料  3 识别确认";
  position: absolute;
  right: 24px;
  bottom: 24px;
  z-index: 1;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.23);
  padding: 9px 13px;
  font-size: 13px;
  font-weight: 800;
}

.front-page .eyebrow {
  color: inherit;
  font-size: 16px;
}

.front-page h1 {
  position: relative;
  z-index: 2;
  font-size: 34px;
}

.front-page form > .field,
.front-page .option-row,
.front-page .supplement-public {
  border-radius: 16px;
  padding: 16px;
  background: #f8fbff;
}

.front-page form > .field:nth-child(1) {
  background: #fff8db;
}

.front-page form > .field:nth-child(2) {
  background: #e8f7ff;
}

.front-page form > .field:nth-child(3) {
  background: #fff1f2;
}

.front-page fieldset.field legend,
.front-page #orderForm > .field > label,
.front-page .option-row > label > span,
.front-page .result .field > label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  border-radius: 999px;
  padding: 7px 12px;
  background: #ffffff;
  color: #0f172a;
  font-size: 21px;
  font-weight: 950;
  box-shadow: 0 8px 18px rgba(15, 76, 117, 0.08);
}

.front-page fieldset.field legend::before,
.front-page #orderForm > .field > label::before,
.front-page .option-row > label > span::before,
.front-page .result .field > label::before {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #ef4444;
  color: #ffffff;
  font-size: 15px;
  font-weight: 950;
}

.front-page fieldset.field legend::before { content: "1"; }
.front-page label[for="files"]::before { content: "2"; }
.front-page label[for="demand"]::before { content: "3"; }
.front-page .option-row > label:nth-child(1) > span::before { content: "4"; }
.front-page .option-row > label:nth-child(2) > span::before { content: "5"; }
.front-page .option-row > label:nth-child(3) > span::before { content: "6"; }
.front-page label[for="finalRequirement"]::before { content: "7"; }

.front-page .type-grid {
  grid-template-columns: repeat(3, 1fr);
}

.front-page .type-grid span {
  min-height: 72px;
  border: 0;
  border-radius: 14px;
  color: #17324d;
  font-size: 18px;
  font-weight: 900;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.55), 0 12px 22px rgba(35, 55, 75, 0.08);
}

.front-page .type-grid label:nth-child(1) span { background: #fff0b3; }
.front-page .type-grid label:nth-child(2) span { background: #ffd6e7; }
.front-page .type-grid label:nth-child(3) span { background: #dbeafe; }
.front-page .type-grid label:nth-child(4) span { background: #ccfbf1; }
.front-page .type-grid label:nth-child(5) span { background: #fde68a; }
.front-page .type-grid label:nth-child(6) span { background: #ddd6fe; }

.front-page .type-grid input:checked + span {
  background: #102a43;
  color: #ffffff;
  box-shadow: 0 0 0 4px rgba(255, 183, 3, 0.38), 0 16px 30px rgba(16, 42, 67, 0.2);
  transform: translateY(-2px);
}

.front-page input,
.front-page textarea,
.front-page select {
  border: 2px solid #d7ecf7;
  border-radius: 12px;
  background: #ffffff;
}

.front-page input:focus,
.front-page textarea:focus,
.front-page select:focus {
  outline: 3px solid rgba(56, 189, 248, 0.26);
  border-color: #38bdf8;
}

.front-page .file-item {
  border: 0;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(15, 76, 117, 0.08);
}

.front-page .file-tools button,
.front-page .file-item button {
  border-radius: 10px;
  background: #fff1f2;
  color: #be123c;
}

.front-page .actions button {
  min-height: 58px;
  border-radius: 14px;
  font-size: 19px;
}

.front-page #analyzeBtn {
  background: linear-gradient(135deg, #f97316, #fb7185);
}

.front-page #submitBtn {
  background: linear-gradient(135deg, #0891b2, #16a34a);
}

.front-page button:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.front-page .badge {
  background: #ffedd5;
  color: #c2410c;
}

.front-page .empty,
.front-page .intent-grid {
  border-radius: 14px;
  padding: 14px;
  background: #ffffff;
}

.front-page .intent-section {
  border-top: 2px dashed #c7e7f5;
}

.front-page .project-evaluation {
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, #fff7ed, #ecfeff);
  box-shadow: 0 10px 24px rgba(15, 76, 117, 0.08);
}

.front-page .eval-title {
  color: #c2410c;
}

.front-page .supplement-public {
  background: #f0fdf4;
}

.front-page .supplement-public summary {
  color: #15803d;
}

@media (max-width: 900px) {
  .front-page .type-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .front-page .topbar::before {
    position: relative;
    right: auto;
    bottom: auto;
    display: inline-flex;
    margin-top: 12px;
  }

  .quote-eval {
    grid-template-columns: 1fr;
  }
}
