/* ═══════════════════════════════════════
   基础变量、排版、按钮、布局
   ═══════════════════════════════════════ */

:root {
  --bg: #f1f5f9;
  --ink: #1e293b;
  --muted: #64748b;
  --line: #e2e8f0;
  --panel: #ffffff;
  --brand: #0f766e;
  --brand-light: #ccfbf1;
  --brand-dark: #115e59;
  --accent: #d97706;
  --accent-light: #fef3c7;
  --radius: 12px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.12);
  --max-w: 1040px;

  --tool-coze: #f97316;
  --tool-workbuddy: #0d9488;
  --tool-notebook: #059669;
  --tool-ide: #6366f1;
  --tool-table: #2563eb;
  --tool-miaoji: #8b5cf6;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  line-height: 1.6;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin-top: 0; }
a { color: inherit; text-decoration: none; }

/* ── 容器 ── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px 60px;
}

.step-section { display: none; }
.step-section.visible { display: block; animation: fadeUp 0.4s ease; }

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

/* ── 按钮 ── */
.btn {
  display: inline-flex; height: 46px;
  align-items: center; justify-content: center; gap: 8px;
  padding: 0 20px; font-weight: 700; font-size: 15px;
  border-radius: 8px; border: 1.5px solid transparent;
  transition: all 0.2s;
}

.btn svg { width: 18px; height: 18px; flex-shrink: 0; }

.btn-primary { color: #fff; background: var(--brand); border-color: var(--brand); }
.btn-primary:hover { background: var(--brand-dark); }

.btn-secondary { color: var(--ink); background: #fff; border-color: #d1d5db; }
.btn-secondary:hover { background: #f8fafc; }

.btn-ghost { color: var(--muted); background: transparent; border-color: transparent; }
.btn-ghost:hover { color: var(--ink); background: #f1f5f9; }

.btn-accent { color: #fff; background: var(--accent); border-color: var(--accent); }
.btn-accent:hover { background: #b45309; }

/* ── 输入 ── */
input, select, textarea {
  width: 100%; color: var(--ink); background: #fff;
  border: 1.5px solid #d1d5db; border-radius: 8px; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input, select { height: 46px; padding: 0 14px; }
textarea { min-height: 180px; resize: vertical; padding: 14px; line-height: 1.7; }
input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.field { display: grid; gap: 6px; margin-bottom: 18px; }
.field label { font-size: 14px; font-weight: 700; }
.field small { color: var(--muted); font-size: 12px; line-height: 1.4; }

.action-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

/* ── 段头 ── */
.section-header { margin-bottom: 24px; }
.section-header h2 { font-size: clamp(22px, 3vw, 30px); margin-bottom: 8px; }
.section-header p {
  color: var(--muted); font-size: 15px;
  max-width: 700px; margin-bottom: 0;
}

.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px; font-size: 13px; font-weight: 600;
  border-radius: 6px; background: var(--brand-light);
  color: var(--brand-dark);
}

.context-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }

.bottom-bar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
  margin-top: 28px; padding-top: 24px;
  border-top: 1px solid var(--line);
}

.count-text { font-size: 14px; color: var(--muted); }
.count-text strong { color: var(--brand); }

/* ── 加载遮罩 ── */
.loading-overlay {
  display: none; position: fixed; inset: 0; z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
}
.loading-overlay.visible { display: grid; place-items: center; }
.loading-box { text-align: center; padding: 40px; }
.spinner {
  width: 48px; height: 48px; margin: 0 auto 20px;
  border: 4px solid var(--line);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-box h3 { font-size: 18px; margin-bottom: 6px; }
.loading-box p { color: var(--muted); font-size: 14px; margin: 0; }

/* ── Toast ── */
.toast {
  position: fixed; bottom: 32px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  padding: 12px 24px; background: #1e293b;
  color: #fff; font-size: 14px; font-weight: 600;
  border-radius: 8px; z-index: 200;
  opacity: 0; transition: all 0.3s ease;
  pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ── 模态框 ── */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 150;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
}
.modal-overlay.visible { display: grid; place-items: center; padding: 20px; }
.modal-box {
  background: #fff; border-radius: var(--radius);
  max-width: 520px; width: 100%;
  box-shadow: var(--shadow-lg); overflow: hidden;
  animation: modalIn 0.3s ease;
}
@keyframes modalIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
.modal-head { padding: 20px 24px; border-bottom: 1px solid var(--line); }
.modal-title { margin: 0; font-size: 18px; font-weight: 800; }
.modal-body { padding: 20px 24px; }
.modal-foot {
  padding: 16px 24px; border-top: 1px solid var(--line);
  display: flex; gap: 10px; justify-content: flex-end;
}

/* ── Footer ── */
.footer {
  text-align: center; padding: 32px 24px 48px;
  color: var(--muted); font-size: 13px;
  border-top: 1px solid var(--line);
}

@media (max-width: 760px) {
  .container { padding: 0 16px 40px; }
  .action-row .btn { width: 100%; }
  .bottom-bar { flex-direction: column; align-items: stretch; }
  .bottom-bar .btn { width: 100%; }
}
