/* ============================================================
   Kory AI · 极速版 / 专业版 视觉（v8）
   相比 v7 的修正：
     模式类 proto-fast / proto-pro 从 <body> 改挂在 .form-page-grid 上。
     <body> 在站内切换页面时不会重建，旧类会残留到下一个页面，
     导致再进入时直接显示专业版布局、且没有返回按钮。
     挂在栅格上则随表单节点一起销毁，天然不会泄漏到其它页面。
   ============================================================ */

/* ---------- 升级入口 ---------- */
.proto-promo {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 18px;
}

.proto-promo__tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: filter .15s, box-shadow .15s;
}

.proto-promo__tag:hover { filter: brightness(.97); box-shadow: 0 3px 10px #0f172a14; }

.proto-promo__tag--outline {
  background: #fdeceb;
  border-color: #f8c9c5;
  color: #d92d20;
}

.proto-promo__tag--upgrade {
  position: relative;
  background: #fff4e5;
  border-color: #ffd39e;
  color: #c2410c;
}

.proto-promo__hot {
  position: absolute;
  top: -9px;
  right: -6px;
  padding: 1px 5px;
  border-radius: 4px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.5;
}

.proto-promo__back {
  display: none;
  align-items: center;
  gap: 4px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid #bfd6f5;
  border-radius: 999px;
  background: linear-gradient(180deg, #f7fbff, #eaf3ff);
  color: #2563eb;
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 2px 8px #2563eb14;
  transition: background .16s, border-color .16s, box-shadow .16s, transform .16s;
}

.proto-promo__back:hover {
  border-color: var(--primary, #2563eb);
  background: #fff;
  box-shadow: 0 4px 14px #2563eb2e;
  transform: translateY(-1px);
}

.proto-promo__back:focus-visible {
  outline: 2px solid var(--primary, #2563eb);
  outline-offset: 2px;
}

/* 专业版下只显示返回入口 */
.proto-pro .proto-promo__tag { display: none; }
.proto-pro .proto-promo__back { display: inline-flex; align-items: center; }

/* ---------- 模式小标签 ---------- */
.proto-mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 10px;
  padding: 3px 10px 3px 8px;
  border-radius: 999px;
  background: linear-gradient(120deg, #6366f1 0%, #3b82f6 50%, #06b6d4 100%);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .05em;
  vertical-align: 4px;
  box-shadow: 0 3px 10px #4f46e54d;
  transform: rotate(-2deg);
  transition: transform .2s, box-shadow .2s;
  cursor: default;
  user-select: none;
}

.proto-mode-badge::before {
  content: "✦";
  font-size: 10px;
  opacity: .9;
  animation: proto-sparkle 2.4s ease-in-out infinite;
}

.proto-mode-badge:hover {
  transform: rotate(0deg) translateY(-1px);
  box-shadow: 0 5px 16px #4f46e566;
}

@keyframes proto-sparkle {
  0%, 100% { opacity: .9; transform: scale(1); }
  50% { opacity: .45; transform: scale(.82); }
}

/* 专业版：深藏青底 + 金色描边与字色 */
.proto-pro .proto-mode-badge {
  background: linear-gradient(135deg, #16213e 0%, #1e3a8a 60%, #1e40af 100%);
  color: #f0d9a8;
  box-shadow:
    inset 0 0 0 1px #c9a22766,
    0 4px 14px #1e3a8a4d;
  text-shadow: 0 1px 2px #0b1220;
}

.proto-pro .proto-mode-badge::before {
  content: "◆";
  color: #e8c87a;
  font-size: 8px;
  animation: none;
}

@media (prefers-reduced-motion: reduce) {
  .proto-mode-badge::before { animation: none; }
}

/* ---------- 布局：两种模式统一为三列 ---------- */

/* 右侧「数据图表选项说明」面板：两种模式都去掉 */
.proto-fast .form-page-grid__guide,
.proto-pro .form-page-grid__guide { display: none !important; }

:root { --proto-showcase-w: 268px; }

.form-page-grid.proto-fast,
.form-page-grid.proto-pro {
  grid-template-columns: auto var(--proto-showcase-w) minmax(0, 1fr) !important;
  gap: 24px;
}

.form-page-grid.proto-fast .form-page-grid__form,
.form-page-grid.proto-pro .form-page-grid__form {
  grid-column: 3 !important;
}

/* ---------- 左侧引导展示区 ---------- */
.proto-showcase {
  grid-column: 2;
  position: sticky;
  top: calc(var(--nav-height) + 16px);
  width: var(--proto-showcase-w);
  padding: 0;
  text-align: left;
  align-self: start;
}

.proto-showcase__panel {
  position: relative;
  border-radius: 20px;
  background:
    radial-gradient(120% 60% at 100% 0%, #e0efff 0%, transparent 60%),
    radial-gradient(120% 55% at 0% 100%, #e8f1ff 0%, transparent 62%),
    linear-gradient(180deg, #fbfdff 0%, #f2f8ff 100%);
  padding: 14px 12px 12px;
  box-shadow: 0 10px 30px #2563eb14, 0 2px 6px #2563eb0a;
  overflow: hidden;
}

.proto-showcase__panel::before,
.proto-showcase__panel::after {
  content: "✦";
  position: absolute;
  color: #bfd8f7;
  font-size: 13px;
  opacity: .8;
}

.proto-showcase__panel::before { top: 12px; left: 14px; }
.proto-showcase__panel::after { top: 26px; right: 16px; font-size: 9px; opacity: .6; }

.proto-showcase__head {
  text-align: center;
  padding-bottom: 10px;
  margin-bottom: 2px;
}

.proto-showcase__badge {
  display: inline-block;
  margin-bottom: 6px;
  padding: 2px 11px;
  border-radius: 999px;
  background: linear-gradient(120deg, #60a5fa, #3b82f6);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .06em;
  box-shadow: 0 3px 10px #3b82f64d;
}

.proto-pro .proto-showcase__badge {
  background: linear-gradient(135deg, #16213e 0%, #1e3a8a 60%, #1e40af 100%);
  color: #f0d9a8;
  box-shadow:
    inset 0 0 0 1px #c9a22766,
    0 4px 14px #1e3a8a40;
}

.proto-showcase__title {
  margin: 0;
  font-size: 21px;
  font-weight: 800;
  color: #1e3a8a;
  letter-spacing: .04em;
  line-height: 1.25;
}

.proto-showcase__sub {
  margin: -5px 0 0;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .02em;
  color: #d6e6fa;
  text-transform: uppercase;
  line-height: 1.1;
  user-select: none;
  position: relative;
  z-index: 0;
}

/* ---------- 步骤 ---------- */
.proto-sc-step { position: relative; margin-bottom: 0; }

.proto-sc-step__head {
  position: relative;
  z-index: 2;
  width: calc(100% - 18px);
  margin: 0 auto -10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 9px;
  background: linear-gradient(120deg, #93c5fd 0%, #60a5fa 55%, #3b82f6 100%);
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .01em;
  box-shadow: 0 4px 12px #60a5fa3d;
  text-shadow: 0 1px 2px #1d4ed833;
}

.proto-sc-step__no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffffd9;
  color: #2563eb;
  font-size: 10px;
  font-weight: 800;
  flex-shrink: 0;
}

.proto-sc-step__body {
  position: relative;
  z-index: 1;
  padding: 16px 11px 9px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 3px 12px #2563eb12;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--text-secondary, #334155);
}

.proto-sc-step__body--center {
  text-align: center;
  color: #1e40af;
  font-weight: 600;
  letter-spacing: .02em;
}

.proto-sc-step__body--list { color: #475569; }

.proto-sc-step__arrow {
  display: flex;
  justify-content: center;
  margin: 5px 0;
  color: #93b8e6;
  font-size: 13px;
  font-weight: 700;
}

/* ---------- 样例卡片 ---------- */
.proto-sc-sample__title {
  margin: 0 0 7px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.65;
  color: #1e3a8a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.proto-sc-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
}

.proto-sc-tag {
  padding: 2px 7px;
  border-radius: 5px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 10.5px;
  font-weight: 700;
}

.proto-sc-tag--orange { background: #ffedd5; color: #c2410c; }
.proto-sc-tag--green  { background: #dcfce7; color: #15803d; }

.proto-sc-excerpt {
  margin: 0 0 7px;
  font-size: 10.5px;
  line-height: 1.7;
  color: #7b8aa3;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.proto-sc-report {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 8px;
  background: linear-gradient(120deg, #eff6ff, #e6f1ff);
  font-size: 11.5px;
  color: #1d4ed8;
  font-weight: 700;
}

.proto-sc-report b {
  color: #16a34a;
  position: relative;
  padding: 0 2px;
  z-index: 0;
}

.proto-sc-report b::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 42%;
  background: #bbf7d0;
  border-radius: 2px;
  z-index: -1;
}

/* ---------- 底部能力条 ---------- */
.proto-showcase__foot-bar {
  position: relative;
  z-index: 2;
  width: calc(100% - 14px);
  margin: 0 auto -10px;
  padding: 8px 6px;
  border-radius: 9px;
  background: linear-gradient(120deg, #93c5fd 0%, #60a5fa 55%, #3b82f6 100%);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  line-height: 1.55;
  letter-spacing: .01em;
  box-shadow: 0 4px 12px #60a5fa3d;
  text-shadow: 0 1px 2px #1d4ed833;
  text-wrap: balance;
}

.proto-showcase__foot-card {
  position: relative;
  z-index: 1;
  padding: 20px 12px 11px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 3px 12px #2563eb12;
}

.proto-showcase__foot-list {
  margin: 0 0 7px;
  padding: 0;
  list-style: none;
  font-size: 11px;
  line-height: 1.9;
  color: #64748b;
}

.proto-showcase__foot-list li {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.proto-showcase__foot-list li::before {
  content: "≡";
  color: #cbd5e1;
  font-size: 10px;
  flex-shrink: 0;
}

/* 三个标签等分宽度；允许收缩，保证整体不超出白卡边界 */
.proto-showcase__chips {
  display: flex;
  gap: 6px;
}

.proto-showcase__chip {
  flex: 1 1 0;
  min-width: 0;
  padding: 6px 2px;
  border-radius: 8px;
  background: linear-gradient(180deg, #eff6ff, #e4efff);
  color: #1d4ed8;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: inset 0 0 0 1px #ffffffb3;
}

/* ---------- 极速版表单 ---------- */

/* 去掉表单卡片的外框、底色与投影，消除割裂感 */
.proto-fast .form-wrap {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* 步骤条：两种模式都去掉 */
.form-page-grid.proto-fast .autopaper-stepper,
.form-page-grid.proto-pro .autopaper-stepper { display: none !important; }

.proto-fast .form-header {
  margin-bottom: 24px;
  padding-bottom: 0;
  border-bottom: 0;
}

.proto-fast .form-title { font-size: 24px; letter-spacing: .01em; }
.proto-fast .form-subtitle { margin-top: 6px; font-size: 13px; }

.proto-fast .form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary, #334155);
}

.proto-fast .form-input,
.proto-fast .form-select,
.proto-fast .form-textarea {
  min-height: 44px;
  border-radius: 10px;
  border-color: #dbe6f6;
  font-size: 13.5px;
  transition: border-color .15s, box-shadow .15s;
}

.proto-fast .form-input:hover,
.proto-fast .form-select:hover { border-color: #bfd6f5; }

.proto-fast .form-input:focus,
.proto-fast .form-select:focus,
.proto-fast .form-textarea:focus {
  border-color: var(--primary, #2563eb);
  box-shadow: 0 0 0 3px #2563eb1f;
  outline: none;
}

.proto-fast .form-group { margin-bottom: 22px; }

/* ---------- 隐藏高级字段 ---------- */
.proto-fast .proto-hidden { display: none !important; }

/* ---------- 极速版字段排布 ---------- */
.proto-fast .form-row {
  grid-template-columns: 1fr !important;
  gap: 0;
}

.proto-fast .form-row--4 {
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr) !important;
  gap: 18px;
}

.proto-fast .form-group--degree { grid-column: 1; }
.proto-fast .form-group--major  { grid-column: 2; }

/* ---------- 开题报告：普通表单行 ---------- */
.proto-proposal {
  display: none;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 13px;
  line-height: 1.9;
  color: var(--text-secondary, #334155);
}

.proto-fast .proto-proposal { display: flex; }

.proto-proposal__label {
  flex-shrink: 0;
  font-weight: 600;
  color: var(--text-secondary, #334155);
}

.proto-proposal__link {
  padding: 0;
  border: 0;
  background: transparent;
  color: #2563eb;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
}

.proto-proposal__link:hover { text-decoration: underline; }

.proto-proposal__hint {
  font-size: 13px;
  color: var(--text-hint, #94a3b8);
}

.proto-proposal__file {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 4px;
}

.proto-proposal__file[hidden] { display: none; }

.proto-proposal__ok {
  font-size: 12.5px;
  color: #16a34a;
}

.proto-proposal__remove {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-hint, #94a3b8);
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  text-decoration: underline;
}

.proto-proposal__remove:hover { color: #dc2626; }

.proto-proposal__err {
  font-size: 12.5px;
  color: #dc2626;
}

/* ---------- 学历单选：胶囊卡片 ---------- */
.proto-degree-radios {
  display: none;
  align-items: stretch;
  gap: 10px;
  min-height: 44px;
  flex-wrap: wrap;
}

.proto-fast .proto-degree-radios { display: flex; }
.proto-fast .form-group--degree .form-select { display: none; }

.proto-degree-radios label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 16px;
  border: 1px solid #dbe6f6;
  border-radius: 10px;
  background: #fff;
  font-size: 13.5px;
  color: var(--text-secondary, #334155);
  cursor: pointer;
  user-select: none;
  transition: border-color .15s, background .15s, color .15s, box-shadow .15s;
}

.proto-degree-radios label:hover { border-color: #bfd6f5; }

.proto-degree-radios input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.proto-radio {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1.5px solid #cbd5e1;
  background: #fff;
  position: relative;
  flex-shrink: 0;
  transition: border-color .15s;
}

.proto-degree-radios input:checked + .proto-radio {
  border-color: var(--primary, #2563eb);
}

.proto-degree-radios input:checked + .proto-radio::after {
  content: "";
  position: absolute;
  inset: 2.5px;
  border-radius: 50%;
  background: var(--primary, #2563eb);
}

.proto-degree-radios label:has(input:checked) {
  border-color: var(--primary, #2563eb);
  background: #eff6ff;
  color: var(--primary-dark, #1d4ed8);
  font-weight: 600;
  box-shadow: 0 0 0 3px #2563eb14;
}

/* ---------- 生成文件勾选区 ---------- */
.proto-fast .checkbox-group {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.proto-fast .checkbox-item {
  justify-content: center;
  min-height: 46px;
  border-radius: 10px;
  border-color: #dbe6f6;
  background: #fff;
  font-size: 13px;
  transition: border-color .15s, background .15s, box-shadow .15s;
}

.proto-fast .checkbox-item:hover { border-color: #bfd6f5; }

.proto-fast .checkbox-item.checked {
  border-color: var(--primary, #2563eb);
  background: #eff6ff;
  box-shadow: 0 0 0 3px #2563eb14;
}

/* ---------- 提交区 ---------- */
.proto-fast .form-footer {
  margin-top: 8px;
  padding-top: 22px;
  border-top: 1px solid #eef4fd;
}

.proto-fast .btn-submit {
  min-width: 220px;
  height: 48px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .02em;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  box-shadow: 0 8px 22px #2563eb3d;
  transition: transform .18s, box-shadow .18s, filter .18s;
}

.proto-fast .btn-submit:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px #2563eb4d;
  filter: brightness(1.03);
}

/* ---------- 流程演示浮层（仅 #demo- 地址使用） ---------- */
.proto-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: #0f172a73;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.proto-overlay.is-open { display: flex; }

.proto-overlay__card {
  width: min(440px, 100%);
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 24px 64px #0f172a3d;
  padding: 26px 24px;
  text-align: left;
  font-family: inherit;
}

.proto-overlay__icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  margin-bottom: 14px;
  background: var(--primary-muted, #2563eb1f);
  position: relative;
}

.proto-overlay__icon::after {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  background: var(--primary, #2563eb);
}

.proto-overlay__title {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
}

.proto-overlay__desc {
  margin: 0 0 14px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text-muted, #64748b);
}

.proto-overlay__steps {
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid var(--border, #dbeafe);
  border-radius: 12px;
  background: var(--bg-subtle, #f8fbff);
  list-style: none;
  font-size: 13px;
  line-height: 2;
  color: var(--text-secondary, #334155);
}

.proto-overlay__close {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--primary, #2563eb);
  border-radius: 10px;
  background: var(--primary, #2563eb);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

/* ---------- 窄屏 ---------- */
@media (max-width: 1360px) {
  .proto-showcase { display: none !important; }

  .form-page-grid.proto-fast,
  .form-page-grid.proto-pro {
    grid-template-columns: auto minmax(0, 1fr) !important;
  }

  .form-page-grid.proto-fast .form-page-grid__form,
  .form-page-grid.proto-pro .form-page-grid__form { grid-column: 2 !important; }
}

@media (max-width: 900px) {
  .proto-fast .form-row--4 { grid-template-columns: 1fr !important; }
  .proto-fast .checkbox-group { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .proto-fast .btn-submit { width: 100%; min-width: 0; }
  .proto-promo { position: static; margin-bottom: 14px; justify-content: flex-end; }
}

@media (max-width: 640px) {
  .proto-degree-radios { gap: 8px; }
  .proto-degree-radios label { padding: 0 11px; }
  .proto-promo__tag { height: 30px; font-size: 12px; padding: 0 9px; }
}
