/* ═══════════════════════════════════════════════
   永恒陪伴 · 组件库 (components.css)
   ═══════════════════════════════════════════════ */

/* ── 移动端导航 ── */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: var(--radius-xs);
  transition: background var(--transition);
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}
.nav-toggle.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-active span:nth-child(2) { opacity: 0; }
.nav-toggle.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.nav-toggle:hover { background: rgba(0,0,0,.04); }

.nav-back {
  color: var(--text-secondary) !important;
  font-weight: 550 !important;
}

.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  top: 60px;
  background: rgba(45,36,32,.35);
  z-index: 99;
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
}
.nav-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

body.nav-menu-open { overflow: hidden; }

/* ── Toast 容器 ── */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast-container .toast {
  position: static;
  animation: none;
  opacity: 0;
  transform: translateX(24px);
  transition: opacity .3s, transform .3s;
  pointer-events: auto;
}
.toast-container .toast.toast-visible {
  opacity: 1;
  transform: translateX(0);
}
.toast-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  font-weight: 700;
}
.toast-success .toast-icon { background: var(--success-bg); color: var(--success); }
.toast-error .toast-icon { background: var(--danger-bg); color: var(--danger); }
.toast-warning .toast-icon { background: var(--warning-bg); color: var(--warning); }
.toast-info .toast-icon { background: var(--info-bg); color: var(--info); }
.toast-msg { flex: 1; line-height: 1.5; }

/* ── 模态框 ── */
.modal-root[hidden] { display: none !important; }
.modal-overlay[hidden] { display: none !important; }
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(45,36,32,.45);
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn .2s ease;
}
.modal {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  animation: slideUp .25s cubic-bezier(.16,1,.3,1);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
}
.modal-header h3 { font-size: 1.05rem; margin: 0; }
.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg-warm);
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}
.modal-close:hover { background: var(--border); color: var(--text); }
.modal-body { padding: 24px; }
.modal-body p { color: var(--text-secondary); line-height: 1.65; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

/* ── 页面头部 ── */
.page-header {
  margin-bottom: 28px;
}
.page-header h1 {
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}
.page-header .page-desc {
  color: var(--text-secondary);
  font-size: .92rem;
  margin-top: 8px;
}
.page-breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: .85rem;
  margin-bottom: 10px;
  text-decoration: none;
  transition: color var(--transition);
}
.page-breadcrumb:hover { color: var(--primary); }

.page-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 28px;
}
.page-header-row h1 { margin: 0; font-size: 1.6rem; }

/* ── 信息列表 ── */
.info-list .info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: .9rem;
  gap: 16px;
}
.info-list .info-row:last-child { border-bottom: none; }
.info-label { color: var(--text-secondary); font-weight: 500; flex-shrink: 0; }

.card-title {
  font-size: 1rem;
  font-weight: 650;
  margin-bottom: 16px;
}

/* ── 指标卡片 ── */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.metric-card {
  text-align: center;
  padding: 24px 16px !important;
}
.metric-value {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -.02em;
}
.metric-label {
  color: var(--text-muted);
  font-size: .85rem;
  margin-top: 4px;
}
.metric-value.primary { color: var(--primary); }
.metric-value.secondary { color: var(--secondary-dark); }
.metric-value.accent { color: var(--accent-dark); }

/* ── 图表 ── */
.chart-container {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  height: 220px;
  justify-content: center;
}
.chart-bar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  max-width: 60px;
}
.chart-bar {
  width: 100%;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--primary-light), var(--primary));
  min-height: 10px;
  transition: height .4s ease;
}
.chart-bar.today {
  background: linear-gradient(180deg, var(--accent-light), var(--accent-dark));
}
.chart-val {
  font-size: .78rem;
  font-weight: 700;
  color: var(--text-secondary);
}
.chart-label {
  font-size: .72rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── 列表行 ── */
.list-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-light);
  gap: 12px;
}
.list-row:last-child { border-bottom: none; }
.list-row-title {
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  transition: color var(--transition);
}
.list-row-title:hover { color: var(--primary); }

/* ── FAQ ── */
.faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.faq-card h4 {
  font-size: .95rem;
  margin-bottom: 8px;
  color: var(--primary);
}
.faq-card p {
  font-size: .88rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

.section-title {
  text-align: center;
  margin-bottom: 40px;
  font-size: 1.6rem;
}

.cta-section {
  text-align: center;
  padding: 60px 0;
}
.cta-card {
  max-width: 600px;
  margin: 0 auto;
  padding: 44px !important;
}
.cta-card h2 { margin-bottom: 12px; }
.cta-card p {
  color: var(--text-secondary);
  margin-bottom: 28px;
}

/* ── 记忆时间线 ── */
.memory-timeline {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.memory-entry {
  padding: 14px 0;
  border-bottom: 1px solid var(--border-light);
}
.memory-entry:last-child { border-bottom: none; }
.memory-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.memory-role {
  font-size: .78rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}
.role-user { background: #fef0eb; color: var(--primary); }
.role-ai { background: #ebf5fb; color: var(--info); }
.memory-time {
  font-size: .75rem;
  color: var(--text-muted);
}
.memory-content {
  font-size: .9rem;
  line-height: 1.7;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── 角色详情网格 ── */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.detail-item-label {
  font-size: .78rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.detail-item-value {
  font-size: .9rem;
}

.prompt-details summary {
  cursor: pointer;
  font-size: .85rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-top: 16px;
}
.prompt-pre {
  margin-top: 8px;
  padding: 12px;
  background: var(--bg);
  border-radius: var(--radius-xs);
  font-size: .82rem;
  line-height: 1.7;
  white-space: pre-wrap;
  border: 1px solid var(--border-light);
  font-family: inherit;
}

/* ── 开关控件 ── */
.form-switch {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.form-switch input[type="checkbox"] {
  width: auto;
  cursor: pointer;
  transform: scale(1.3);
  accent-color: var(--primary);
}

/* ── 提示卡片 ── */
.tip-card {
  background: linear-gradient(135deg, #fef9f4, #fff5f0);
}
.tip-list {
  color: var(--text-secondary);
  font-size: .88rem;
  line-height: 1.8;
  padding-left: 20px;
}

.status-banner {
  background: var(--success-bg);
  padding: 12px 16px;
  border-radius: var(--radius-xs);
  margin-bottom: 16px;
  font-size: .88rem;
}

/* ── 预设角色库 ── */
.preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}
.preset-card {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  padding: 22px !important;
}
.preset-card:hover {
  transform: translateY(-4px);
  border-color: #ffe0d5;
}
.preset-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
}
.preset-avatar {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, #fff0ed, #ffe4de);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
  color: var(--primary);
  border: 1px solid #ffe8e0;
}
.preset-info h3 {
  margin: 0 0 3px;
  font-size: 1.1rem;
}
.preset-info .tagline {
  font-size: .82rem;
  color: var(--primary);
  margin: 0;
  opacity: .85;
}
.preset-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.preset-tag {
  padding: 2px 10px;
  border-radius: 12px;
  font-size: .72rem;
  background: var(--bg-warm);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
}
.preset-desc {
  font-size: .82rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  line-height: 1.5;
  flex: 1;
}
.preset-actions {
  display: flex;
  gap: 8px;
}
.preset-actions .btn { flex: 1; justify-content: center; }

.preset-limit {
  margin-top: 8px;
  font-size: .85rem;
  color: var(--text-secondary);
}
.preset-limit.at-limit { color: var(--danger); }

/* ── 添加智能体页 ── */
.page-create .container {
  max-width: none;
  padding: 0;
}

.create-hub {
  min-height: calc(100vh - 60px);
  padding-bottom: 48px;
}

.create-hero {
  background:
    linear-gradient(135deg, rgba(255, 107, 107, .08) 0%, rgba(255, 142, 142, .04) 40%, rgba(78, 205, 196, .06) 100%),
    var(--bg-warm);
  border-bottom: 1px solid var(--border-light);
}

.create-hero-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 36px 28px 32px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
}

.create-hero-eyebrow {
  display: inline-block;
  font-size: .78rem;
  font-weight: 650;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 10px;
}

.create-hero-title {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -.03em;
  margin: 0 0 10px;
  line-height: 1.2;
}

.create-hero-desc {
  margin: 0;
  max-width: 560px;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text-secondary);
}

.create-quota-card {
  min-width: 148px;
  padding: 18px 22px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  text-align: center;
}

.create-quota-card.is-full {
  border-color: #f5c6cb;
  background: var(--danger-bg);
}

.create-quota-label {
  display: block;
  font-size: .78rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.create-quota-value {
  display: block;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--text);
  line-height: 1.2;
}

.create-quota-value span {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
}

.create-quota-hint {
  display: block;
  margin-top: 6px;
  font-size: .78rem;
  color: var(--text-secondary);
}

.create-quota-warn {
  display: block;
  margin-top: 6px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--danger);
}

.create-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 28px 0;
}

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

.create-tab {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 2px solid var(--border);
  background: var(--bg-surface);
  padding: 18px 20px;
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.create-tab:hover {
  border-color: #ffd4cc;
  box-shadow: var(--shadow-sm);
}

.create-tab.active {
  border-color: var(--primary);
  background: linear-gradient(135deg, #fff 0%, #fff8f6 100%);
  box-shadow: 0 4px 20px rgba(255, 107, 107, .12);
}

.create-tab-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--bg-warm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.create-tab.active .create-tab-icon {
  background: linear-gradient(135deg, #ffe8e4, #fff0ed);
}

.create-tab-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.create-tab-text strong {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.create-tab-text small {
  font-size: .82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.create-panel {
  display: none;
  animation: createFadeIn .35s ease;
}

.create-panel.active {
  display: block;
}

.create-cyber-banner {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, .85fr);
  gap: 24px;
  padding: 28px 32px;
  border: 1px solid rgba(236, 120, 186, .18);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 0% 0%, rgba(236, 120, 186, .12), transparent 38%),
    linear-gradient(135deg, rgba(255, 255, 255, .96), rgba(253, 246, 252, .92));
  box-shadow: var(--shadow-card);
}

.create-cyber-eyebrow {
  margin: 0 0 10px;
  font-size: .8125rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--primary-dark);
}

.create-cyber-title {
  margin: 0 0 12px;
  font-size: clamp(1.35rem, 2.8vw, 1.85rem);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -.02em;
  color: var(--text);
}

.create-cyber-desc {
  margin: 0 0 22px;
  max-width: 36em;
  font-size: .95rem;
  line-height: 1.65;
  color: var(--text-secondary);
}

.create-cyber-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.create-cyber-note {
  margin: 0;
  font-size: .82rem;
  line-height: 1.55;
}

.create-cyber-cards {
  display: grid;
  gap: 12px;
  align-content: center;
}

.create-cyber-card {
  padding: 16px 18px;
  border: 1px solid rgba(236, 120, 186, .16);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .88);
  box-shadow: var(--shadow-xs);
}

.create-cyber-card-label {
  display: block;
  margin-bottom: 6px;
  font-size: .88rem;
  font-weight: 800;
  color: var(--primary-dark);
}

.create-cyber-card p {
  margin: 0;
  font-size: .88rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

@keyframes createFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.create-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  align-items: start;
}

.create-form-card {
  padding: 0 !important;
  overflow: hidden;
}

.create-form-head {
  padding: 28px 32px 0;
}

.create-form-head h2 {
  margin: 0 0 6px;
  font-size: 1.25rem;
  font-weight: 750;
}

.create-form-head p {
  margin: 0;
  font-size: .9rem;
  color: var(--text-muted);
}

.create-form {
  padding: 24px 32px 32px;
}

.create-field {
  margin-bottom: 22px;
}

.create-field-name {
  margin-bottom: 24px;
}

.create-field label {
  display: block;
  font-size: .92rem;
  font-weight: 650;
  color: var(--text);
  margin-bottom: 4px;
}

.create-field-hint {
  display: block;
  font-size: .82rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.create-field input,
.create-field textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .95rem;
  font-family: inherit;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg-surface);
  transition: border-color var(--transition), box-shadow var(--transition);
  resize: vertical;
}

.create-field input {
  font-size: 1.05rem;
  font-weight: 500;
  padding: 16px 18px;
}

.create-field input::placeholder,
.create-field textarea::placeholder {
  color: #c9bdb5;
}

.create-field input:focus,
.create-field textarea:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.create-field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.create-option-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  margin-bottom: 28px;
  background: linear-gradient(135deg, var(--bg-warm) 0%, #fff 100%);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
}

.create-option-title {
  display: block;
  font-size: .95rem;
  font-weight: 650;
  color: var(--text);
  margin-bottom: 4px;
}

.create-option-desc {
  display: block;
  font-size: .82rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

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

.create-submit-btn {
  min-width: 180px;
  padding: 14px 28px !important;
  font-size: 1rem !important;
  border-radius: var(--radius-sm) !important;
}

.create-aside {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 84px;
}

.create-aside-card {
  padding: 22px !important;
}

.create-aside-card h3 {
  margin: 0 0 16px;
  font-size: .95rem;
  font-weight: 700;
}

.create-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.create-steps li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.create-step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.create-steps strong {
  display: block;
  font-size: .88rem;
  font-weight: 650;
  margin-bottom: 2px;
}

.create-steps p {
  margin: 0;
  font-size: .8rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.create-tip {
  padding: 18px 20px !important;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--info-bg) !important;
  border-color: #d6eaf8 !important;
}

.create-tip-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  line-height: 1.4;
}

.create-tip p {
  margin: 0;
  font-size: .82rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.create-library-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.create-library-head h2 {
  margin: 0 0 6px;
  font-size: 1.25rem;
  font-weight: 750;
}

.create-library-head p {
  margin: 0;
  font-size: .9rem;
}

.create-library-count {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: var(--bg-warm);
  border: 1px solid var(--border-light);
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.create-preset-grid {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

.create-preset-grid .preset-card {
  min-height: 220px;
}

.create-empty {
  grid-column: 1 / -1;
  padding: 48px 24px !important;
}

@media (max-width: 960px) {
  .create-layout {
    grid-template-columns: 1fr;
  }

  .create-aside {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .create-aside-card,
  .create-tip {
    flex: 1 1 280px;
  }
}

@media (max-width: 720px) {
  .create-hero-inner {
    padding: 28px 18px 24px;
  }

  .create-shell {
    padding: 20px 18px 0;
  }

  .create-tabs {
    grid-template-columns: 1fr;
  }

  .create-cyber-banner {
    grid-template-columns: 1fr;
    padding: 22px 20px;
  }

  .create-cyber-actions {
    flex-direction: column;
  }

  .create-cyber-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .create-tab {
    padding: 14px 16px;
  }

  .create-field-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .create-form-head,
  .create-form {
    padding-left: 20px;
    padding-right: 20px;
  }

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

  .create-submit-btn {
    width: 100%;
  }

  .create-aside {
    flex-direction: column;
  }

  .create-preset-grid {
    grid-template-columns: 1fr;
  }
}


.modal-root:not([hidden]) {
  position: fixed;
  inset: 0;
  z-index: 1400;
  pointer-events: none;
}
.modal-root:not([hidden]) > .modal-overlay {
  pointer-events: auto;
}
body.preset-modal-open {
  overflow: hidden;
}
.preview-modal .modal {
  max-width: 560px;
  max-height: 80vh;
  overflow-y: auto;
}
.preview-body { padding: 28px; }
.preview-body h2 { font-size: 1.3rem; margin-bottom: 4px; }
.preview-body .tagline { color: var(--primary); font-size: .9rem; margin-bottom: 16px; }
.preview-body .preview-pre {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.65;
  color: var(--text-secondary);
  font-size: .88rem;
}
.preview-body .section { margin-bottom: 16px; }
.preview-body .section h4 {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.preview-body .section p {
  font-size: .9rem;
  line-height: 1.7;
  color: var(--text-secondary);
  white-space: pre-wrap;
}
.preview-greeting {
  color: var(--primary);
  font-style: italic;
}

/* ── 主动关心（TheOne 风格开关） ── */
.proactive-care-card { padding: 24px 28px !important; }
.proactive-care-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}
.proactive-care-header .card-title { margin: 0 0 8px; }
.proactive-switch { flex-shrink: 0; margin-top: 4px; }
.proactive-care-rules {
  margin: 0 0 16px;
  padding-left: 18px;
  color: var(--text-secondary);
  font-size: .88rem;
  line-height: 1.8;
}
.proactive-care-actions { margin-top: 12px; }

/* ── 设定页：主动消息（TheOne 风格） ── */
.form-divider {
  height: 1px;
  background: var(--border-light);
  margin: 8px 0 20px;
}
.settings-proactive-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}
.settings-proactive-info { flex: 1; min-width: 0; }
.settings-proactive-label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}
.settings-proactive-bind { color: var(--primary); margin-top: 4px; }
.settings-proactive .proactive-switch { flex-shrink: 0; margin-top: 2px; }

/* ── 角色详情：记忆 Tab ── */
.char-memory-intro { padding: 22px 24px !important; }
.char-memory-metrics { margin-top: 16px; }
.memory-snippet-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.memory-snippet {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-warm);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}
.memory-snippet-text {
  flex: 1;
  font-size: .9rem;
  line-height: 1.6;
  color: var(--text-secondary);
}
.memory-snippet-time {
  font-size: .75rem;
  color: var(--text-muted);
  flex-shrink: 0;
}
.char-data-export .btn-group { flex-wrap: wrap; }
.char-tab-jump { font-size: .82rem; }

/* ── 设定页 TheOne 风格 ── */
.char-settings-panel {
  padding: 0 !important;
  overflow: hidden;
  border: 1px solid var(--border-light);
  box-shadow: 0 2px 16px rgba(45, 36, 32, 0.04);
}

.char-settings-panel:hover {
  border-color: var(--border-light);
  box-shadow: 0 4px 24px rgba(45, 36, 32, 0.06);
}

.char-settings-summary {
  padding: 28px 32px 24px;
  background: #fff;
  border-bottom: 1px solid var(--border-light);
}

.char-settings-summary-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.char-settings-name {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.char-settings-badge {
  flex-shrink: 0;
  padding: 5px 14px;
  font-size: .8rem;
  font-weight: 600;
  color: #5c5c5c;
  background: #f0f0f0;
  border-radius: var(--radius-full);
}

.char-settings-badge.is-complete {
  color: #1f6b42;
  background: #e3f4ea;
}

.char-settings-oneline {
  margin: 0 0 18px;
  font-size: .92rem;
  line-height: 1.75;
  color: #4a4a4a;
}

.char-settings-oneline-item strong {
  font-weight: 600;
  color: var(--text);
  margin-right: 4px;
}

.char-settings-oneline-sep {
  color: #c8c8c8;
  margin: 0 8px;
}

.char-settings-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.char-settings-tile {
  padding: 14px 16px;
  background: #f7f7f7;
  border: 1px solid #e4e4e4;
  border-radius: 14px;
  min-height: 88px;
}

.char-settings-tile-label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: #3d3d3d;
  margin-bottom: 8px;
}

.char-settings-tile-value {
  font-size: .88rem;
  line-height: 1.6;
  color: #2d2d2d;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}

.char-settings-tile-value.is-on {
  color: var(--primary-dark);
  font-weight: 600;
}

.char-settings-form {
  padding: 28px 32px 32px;
  background: #fff;
}

.char-settings-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 32px;
  margin-bottom: 24px;
}

.char-settings-field {
  margin-bottom: 0;
}

.char-settings-grid .char-settings-field {
  margin-bottom: 0;
}

.char-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px 28px;
  margin-bottom: 8px;
}

.char-settings-field label {
  display: block;
  font-size: .9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
}

.char-settings-field input,
.char-settings-field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #ddd;
  border-radius: 12px;
  font-size: .92rem;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  line-height: 1.65;
  transition: border-color var(--transition), box-shadow var(--transition);
  box-sizing: border-box;
}

.char-settings-field-short {
  flex: 0 0 auto;
  width: 220px;
  max-width: 100%;
}

.char-settings-field-short input {
  width: 100%;
}

.char-settings-field textarea {
  min-height: 128px;
  resize: vertical;
}

.char-settings-field-full {
  grid-column: 1 / -1;
  margin-top: 8px;
}

.char-settings-field-hint {
  margin: -4px 0 10px;
  font-size: .78rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.char-settings-field-hint code {
  font-size: .76rem;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--bg-warm);
  color: var(--text-secondary);
}

.char-settings-field input::placeholder,
.char-settings-field textarea::placeholder {
  color: #a8a8a8;
}

.char-settings-field input:focus,
.char-settings-field textarea:focus {
  outline: none;
  border-color: #bbb;
  box-shadow: 0 0 0 3px rgba(45, 36, 32, 0.06);
}

.char-settings-footer {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border-light);
}

.char-settings-proactive {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 0 4px;
}

.char-settings-proactive-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.char-settings-proactive-title {
  font-size: .95rem;
  font-weight: 600;
  color: var(--text);
}

.char-settings-proactive-hint {
  font-size: .82rem;
  color: #666;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
  width: 52px;
  height: 32px;
  cursor: pointer;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-track {
  position: absolute;
  inset: 0;
  background: #e0e0e0;
  border-radius: var(--radius-full);
  transition: background 0.22s ease;
}

.toggle-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
  transition: transform 0.22s ease;
}

.toggle-switch input:checked + .toggle-track {
  background: var(--primary);
}

.toggle-switch input:checked + .toggle-track::after {
  transform: translateX(20px);
}

.toggle-switch input:disabled + .toggle-track {
  opacity: 0.45;
  cursor: not-allowed;
}

.char-settings-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}

.char-settings-save {
  padding: 12px 28px;
  font-size: .9rem;
  font-weight: 600;
  color: #fff;
  background: #2d2420;
  border: none;
  border-radius: var(--radius-full);
  box-shadow: none;
}

.char-settings-save:hover {
  background: #1f1815;
  transform: none;
  box-shadow: 0 4px 14px rgba(45, 36, 32, 0.18);
}

.char-settings-delete {
  padding: 12px 24px;
  font-size: .9rem;
  font-weight: 600;
  color: #c45c5c;
  background: #fceaea;
  border: none;
  border-radius: var(--radius-full);
  box-shadow: none;
}

.char-settings-delete:hover {
  background: #f8d8d8;
  color: #a94442;
  transform: none;
  box-shadow: none;
}

@media (max-width: 900px) {
  .char-settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .char-settings-summary,
  .char-settings-form {
    padding-left: 20px;
    padding-right: 20px;
  }

  .char-settings-oneline-sep {
    display: none;
  }

  .char-settings-oneline-item {
    display: block;
    margin-bottom: 8px;
  }

  .char-settings-tiles {
    grid-template-columns: 1fr;
  }

  .char-settings-field-short {
    width: 100%;
  }

  .char-settings-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .char-settings-save,
  .char-settings-delete {
    width: 100%;
    justify-content: center;
  }
}

/* ── 绑定页 ── */
.bind-warning {
  background: var(--warning-bg);
  border-color: #fdba74;
}

/* ── 微信激活弹窗（TheOne 风格） ── */
body.activation-modal-open {
  overflow: hidden;
}

.activation-modal-overlay {
  z-index: 1400;
  padding: 20px;
}

.activation-modal-card {
  width: 100%;
  max-width: 440px;
  padding: 0;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.activation-modal-card .modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--border-light);
}

.activation-modal-card .modal-head h2 {
  margin: 0 0 6px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}

.activation-modal-card .hint {
  margin: 0;
  color: var(--text-secondary);
  font-size: .88rem;
  line-height: 1.55;
}

.activation-body {
  padding: 20px 24px 24px;
}

.activation-state .status-card {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(99, 102, 241, .08), rgba(168, 85, 247, .06));
  border: 1px solid rgba(99, 102, 241, .12);
  margin-bottom: 18px;
}

.activation-state .status-card strong {
  display: block;
  font-size: .95rem;
  margin-bottom: 4px;
}

.scan-tip {
  text-align: center;
  font-size: .88rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.activation-qr-stage {
  position: relative;
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

.activation-qr-wrap {
  position: relative;
  padding: 14px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 8px 32px rgba(99, 102, 241, .12);
}

.activation-qr-wrap .activation-qr {
  position: relative;
  z-index: 1;
  min-width: 196px;
  min-height: 196px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.activation-qr-wrap .activation-qr img,
.activation-qr-wrap .activation-qr canvas {
  display: block;
  border-radius: 12px;
}

.activation-pending-glow {
  position: absolute;
  inset: -8px;
  border-radius: 24px;
  background: radial-gradient(circle at center, rgba(99, 102, 241, .18), transparent 70%);
  pointer-events: none;
  animation: activationGlow 2.4s ease-in-out infinite;
}

@keyframes activationGlow {
  0%, 100% { opacity: .55; transform: scale(.98); }
  50% { opacity: 1; transform: scale(1); }
}

.activation-status-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.activation-status-row .hint.center,
#activation-status {
  text-align: center;
}

#activation-status.is-pending {
  color: var(--primary);
}

#activation-status.is-error {
  color: var(--danger);
}

.activation-loading,
.activation-error {
  text-align: center;
  padding: 28px 8px;
}

.activation-success {
  text-align: center;
  padding: 8px 4px 4px;
}

.success-badge {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(34, 197, 94, .28);
}

.activation-success h3 {
  margin: 0 0 10px;
  font-size: 1.15rem;
}

.success-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 22px !important;
}

.center-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.activation-error .actions {
  margin-top: 18px;
}

.qr-status {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.qr-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--primary-light);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

/* ── 导出格式 ── */
.export-page { max-width: 560px; margin: 40px auto; }
.export-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 12px;
}
.export-format-card {
  text-align: center;
  padding: 28px !important;
  text-decoration: none;
  color: inherit;
}
.export-format-card .format-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
}
.export-format-card .format-title {
  font-weight: 700;
  color: var(--text);
}
.export-format-card .format-desc {
  font-size: .82rem;
  color: var(--text-muted);
  margin-top: 4px;
}

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

/* ── 智能体详情页 ── */
.char-hub {
  width: 100%;
  max-width: none;
}

.char-hub-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
  padding: 24px 28px !important;
  margin-bottom: 20px;
}

.char-hub-profile {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  flex: 1;
  min-width: 0;
}

.char-hub-avatar {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: linear-gradient(135deg, #fff0ed, #ffe4de);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary);
  border: 1px solid #ffe8e0;
  flex-shrink: 0;
}

.char-hub-info h1 {
  font-size: 1.45rem;
  margin: 0 0 6px;
}

.char-hub-tagline {
  color: var(--text-secondary);
  font-size: .9rem;
  margin: 0 0 10px;
  line-height: 1.5;
}

.char-hub-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.char-hub-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.char-hub-actions .btn.is-disabled {
  opacity: .78;
  cursor: default;
  pointer-events: none;
}

.char-inline-action {
  display: inline;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  color: var(--primary-dark);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

.char-inline-action:hover {
  color: var(--primary);
}

.char-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  padding: 4px;
  background: var(--bg-warm);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}

.char-tab {
  flex: 1;
  padding: 10px 12px;
  border: none;
  background: transparent;
  border-radius: var(--radius-xs);
  font-size: .88rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

.char-tab:hover {
  color: var(--text);
  background: rgba(255,255,255,.6);
}

.char-tab.active {
  background: #fff;
  color: var(--primary);
  box-shadow: var(--shadow-xs);
}

.char-tab-panel {
  display: none;
}

.char-tab-panel.active {
  display: block;
  animation: fadeIn .2s ease;
}

.char-chat-card {
  padding: 0 !important;
  overflow: hidden;
}

.char-chat-empty {
  padding: 48px 24px;
}

.char-chat-timeline {
  padding: 20px 24px;
  max-height: 420px;
  overflow-y: auto;
  border-bottom: 1px solid var(--border-light);
}

.char-bot-send {
  padding: 20px 24px 24px;
  background: linear-gradient(180deg, var(--bg-warm) 0%, #fff 100%);
}

.char-bot-send.is-disabled {
  opacity: .92;
}

.char-bot-send-title {
  display: block;
  font-size: .95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.char-bot-send-desc {
  display: block;
  font-size: .82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.char-bot-send-input {
  width: 100%;
  margin-top: 14px;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .95rem;
  font-family: inherit;
  line-height: 1.6;
  resize: vertical;
  min-height: 88px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.char-bot-send-input:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.char-bot-send-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.char-bot-send-hint {
  font-size: .78rem;
}

.char-bot-send-locked {
  margin: 14px 0 0;
  font-size: .88rem;
  line-height: 1.5;
}

.char-bot-send-locked a {
  color: var(--primary);
  font-weight: 600;
  margin-left: 4px;
}

.char-danger-zone {
  border-color: #fde8e8 !important;
  background: #fffafa;
}

@media (max-width: 600px) {
  .char-hub-header {
    flex-direction: column;
  }
  .char-hub-actions {
    width: 100%;
  }
  .char-hub-actions .btn {
    flex: 1;
    justify-content: center;
  }
  .char-tab {
    font-size: .78rem;
    padding: 8px 6px;
  }
  .char-chat-timeline {
    max-height: 320px;
    padding: 16px 18px;
  }
  .char-bot-send {
    padding: 16px 18px 20px;
  }
  .char-bot-send-foot {
    flex-direction: column;
    align-items: stretch;
  }
  .char-bot-send-foot .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ── 响应式 ── */
@media (max-width: 768px) {
  .nav-toggle { display: flex; }

  .nav-links {
    position: fixed;
    top: 60px;
    right: 0;
    width: min(280px, 85vw);
    height: calc(100vh - 60px);
    background: var(--bg-surface);
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    gap: 4px;
    box-shadow: var(--shadow-lg);
    transform: translateX(100%);
    transition: transform var(--transition-smooth);
    z-index: 100;
    overflow-y: auto;
  }
  .nav-links.nav-open { transform: translateX(0); }
  .nav-links a {
    padding: 12px 16px !important;
    border-radius: var(--radius-xs);
  }
  .nav-links .nav-user {
    margin-top: 8px;
    justify-content: center;
  }
  .nav-links .btn { width: 100%; justify-content: center; margin-top: 4px; }
  .nav-overlay { display: block; }

  .toast-container {
    left: 16px;
    right: 16px;
    top: 16px;
  }
  .toast-container .toast { max-width: none; }

  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .preset-grid { grid-template-columns: 1fr; }
  .faq-grid { grid-template-columns: 1fr; }
}

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

/* ===== 邀请奖励页 ===== */
.rewards-page .container.rewards-main {
  padding-top: 32px;
  padding-bottom: 56px;
}

.rewards-hero {
  background:
    linear-gradient(145deg, rgba(255, 107, 107, .11) 0%, rgba(255, 142, 142, .05) 35%, rgba(78, 205, 196, .08) 100%),
    var(--bg-warm);
  border-bottom: 1px solid var(--border-light);
  position: relative;
  overflow: hidden;
}

.rewards-hero::before {
  content: '';
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 217, 61, .18) 0%, transparent 70%);
  top: -180px;
  right: -80px;
  pointer-events: none;
}

.rewards-hero-inner {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 40px 28px 44px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 32px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.rewards-hero-eyebrow {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 12px;
}

.rewards-hero-title {
  font-size: clamp(1.85rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.18;
  margin: 0 0 14px;
}

.rewards-hero-title .highlight {
  background: linear-gradient(120deg, var(--primary) 0%, #ff9f43 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.rewards-hero-desc {
  margin: 0;
  max-width: 520px;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.7;
}

.rewards-hero-metrics {
  display: flex;
  gap: 14px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.rewards-metric {
  flex: 1;
  min-width: 96px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, .72);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, .85);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  text-align: center;
}

.rewards-metric-value {
  display: block;
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -.03em;
  color: var(--text);
  line-height: 1.1;
}

.rewards-metric-label {
  display: block;
  margin-top: 4px;
  font-size: .78rem;
  color: var(--text-secondary);
}

.rewards-share-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
}

.rewards-share-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.rewards-share-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  background: var(--primary-glow);
  border-radius: var(--radius-sm);
}

.rewards-share-head strong {
  display: block;
  font-size: 1rem;
}

.rewards-share-head p {
  margin: 2px 0 0;
  font-size: .82rem;
  color: var(--text-muted);
}

.rewards-code-box {
  font-family: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  letter-spacing: .28em;
  text-align: center;
  color: var(--primary-dark);
  padding: 22px 16px;
  background: linear-gradient(180deg, #fff 0%, var(--bg-warm) 100%);
  border: 2px dashed rgba(255, 107, 107, .28);
  border-radius: var(--radius);
  margin-bottom: 16px;
  user-select: all;
}

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

.rewards-share-actions .btn {
  justify-content: center;
  gap: 6px;
}

.rewards-share-note {
  margin: 14px 0 0;
  font-size: .8rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
}

.rewards-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  margin-bottom: 28px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  font-size: .92rem;
  color: var(--text-secondary);
}

.rewards-notice-info {
  background: var(--info-bg);
  border-color: rgba(52, 152, 219, .15);
  color: var(--text);
}

.rewards-notice-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.rewards-section {
  margin-bottom: 36px;
}

.rewards-section-head {
  margin-bottom: 18px;
}

.rewards-section-head h2 {
  margin: 0 0 4px;
  font-size: 1.35rem;
}

.rewards-milestones {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.rewards-milestone {
  padding: 20px;
  border: 1px solid var(--border);
  transition: transform var(--transition), box-shadow var(--transition);
}

.rewards-milestone:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

.rewards-milestone.is-done {
  background: linear-gradient(180deg, #fff 0%, var(--success-bg) 100%);
  border-color: rgba(46, 204, 113, .2);
}

.rewards-milestone.is-ready {
  border-color: rgba(255, 107, 107, .35);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.rewards-milestone-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.rewards-milestone-badge {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: .95rem;
  color: var(--primary);
  background: var(--primary-glow);
  border-radius: var(--radius-full);
}

.rewards-milestone.is-done .rewards-milestone-badge {
  background: var(--success);
  color: #fff;
}

.rewards-milestone-meta {
  flex: 1;
  min-width: 0;
}

.rewards-milestone-meta h3 {
  margin: 0 0 2px;
  font-size: 1.05rem;
}

.rewards-milestone-meta p {
  margin: 0;
  font-size: .85rem;
  color: var(--text-secondary);
}

.rewards-tag {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 7px;
  font-size: .72rem;
  font-weight: 600;
  color: var(--secondary-dark);
  background: rgba(78, 205, 196, .12);
  border-radius: var(--radius-full);
}

.rewards-status-pill {
  flex-shrink: 0;
  padding: 4px 10px;
  font-size: .72rem;
  font-weight: 650;
  border-radius: var(--radius-full);
  background: var(--bg-warm);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
}

.rewards-status-pill.is-success {
  background: var(--success-bg);
  color: #1e8449;
  border-color: rgba(46, 204, 113, .25);
}

.rewards-status-pill.is-pending {
  background: var(--warning-bg);
  color: #b7791f;
  border-color: rgba(243, 156, 18, .2);
}

.rewards-milestone-reward {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
  background: var(--bg-warm);
  border-radius: var(--radius-sm);
}

.rewards-reward-icon {
  font-size: 1.35rem;
}

.rewards-milestone-reward strong {
  display: block;
  font-size: .95rem;
}

.rewards-milestone-reward span {
  display: block;
}

.rewards-milestone-progress {
  margin-top: auto;
}

.rewards-progress-track {
  height: 10px;
  background: var(--divider);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.rewards-progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
  transition: width .5s cubic-bezier(.4, 0, .2, 1);
}

.rewards-milestone.is-done .rewards-progress-fill {
  background: linear-gradient(90deg, var(--success) 0%, #58d68d 100%);
}

.rewards-progress-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: .8rem;
  font-weight: 600;
}

.rewards-invite-list {
  padding: 8px;
  overflow: hidden;
}

.rewards-invite-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.rewards-invite-row:hover {
  background: var(--bg-warm);
}

.rewards-invite-row + .rewards-invite-row {
  border-top: 1px solid var(--border-light);
}

.rewards-invite-avatar {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  color: var(--primary);
  background: linear-gradient(135deg, var(--primary-glow) 0%, rgba(78, 205, 196, .12) 100%);
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 107, 107, .12);
}

.rewards-invite-info {
  flex: 1;
  min-width: 0;
}

.rewards-invite-info strong {
  display: block;
  font-size: .95rem;
}

.rewards-invite-status {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.rewards-invite-time {
  font-size: .75rem;
}

.rewards-history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.rewards-history-card {
  display: flex;
  gap: 14px;
  padding: 18px;
  align-items: flex-start;
}

.rewards-history-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  background: var(--warning-bg);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.rewards-history-card strong {
  display: block;
  margin-bottom: 2px;
}

.rewards-history-card p {
  margin: 0 0 4px;
}

.rewards-empty-state {
  text-align: center;
  padding: 48px 28px;
  max-width: 480px;
  margin: 60px auto;
}

.rewards-empty-inline {
  padding: 28px;
  text-align: center;
}

.rewards-empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  line-height: 1;
}

.rewards-empty-state h2,
.rewards-empty-state h3 {
  margin: 0 0 8px;
}

.rewards-empty-state p {
  margin: 0 0 20px;
}

@media (max-width: 900px) {
  .rewards-hero-inner {
    grid-template-columns: 1fr;
  }

  .rewards-share-card {
    max-width: 480px;
  }
}

@media (max-width: 640px) {
  .rewards-hero-inner {
    padding: 32px 20px 36px;
  }

  .rewards-hero-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .rewards-metric {
    min-width: 0;
    padding: 12px 8px;
  }

  .rewards-metric-value {
    font-size: 1.45rem;
  }

  .rewards-share-actions {
    grid-template-columns: 1fr;
  }

  .rewards-code-box {
    letter-spacing: .16em;
    font-size: 1.35rem;
  }

  .rewards-milestones {
    grid-template-columns: 1fr;
  }

  .rewards-invite-row {
    flex-wrap: wrap;
  }

  .rewards-invite-status {
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding-left: 56px;
  }
}

/* ═══════════════════════════════════════════════
   App Shell · 用户控制台侧栏布局
   ═══════════════════════════════════════════════ */

:root {
  --app-sidebar-w: 252px;
}

body.app-shell {
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

body.app-shell::before {
  z-index: -2;
}

.app-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(45, 36, 32, .35);
  z-index: 190;
  opacity: 0;
  transition: opacity var(--transition);
}

.app-sidebar-overlay.visible {
  display: block;
  opacity: 1;
}

.app-sidebar {
  width: var(--app-sidebar-w);
  flex-shrink: 0;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-right: 1px solid var(--border);
  box-shadow: 2px 0 24px rgba(0, 0, 0, .03);
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 20px 18px;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid var(--border-light);
}

.app-brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  box-shadow: 0 4px 14px rgba(255, 107, 107, .25);
}

.app-brand-text {
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: -.02em;
}

.app-quota-card {
  margin: 16px 14px 8px;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(255, 107, 107, .08) 0%, rgba(255, 217, 61, .08) 100%);
  border: 1px solid rgba(255, 107, 107, .15);
  border-radius: var(--radius-sm);
}

.app-quota-card.is-low {
  background: var(--danger-bg);
  border-color: rgba(231, 76, 60, .2);
}

.app-quota-label {
  display: block;
  font-size: .72rem;
  font-weight: 650;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 4px;
}

.app-quota-value {
  display: block;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary-dark);
  letter-spacing: -.02em;
}

.app-quota-card.is-low .app-quota-value {
  color: var(--danger);
}

.app-quota-link {
  display: inline-block;
  margin-top: 6px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
}

.app-quota-link:hover {
  color: var(--primary);
}

.app-nav {
  flex: 1;
  padding: 8px 10px;
  overflow-y: auto;
}

.app-nav-section {
  padding: 12px 12px 6px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.app-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  margin-bottom: 4px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: .92rem;
  font-weight: 600;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}

.app-nav-link:hover {
  background: var(--bg-warm);
  color: var(--text);
}

.app-nav-link.active {
  background: linear-gradient(135deg, rgba(255, 107, 107, .12) 0%, rgba(255, 142, 142, .06) 100%);
  color: var(--primary-dark);
  box-shadow: inset 3px 0 0 var(--primary);
}

.app-nav-icon {
  width: 22px;
  text-align: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.app-sidebar-footer {
  padding: 14px;
  border-top: 1px solid var(--border-light);
  background: var(--bg-elevated);
}

.app-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.app-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary-glow), rgba(78, 205, 196, .15));
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: .9rem;
  color: var(--primary);
}

.app-user-meta {
  min-width: 0;
}

.app-user-meta strong {
  display: block;
  font-size: .88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-user-meta span {
  display: block;
  font-size: .72rem;
  color: var(--text-muted);
}

.app-logout-btn {
  display: block;
  text-align: center;
  padding: 8px 12px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--bg-surface);
  transition: var(--transition);
}

.app-logout-btn:hover {
  color: var(--danger);
  border-color: rgba(231, 76, 60, .25);
  background: var(--danger-bg);
}

.app-main {
  flex: 1;
  min-width: 0;
  width: calc(100% - var(--app-sidebar-w));
  margin-left: var(--app-sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  height: 60px;
  background: rgba(254, 252, 249, .85);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border-light);
}

.app-sidebar-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--bg-surface);
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--text);
}

.app-topbar-title {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.app-topbar-title h1 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 750;
  letter-spacing: -.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-topbar-back {
  font-size: .88rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
}

.app-topbar-back:hover {
  color: var(--primary);
}

.app-topbar-sep {
  color: var(--text-muted);
  font-size: .85rem;
}

.app-topbar-quota {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  font-size: .78rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-glow);
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 107, 107, .12);
}

.app-topbar-quota.is-low {
  color: var(--danger);
  background: var(--danger-bg);
  border-color: rgba(231, 76, 60, .15);
}

.app-content {
  flex: 1;
  padding: 24px 28px 40px;
}

.app-content--flush {
  padding: 0;
}

.app-content .container {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0;
}

.app-content--flush .container.rewards-main {
  padding: 24px 28px 40px;
}

.rewards-page.app-shell .rewards-hero {
  border-bottom: 1px solid var(--border-light);
}

/* Console extras moved to theme-app.css */

.console-plan-grid,
.console-guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.console-plan-card,
.console-guide-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 100%;
}

.console-plan-badge,
.console-announcement-tag {
  display: inline-flex;
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: .72rem;
  font-weight: 700;
  color: var(--primary-dark);
  background: var(--primary-glow);
}

.console-plan-price {
  margin-top: auto;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
}

.console-plan-meta {
  font-size: .88rem;
  color: var(--text-secondary);
}

.console-section-title {
  margin: 28px 0 14px;
  font-size: 1rem;
  font-weight: 700;
}

.console-guide-step {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--primary-dark);
  background: var(--primary-glow);
}

.console-announcement time {
  display: block;
  margin-top: 8px;
  font-size: .82rem;
}

.console-faq-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--border-light);
}

.console-faq-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.console-faq-item summary {
  cursor: pointer;
  font-weight: 650;
  color: var(--text);
  list-style: none;
}

.console-faq-item summary::-webkit-details-marker {
  display: none;
}

.console-faq-item p {
  margin: 10px 0 0;
  line-height: 1.65;
}

.app-content--flush .console-tabs {
  margin: 0;
  padding: 16px 28px 0;
  border-bottom: none;
}

@media (max-width: 960px) {
  .app-sidebar {
    transform: translateX(-100%);
    transition: transform var(--transition-smooth);
  }

  .app-sidebar.sidebar-open {
    transform: translateX(0);
  }

  .app-main {
    width: 100%;
    margin-left: 0;
  }

  .app-sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .app-content {
    padding: 20px 16px 32px;
  }

  .app-content--flush .container.rewards-main {
    padding: 20px 16px 32px;
  }
}

/* ── 赛博前任训练工作台 ── */
.page-train-ex .app-content {
  max-width: none;
  padding: 0;
}

.train-ex-hub {
  padding-bottom: 48px;
}

.train-ex-eyebrow {
  margin: 0 0 10px;
  font-size: .8125rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--primary-dark);
}

.train-ex-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(240px, .8fr);
  gap: 24px;
  padding: 32px 28px;
  border-bottom: 1px solid var(--border-light);
  background:
    radial-gradient(circle at 0% 0%, rgba(236, 120, 186, .12), transparent 38%),
    linear-gradient(135deg, rgba(255, 255, 255, .96), rgba(253, 246, 252, .92));
}

.train-ex-title {
  margin: 0 0 12px;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--text);
}

.train-ex-desc {
  margin: 0 0 22px;
  max-width: 40em;
  font-size: .95rem;
  line-height: 1.65;
  color: var(--text-secondary);
}

.train-ex-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.train-ex-flow-step {
  padding: 14px 12px;
  border: 1px solid rgba(236, 120, 186, .16);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .82);
  box-shadow: var(--shadow-xs);
}

.train-ex-flow-icon {
  display: block;
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.train-ex-flow-step strong {
  display: block;
  margin-bottom: 4px;
  font-size: .88rem;
  color: var(--text);
}

.train-ex-flow-step span {
  display: block;
  font-size: .78rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.train-ex-hero-art {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 220px;
}

.train-ex-portrait-glow {
  position: absolute;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(236, 120, 186, .28), rgba(168, 85, 247, .12) 58%, transparent 72%);
}

.train-ex-complete-card {
  position: relative;
  z-index: 1;
  width: min(100%, 280px);
  padding: 18px 20px;
  border: 1px solid rgba(236, 120, 186, .2);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, .92);
  box-shadow: var(--shadow-card);
  text-align: center;
}

.train-ex-complete-card > span {
  display: block;
  margin-bottom: 10px;
  font-size: .82rem;
  color: var(--text-muted);
}

.train-ex-complete-items {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: .88rem;
}

.train-ex-complete-items b {
  color: var(--primary-dark);
}

.train-ex-complete-items i {
  font-style: normal;
  color: var(--text-muted);
}

.train-ex-material,
.train-ex-architecture {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 28px;
  box-sizing: border-box;
}

.train-ex-material {
  border-bottom: 1px solid var(--border-light);
}

.train-ex-material-head,
.train-ex-architecture-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.train-ex-material-head h2,
.train-ex-architecture-head h2 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
}

.train-ex-member-badge {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(236, 120, 186, .12);
  border: 1px solid rgba(236, 120, 186, .22);
  color: var(--primary-dark);
  font-size: .78rem;
  font-weight: 700;
}

.train-ex-member-badge.is-locked {
  background: var(--warning-bg);
  border-color: rgba(245, 158, 11, .28);
  color: #b45309;
}

.train-ex-vip-lock {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding: 16px 18px;
  border: 1px solid rgba(245, 158, 11, .22);
  border-radius: var(--radius-sm);
  background: var(--warning-bg);
}

.train-ex-vip-lock strong {
  display: block;
  margin-bottom: 4px;
}

.train-ex-vip-lock p {
  margin: 0;
  font-size: .88rem;
  color: var(--text-secondary);
}

.train-ex-material-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 280px;
  gap: 18px;
  align-items: start;
}

.train-ex-material.is-locked .train-ex-material-grid {
  opacity: .72;
  pointer-events: none;
  user-select: none;
}

.train-ex-material.is-locked .train-ex-vip-lock,
.train-ex-material.is-locked .train-ex-material-head {
  opacity: 1;
  pointer-events: auto;
  user-select: auto;
}

.train-ex-upload-card {
  display: block;
  margin-bottom: 16px;
  padding: 28px 20px;
  border: 2px dashed rgba(236, 120, 186, .28);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .88);
  text-align: center;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
}

.train-ex-upload-card:hover:not(.is-disabled) {
  border-color: rgba(236, 120, 186, .42);
  background: rgba(236, 120, 186, .06);
}

.train-ex-upload-card.is-disabled {
  cursor: not-allowed;
}

.train-ex-hidden-file {
  display: none;
}

.train-ex-upload-icon {
  display: block;
  font-size: 1.6rem;
  margin-bottom: 10px;
}

.train-ex-upload-card strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
}

.train-ex-upload-card p {
  margin: 0;
  font-size: .82rem;
  color: var(--text-muted);
}

.train-ex-tag-board {
  padding: 16px;
  border: 1px solid rgba(236, 120, 186, .16);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .9);
}

.train-ex-tag-hint {
  margin: 0 0 14px;
  font-size: .88rem;
  font-weight: 650;
  color: var(--text);
}

.train-ex-tag-hint span {
  display: block;
  margin-top: 4px;
  font-size: .78rem;
  font-weight: 400;
  color: var(--text-muted);
}

.train-ex-tag-group {
  margin-bottom: 14px;
}

.train-ex-tag-group:last-child {
  margin-bottom: 0;
}

.train-ex-tag-group b {
  display: block;
  margin-bottom: 8px;
  font-size: .82rem;
  color: var(--text-secondary);
}

.train-ex-tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.train-ex-tag-chip {
  padding: 6px 12px;
  border: 1px solid rgba(236, 120, 186, .18);
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  color: var(--text-secondary);
  font-size: .78rem;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.train-ex-tag-chip:hover:not(:disabled) {
  border-color: rgba(236, 120, 186, .32);
  color: var(--primary-dark);
}

.train-ex-tag-chip.is-active {
  background: rgba(236, 120, 186, .14);
  border-color: rgba(236, 120, 186, .36);
  color: var(--primary-dark);
  font-weight: 650;
}

.train-ex-tag-chip:disabled {
  cursor: not-allowed;
  opacity: .65;
}

.train-ex-form {
  padding: 18px;
  border: 1px solid rgba(236, 120, 186, .16);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .94);
  box-shadow: var(--shadow-card);
}

.train-ex-field {
  margin-bottom: 16px;
}

.train-ex-field:last-child {
  margin-bottom: 0;
}

.train-ex-field label {
  display: block;
  margin-bottom: 6px;
  font-size: .88rem;
  font-weight: 650;
  color: var(--text);
}

.train-ex-field input,
.train-ex-field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: .92rem;
  color: var(--text);
  background: var(--bg-surface);
  transition: border-color .18s ease, box-shadow .18s ease;
}

.train-ex-field textarea {
  resize: vertical;
  min-height: 96px;
  line-height: 1.6;
}

.train-ex-field input:focus,
.train-ex-field textarea:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.train-ex-field input:disabled,
.train-ex-field textarea:disabled {
  background: var(--bg-warm);
  color: var(--text-muted);
}

.train-ex-phone {
  padding: 16px;
  border: 1px solid rgba(236, 120, 186, .18);
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 0%, rgba(236, 120, 186, .1), transparent 42%),
    rgba(255, 255, 255, .96);
  box-shadow: var(--shadow-card);
}

.train-ex-phone-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
  font-size: .82rem;
}

.train-ex-phone-title strong {
  color: var(--text);
}

.train-ex-phone-title span {
  color: var(--text-muted);
}

.train-ex-avatar-ring {
  display: grid;
  place-items: center;
  margin-bottom: 16px;
}

.train-ex-avatar-face {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--cecho-gradient);
  color: #fff;
  font-size: 1.5rem;
  font-weight: 800;
  box-shadow: 0 12px 28px rgba(236, 120, 186, .24);
}

.train-ex-chat-preview {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.train-ex-bubble {
  margin: 0;
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: .82rem;
  line-height: 1.5;
}

.train-ex-bubble-left {
  justify-self: start;
  background: rgba(236, 120, 186, .12);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.train-ex-bubble-right {
  justify-self: end;
  background: var(--cecho-gradient);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.train-ex-bubble-wide {
  max-width: 96%;
}

.train-ex-bubble-typing {
  justify-self: start;
  color: var(--text-muted);
  background: transparent;
  padding-left: 4px;
}

.train-ex-fake-input {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(236, 120, 186, .16);
  border-radius: 999px;
  background: var(--bg-warm);
  color: var(--text-muted);
  font-size: .82rem;
}

.train-ex-fake-input button {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: var(--cecho-gradient);
  color: #fff;
  font-size: 1rem;
  line-height: 1;
}

.train-ex-architecture {
  padding-top: 24px;
}

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

.train-ex-arch-card {
  padding: 20px;
  border: 1px solid rgba(236, 120, 186, .16);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .94);
  box-shadow: var(--shadow-card);
}

.train-ex-arch-label {
  display: inline-block;
  margin-bottom: 8px;
  font-size: .82rem;
  font-weight: 800;
  color: var(--primary-dark);
}

.train-ex-arch-card h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.train-ex-arch-card p {
  margin: 0 0 12px;
  font-size: .86rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.train-ex-arch-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--text-muted);
  font-size: .82rem;
  line-height: 1.7;
}

.train-ex-limit-note {
  margin: 14px 0 0;
  font-size: .86rem;
}

@media (max-width: 1080px) {
  .train-ex-hero {
    grid-template-columns: 1fr;
  }

  .train-ex-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .train-ex-material-grid {
    grid-template-columns: 1fr 1fr;
  }

  .train-ex-phone {
    grid-column: 1 / -1;
    max-width: 320px;
    margin: 0 auto;
  }
}

@media (max-width: 720px) {
  .train-ex-hero,
  .train-ex-material,
  .train-ex-architecture {
    padding-left: 18px;
    padding-right: 18px;
  }

  .train-ex-flow,
  .train-ex-material-grid,
  .train-ex-architecture-grid {
    grid-template-columns: 1fr;
  }

  .train-ex-material-head,
  .train-ex-architecture-head,
  .train-ex-vip-lock {
    flex-direction: column;
    align-items: stretch;
  }

  .train-ex-architecture-head .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ── 赛博前任训练进度弹窗 ── */
body.train-ex-modal-open {
  overflow: hidden;
}

.train-ex-progress-modal {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(26, 21, 45, .42);
  backdrop-filter: blur(6px);
}

.train-ex-progress-modal[hidden] {
  display: none !important;
}

.train-ex-progress-dialog {
  width: min(100%, 480px);
  padding: 26px 28px 24px;
  border: 1px solid rgba(236, 120, 186, .2);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 0% 0%, rgba(236, 120, 186, .1), transparent 38%),
    rgba(255, 255, 255, .98);
  box-shadow: var(--shadow-lg);
}

.train-ex-progress-head h3 {
  margin: 0 0 8px;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
}

.train-ex-progress-subtitle {
  margin: 0 0 18px;
  font-size: .88rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.train-ex-progress-bar-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.train-ex-progress-bar {
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: rgba(236, 120, 186, .12);
  overflow: hidden;
}

.train-ex-progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--cecho-gradient-soft);
  transition: width .45s ease;
}

.train-ex-progress-percent {
  flex-shrink: 0;
  min-width: 42px;
  font-size: .82rem;
  font-weight: 700;
  color: var(--primary-dark);
  text-align: right;
}

.train-ex-progress-steps {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  display: grid;
  gap: 10px;
}

.train-ex-progress-steps li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(236, 120, 186, .12);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .72);
  color: var(--text-muted);
  transition: border-color .2s ease, background .2s ease, color .2s ease;
}

.train-ex-progress-steps li > span {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(236, 120, 186, .1);
  font-size: .78rem;
  font-weight: 800;
}

.train-ex-progress-steps li strong {
  display: block;
  font-size: .88rem;
  color: var(--text);
}

.train-ex-progress-steps li small {
  display: block;
  font-size: .78rem;
  color: var(--text-muted);
}

.train-ex-progress-steps li.is-active {
  border-color: rgba(236, 120, 186, .32);
  background: rgba(236, 120, 186, .08);
  color: var(--text);
}

.train-ex-progress-steps li.is-active > span {
  background: var(--cecho-gradient);
  color: #fff;
}

.train-ex-progress-steps li.is-done {
  border-color: rgba(34, 197, 94, .24);
  background: rgba(34, 197, 94, .06);
}

.train-ex-progress-steps li.is-done > span {
  background: #22c55e;
  color: #fff;
}

.train-ex-progress-steps li.is-error {
  border-color: rgba(239, 68, 68, .24);
  background: var(--danger-bg);
}

.train-ex-progress-error {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--danger-bg);
  border: 1px solid rgba(239, 68, 68, .2);
  color: #b91c1c;
  font-size: .86rem;
  line-height: 1.55;
}

.train-ex-progress-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}
