/* ── Design Tokens ──────────────────────────────────────── */
:root {
  --c-primary: #007cba;
  --c-primary-hover: #006ba1;
  --c-primary-light: #e8f4fd;
  --c-accent: #00d084;
  --c-text: #1a1a2e;
  --c-text-secondary: #4a5568;
  --c-text-muted: #8896a4;
  --c-bg: #f7f8fa;
  --c-surface: #ffffff;
  --c-border: #e5e7ec;
  --c-bg-alt: #f0f1f5;
  --c-header: #0d1b2a;
  --c-header-text: #e0e6ed;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.10);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --max-width: 960px;
}

/* ── Reset & Base ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: linear-gradient(180deg, #dcedc8 0%, #e8f5e9 30%, #f1f8e9 100%);
  color: var(--c-text);
  line-height: 1.7;
  min-height: 100vh;
}

/* ── Header ─────────────────────────────────────────────── */
.site-header {
  background: var(--c-header);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: sticky; top: 0; z-index: 100;
}
.header-inner {
  max-width: var(--max-width); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; height: 62px;
}
.header-logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: #fff;
  font-size: 1rem; font-weight: 600;
}
.header-logo-dot {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--c-primary), #31cdcf);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 700; color: #fff;
}
.header-nav { display: flex; align-items: center; gap: 2px; }
.header-nav a {
  color: rgba(255,255,255,0.75); text-decoration: none;
  padding: 8px 18px; border-radius: 6px;
  font-size: .86rem; font-weight: 500;
  transition: all .2s;
}
.header-nav a:hover { color: #fff; background: rgba(255,255,255,0.08); }
.header-nav a.active { color: #fff; background: var(--c-primary); }
@media (max-width: 600px) {
  .header-inner { padding: 0 14px; }
  .header-nav { display: none; }
}

/* ── Container ──────────────────────────────────────────── */
.container { max-width: var(--max-width); margin: 0 auto; padding: 32px 20px; }

/* ── Hero ───────────────────────────────────────────────── */
.hero { text-align: center; padding: 48px 0 32px; }
.hero__icon { font-size: 2.8rem; margin-bottom: 16px; }
.hero__title {
  font-size: 1.8rem; font-weight: 800; color: var(--c-text);
  margin-bottom: 10px; letter-spacing: -0.5px;
}
.hero__desc {
  font-size: 1rem; color: var(--c-text-secondary);
  max-width: 540px; margin: 0 auto; line-height: 1.8;
}

/* ── Tool Panel (card) ──────────────────────────────────── */
.tool-panel {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: var(--radius-lg);
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
  margin-bottom: 24px;
  overflow: hidden;
}
.tool-panel__header { padding: 22px 28px 14px; }
.tool-panel__header h2 { font-size: 1.05rem; font-weight: 700; }
.tool-panel__header p { font-size: .84rem; color: var(--c-text-muted); margin-top: 4px; }
.tool-panel__body { padding: 16px 28px 24px; }

/* ── Form ───────────────────────────────────────────────── */
.keyword-hero { display: flex; gap: 10px; align-items: flex-start; }
.keyword-hero .input-field--lg { flex: 1; font-size: 1.12rem; padding: 16px 22px; border: 2px solid #cbd5e1; border-radius: 10px; } .keyword-hero .input-field--lg:focus { border-color: var(--c-primary); box-shadow: 0 0 0 4px rgba(0,124,186,0.1); }
.keyword-hero .btn { flex-shrink: 0; padding: 13px 28px; font-size: .95rem; white-space: nowrap; }
@media (max-width: 560px) {
  .keyword-hero { flex-direction: column; }
  .keyword-hero .btn { width: 100%; }
}
.quick-settings { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.quick-settings .input-group { flex: 1; min-width: 100px; margin-bottom: 12px; }
.input-group { margin-bottom: 16px; }
.input-label { display: block; font-size: .84rem; font-weight: 600; color: var(--c-text-secondary); margin-bottom: 6px; }
.input-field {
  width: 100%; padding: 10px 14px;
  border: 1px solid var(--c-border); border-radius: var(--radius-sm);
  font-size: .92rem; font-family: var(--font-sans);
  transition: border-color .2s, box-shadow .2s;
  background: var(--c-surface); color: var(--c-text);
}
.input-field:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(0,124,186,0.12); }
.input-field:disabled { background: var(--c-bg-alt); color: var(--c-text-muted); cursor: not-allowed; }
textarea.input-field { resize: vertical; }

.advanced-toggle {
  display: block; width: 100%; text-align: center;
  padding: 6px 0; margin-bottom: 12px;
  font-size: .82rem; color: var(--c-text-muted);
  background: none; border: 1px dashed var(--c-border);
  border-radius: var(--radius-sm); cursor: pointer;
  font-family: var(--font-sans); transition: all .2s;
}
.advanced-toggle:hover { color: var(--c-primary); border-color: var(--c-primary); }
.advanced-options { padding-top: 4px; border-top: 1px solid var(--c-border); margin-bottom: 4px; }

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px; font-size: .9rem; font-weight: 600;
  font-family: var(--font-sans); border: 1px solid transparent;
  border-radius: var(--radius-sm); cursor: pointer;
  transition: all .2s; text-decoration: none;
}
.btn--primary { background: var(--c-primary); color: #fff; }
.btn--primary:hover { background: var(--c-primary-hover); }
.btn--primary:disabled { background: var(--c-bg-alt); color: var(--c-text-muted); cursor: not-allowed; border-color: var(--c-border); }
.btn--outline { background: var(--c-surface); color: var(--c-primary); border-color: var(--c-primary); }
.btn--outline:hover { background: var(--c-primary-light); }
.btn--ghost { background: transparent; color: var(--c-text-secondary); border-color: var(--c-border); }
.btn--ghost:hover { background: var(--c-bg-alt); }
.btn--full { width: 100%; }
.btn--sm { padding: 6px 14px; font-size: .82rem; }
.btn--accent { background: var(--c-accent); color: #fff; }
.btn--accent:hover { opacity: .9; }

/* ── Loading ────────────────────────────────────────────── */
.loading-overlay {
  display: none; margin: 24px 0; text-align: center;
  padding: 48px 24px;
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
.loading-emoji { font-size: 2.5rem; display: block; margin-bottom: 14px; }
.loading-text { font-size: .95rem; color: var(--c-text-secondary); font-weight: 500; }
.loading-sub { font-size: .82rem; color: var(--c-text-muted); margin-top: 8px; }
.loading-progress { margin-top: 16px; width: 100%; height: 5px; background: var(--c-bg-alt); border-radius: 999px; overflow: hidden; }
.loading-progress__fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--c-primary), #31cdcf); border-radius: 999px; transition: width .5s ease; }

/* ── Error ──────────────────────────────────────────────── */
.error-panel {
  display: none; background: #fef2f2; border: 1px solid #fecaca;
  color: #dc2626; padding: 14px 18px; border-radius: var(--radius-md);
  margin-top: 16px; font-size: .9rem;
}

/* ── Stats badge ────────────────────────────────────────── */
.limit-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .8rem; color: var(--c-text-muted); margin-top: 14px;
}
.limit-badge strong { color: var(--c-primary); }

/* ── Results ────────────────────────────────────────────── */
.results-panel { display: none; }

/* ── Outline Cards ──────────────────────────────────────── */
.outline-sec {
  position: relative; background: var(--c-surface);
  border: 1px solid var(--c-border); border-left: 3px solid var(--c-primary);
  border-radius: var(--radius-md); padding: 16px 18px; margin-bottom: 14px;
}
.outline-sec--cta { border-left-color: #f59e0b; background: linear-gradient(135deg, #fffdf5, #fff); }
.outline-sec--faq { border-left-color: #8b5cf6; }
.outline-sec__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.outline-sec__h2 { font-weight: 700; font-size: 1.02rem; color: var(--c-text); line-height: 1.5; }
.outline-sec__h2 .tag-h2 { color: var(--c-text-muted); font-weight: 700; font-size: .78rem; margin-right: 6px; }
.outline-sec__wc {
  flex-shrink: 0; white-space: nowrap;
  font-size: .72rem; font-weight: 600;
  background: var(--c-bg-alt); color: var(--c-text-secondary);
  padding: 3px 10px; border-radius: 999px;
}
.outline-sec__intro { margin-top: 8px; font-size: .875rem; color: var(--c-text-secondary); line-height: 1.8; }
.faq-list { margin: 10px 0 0; padding-left: 1.1rem; }
.faq-list li { font-size: .9rem; color: var(--c-text); line-height: 1.85; margin-bottom: 4px; }

.result-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.result-title { font-size: 1rem; font-weight: 700; flex: 1; }

/* ── Analysis (collapsible) ─────────────────────────────── */
.analysis-box { margin-top: 24px; }
.analysis-box > summary {
  cursor: pointer; font-weight: 700; font-size: .95rem; color: var(--c-text-secondary);
  padding: 12px 16px; background: var(--c-bg-alt); border: 1px solid var(--c-border);
  border-radius: var(--radius-md); list-style: none; user-select: none;
}
.analysis-box > summary::-webkit-details-marker { display: none; }
.analysis-box[open] > summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.analysis-inner { border: 1px solid var(--c-border); border-top: none; border-radius: 0 0 var(--radius-md) var(--radius-md); padding: 16px 18px; background: var(--c-surface); }
.need-group { margin-bottom: 16px; }
.need-group h4 { font-size: .88rem; color: var(--c-text); margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-block; padding: 4px 12px; font-size: .82rem; border-radius: 999px; background: var(--c-bg-alt); color: var(--c-text-secondary); border: 1px solid var(--c-border); }
.chip--primary { background: #dbeafe; color: #1e40af; border-color: #bfdbfe; }
.chip--secondary { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.chip--miss { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.comp-card { background: var(--c-bg); border: 1px solid var(--c-border); border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 8px; }
.comp-card__title { font-size: .85rem; font-weight: 600; margin-bottom: 4px; }
.comp-card__title a { color: var(--c-primary); text-decoration: none; }
.comp-card__title a:hover { text-decoration: underline; }
.comp-card__snippet { font-size: .78rem; color: var(--c-text-muted); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.comp-list { margin: 6px 0 0; padding-left: 1rem; font-size: .85rem; line-height: 1.9; }
.comp-list a { color: var(--c-primary); text-decoration: none; }
.comp-list a:hover { text-decoration: underline; }

/* ── Guide Steps ────────────────────────────────────────── */
.guide-steps { display: flex; flex-direction: column; gap: 14px; }
.guide-step { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; background: var(--c-bg); border-radius: var(--radius-md); border: 1px solid var(--c-border); }
.guide-step__num { flex-shrink: 0; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; background: var(--c-primary); color: #fff; border-radius: 50%; font-size: .85rem; font-weight: 700; }
.guide-step strong { display: block; font-size: .95rem; margin-bottom: 4px; }
.guide-step p { font-size: .85rem; color: var(--c-text-secondary); margin: 0; line-height: 1.6; }

/* ── Toast ──────────────────────────────────────────────── */
.toast { position: fixed; bottom: 40px; left: 50%; transform: translateX(-50%); background: #1a1a2e; color: #fff; padding: 10px 24px; border-radius: 999px; font-size: .85rem; font-weight: 500; opacity: 0; transition: opacity .3s; z-index: 999; }
.toast--show { opacity: 1; }

/* ── Footer ─────────────────────────────────────────────── */
.site-footer { text-align: center; padding: 40px 20px; color: var(--c-text-muted); font-size: .82rem; border-top: 1px solid var(--c-border); margin-top: 40px; }
.site-footer a { color: var(--c-primary); text-decoration: none; }

/* ── Activation ─────────────────────────────────────────── */
.activation-banner { margin-bottom: 16px; padding: 14px 18px; background: #fef2f2; border: 1px solid #fecaca; border-radius: var(--radius-md); max-width: var(--max-width); margin-left: auto; margin-right: auto; }
.activation-banner .banner-title { font-weight: 600; color: #dc2626; font-size: .9rem; }
.activation-bar { margin-bottom: 16px; padding: 10px 16px; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: var(--radius-md); font-size: .84rem; color: #166534; max-width: var(--max-width); margin-left: auto; margin-right: auto; }

/* ── Tools Hub ──────────────────────────────────────────── */
.tools-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin-top: 24px; }
.tool-card {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow-sm);
  transition: all .2s; text-decoration: none; color: inherit; display: block;
}
.tool-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.tool-card__icon { font-size: 2.2rem; margin-bottom: 16px; }
.tool-card__title { font-size: 1.15rem; font-weight: 700; margin-bottom: 8px; color: var(--c-text); }
.tool-card__desc { font-size: .88rem; color: var(--c-text-secondary); line-height: 1.7; }
.tool-card__tag {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: .75rem; font-weight: 600; margin-top: 12px;
}
.tool-card__tag--blue { background: #dbeafe; color: #1e40af; }
.tool-card__tag--green { background: #d1fae5; color: #065f46; }

/* ── Brand tool specific ────────────────────────────────── */
.brand-hero { display: flex; gap: 10px; align-items: flex-start; }
.brand-hero .input-field--lg { flex: 1; font-size: 1.12rem; padding: 16px 22px; border: 2px solid #cbd5e1; border-radius: 10px; } .brand-hero .input-field--lg:focus { border-color: var(--c-primary); box-shadow: 0 0 0 4px rgba(0,124,186,0.1); }
.brand-hero .btn { flex-shrink: 0; padding: 13px 28px; font-size: .95rem; }
@media (max-width: 560px) { .brand-hero { flex-direction: column; } .brand-hero .btn { width: 100%; } }
.summary-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.summary-title { flex: 1; font-size: .95rem; font-weight: 700; }
.analysis-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 10px; margin-bottom: 24px; }
.analysis-card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-md); padding: 14px 12px; text-align: center; }
.analysis-card__num { font-size: 1.6rem; font-weight: 800; color: var(--c-primary); }
.analysis-card__label { font-size: .78rem; color: var(--c-text-muted); margin-top: 4px; }
.result-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.result-table th { text-align: left; padding: 8px 10px; background: var(--c-bg-alt); font-weight: 600; color: var(--c-text); border-bottom: 2px solid var(--c-border); white-space: nowrap; }
.result-table td { padding: 7px 10px; border-bottom: 1px solid var(--c-border); color: var(--c-text-secondary); vertical-align: top; }
.result-table tr:hover td { background: var(--c-bg); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .72rem; font-weight: 700; }
.badge-p0 { background: #fef2f2; color: #dc2626; }
.badge-p1 { background: #fef3c7; color: #d97706; }
.badge-p2 { background: #f0fdf4; color: #16a34a; }
.module-desc { font-size: .82rem; color: var(--c-text-muted); margin-top: 4px; line-height: 1.6; }
.export-bar { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.brand-star { color: #f59e0b; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 480px) {
  .hero__title { font-size: 1.4rem; }
  .container { padding: 20px 12px; }
  .tool-panel__body { padding: 12px 16px 20px; }
  .tool-panel__header { padding: 16px 16px 8px; }
}

/* ── FAB — Mobile tool switcher ─────────────────────────── */
.fab-btn {
  display: none;
  position: fixed; bottom: 24px; right: 20px; z-index: 9999;
  width: 50px; height: 50px; border-radius: 50%;
  background: var(--c-primary); color: #fff; border: none;
  font-size: 22px; cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  align-items: center; justify-content: center;
  transition: transform .2s, box-shadow .2s;
}
.fab-btn:hover { transform: scale(1.08); box-shadow: 0 6px 20px rgba(0,0,0,0.35); }
.fab-btn--open { background: #374151; transform: rotate(45deg); }

.fab-menu {
  display: none; flex-direction: column; gap: 4px;
  position: fixed; bottom: 84px; right: 20px; z-index: 9998;
  background: #fff; border-radius: 12px; padding: 6px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.18);
  min-width: 150px;
}
.fab-menu a {
  display: block; padding: 10px 16px; border-radius: 8px;
  text-decoration: none; font-size: .88rem; font-weight: 500;
  color: #374151; transition: background .15s;
}
.fab-menu a:hover { background: #f3f4f6; }
.fab-menu a.active { background: #dbeafe; color: #2563eb; font-weight: 600; }

.fab-backdrop {
  display: none; position: fixed; inset: 0; z-index: 9997;
  background: rgba(0,0,0,0.3);
}

@media (max-width: 600px) {
  .fab-btn { display: flex; }
}
