/* ===== 知卡工坊 - 公共样式 ===== */
/* 每个行业页通过 CSS 变量覆盖主题色 */

:root {
  --primary: #6c5ce7;
  --primary-hover: #5a4bd1;
  --primary-light: #f0f0ff;
  --primary-gradient: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 100%);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f5f6fa;
  color: #2d3436;
  min-height: 100vh;
  line-height: 1.6;
}

/* ===== Header ===== */
.header {
  background: var(--primary-gradient);
  color: #fff;
  padding: 56px 20px 24px;
  position: relative;
}
.header .back {
  position: absolute;
  left: 16px; top: 16px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: rgba(255,255,255,0.9);
  text-decoration: none;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 20px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(4px);
  transition: all 0.2s;
}
.header .back:hover { background: rgba(255,255,255,0.25); color: #fff; }
.header h1 { font-size: 24px; font-weight: 700; }
.header p { font-size: 14px; opacity: 0.9; margin-top: 4px; }

/* ===== Container ===== */
.container { max-width: 720px; margin: 0 auto; padding: 20px 16px 48px; }

/* ===== Step Indicator ===== */
.step-indicator { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.step-dot { flex: 1; height: 4px; border-radius: 2px; background: #dfe6e9; }
.step-dot.done { background: var(--primary); }
.step-label { font-size: 12px; color: #636e72; margin-bottom: 4px; }

/* ===== Section ===== */
.section {
  background: #fff;
  border-radius: 14px;
  padding: 18px 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 8px rgba(0,0,0,0.05);
}
.section-title { font-size: 15px; font-weight: 600; margin-bottom: 12px; color: #2d3436; }

/* ===== Type Grid ===== */
.type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.type-btn {
  background: #fff;
  border: 2px solid #dfe6e9;
  border-radius: 10px;
  padding: 10px 8px 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 12px;
  font-weight: 500;
  color: #2d3436;
}
.type-btn:hover { border-color: var(--primary); }
.type-btn.active { border-color: var(--primary); background: var(--primary-light); color: var(--primary); font-weight: 600; }
.type-btn .type-icon {
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--primary-light), rgba(255,255,255,0.8));
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  margin-bottom: 4px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.type-btn:hover .type-icon {
  transform: scale(1.05);
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.type-btn.active .type-icon {
  background: var(--primary-gradient);
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

/* ===== Style Chips ===== */
.style-section { margin-bottom: 12px; }
.style-label { font-size: 12px; color: #636e72; margin-bottom: 6px; font-weight: 500; }
.style-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.style-chip {
  background: #fff;
  border: 1.5px solid #dfe6e9;
  border-radius: 16px;
  padding: 3px 12px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
  color: #636e72;
  white-space: nowrap;
}
.style-chip:hover { border-color: var(--primary); color: var(--primary); }
.style-chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ===== Topic Chips ===== */
.topic-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.topic-chip {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid transparent;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}
.topic-chip:hover { opacity: 0.8; }
.topic-chip.active { background: var(--primary); color: #fff; }

/* ===== Custom Input ===== */
.custom-input-wrap { display: flex; gap: 8px; }
.custom-input-wrap input {
  flex: 1;
  border: 1.5px solid #dfe6e9;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  outline: none;
  transition: border 0.2s;
}
.custom-input-wrap input:focus { border-color: var(--primary); }
.custom-input-wrap input::placeholder { color: #b2bec3; }

/* ===== Generate Button ===== */
.gen-btn {
  width: 100%;
  background: var(--primary-gradient);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}
.gen-btn:hover { opacity: 0.9; }

/* ===== Platform Chips ===== */
.platform-section { margin-bottom: 16px; }
.platform-label { font-size: 12px; color: #636e72; margin-bottom: 6px; font-weight: 500; }
.platform-chips { display: flex; flex-wrap: nowrap; gap: 6px; overflow-x: auto; }
.platform-chip {
  background: #fff;
  border: 1.5px solid #dfe6e9;
  border-radius: 16px;
  padding: 4px 10px;
  font-size: 12px;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.15s;
  color: #636e72;
}
.platform-chip:hover { border-color: var(--primary); color: var(--primary); }
.platform-chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ===== Output Area ===== */
.output-area { margin-top: 16px; display: none; }
.output-area.show { display: block; }
.output-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
  background: #f1f2f6;
  border-radius: 10px;
  padding: 4px;
}
.output-tab {
  flex: 1;
  padding: 8px;
  text-align: center;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: #636e72;
  background: transparent;
  border: none;
  transition: all 0.2s;
}
.output-tab.active {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.output-box {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 16px;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid #eee;
}
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  padding: 8px 18px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}
.copy-btn:hover { opacity: 0.85; }
.copy-btn.copied { background: #636e72; }

/* ===== Flow Guide ===== */
.flow-guide {
  margin-top: 20px;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 8px rgba(0,0,0,0.05);
}
.flow-hdr {
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}
.flow-hdr .arrow { transition: transform 0.25s; font-size: 12px; }
.flow-hdr.open .arrow { transform: rotate(180deg); }
.flow-body { padding: 0 16px 16px; display: none; }
.flow-body.open { display: block; }
.flow-step {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px dashed #ede5d8;
}
.flow-step:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.fnum {
  width: 26px; height: 26px;
  background: var(--primary-gradient);
  border-radius: 50%;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.fcontent h4 { font-size: 13px; font-weight: 600; color: #2d3436; margin-bottom: 3px; }
.fcontent p { font-size: 12px; color: #636e72; line-height: 1.65; }
.ftip {
  background: rgba(108,92,231,0.07);
  border-left: 2px solid var(--primary);
  border-radius: 0 5px 5px 0;
  padding: 7px 11px;
  margin-top: 7px;
  font-size: 11px;
  color: #636e72;
  line-height: 1.6;
}

/* ===== FAQ ===== */
.faq-wrap {
  margin-top: 12px;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 8px rgba(0,0,0,0.05);
}
.faq-hdr {
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}
.faq-hdr .arrow { transition: transform 0.25s; font-size: 12px; }
.faq-hdr.open .arrow { transform: rotate(180deg); }
.faq-body { padding: 0 16px 16px; display: none; }
.faq-body.open { display: block; }
.faq-item { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px dashed #ede5d8; }
.faq-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.faq-q { display: flex; align-items: flex-start; gap: 7px; margin-bottom: 5px; }
.faq-qb {
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 1px;
}
.faq-qt { font-size: 13px; font-weight: 600; color: #2d3436; line-height: 1.5; }
.faq-a { display: flex; align-items: flex-start; gap: 7px; }
.faq-ab {
  background: rgba(108,92,231,0.15);
  color: var(--primary);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 1px;
}
.faq-at { font-size: 12px; color: #636e72; line-height: 1.65; }

/* ===== Footer ===== */
.footer { text-align: center; padding: 24px 16px; font-size: 13px; color: #b2bec3; }
.footer a { color: var(--primary); text-decoration: none; }

/* ===== Responsive ===== */
@media (max-width: 480px) {
  .type-grid { grid-template-columns: 1fr 1fr; }
}
