/* ============ AI 工具箱 设计系统 v3（晨光主题 · 融合流水线平台设计语言）============ */
:root {
  --bg: #FFF8EF;
  --card: #ffffff;
  --ink: #1E2A3A;
  --ink-2: #5b6272;
  --ink-3: #9aa1b2;
  --line: #EDE7DC;
  --primary: #5B6CFF;
  --primary-2: #8B5CF6;
  --accent: #F97316;
  --grad: linear-gradient(135deg, #5B6CFF, #8B5CF6);
  --grad-warm: linear-gradient(135deg, #5B6CFF, #8B5CF6 55%, #F97316);
  --primary-weak: #EEF0FE;
  --primary-ink: #3730a3;
  --ok: #10B981;
  --warn: #F59E0B;
  --err: #EF4444;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(30,42,58,.04), 0 8px 24px rgba(30,42,58,.06);
  --shadow-lg: 0 4px 12px rgba(30,42,58,.08), 0 18px 44px rgba(30,42,58,.12);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg); color: var(--ink);
  font-size: 15px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  position: relative;
}
/* 晨光光斑：左上暖橙 + 右上淡紫，全局氛围 */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(720px 420px at 8% -6%, rgba(255,183,94,.18), transparent 62%),
    radial-gradient(860px 500px at 96% -10%, rgba(139,92,246,.12), transparent 60%),
    radial-gradient(640px 420px at 55% 108%, rgba(249,115,22,.06), transparent 58%);
}
::selection { background: rgba(91,108,255,.22); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2.5px solid rgba(91,108,255,.55); outline-offset: 2px; border-radius: 6px; }

/* ---------- 顶栏 ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,252,246,.85); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1080px; margin: 0 auto; padding: 0 20px;
  height: 60px; display: flex; align-items: center; gap: 8px;
}
.nav-logo {
  display: flex; align-items: center; gap: 9px;
  font-weight: 800; font-size: 17px; color: var(--ink);
  margin-right: 8px; letter-spacing: .3px;
}
.nav-logo .dot {
  width: 26px; height: 26px; border-radius: 50%;
  background: conic-gradient(from 210deg, #6366F1, #A78BFA, #F97316, #6366F1);
  box-shadow: 0 0 14px rgba(139,92,246,.5);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 13px;
}
.nav-links { display: flex; align-items: center; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a {
  color: var(--ink-2); padding: 6px 11px; border-radius: 999px;
  font-size: 14px; white-space: nowrap; font-weight: 500;
}
.nav-links a:hover { background: var(--primary-weak); color: var(--primary-ink); text-decoration: none; }
.nav-links a.active { background: var(--grad); color: #fff; font-weight: 600; box-shadow: 0 4px 12px rgba(91,108,255,.35); }

/* ---------- 布局 ---------- */
.wrap { max-width: 1080px; margin: 0 auto; padding: 28px 20px 80px; }
.wrap-narrow { max-width: 760px; }
.page-title { font-size: 26px; font-weight: 800; letter-spacing: .2px; margin: 6px 0 4px; }
.page-sub { color: var(--ink-2); font-size: 14.5px; margin: 0 0 22px; }

/* ---------- Hero ---------- */
.hero { text-align: center; padding: 58px 0 30px; position: relative; }
.hero h1 { font-size: clamp(30px, 4.6vw, 42px); margin: 0 0 12px; font-weight: 900; letter-spacing: .5px; line-height: 1.28; }
.hero h1 .grad { background: var(--grad-warm); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--ink-2); font-size: 16px; margin: 0 auto; max-width: 600px; }
.hero .meta { margin-top: 14px; color: var(--ink-3); font-size: 13px; }

/* 首页搜索框 + 热门标签 */
.searchbox {
  display: flex; max-width: 640px; margin: 26px auto 0;
  background: #fff; border: 1.5px solid var(--line); border-radius: 16px; padding: 8px;
  box-shadow: 0 10px 30px rgba(30,42,58,.08); transition: box-shadow .2s, border-color .2s;
}
.searchbox:focus-within { border-color: var(--primary); box-shadow: 0 10px 34px rgba(91,108,255,.18); }
.searchbox input { flex: 1; border: none; outline: none; padding: 8px 14px; font-size: 15px; font-family: inherit; background: transparent; color: var(--ink); }
.searchbox button { border: none; border-radius: 12px; width: 46px; background: var(--grad); color: #fff; font-size: 18px; cursor: pointer; transition: transform .15s; }
.searchbox button:hover { transform: scale(1.06); }
.tags { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.tag-chip {
  font-size: 12.5px; color: var(--ink-2); background: #fff; border: 1px solid var(--line);
  padding: 5px 13px; border-radius: 999px; cursor: pointer; font-family: inherit; transition: all .15s;
}
.tag-chip:hover { color: var(--primary); border-color: var(--primary); transform: translateY(-1px); box-shadow: 0 4px 10px rgba(91,108,255,.14); }

/* ---------- 卡片 ---------- */
.grid { display: grid; gap: 16px; }
.grid-tools { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
}
.tool-card {
  display: block; color: inherit; transition: transform .2s ease, box-shadow .2s ease, border-color .2s;
  text-decoration: none; position: relative; overflow: hidden;
}
.tool-card::after {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--grad-warm); opacity: 0; transition: opacity .2s;
}
.tool-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); text-decoration: none; border-color: transparent; }
.tool-card:hover::after { opacity: 1; }
.tool-card .icon {
  width: 46px; height: 46px; border-radius: 12px; font-size: 23px;
  display: flex; align-items: center; justify-content: center; margin-bottom: 12px;
  background: linear-gradient(135deg, #EEF2FF, #FDF2F8);
}
.tool-card h3 { margin: 0 0 6px; font-size: 16.5px; font-weight: 700; }
.tool-card p { margin: 0; color: var(--ink-2); font-size: 13.5px; line-height: 1.55; }
.tool-card .tag {
  position: absolute; top: 14px; right: 14px; font-size: 11px;
  padding: 2px 9px; border-radius: 999px;
  background: linear-gradient(135deg, #FEF3C7, #FDE8D0); color: #B45309; font-weight: 600;
}

/* ---------- 表单 ---------- */
label.fl { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink-2); margin: 0 0 6px; }
input[type=text], input[type=password], input[type=number], input[type=date], select, textarea {
  width: 100%; border: 1.5px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font-size: 14.5px; font-family: inherit;
  background: #fff; color: var(--ink); outline: none; transition: border .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(91,108,255,.14); }
textarea { resize: vertical; min-height: 110px; line-height: 1.65; }
.field { margin-bottom: 16px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 200px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: none; cursor: pointer; border-radius: 10px;
  padding: 10px 20px; font-size: 14.5px; font-weight: 600; font-family: inherit;
  transition: all .15s; text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 6px 16px rgba(91,108,255,.32); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(91,108,255,.42); }
.btn-primary:active { transform: none; }
.btn-primary:disabled { background: #b9b6f2; cursor: not-allowed; box-shadow: none; transform: none; }
.btn-ghost { background: #fff; color: var(--primary); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--primary); box-shadow: 0 4px 12px rgba(91,108,255,.14); }
.btn-soft { background: var(--primary-weak); color: var(--primary-ink); }
.btn-sm { padding: 6px 13px; font-size: 13px; border-radius: 8px; }
.btn-danger { background: #fef2f2; color: var(--err); border: 1.5px solid #fecaca; }
.btn-lg { padding: 13px 30px; font-size: 16px; border-radius: 12px; }

/* ---------- 标签/徽章 ---------- */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; background: var(--primary-weak); color: var(--primary-ink);
}
.badge-gray { background: #f1f2f6; color: var(--ink-2); }
.badge-ok { background: #ECFDF5; color: #059669; }
.badge-warn { background: #fffbeb; color: #B45309; }
.badge-err { background: #fef2f2; color: var(--err); }

/* ---------- Tabs（胶囊风格）---------- */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; border-bottom: none; }
.tab {
  padding: 8px 18px; cursor: pointer; font-size: 14px; font-weight: 600;
  color: var(--ink-2); border: 1px solid var(--line); background: #fff;
  border-radius: 999px; margin-bottom: 0; font-family: inherit; transition: all .15s;
}
.tab:hover { color: var(--primary); border-color: rgba(91,108,255,.4); }
.tab.active { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 4px 12px rgba(91,108,255,.32); }
.tabpane { display: none; }
.tabpane.active { display: block; }

/* ---------- 提示 ---------- */
.tip { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; border-radius: 10px; padding: 11px 14px; font-size: 13.5px; margin: 0 0 16px; line-height: 1.6; }
.tip-warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.tip-ok { background: #ECFDF5; border-color: #a7f3d0; color: #065f46; }
.callout { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--primary); border-radius: 10px; padding: 14px 16px; font-size: 14px; }

/* ---------- Toast ---------- */
#toast-box { position: fixed; top: 74px; left: 50%; transform: translateX(-50%); z-index: 999; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: rgba(30,42,58,.92); color: #fff; padding: 10px 20px; border-radius: 12px;
  font-size: 14px; box-shadow: var(--shadow-lg); animation: toastIn .25s ease; max-width: 80vw;
  backdrop-filter: blur(8px);
}
.toast.err { background: rgba(220,38,38,.95); }
.toast.ok { background: rgba(16,185,129,.95); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------- Loading ---------- */
.spinner {
  width: 18px; height: 18px; border: 2.5px solid var(--primary-weak);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin .7s linear infinite; display: inline-block; vertical-align: -4px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-block { text-align: center; padding: 34px 0; color: var(--ink-2); font-size: 14px; }
.loading-block .spinner { width: 26px; height: 26px; margin-bottom: 10px; display: block; margin-inline: auto; }

/* ---------- Markdown 输出 ---------- */
.md { line-height: 1.75; font-size: 14.8px; word-break: break-word; }
.md h1, .md h2, .md h3, .md h4 { margin: 1.1em 0 .45em; font-weight: 800; line-height: 1.4; }
.md h1 { font-size: 21px; } .md h2 { font-size: 18.5px; } .md h3 { font-size: 16.5px; }
.md p { margin: .5em 0; }
.md ul, .md ol { padding-left: 1.4em; margin: .5em 0; }
.md code { background: #f1f2f6; border-radius: 5px; padding: 1.5px 6px; font-size: .9em; }
.md pre { background: #14161d; color: #e6e8ef; padding: 14px 16px; border-radius: 10px; overflow-x: auto; font-size: 13px; line-height: 1.6; }
.md pre code { background: none; color: inherit; padding: 0; }
.md table { border-collapse: collapse; width: 100%; margin: .8em 0; font-size: 13.5px; }
.md th, .md td { border: 1px solid var(--line); padding: 7px 11px; text-align: left; }
.md th { background: #FFF8EF; font-weight: 700; }
.md blockquote { border-left: 3.5px solid var(--primary); margin: .7em 0; padding: 2px 0 2px 14px; color: var(--ink-2); }
.md hr { border: none; border-top: 1px solid var(--line); margin: 1.2em 0; }

/* ---------- 结果容器 ---------- */
.result-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); }
.result-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 10px; flex-wrap: wrap; }
.result-head h3 { margin: 0; font-size: 16px; }
.cursor-blink::after { content: "▋"; animation: blink 1s steps(1) infinite; color: var(--primary); }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- 双栏对比 ---------- */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 720px) { .compare { grid-template-columns: 1fr; } }
.compare .pane { background: #FFFCF6; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; font-size: 13.5px; }
.compare .pane h4 { margin: 0 0 8px; font-size: 13px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .5px; }

/* ---------- 关键词覆盖 ---------- */
.cov-row { display: flex; align-items: center; gap: 10px; margin: 7px 0; font-size: 13.5px; }
.cov-bar { flex: 1; height: 8px; border-radius: 999px; background: #eef0f4; overflow: hidden; }
.cov-bar i { display: block; height: 100%; border-radius: 999px; background: var(--grad); }
.cov-row.miss .cov-bar i { background: #fca5a5; }
.cov-row.miss .kw { color: var(--err); }
.cov-row .kw { width: 140px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cov-row .pct { width: 46px; text-align: right; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* ---------- 提示词工具箱 ---------- */
.prompts-layout { display: grid; grid-template-columns: 200px 1fr; gap: 20px; }
@media (max-width: 760px) { .prompts-layout { grid-template-columns: 1fr; } }
.cat-list { display: flex; flex-direction: column; gap: 3px; position: sticky; top: 76px; align-self: start; max-height: calc(100vh - 100px); overflow: auto; }
.cat-item {
  text-align: left; border: none; background: none; cursor: pointer;
  padding: 8px 12px; border-radius: 9px; font-size: 14px; color: var(--ink-2);
  display: flex; justify-content: space-between; align-items: center; font-family: inherit;
}
.cat-item:hover { background: #FFF6E9; }
.cat-item.active { background: var(--primary-weak); color: var(--primary); font-weight: 700; }
.cat-item .n { font-size: 12px; color: var(--ink-3); font-weight: 500; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.tool-chip {
  background: var(--card); border: 1px solid var(--line); border-radius: 11px;
  padding: 12px 14px; cursor: pointer; transition: all .15s; text-align: left; font-family: inherit;
}
.tool-chip:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-1px); }
.tool-chip b { display: block; font-size: 14px; margin-bottom: 3px; }
.tool-chip span { font-size: 12px; color: var(--ink-3); }

/* ---------- 二维码 ---------- */
.qr-stage { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.qr-preview {
  width: 320px; height: 320px; border-radius: 20px; background: #fff;
  border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.qr-preview canvas, .qr-preview img { max-width: 100%; max-height: 100%; }
.style-picker { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.style-opt {
  border: 2px solid var(--line); border-radius: 12px; padding: 8px 14px 8px 8px;
  cursor: pointer; display: flex; align-items: center; gap: 8px; background: #fff;
  font-size: 13.5px; font-weight: 600; transition: all .15s; font-family: inherit;
}
.style-opt.active { border-color: var(--primary); background: var(--primary-weak); color: var(--primary-ink); box-shadow: 0 0 0 3px rgba(91,108,255,.12); }
.style-opt .sw { width: 30px; height: 30px; border-radius: 8px; }

/* ---------- 情绪曲线 ---------- */
.mood-chart { width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line); padding: 26px 20px 40px; text-align: center;
  color: var(--ink-3); font-size: 13px; background: #FFFCF6; position: relative;
}
.footer::before { content: ""; position: absolute; top: -1px; left: 0; right: 0; height: 2px; background: var(--grad-warm); opacity: .55; }
.footer a { color: var(--ink-2); }

/* ---------- 其他 ---------- */
.divider { height: 1px; background: var(--line); margin: 22px 0; }
.kbd { background: #f1f2f6; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 1px 7px; font-size: 12.5px; font-family: ui-monospace, monospace; }
.muted { color: var(--ink-3); font-size: 13px; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; } .mb8{margin-bottom:8px;} .mb16 { margin-bottom: 16px; }
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; } .gap8{gap:8px;} .gap12{gap:12px;}
.hidden { display: none !important; }
.doc-item { display: flex; align-items: center; justify-content: space-between; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; background: #fff; }
.doc-item b { font-size: 14px; }
.doc-item .muted { font-size: 12px; }
.file-drop {
  border: 2px dashed var(--line); border-radius: 12px; padding: 30px; text-align: center;
  color: var(--ink-2); cursor: pointer; transition: all .15s; background: #fff;
}
.file-drop:hover, .file-drop.drag { border-color: var(--primary); background: var(--primary-weak); box-shadow: 0 0 0 4px rgba(91,108,255,.08); }

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  .nav-inner { padding: 0 14px; }
  .nav-links { gap: 0; }
  .nav-links a { padding: 6px 9px; font-size: 13.5px; }
  .hero { padding: 40px 0 24px; }
  .wrap { padding: 22px 16px 64px; }
  .searchbox { margin-top: 20px; border-radius: 14px; }
  .grid-tools { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .tool-card .icon { width: 40px; height: 40px; font-size: 20px; }
}
