/* ====================================================
   蜗牛AI · 主题样式
   主色：靛蓝 #4f46e5
   辅助：浅蓝 #dbeafe
   背景：浅蓝 + 白色
   ==================================================== */

/* -------- 全局 -------- */
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: #1f2330;
  background: #f8fafc;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}

/* 整体背景：清爽的蓝色调 */
body {
  background:
    radial-gradient(ellipse at top left, #dbeafe 0%, #f8fafc 50%, #f8fafc 100%);
  min-height: 100vh;
}

h1, h2, h3, h4 { margin: 0; font-weight: 700; color: #0f172a; letter-spacing: -.2px; }
h1 { font-size: 36px; line-height: 1.2; }
h2 { font-size: 22px; }
h3 { font-size: 15px; }
p  { margin: 0; }
a  { color: #4f46e5; text-decoration: none; }
a:hover { color: #4338ca; text-decoration: underline; }
muted, .muted { color: #475569; opacity: 0.85; }
.small { font-size: 12px; }

::selection { background: #c7d2fe; color: #1e1b4b; }

/* -------- 顶部导航 -------- */
.topnav {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 30;
}
.topnav-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}
.brand-logo {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: #eff6ff;
  display: flex; align-items: center; justify-content: center;
  padding: 4px;
}
.brand-title { font-size: 15px; font-weight: 700; color: #0f172a; letter-spacing: 0.3px; }
.brand-sub   { font-size: 11px; color: #94a3b8; margin-top: 2px; }

.nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1 1 auto;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.nav-item {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  color: #64748b;
  text-decoration: none;
  transition: color .12s ease, background .12s ease;
  white-space: nowrap;
  font-weight: 500;
  position: relative;
}
.nav-item:hover { background: #f1f5f9; color: #0f172a; text-decoration: none; }
.nav-item.active {
  color: #4f46e5;
  background: #eef2ff;
  font-weight: 600;
}

/* -------- 主内容区 -------- */
.content {
  padding: 44px 24px 64px;
  max-width: 1160px;
  width: 100%;
  margin: 0 auto;
}

/* -------- 面板切换 -------- */
.panel { display: none; animation: fade .18s ease; }
.panel.active { display: block; }
@keyframes fade {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.panel-head {
  text-align: center;
  margin-bottom: 28px;
}
.panel-head h2 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.4px;
  margin-bottom: 10px;
  color: #0f172a;
}
.panel-head p { color: #64748b; opacity: 0.85; font-size: 13.5px; }

/* -------- Hero 首页带蜗牛装饰 -------- */
.hero {
  position: relative;
  text-align: center;
  padding: 52px 20px 32px;
  background: linear-gradient(135deg, #f8fafc 0%, #dbeafe 50%, #fff 100%);
  border-radius: 24px;
  overflow: hidden;
  border: 2px solid #bfdbfe;
}

/* 大蜗牛装饰 */
.hero-snail-decor {
  position: absolute;
  opacity: 0.5;
  pointer-events: none;
}
.hero-snail-decor {
  top: 30px;
  left: 40px;
  animation: snailWalk 8s ease-in-out infinite;
}
.hero-snail-decor-2 {
  top: auto;
  left: auto;
  bottom: 20px;
  right: 60px;
  animation-delay: -3s;
  animation: snailWalk 10s ease-in-out infinite;
}

@keyframes snailWalk {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(3deg); }
}

.hero-chip {
  display: inline-block;
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  color: #1e40af;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .3px;
  margin-bottom: 18px;
  border: 1.5px solid #93c5fd;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.hero-title {
  font-size: 38px;
  line-height: 1.3;
  margin-bottom: 14px;
  font-weight: 800;
  letter-spacing: -.6px;
  color: #0f172a;
}

.hero-title .grad {
  background: linear-gradient(90deg, #4f46e5, #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-lead {
  max-width: 560px;
  margin: 0 auto 24px;
  font-size: 14.5px;
  color: #475569;
  opacity: 0.9;
  line-height: 1.8;
}

.hero-actions {
  display: inline-flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 20px;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 2px dashed #bfdbfe;
}
.hero-stats strong {
  display: block;
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}
.hero-stats span { font-size: 12px; color: #64748b; }

/* -------- 功能卡片网格 -------- */
.feature-grid {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.feature-card {
  background: #ffffff;
  border: 2px solid #bfdbfe;
  border-radius: 18px;
  padding: 22px;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.feature-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 40px; height: 40px;
  background: radial-gradient(circle at top right, #dbeafe 0%, transparent 70%);
  opacity: 0.6;
  border-radius: 0 18px 0 0;
  pointer-events: none;
}
.feature-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 12px 28px rgba(79, 70, 229, 0.12);
  transform: translateY(-2px);
}
.feature-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  color: #1e3a8a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-bottom: 14px;
  font-weight: 700;
}
.feature-tag {
  display: inline-block;
  background: #bbf7d0;
  color: #065f46;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .5px;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.feature-card h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
  color: #0f172a;
}
.feature-card p {
  font-size: 13px;
  color: #334155;
  opacity: 0.9;
  line-height: 1.7;
  margin-top: 6px;
}
.feature-card ul {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  font-size: 12.5px;
  color: #475569;
  line-height: 1.8;
  opacity: 0.9;
}
.feature-card li::before {
  content: "🐌";
  margin-right: 8px;
  opacity: 0.7;
}

/* -------- 工作区卡片（通用） -------- */
.workspace {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 8px;
}

.card {
  background: #ffffff;
  border: 2px solid #bfdbfe;
  border-radius: 18px;
  padding: 24px 26px;
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.06);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.card-head-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}
.card-head-sub {
  font-size: 12.5px;
  color: #64748b;
  opacity: 0.85;
  margin-top: 4px;
}

/* -------- pill 选择器 -------- */
.voice-filter {
  display: grid;
  grid-template-columns: 80px 1fr;
  align-items: start;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 2px dashed #bfdbfe;
}
.voice-filter:last-of-type { border-bottom: none; }
.voice-filter.hidden { display: none; }
.voice-filter-label {
  font-size: 13px;
  color: #1e3a8a;
  font-weight: 600;
  padding-top: 8px;
  white-space: nowrap;
}
.voice-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.voice-pill {
  border: 2px solid #bfdbfe;
  background: #f8fafc;
  color: #1e3a8a;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  transition: all .15s ease;
  line-height: 1.3;
}
.voice-pill:hover { border-color: #93c5fd; color: #1e3a8a; background: #dbeafe; }
.voice-pill.active {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  border-color: #4f46e5;
  color: #fff;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.25);
  font-weight: 600;
}
.voice-pill.is-empty {
  opacity: .4;
  cursor: not-allowed;
}
.voice-pill.is-empty:hover {
  background: #f8fafc;
  color: #1e3a8a;
  opacity: .4;
}

/* 当前音色预览卡片 */
.voice-current {
  margin-top: 20px;
  padding: 20px 24px;
  background: linear-gradient(135deg, #dbeafe 0%, #f8fafc 100%);
  border: 2px solid #bfdbfe;
  border-radius: 16px;
  position: relative;
  overflow: hidden;
}
.voice-current::before {
  content: '🐌';
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 48px;
  opacity: 0.15;
}
.voice-current-name {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 10px;
}
.voice-current-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.voice-current-tags .tag {
  display: inline-block;
  padding: 4px 12px;
  background: #fff;
  border: 1.5px solid #bfdbfe;
  color: #1e3a8a;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}
.voice-current-desc {
  font-size: 13px;
  color: #334155;
  opacity: 0.85;
  line-height: 1.6;
}

/* -------- 音色卡片网格 -------- */
.voice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 8px;
}
.voice-card {
  background: #ffffff;
  border: 2px solid #bfdbfe;
  border-radius: 14px;
  padding: 14px 18px;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.voice-card:hover { background: #f8fafc; border-color: #93c5fd; }
.voice-card-selected {
  background: #dbeafe;
  border-color: #4f46e5;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.12);
}
.voice-name {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 8px;
}
.voice-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.tag {
  display: inline-block;
  font-size: 11.5px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1e3a8a;
  font-weight: 500;
  border: 1px solid #bfdbfe;
}
.voice-summary {
  margin-top: 12px;
  background: #f8fafc;
  border: 2px solid #bfdbfe;
  color: #334155;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 13px;
}

/* -------- 表单元素（统一专业风格） -------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}
.field label {
  font-size: 13px;
  color: #1e3a8a;
  font-weight: 600;
}
.field-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.field-row .field { margin-bottom: 0; }

textarea,
input[type=text],
input[type=number],
select {
  width: 100%;
  border: 2px solid #bfdbfe;
  background: #f8fafc;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 14px;
  color: #0f172a;
  font-family: inherit;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
  outline: none;
}
textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.7;
}
textarea:focus,
input:focus,
select:focus {
  border-color: #4f46e5;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.10);
}

/* JSON 工具：大输入输出框 + 等宽字体 */
#json-input, #json-output,
#json-diff-a, #json-diff-b {
  width: 100%;
  min-height: 600px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, Monaco, monospace;
  font-size: 13px;
  line-height: 1.8;
  tab-size: 2;
  color: #0f172a;
  border: 2px solid #bfdbfe;
  border-radius: 12px;
  padding: 14px 16px;
  resize: vertical;
  box-sizing: border-box;
}
#json-input:focus, #json-diff-a:focus, #json-diff-b:focus { border-color: #4f46e5; box-shadow: 0 0 0 4px rgba(79,70,229,.10); outline: none; }
#json-output { background: #f8fafc; }

/* 隐藏原生 file input */
input[type=file] {
  position: absolute;
  opacity: 0;
  width: 1px; height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* 字数统计 */
.input-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #64748b;
  opacity: 0.85;
  margin-top: 4px;
}
.input-meta .count { font-weight: 600; }
.input-meta .count.over { color: #ef4444; }

.lang-hint {
  display: none;
  margin-top: 8px;
  padding: 8px 12px;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  color: #92400e;
  font-size: 13px;
  line-height: 1.5;
}

/* 文件上传区 */
.upload-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px 20px;
  border: 2.5px dashed #93c5fd;
  border-radius: 18px;
  background: #f8fafc;
  color: #1e3a8a;
  font-size: 13.5px;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
  text-align: center;
  user-select: none;
  margin-top: 8px;
}
.upload-drop:hover, .upload-drop.hover {
  border-color: #4f46e5;
  background: #dbeafe;
  color: #1e3a8a;
}
.upload-icon {
  width: 56px; height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  color: #4f46e5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 6px;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
}
.file-selected {
  margin-top: 10px;
  padding: 6px 14px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1e3a8a;
  font-size: 12px;
  font-weight: 500;
  border: 1.5px solid #bfdbfe;
}

/* -------- 按钮 -------- */
.actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.btn {
  background: #ffffff;
  border: 2px solid #bfdbfe;
  color: #1e3a8a;
  border-radius: 12px;
  padding: 10px 20px;
  cursor: pointer;
  font-size: 13.5px;
  font-family: inherit;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .12s ease, box-shadow .15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn:hover { background: #dbeafe; border-color: #93c5fd; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  border: none;
  color: #fff;
  padding: 12px 28px;
  font-size: 14.5px;
  font-weight: 600;
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(79, 70, 229, 0.25);
  letter-spacing: .2px;
}
.btn.primary:hover { filter: brightness(1.05); box-shadow: 0 14px 28px rgba(79, 70, 229, 0.30); }
.btn.primary .arrow { opacity: .85; margin-left: 2px; }
.btn.block { width: 100%; justify-content: center; }
.btn.ghost {
  background: #ffffff;
  border-color: #bfdbfe;
}
.btn.ghost:hover { background: #f8fafc; }

/* -------- TTS 音频区 -------- */
.tts-audio-wrap {
  margin-top: 14px;
  background: #f8fafc;
  border: 2px solid #bfdbfe;
  border-radius: 14px;
  padding: 14px 18px;
  position: relative;
}
.tts-audio-wrap::before {
  content: '🎵';
  position: absolute;
  top: 14px;
  right: 18px;
  opacity: 0.4;
  font-size: 20px;
}
.tts-audio-wrap audio { width: 100%; margin-top: 6px; }

/* -------- JSON 工具 -------- */
.op-groups {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 18px;
  padding: 6px 8px;
  background: #f8fafc;
  border-radius: 10px;
}
.op-btn {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 12px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  color: #475569;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  transition: all .12s ease;
  white-space: nowrap;
}
.op-btn:hover { background: #ffffff; border-color: #e2e8f0; color: #0f172a; }
.op-btn.active {
  background: #ffffff;
  border-color: #4f46e5;
  color: #4f46e5;
  box-shadow: 0 1px 2px rgba(79, 70, 229, 0.08);
}
.op-icon {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
  opacity: 0.85;
}
.op-btn.active .op-icon { color: #4f46e5; opacity: 1; }

/* 输入输出并排 */
.json-io {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 768px) {
  .json-io { grid-template-columns: 1fr; }
}
.json-io-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.json-io-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.json-io-head label {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}
.json-io-actions {
  display: flex;
  gap: 4px;
}
.mini-btn {
  padding: 3px 9px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 12px;
  color: #64748b;
  cursor: pointer;
  font-family: inherit;
  transition: all .12s ease;
  white-space: nowrap;
  font-weight: 500;
}
.mini-btn:hover { background: #f1f5f9; color: #0f172a; }
.mini-btn:active { background: #e2e8f0; }
.json-count {
  font-size: 11px;
  color: #94a3b8;
  text-align: right;
  padding-right: 2px;
}

/* JSON 树形高亮展示 */
.json-tree {
  width: 100%;
  min-height: 600px;
  max-height: 800px;
  overflow: auto;
  border: 2px solid #bfdbfe;
  border-radius: 12px;
  padding: 14px 16px;
  background: #0f172a;
  color: #e2e8f0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, Monaco, monospace;
  font-size: 13px;
  line-height: 1.9;
  box-sizing: border-box;
}
.json-tree::-webkit-scrollbar { width: 10px; height: 10px; }
.json-tree::-webkit-scrollbar-track { background: transparent; }
.json-tree::-webkit-scrollbar-thumb { background: #334155; border-radius: 6px; }

.json-row {
  display: block;
}
.json-row.is-parent > .json-children {
  display: block;
  padding-left: 22px;
}
.json-row.is-parent.collapsed > .json-children {
  display: none;
}
.json-row.is-parent.collapsed > .json-hint {
  display: none;
}
.json-row.is-parent.collapsed > .json-summary {
  display: block;
}
.json-row.is-parent:not(.collapsed) > .json-summary {
  display: none;
}

.json-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  margin-right: 4px;
  color: #64748b;
  cursor: pointer;
  user-select: none;
  font-size: 8px;
  border-radius: 3px;
  transition: transform .12s ease;
  background: transparent;
  border: none;
  padding: 0;
  vertical-align: middle;
  flex-shrink: 0;
}
.json-toggle:hover { background: #1e293b; color: #cbd5e1; }
.json-row.collapsed > .json-toggle { transform: rotate(-90deg); }

.json-summary {
  display: none;
  color: #64748b;
  font-size: 11px;
  font-weight: 500;
  padding: 1px 6px;
  margin-left: 2px;
  background: #1e293b;
  border-radius: 4px;
  vertical-align: middle;
}
.json-summary:hover { background: #334155; color: #cbd5e1; }

.json-k { color: #93c5fd; }
.json-colon { color: #64748b; margin: 0 3px; }
.json-str { color: #86efac; }
.json-num { color: #fbbf24; }
.json-bool { color: #f472b6; }
.json-null { color: #a78bfa; }
.json-brace { color: #60a5fa; }
.json-comma { color: #475569; }
.json-hint { font-size: 11px; color: #475569; margin-left: 4px; }

/* -------- Diff 工具 -------- */
.diff-container {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.diff-row {
  display: grid;
  grid-template-columns: 48px 1fr 1fr;
  border-bottom: 1px solid #f1f5f9;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, Monaco, monospace;
  font-size: 13px;
  line-height: 1.7;
}
.diff-row:last-child { border-bottom: none; }
.diff-lineno {
  padding: 6px 8px;
  text-align: right;
  color: #94a3b8;
  font-size: 12px;
  background: #f8fafc;
  border-right: 1px solid #e2e8f0;
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.diff-cell {
  padding: 6px 12px;
  white-space: pre-wrap;
  word-break: break-all;
  position: relative;
  min-height: 28px;
  color: #334155;
}
.diff-cell:nth-of-type(3) { border-left: 1px solid #f1f5f9; }

.diff-equal .diff-cell { background: #ffffff; color: #94a3b8; }
.diff-modified .diff-cell:nth-of-type(2) { background: #fef2f2; }
.diff-modified .diff-cell:nth-of-type(3) { background: #f0fdf4; }
.diff-added .diff-cell:nth-of-type(2) { background: #f8fafc; color: #cbd5e1; }
.diff-added .diff-cell:nth-of-type(3) { background: #f0fdf4; }
.diff-removed .diff-cell:nth-of-type(2) { background: #fef2f2; }
.diff-removed .diff-cell:nth-of-type(3) { background: #f8fafc; color: #cbd5e1; }

.diff-cell .diff-char-del {
  background: #fecaca;
  color: #991b1b;
  border-radius: 2px;
  padding: 0 1px;
}
.diff-cell .diff-char-add {
  background: #bbf7d0;
  color: #166534;
  border-radius: 2px;
  padding: 0 1px;
}

.diff-summary {
  display: flex;
  gap: 14px;
  font-size: 12.5px;
  color: #475569;
  margin-top: 8px;
  padding: 8px 12px;
  background: #f8fafc;
  border-radius: 8px;
}
.diff-summary .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}
.diff-summary .dot.del { background: #ef4444; }
.diff-summary .dot.add { background: #22c55e; }
.diff-summary .dot.mod { background: #f59e0b; }

.diff-json-node {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, Monaco, monospace;
  font-size: 13px;
  padding: 8px 12px;
  border-bottom: 1px solid #f1f5f9;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: start;
}
.diff-json-node:last-child { border-bottom: none; }
.diff-json-node .dj-key {
  color: #475569;
  font-weight: 500;
  min-width: 120px;
}
.diff-json-node .dj-a,
.diff-json-node .dj-b {
  padding: 4px 10px;
  border-radius: 6px;
  white-space: pre-wrap;
  word-break: break-all;
  font-size: 12.5px;
}
.diff-json-node .dj-status {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 10px;
  white-space: nowrap;
}
.dj-status.same { background: #f1f5f9; color: #64748b; }
.dj-status.changed { background: #fef3c7; color: #b45309; }
.dj-status.added { background: #dcfce7; color: #166534; }
.dj-status.removed { background: #fee2e2; color: #991b1b; }
.diff-json-node .dj-a { background: #fef2f2; }
.diff-json-node .dj-b { background: #f0fdf4; }

/* -------- 博客文章卡片 -------- */
.posts {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.post {
  background: #ffffff;
  border: 2px solid #bfdbfe;
  border-radius: 18px;
  padding: 22px 26px;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}
.post::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #6366f1, #4f46e5);
  border-radius: 4px 0 0 4px;
}
.post:hover {
  border-color: #93c5fd;
  transform: translateY(-1px);
  box-shadow: 0 12px 30px -10px rgba(79, 70, 229, 0.15);
}
.post-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 12px;
}
.post h3 {
  margin: 0 0 10px;
  color: #0f172a;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.5;
}
.post .meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  color: #64748b;
  font-size: 12.5px;
  margin-bottom: 14px;
  opacity: 0.9;
}
.post .meta-time::before { content: '🐌 '; }
.post-content {
  color: #334155;
  font-size: 14px;
  line-height: 1.8;
  background: #f8fafc;
  border-radius: 12px;
  padding: 14px 18px;
  white-space: pre-wrap;
  word-break: break-word;
  opacity: 0.9;
}
.post-empty {
  text-align: center;
  padding: 40px 20px;
  color: #64748b;
  font-size: 14px;
}
.post-empty-icon {
  font-size: 32px;
  margin-bottom: 12px;
  opacity: 0.6;
}

/* -------- 音色克隆 Tab 切换 -------- */
.tab-switch {
  display: inline-flex;
  background: #f8fafc;
  border: 2px solid #bfdbfe;
  border-radius: 14px;
  padding: 4px;
  margin: 12px 0 16px;
  gap: 4px;
}
.tab-switch .tab-btn {
  padding: 8px 18px;
  border: none;
  background: transparent;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s ease;
}
.tab-switch .tab-btn:hover { color: #1e3a8a; }
.tab-switch .tab-btn.active {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}
.tab-content { display: none; }
.tab-content.active { display: block; }

/* -------- 预设特色音色 -------- */
.preset-voices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin: 8px 0;
}
.preset-voice-item {
  background: #ffffff;
  border: 2px solid #bfdbfe;
  border-radius: 14px;
  padding: 14px 12px;
  cursor: pointer;
  text-align: center;
  transition: all .15s ease;
}
.preset-voice-item:hover {
  border-color: #93c5fd;
  background: #f8fafc;
  transform: translateY(-1px);
}
.preset-voice-item.selected {
  border-color: #4f46e5;
  background: linear-gradient(135deg, #eef2ff, #e0e7ff);
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.15);
}
.preset-voice-icon {
  font-size: 28px;
  margin-bottom: 6px;
}
.preset-voice-name {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
}
.preset-voice-desc {
  font-size: 11px;
  color: #64748b;
  margin-top: 3px;
}

.full-input {
  width: 100%;
  border: 2px solid #bfdbfe;
  background: #f8fafc;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 14px;
  color: #0f172a;
  font-family: inherit;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
  outline: none;
}
.full-input:focus {
  border-color: #4f46e5;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.10);
}

/* -------- 下拉选择框样式 -------- */
select.full-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234f46e5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  padding-right: 40px;
  cursor: pointer;
  font-size: 14px;
  color: #0f172a;
}
select.full-input:focus {
  border-color: #4f46e5;
  background-color: #ffffff;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.10);
}
select.full-input option {
  padding: 8px 12px;
  font-size: 13px;
}

/* -------- 响应式 -------- */
@media (max-width: 980px) {
  .topnav-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 12px 16px;
  }
  .nav { justify-content: flex-start; }
  .nav-item { font-size: 12.5px; padding: 7px 12px; }
  .topnav-right { justify-content: flex-start; }
  .content { padding: 24px 16px 48px; }
  .hero { padding: 32px 10px 16px; }
  .hero-title { font-size: 28px; }
  .feature-grid { margin-top: 24px; }
  .field-row { grid-template-columns: 1fr 1fr; }
  .voice-filter { grid-template-columns: 80px 1fr; gap: 12px; }
}

/* -------- 底部申明 -------- */
.site-footer {
  border-top: 2px solid #bfdbfe;
  background: #ffffff;
  padding: 22px 24px 28px;
  margin-top: 48px;
  position: relative;
}
.footer-inner {
  max-width: 1160px;
  margin: 0 auto;
  position: relative;
}
.footer-snail {
  position: absolute;
  top: -18px;
  right: 10px;
  opacity: 0.6;
}
.footer-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 13px;
  color: #64748b;
  opacity: 0.9;
}
.footer-brand-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: #0f172a;
}
.brand-sep { color: #93c5fd; font-weight: 400; }
.footer-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.footer-right a { color: #4f46e5; text-decoration: none; font-weight: 500; }
.footer-right a:hover { text-decoration: underline; }
.footer-right .sep { color: #93c5fd; }
@media (max-width: 980px) {
  .site-footer { padding: 16px 20px 20px; }
  .footer-line { flex-direction: column; align-items: flex-start; }
  .footer-snail { right: 10px; top: -14px; }
}

/* ============== 博客改版样式 ============== */
.blog-toolbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
  padding: 16px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
}
/* 顶部一行：搜索框 + 排序 */
.blog-search-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  width: 100%;
}
.blog-search-box {
  position: relative;
  flex: 1;
  min-width: 280px;
  display: flex;
  align-items: center;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #f9fafb;
  padding: 0 12px;
  height: 42px;
  transition: all .15s;
}
.blog-search-box:focus-within {
  border-color: #6366f1;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.blog-search-icon {
  color: #9ca3af;
  margin-right: 8px;
  flex-shrink: 0;
}
#blog-search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
  color: #1f2937;
  padding: 4px 0;
  height: 100%;
}
#blog-search-input::placeholder { color: #9ca3af; }
.blog-search-submit {
  background: #4f46e5;
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 500;
  transition: background .15s;
  margin-left: 8px;
}
.blog-search-submit:hover { background: #4338ca; }
.blog-search-clear {
  display: none;
  background: transparent;
  border: none;
  color: #9ca3af;
  width: 24px;
  height: 24px;
  cursor: pointer;
  border-radius: 50%;
  font-size: 13px;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
}
.blog-search-clear:hover { background: #e5e7eb; color: #4b5563; }
#blog-search-input:not(:placeholder-shown) ~ .blog-search-clear {
  display: inline-flex;
}

/* 搜索结果提示 */
.blog-search-tip {
  font-size: 13px;
  color: #4f46e5;
  padding: 6px 10px;
  background: #eef2ff;
  border-radius: 6px;
}
.blog-search-tip .st-reset {
  margin-left: 8px;
  cursor: pointer;
  color: #7c3aed;
  text-decoration: underline;
}

.blog-sort { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.blog-sort .muted { font-size: 13px; color: #6b7280; }
.sort-btn {
  padding: 5px 12px;
  font-size: 13px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  color: #4b5563;
  cursor: pointer;
  transition: all .15s;
}
.sort-btn:hover { border-color: #6366f1; color: #4f46e5; }
.sort-btn.active { background: #4f46e5; color: #fff; border-color: #4f46e5; }

.blog-tag-filter {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  width: 100%;
}
.blog-tag-filter .muted { font-size: 13px; color: #6b7280; flex-shrink: 0; }
.tag-btn {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #4b5563;
  cursor: pointer;
  transition: all .15s;
}
.tag-btn em { font-style: normal; color: #9ca3af; font-size: 11px; margin-left: 3px; }
.tag-btn:hover { border-color: #6366f1; color: #4f46e5; }
.tag-btn.active { background: #6366f1; color: #fff; border-color: #6366f1; }
.tag-btn.active em { color: #c7d2fe; }

/* 文章卡片 */
.post-card {
  display: flex;
  gap: 16px;
  padding: 20px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  margin-bottom: 14px;
  transition: box-shadow .2s, transform .2s;
}
.post-card:hover { box-shadow: 0 4px 14px rgba(79,70,229,0.08); transform: translateY(-1px); }
.post-cover { flex: 0 0 180px; }
.post-cover img { width: 100%; height: 120px; object-fit: cover; border-radius: 8px; }
.post-body { flex: 1; min-width: 0; }
.post-title { font-size: 18px; font-weight: 600; margin: 0 0 8px; }
.post-title a { color: #1f2937; text-decoration: none; }
.post-title a:hover { color: #4f46e5; }
.post-summary {
  font-size: 14px; color: #6b7280; line-height: 1.6;
  margin: 0 0 10px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-meta {
  display: flex; flex-wrap: wrap; gap: 14px;
  font-size: 12px; color: #6b7280;
  margin-bottom: 8px;
}
.post-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-chip {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  background: #eef2ff;
  color: #4338ca;
  border-radius: 999px;
}
.tag-chip.vtag { background: #fef3c7; color: #92400e; }
.post-score {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  border-radius: 6px;
  font-weight: 600;
}
.post-score.high { background: #dcfce7; color: #166534; }
.post-score.mid  { background: #fef3c7; color: #92400e; }
.post-score.low  { background: #fee2e2; color: #991b1b; }

/* 文章卡片内分类 */
.post-title-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 4px;
}
.post-cat {
  flex: 0 0 auto;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 600;
  background: #eef2ff;
  color: #4338ca;
  border-radius: 6px;
}

/* AI 指标面板 - 文章详情页 */
.post-ai-panel {
  margin: 18px 0 24px;
  padding: 20px;
  border-radius: 14px;
  background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
  border: 1px solid #e0e7ff;
}
.ai-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 16px;
}
.ai-metric {
  background: #fff;
  border-radius: 10px;
  padding: 14px;
  border: 1px solid #e5e7eb;
}
.ai-label {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 6px;
  font-weight: 500;
}
.ai-val {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  color: #1f2937;
  margin-bottom: 8px;
}
.ai-val em {
  font-style: normal;
  font-size: 14px;
  color: #9ca3af;
  font-weight: 500;
}
.ai-metric.score.high .ai-val { color: #16a34a; }
.ai-metric.score.mid  .ai-val { color: #d97706; }
.ai-metric.score.low  .ai-val { color: #dc2626; }
.ai-metric.ori.high .ai-val   { color: #16a34a; }
.ai-metric.ori.mid  .ai-val   { color: #d97706; }
.ai-metric.ori.low  .ai-val   { color: #dc2626; }
.ai-metric.ai.high  .ai-val   { color: #16a34a; }
.ai-metric.ai.mid   .ai-val   { color: #d97706; }
.ai-metric.ai.low   .ai-val   { color: #dc2626; }
.ai-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.ai-tags span {
  padding: 2px 6px;
  font-size: 10px;
  background: #fef3c7;
  color: #92400e;
  border-radius: 4px;
}
.ai-tags span.muted {
  background: #f3f4f6;
  color: #9ca3af;
}
.ai-bar {
  height: 6px;
  background: #f3f4f6;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px;
}
.ai-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #4f46e5);
  border-radius: 999px;
}
.ai-cat {
  display: inline-block;
  margin-top: 2px;
  padding: 4px 14px;
  background: #4f46e5;
  color: #fff;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
}

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

@media (max-width: 640px) {
  .post-card { flex-direction: column; }
  .post-cover { flex: none; }
  .post-cover img { height: 160px; }
  .post-title-row { align-items: flex-start; }
}

/* 分页器 */
.blog-pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin: 24px 0;
  flex-wrap: wrap;
}
.page-btn {
  min-width: 32px; height: 32px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #4b5563;
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
}
.page-btn:hover:not(.disabled):not(.active) { border-color: #6366f1; color: #4f46e5; }
.page-btn.active { background: #4f46e5; color: #fff; border-color: #4f46e5; }
.page-btn.disabled { opacity: .4; cursor: not-allowed; }
.page-ellipsis { color: #9ca3af; padding: 0 4px; }

/* 返回按钮 */
.blog-back-btn {
  display: inline-block;
  padding: 6px 14px;
  margin-bottom: 16px;
  font-size: 13px;
  color: #4f46e5;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  cursor: pointer;
  transition: all .15s;
}
.blog-back-btn:hover { background: #6366f1; color: #fff; }

/* 文章详情 */
.post-detail {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  padding: 32px 36px;
  max-width: 880px;
  margin: 0 auto;
}
.post-detail-head { margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid #f3f4f6; }
.post-detail-head h1 { font-size: 28px; font-weight: 700; margin: 0 0 12px; color: #111827; line-height: 1.4; }
.post-detail .post-meta { font-size: 13px; gap: 18px; }

/* Markdown 正文样式 */
.markdown-body { color: #374151; line-height: 1.8; font-size: 15px; }
.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 {
  color: #111827; margin: 24px 0 12px; line-height: 1.4;
}
.markdown-body h1 { font-size: 24px; padding-bottom: 8px; border-bottom: 1px solid #e5e7eb; }
.markdown-body h2 { font-size: 20px; }
.markdown-body h3 { font-size: 17px; }
.markdown-body p { margin: 12px 0; }
.markdown-body ul, .markdown-body ol { padding-left: 24px; margin: 12px 0; }
.markdown-body li { margin: 4px 0; }
.markdown-body blockquote {
  border-left: 4px solid #6366f1;
  padding: 8px 16px;
  margin: 16px 0;
  color: #6b7280;
  background: #f5f3ff;
  border-radius: 0 8px 8px 0;
}
.markdown-body pre {
  background: #1f2937;
  color: #f3f4f6;
  padding: 16px 20px;
  border-radius: 10px;
  overflow-x: auto;
  margin: 16px 0;
  font-size: 13px;
  line-height: 1.6;
}
.markdown-body pre code { background: none; padding: 0; color: inherit; }
.markdown-body code {
  background: #f3f4f6;
  color: #be185d;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: 'JetBrains Mono', Consolas, Monaco, monospace;
}
.markdown-body a { color: #4f46e5; text-decoration: none; border-bottom: 1px solid #c7d2fe; }
.markdown-body a:hover { border-bottom-color: #4f46e5; }
.markdown-body img { max-width: 100%; border-radius: 8px; margin: 12px 0; }
.markdown-body table {
  border-collapse: collapse; width: 100%; margin: 16px 0; font-size: 14px;
}
.markdown-body th, .markdown-body td {
  border: 1px solid #e5e7eb; padding: 8px 12px; text-align: left;
}
.markdown-body th { background: #f9fafb; font-weight: 600; }
.markdown-body hr { border: none; border-top: 1px solid #e5e7eb; margin: 24px 0; }
.markdown-body .mermaid {
  text-align: center; margin: 16px auto; padding: 16px;
  background: #fff; border-radius: 12px;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
  border: 1px solid #e5e7eb;
  max-width: 100%;
  display: block;
}
.markdown-body .mermaid svg { max-width: 100%; height: auto; }
.markdown-body img[alt="PlantUML"],
.markdown-body img[alt="plantuml"] {
  max-width: 100%;
  display: block;
  margin: 16px auto;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
  border: 1px solid #e5e7eb;
  padding: 8px;
  background: #fff;
}
.markdown-body img[alt="图表"] {
  max-width: 100%;
  display: block;
  margin: 16px auto;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
  border: 1px solid #e5e7eb;
}

@media (max-width: 640px) {
  .post-detail { padding: 20px 16px; }
  .post-detail-head h1 { font-size: 22px; }
  .markdown-body { font-size: 14px; }
}

/* ========== AI 资讯 ========== */
.news-layout {
  display: grid; grid-template-columns: 1fr 280px; gap: 20px;
  align-items: flex-start;
}
.news-main { min-width: 0; }
.news-side-title {
  margin: 0 0 12px; font-size: 14px; font-weight: 700; color: #1e293b;
}
.news-cat-filter { display: flex; flex-wrap: wrap; gap: 6px; }
.news-cat-btn {
  border: 1px solid #e2e8f0; background: #fff; color: #64748b;
  padding: 5px 14px; border-radius: 16px; font-size: 12px;
  cursor: pointer; transition: all .15s ease;
}
.news-cat-btn:hover { border-color: #c7d2fe; color: #4f46e5; }
.news-cat-btn.active { background: #4f46e5; border-color: #4f46e5; color: #fff; }
.news-sort { display: flex; gap: 6px; }
.news-sort-btn {
  border: 1px solid #e2e8f0; background: #fff; color: #64748b;
  padding: 5px 14px; border-radius: 16px; font-size: 12px;
  cursor: pointer; transition: all .15s ease;
}
.news-sort-btn:hover { border-color: #c7d2fe; color: #4f46e5; }
.news-sort-btn.active { background: #4f46e5; border-color: #4f46e5; color: #fff; }

.news-list { display: flex; flex-direction: column; gap: 10px; }
.news-item {
  display: flex; gap: 14px; align-items: flex-start;
  background: #fff; border: 1px solid #f1f5f9; border-radius: 12px;
  padding: 12px 14px; text-decoration: none; color: inherit;
  transition: all .15s ease;
}
.news-item:hover {
  border-color: #c7d2fe; box-shadow: 0 4px 14px rgba(79,70,229,.08);
  transform: translateY(-1px);
}
.news-item-img {
  width: 140px; height: 90px; object-fit: cover; border-radius: 8px;
  flex-shrink: 0; background: #f1f5f9;
}
.news-item-body { flex: 1; min-width: 0; }
.news-item-title {
  margin: 0 0 6px; font-size: 15px; font-weight: 600; color: #1e293b;
  line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-item-summary {
  margin: 0 0 8px; font-size: 13px; color: #64748b; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-item-meta {
  display: flex; gap: 12px; font-size: 11px; color: #94a3b8;
}
.news-item-stars { color: #f59e0b; font-weight: 600; }
.news-item-views { color: #64748b; }

.news-empty {
  padding: 40px 20px; text-align: center; color: #94a3b8; font-size: 13px;
}
.news-pager { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; justify-content: center; }
.news-pager-btn {
  border: 1px solid #e2e8f0; background: #fff; color: #475569;
  padding: 4px 12px; border-radius: 6px; font-size: 12px; cursor: pointer;
  transition: all .15s ease;
}
.news-pager-btn:hover { border-color: #c7d2fe; color: #4f46e5; }
.news-pager-btn.active { background: #4f46e5; border-color: #4f46e5; color: #fff; }

.news-hot-list { list-style: none; padding: 0; margin: 0; }
.news-hot-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 0; border-bottom: 1px solid #f1f5f9;
}
.news-hot-item:last-child { border-bottom: none; }
.news-hot-item a {
  font-size: 13px; color: #1e293b; text-decoration: none;
  flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.news-hot-item a:hover { color: #4f46e5; }
.news-rank {
  width: 22px; height: 22px; border-radius: 4px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #64748b; background: #f1f5f9;
}
.news-rank-top { background: #4f46e5; color: #fff; }

/* 热榜前三名突出：金/银/铜奖牌 + 高亮卡片 */
.news-hot-top {
  background: linear-gradient(135deg, #fffbeb 0%, #fff 100%);
  border: 1px solid #fde68a;
  border-bottom: 1px solid #fde68a !important;
  border-radius: 10px;
  padding: 9px 10px;
  margin-bottom: 4px;
  box-shadow: 0 2px 8px rgba(245,158,11,.10);
}
.news-hot-top a { font-weight: 700; color: #1e293b; }
.news-rank.news-rank-1 {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #fff; font-size: 13px;
  box-shadow: 0 2px 6px rgba(245,158,11,.45);
}
.news-rank.news-rank-2 {
  width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(135deg, #cbd5e1, #94a3b8);
  color: #fff; font-size: 12px;
  box-shadow: 0 2px 6px rgba(148,163,184,.45);
}
.news-rank.news-rank-3 {
  width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(135deg, #f0a35e, #d97706);
  color: #fff; font-size: 12px;
  box-shadow: 0 2px 6px rgba(217,119,6,.40);
}

@media (max-width: 768px) {
  .news-layout { grid-template-columns: 1fr; }
  .news-side { position: static; }
  .news-item-img { width: 100px; height: 70px; }
}

/* ========== AI 资讯（完整版） ========== */
.news-hero {
  position: relative;
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 50%, #7c3aed 100%);
  border-radius: 16px;
  padding: 36px 40px;
  margin-bottom: 20px;
  overflow: hidden;
  color: #fff;
  display: flex; align-items: center; justify-content: space-between;
}
.news-hero::after {
  content: ''; position: absolute; right: -40px; top: -40px;
  width: 240px; height: 240px; border-radius: 50%;
  background: rgba(255,255,255,0.08);
}
.news-hero-tag {
  font-size: 12px; letter-spacing: 3px; opacity: .8;
  font-weight: 600; margin-bottom: 10px;
}
.news-hero-title { margin: 0 0 8px; font-size: 30px; font-weight: 800; }
.news-hero-sub { margin: 0; font-size: 14px; opacity: .9; }
.news-hero-icon { position: relative; z-index: 1; opacity: .9; }

.news-search-bar {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
}
.news-search-box {
  flex: 1; display: flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
  padding: 9px 14px; color: #94a3b8;
}
.news-search-box input {
  border: none; outline: none; flex: 1; background: transparent;
  font-size: 14px; color: #1e293b;
}
.news-search-btn {
  background: #4f46e5; color: #fff; border: none; border-radius: 10px;
  padding: 9px 22px; font-size: 14px; cursor: pointer; font-weight: 600;
  transition: background .15s ease;
}
.news-search-btn:hover { background: #4338ca; }

.news-date-group { margin-bottom: 22px; }
.news-date-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 700; color: #4f46e5;
  margin-bottom: 12px;
}
.news-date-bar { width: 4px; height: 16px; background: #4f46e5; border-radius: 2px; }

/* 头条大卡片 */
.news-headline {
  display: flex; gap: 18px;
  background: #fff; border: 1px solid #eef2ff; border-radius: 14px;
  padding: 16px; margin-bottom: 12px; text-decoration: none; color: inherit;
  box-shadow: 0 2px 12px rgba(79,70,229,.06);
  transition: all .18s ease;
}
.news-headline:hover {
  box-shadow: 0 6px 22px rgba(79,70,229,.14); transform: translateY(-2px);
  border-color: #c7d2fe;
}
.news-headline-img {
  width: 240px; height: 160px; object-fit: cover; border-radius: 10px;
  flex-shrink: 0; background: #f1f5f9;
}
.news-headline-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.news-headline-tags { margin-bottom: 8px; }
.news-tag-hot {
  display: inline-block; background: linear-gradient(135deg,#f59e0b,#f97316);
  color: #fff; font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 12px;
}
.news-headline-title {
  margin: 0 0 8px; font-size: 19px; font-weight: 700; color: #1e293b; line-height: 1.4;
}
.news-headline-summary {
  margin: 0 0 12px; font-size: 13px; color: #64748b; line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.news-tag-cat {
  display: inline-block; background: #ecfdf5; color: #059669;
  font-size: 11px; padding: 2px 8px; border-radius: 6px; font-weight: 600;
}
.news-item-hot { color: #f97316; font-weight: 600; }

/* 普通资讯卡片调整 */
.news-item { padding: 12px; }
.news-item-img { width: 130px; height: 88px; }

/* 侧栏：日历 + 热榜两张卡片 */
.news-side {
  background: transparent; border: none; padding: 0;
  position: sticky; top: 12px; display: flex; flex-direction: column; gap: 16px;
}
.news-calendar-card, .news-hot-card {
  background: #fff; border: 1px solid #f1f5f9; border-radius: 12px; padding: 16px;
}
.news-cal-picker { display: flex; gap: 6px; margin-bottom: 12px; }
.news-cal-select {
  flex: 1; border: 1px solid #e2e8f0; border-radius: 8px; padding: 6px 8px;
  font-size: 13px; color: #1e293b; background: #fff; outline: none; cursor: pointer;
}
.news-cal-query-btn {
  background: #4f46e5; color: #fff; border: none; border-radius: 8px;
  padding: 6px 14px; font-size: 13px; cursor: pointer; font-weight: 600;
}
.news-cal-query-btn:hover { background: #4338ca; }
.news-cal-weekdays, .news-cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px;
}
.news-cal-weekdays span {
  text-align: center; font-size: 12px; color: #94a3b8; padding: 4px 0;
}
.news-cal-cell {
  text-align: center; font-size: 13px; color: #475569; padding: 7px 0;
  border-radius: 6px; cursor: pointer; transition: all .12s ease;
}
.news-cal-cell:hover { background: #eef2ff; color: #4f46e5; }
.news-cal-blank { cursor: default; }
.news-cal-blank:hover { background: transparent; }
.news-cal-today { background: #eef2ff; color: #4f46e5; font-weight: 700; }
.news-cal-selected { background: #4f46e5 !important; color: #fff !important; font-weight: 700; }
.news-cal-future { color: #cbd5e1; cursor: not-allowed; }
.news-cal-future:hover { background: transparent; color: #cbd5e1; }
.news-cal-clear {
  margin-top: 10px; width: 100%; background: #f1f5f9; border: none;
  color: #64748b; font-size: 12px; padding: 7px; border-radius: 8px; cursor: pointer;
}
.news-cal-clear:hover { background: #e2e8f0; color: #4f46e5; }

.news-hot-head {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px;
}
.news-hot-head .news-side-title { margin: 0; }
.news-hot-update { font-size: 11px; color: #94a3b8; }
.news-hot-stars { color: #f97316; font-size: 11px; font-weight: 600; }

@media (max-width: 768px) {
  .news-hero { padding: 24px 20px; }
  .news-hero-title { font-size: 22px; }
  .news-hero-icon { display: none; }
  .news-layout { grid-template-columns: 1fr; }
  .news-side { position: static; }
  .news-headline { flex-direction: column; gap: 12px; }
  .news-headline-img { width: 100%; height: 180px; }
  .news-item-img { width: 100px; height: 70px; }
  .news-search-bar { flex-wrap: wrap; }
}

/* ========== AI 工具导航 ========== */
.tools-toolbar {
  display: flex; flex-wrap: wrap; gap: 12px;
  align-items: center; margin-bottom: 16px;
}
.tools-search-box {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 20px;
  padding: 5px 12px; width: 240px; flex-shrink: 0;
}
.tools-search-box svg { color: #94a3b8; flex-shrink: 0; }
.tools-search-box input {
  border: none; outline: none; flex: 1; background: transparent;
  font-size: 13px; color: #1e293b;
}
.tools-search-clear {
  border: none; background: transparent; color: #94a3b8;
  cursor: pointer; font-size: 13px; padding: 2px 6px; border-radius: 50%;
}
.tools-search-clear:hover { background: #f1f5f9; color: #475569; }

.tools-cat-filter {
  display: flex; flex-wrap: wrap; gap: 6px; flex: 1;
}
.tools-cat-btn {
  border: 1px solid #e2e8f0; background: #fff; color: #64748b;
  padding: 5px 12px; border-radius: 16px; font-size: 12px;
  cursor: pointer; transition: all .15s ease;
}
.tools-cat-btn:hover { border-color: #c7d2fe; color: #4f46e5; }
.tools-cat-btn.active {
  background: #4f46e5; border-color: #4f46e5; color: #fff;
}

.tools-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
}
.tools-card {
  display: flex; gap: 10px; align-items: center;
  background: #fff; border: 1px solid #f1f5f9; border-radius: 10px;
  padding: 10px 12px; text-decoration: none; color: inherit;
  transition: all .15s ease;
}
.tools-card:hover {
  border-color: #c7d2fe; box-shadow: 0 2px 10px rgba(79,70,229,.08);
  transform: translateY(-1px);
}
.tools-card-icon {
  width: 46px; height: 46px; border-radius: 10px;
  background: linear-gradient(135deg, #eef2ff, #e0e7ff);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; overflow: hidden;
}
.tools-card-icon img {
  width: 30px; height: 30px; object-fit: contain;
}
.tools-icon-fallback {
  width: 30px; height: 30px;
  display: flex;
  align-items: center; justify-content: center;
  font-size: 16px; font-weight: 600; color: #4f46e5;
  background: #c7d2fe; border-radius: 7px;
}
.tools-card-body { flex: 1; min-width: 0; }
.tools-card-name {
  font-size: 13px; font-weight: 600; color: #1e293b;
  margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tools-card-desc {
  font-size: 11px; color: #64748b; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical;
  overflow: hidden;
}
.tools-loading, .tools-empty {
  grid-column: 1 / -1; text-align: center; padding: 60px 20px;
  color: #94a3b8; font-size: 14px;
}
.tools-empty { color: #cbd5e1; }

@media (max-width: 640px) {
  .tools-toolbar { gap: 8px; }
  .tools-search-box { width: 100%; }
  .tools-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
  .tools-card { padding: 8px 10px; gap: 8px; border-radius: 8px; }
  .tools-card-icon { width: 40px; height: 40px; border-radius: 9px; }
  .tools-card-icon img, .tools-icon-fallback { width: 26px; height: 26px; font-size: 14px; }
  .tools-card-name { font-size: 12px; }
  .tools-card-desc { font-size: 10px; }
}

/* ========== SEO 介绍 / FAQ 内容块 ========== */
.seo-copy {
  margin-top: 20px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 24px 28px;
  color: #334155;
  line-height: 1.8;
}
.seo-copy h2 {
  font-size: 17px;
  color: #1e293b;
  margin: 18px 0 10px;
}
.seo-copy h2:first-child { margin-top: 0; }
.seo-copy p { font-size: 14px; margin: 0 0 8px; }
.seo-copy details {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 16px;
  margin: 10px 0;
  background: #f8fafc;
}
.seo-copy details[open] { background: #fff; border-color: #c7d2fe; }
.seo-copy summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: #312e81;
  list-style: none;
  position: relative;
  padding-right: 24px;
}
.seo-copy summary::-webkit-details-marker { display: none; }
.seo-copy summary::after {
  content: '+';
  position: absolute;
  right: 4px; top: 50%;
  transform: translateY(-50%);
  color: #4f46e5;
  font-size: 18px;
}
.seo-copy details[open] summary::after { content: '−'; }
.seo-copy details p { margin: 10px 0 2px; font-size: 13.5px; color: #475569; }
@media (max-width: 640px) {
  .seo-copy { padding: 18px 16px; border-radius: 12px; }
}

/* ==================== 代码美化工具（仿 Carbon） ==================== */
.carbon-page {
  background: #1b1b1b;
  border-radius: 20px;
  padding: 56px 28px 48px;
  margin-bottom: 24px;
}
.carbon-hero {
  text-align: center;
  margin-bottom: 40px;
}
.carbon-title {
  font-size: 84px;
  font-weight: 800;
  letter-spacing: 2px;
  line-height: 1.1;
  color: transparent;
  -webkit-text-stroke: 2.5px #fde047;
  margin: 0 0 24px;
}
.carbon-sub {
  color: #fff;
  font-size: 20px;
  line-height: 1.55;
  margin: 0;
}
.carbon-frame {
  max-width: 1060px;
  margin: 0 auto;
  border: 2px solid #a5a5a5;
  border-radius: 10px;
  overflow: hidden;
  background: #1b1b1b;
}

/* 工具栏 */
.carbon-toolbar {
  display: flex;
  align-items: stretch;
  gap: 12px;
  padding: 16px;
  flex-wrap: wrap;
}
.ci-select {
  display: flex;
  align-items: stretch;
  height: 40px;
  background: #1e1e1e;
  border: 1px solid #a5a5a5;
  border-radius: 6px;
  overflow: hidden;
}
.ci-sel-icon {
  display: flex;
  align-items: center;
  padding: 0 10px;
  color: #fff;
  border-right: 1px solid #a5a5a5;
}
.ci-select select {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: #1e1e1e url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23ffffff' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 12px center;
  color: #fff;
  font-size: 14px;
  padding: 0 34px 0 12px;
  min-width: 132px;
  cursor: pointer;
  outline: none;
}
.ci-select select option { color: #1f2330; background: #fff; }
.ci-select:hover, .ci-swatch:hover, .ci-icon-btn:hover { border-color: #fff; }
.ci-swatch {
  width: 40px;
  height: 40px;
  padding: 4px;
  background: #1e1e1e;
  border: 1px solid #a5a5a5;
  border-radius: 6px;
  cursor: pointer;
}
.ci-swatch::-webkit-color-swatch-wrapper { padding: 0; }
.ci-swatch::-webkit-color-swatch { border: none; border-radius: 3px; }
.ci-icon-btn {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #1e1e1e;
  border: 1px solid #a5a5a5;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  padding: 0;
}
.ci-icon-btn:hover { background: #2c2c2c; }
.ci-icon-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  background: #1e1e1e;
}
.ci-icon-btn:disabled:hover { background: #1e1e1e; }
/* Format 按钮支持时带紫色描边，提示可点击 */
.ci-icon-btn#ci-format:not(:disabled) {
  color: #c4b5fd;
  border-color: #a78bfa;
}
.ci-icon-btn#ci-format:not(:disabled):hover { background: #241d33; }
.ci-split {
  position: relative;
  display: flex;
  align-items: stretch;
  height: 40px;
  background: #1e1e1e;
  border: 1px solid currentColor;
  border-radius: 6px;
}
.ci-split.share { color: #1da1f2; }
.ci-split.export { color: #a78bfa; }
.ci-action {
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 14px;
  padding: 0 16px;
  cursor: pointer;
}
.ci-action.ci-arrow {
  padding: 0 12px;
  border-left: 1px solid currentColor;
  font-size: 10px;
}
.ci-action:hover { background: rgba(255,255,255,0.06); }
.ci-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 150px;
  background: #1e1e1e;
  border: 1px solid #444;
  border-radius: 8px;
  padding: 6px;
  z-index: 40;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.ci-menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 13.5px;
  padding: 9px 12px;
  border-radius: 6px;
  cursor: pointer;
}
.ci-menu button:hover { background: #2d2d2d; }

/* Export 面板（仿 carbon：File name / Size / Open / Download PNG·SVG） */
.ci-export-panel {
  min-width: 340px;
  padding: 0;
  background: #1d1d1d;
  border: 1px solid #3b3b3b;
  border-radius: 4px;
  overflow: visible;
}
.ci-export-panel::before {
  content: '';
  position: absolute;
  top: -7px;
  right: 16px;
  width: 12px;
  height: 12px;
  background: #1d1d1d;
  border-left: 1px solid #3b3b3b;
  border-top: 1px solid #3b3b3b;
  transform: rotate(45deg);
}
.ci-ep-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 18px;
  border-bottom: 1px solid #2c2c2c;
}
.ci-ep-label {
  color: #a79bc9;
  font-size: 14px;
}
.ci-ep-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: none;
  color: #b4aacf;
  font-size: 14px;
  font-family: inherit;
  text-align: right;
  padding: 0;
}
.ci-ep-input:focus {
  background: transparent;
  border: 0;
  box-shadow: none;
  outline: none;
  color: #d6cef0;
}
.ci-ep-sizes { display: inline-flex; align-items: center; gap: 4px; }
.ci-export-panel .ci-ep-sizes button {
  display: inline;
  width: auto;
  padding: 2px 7px;
  color: #808080;
  font-size: 14px;
  border-radius: 4px;
}
.ci-export-panel .ci-ep-sizes button:hover { background: transparent; color: #c4b5fd; }
.ci-export-panel .ci-ep-sizes button.active { color: #c4b5fd; }
.ci-ep-actions {
  display: flex;
  align-items: stretch;
}
.ci-export-panel .ci-ep-open {
  flex: 1;
  width: auto;
  padding: 14px 0;
  text-align: center;
  color: #c4b5fd;
  font-size: 15px;
  border-right: 1px solid #2c2c2c;
  border-radius: 0;
}
.ci-export-panel .ci-ep-open:hover { background: #262626; }
.ci-ep-download {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 9px 0;
}
.ci-ep-dl-label { color: #c4b5fd; font-size: 15px; }
.ci-ep-dl-formats { display: inline-flex; gap: 10px; }
.ci-export-panel .ci-ep-dl-formats button {
  display: inline;
  width: auto;
  padding: 0 2px;
  color: #7e7896;
  font-size: 14px;
  border-radius: 4px;
}
.ci-export-panel .ci-ep-dl-formats button:hover { background: transparent; color: #c4b5fd; }

/* 齿轮展开的更多设置 */
.carbon-hidden {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  padding: 2px 16px 16px;
  color: #d1d5db;
  font-size: 13px;
}
.carbon-hidden[hidden] { display: none; }
.carbon-hidden select {
  margin-left: 6px;
  background: #1e1e1e;
  color: #fff;
  border: 1px solid #4b5563;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 13px;
  cursor: pointer;
}
.ci-check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.ci-check input { width: 15px; height: 15px; accent-color: #4f46e5; }

/* 预览舞台（背景色可自定义） */
.codeimg-stage {
  background: #abb8c3;
  padding: 56px 40px;
  min-height: 480px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  transition: background .2s;
}
.codeimg-card {
  width: 100%;
  max-width: 760px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.45);
  transition: box-shadow .2s;
}
.codeimg-window {
  background: #272822;
  border-radius: 8px;
  overflow: hidden;
}
.codeimg-traffic {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 18px 22px 0;
  background: transparent;
}
.codeimg-traffic .dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  display: inline-block;
}
.codeimg-traffic .dot.red { background: #ff5f57; }
.codeimg-traffic .dot.yellow { background: #febc2e; }
.codeimg-traffic .dot.green { background: #28c840; }

/* 可直接编辑的代码区：高亮层(pre)在文档流中撑开高度，透明 textarea 绝对定位覆盖其上 */
.codeimg-window .code-editor {
  position: relative;
  min-height: 200px;
}
.code-layer,
.code-input-layer {
  margin: 0;
  padding: 12px 22px 22px;
  border: 0;
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: var(--ci-fs, 14px);
  line-height: 1.65;
  letter-spacing: 0;
  tab-size: 2;
  white-space: pre-wrap;
  word-break: break-word;
  box-sizing: border-box;
}
.code-layer { background: transparent; pointer-events: none; }
.code-layer code.hljs {
  background: transparent;
  padding: 0;
  font: inherit;
  display: block;
  white-space: inherit;
  word-break: inherit;
}
.code-input-layer {
  position: absolute;
  inset: 0;
  resize: none;
  outline: none;
  background: transparent;
  color: transparent;
  caret-color: #e5e7eb;
  overflow: hidden;
  z-index: 2;
}
.code-input-layer::selection { background: rgba(99,102,241,0.35); }
.code-input-layer::placeholder { color: rgba(148,163,184,0.55); }
/* 覆盖全局 textarea:focus 白底样式，避免点击后整个编辑区变白 */
.code-input-layer:focus {
  background: transparent;
  border: 0;
  box-shadow: none;
  outline: none;
}

/* 截图状态：隐藏透明输入层，避免光标入图 */
.codeimg-card.capturing .code-input-layer { display: none; }

/* Monokai 主题：按 Carbon 官方（carbon.now.sh / CodeMirror）实测配色覆盖
   keyword #f92672 · 定义/参数 #fd971f · 变量引用 #9effff · 属性/方法 #a6e22e
   字符串 #e6db74 · 数字 #ae81ff · 注释 #75715e · 基础文字 #f8f8f2 · 无加粗无斜体 */
#ci-card[data-ci-theme="monokai"] .hljs { color: #f8f8f2; }
#ci-card[data-ci-theme="monokai"] .hljs-keyword { color: #f92672; font-weight: normal; }
#ci-card[data-ci-theme="monokai"] .hljs-title,
#ci-card[data-ci-theme="monokai"] .hljs-title.function_,
#ci-card[data-ci-theme="monokai"] .hljs-property { color: #a6e22e; font-weight: normal; }
#ci-card[data-ci-theme="monokai"] .hljs-title.function_.ci-def,
#ci-card[data-ci-theme="monokai"] .ci-def { color: #fd971f; font-weight: normal; }
#ci-card[data-ci-theme="monokai"] .hljs-params { color: #fd971f; font-weight: normal; }
#ci-card[data-ci-theme="monokai"] .ci-var,
#ci-card[data-ci-theme="monokai"] .hljs-variable,
#ci-card[data-ci-theme="monokai"] .hljs-template-variable { color: #9effff; }
#ci-card[data-ci-theme="monokai"] .hljs-attr,
#ci-card[data-ci-theme="monokai"] .hljs-attribute,
#ci-card[data-ci-theme="monokai"] .hljs-selector-class,
#ci-card[data-ci-theme="monokai"] .hljs-selector-id,
#ci-card[data-ci-theme="monokai"] .hljs-selector-attr,
#ci-card[data-ci-theme="monokai"] .hljs-selector-pseudo { color: #a6e22e; }
#ci-card[data-ci-theme="monokai"] .hljs-tag,
#ci-card[data-ci-theme="monokai"] .hljs-name,
#ci-card[data-ci-theme="monokai"] .hljs-selector-tag { color: #bc6283; font-weight: normal; }
#ci-card[data-ci-theme="monokai"] .hljs-string,
#ci-card[data-ci-theme="monokai"] .hljs-subst,
#ci-card[data-ci-theme="monokai"] .hljs-regexp { color: #e6db74; }
#ci-card[data-ci-theme="monokai"] .hljs-number,
#ci-card[data-ci-theme="monokai"] .hljs-literal,
#ci-card[data-ci-theme="monokai"] .hljs-section { color: #ae81ff; font-weight: normal; }
#ci-card[data-ci-theme="monokai"] .hljs-title.class_,
#ci-card[data-ci-theme="monokai"] .hljs-type { color: #fd971f; font-weight: normal; }
#ci-card[data-ci-theme="monokai"] .hljs-comment,
#ci-card[data-ci-theme="monokai"] .hljs-quote,
#ci-card[data-ci-theme="monokai"] .hljs-meta { color: #75715e; font-weight: normal; }
#ci-card[data-ci-theme="monokai"] .hljs-built_in,
#ci-card[data-ci-theme="monokai"] .hljs-symbol,
#ci-card[data-ci-theme="monokai"] .hljs-bullet,
#ci-card[data-ci-theme="monokai"] .hljs-link { color: #f8f8f2; font-weight: normal; }

/* Toast 提示 */
.toast-msg {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 10000;
  opacity: 0;
  transition: opacity .2s, transform .2s;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.toast-msg.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 640px) {
  .carbon-page { padding: 40px 14px 32px; border-radius: 14px; }
  .carbon-title { font-size: 46px; -webkit-text-stroke-width: 1.8px; margin-bottom: 16px; }
  .carbon-sub { font-size: 15.5px; }
  .carbon-toolbar { gap: 8px; padding: 12px; }
  .ci-select select { min-width: 96px; font-size: 13px; }
  .codeimg-stage { padding: 28px 14px; min-height: 320px; }
}

/* ==================== 深夜树洞 ==================== */
body.route-night .content { max-width: none; padding: 0; }

.night-page {
  position: relative;
  width: 100%;
  min-height: max(78vh, 660px);
  background: #04060f;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.night-sky {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* 星云 */
.night-nebula {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  pointer-events: none;
  opacity: 0.85;
}
.night-nebula.n1 {
  top: 8%;
  left: 12%;
  width: 46%;
  height: 46%;
  background: radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.32) 0%, rgba(56, 189, 248, 0.14) 40%, transparent 70%);
  animation: nebula-pulse 12s ease-in-out infinite alternate;
}
.night-nebula.n2 {
  bottom: 4%;
  right: 6%;
  width: 52%;
  height: 48%;
  background: radial-gradient(circle at 50% 50%, rgba(168, 85, 247, 0.30) 0%, rgba(236, 72, 153, 0.12) 42%, transparent 72%);
  animation: nebula-pulse 16s ease-in-out infinite alternate-reverse;
}
@keyframes nebula-pulse {
  0%   { transform: scale(1) translate(0, 0); opacity: 0.7; }
  100% { transform: scale(1.18) translate(3%, -4%); opacity: 1; }
}

/* 地平线光 */
.night-horizon {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 34%;
  background: linear-gradient(to top, rgba(79, 70, 229, 0.30) 0%, rgba(56, 189, 248, 0.10) 45%, transparent 100%);
  pointer-events: none;
}

/* 雾气 */
.night-fog {
  position: absolute;
  bottom: -12%;
  left: -20%;
  width: 140%;
  height: 46%;
  background: radial-gradient(ellipse at 50% 100%, rgba(129, 140, 248, 0.20) 0%, rgba(129, 140, 248, 0.06) 45%, transparent 72%);
  filter: blur(30px);
  pointer-events: none;
  animation: fog-drift 26s ease-in-out infinite alternate;
}
.night-fog.fog-b {
  bottom: -18%;
  height: 38%;
  background: radial-gradient(ellipse at 50% 100%, rgba(56, 189, 248, 0.16) 0%, transparent 70%);
  animation-duration: 34s;
  animation-direction: alternate-reverse;
}
@keyframes fog-drift {
  0%   { transform: translateX(-6%) scaleY(1); }
  100% { transform: translateX(6%) scaleY(1.15); }
}
.night-aurora {
  position: absolute;
  top: -30%;
  left: -10%;
  width: 70%;
  height: 70%;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(79, 70, 229, 0.22) 0%, rgba(56, 189, 248, 0.10) 45%, transparent 70%);
  filter: blur(40px);
  animation: aurora-drift 18s ease-in-out infinite alternate;
  pointer-events: none;
}
.night-aurora.aurora-b {
  top: auto;
  left: auto;
  bottom: -35%;
  right: -15%;
  background: radial-gradient(ellipse at center, rgba(168, 85, 247, 0.16) 0%, rgba(79, 70, 229, 0.08) 45%, transparent 70%);
  animation-duration: 24s;
  animation-delay: -8s;
}
@keyframes aurora-drift {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(6%, 4%) scale(1.12); }
  100% { transform: translate(-4%, 8%) scale(0.95); }
}

.night-content {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 64px 24px 72px;
  text-align: center;
}
.panel[data-panel="night"] > .seo-copy {
  max-width: 1112px;
  margin: 24px auto 0;
}
.night-title {
  font-size: 46px;
  font-weight: 800;
  letter-spacing: 0.14em;
  margin: 0 0 12px;
  background: linear-gradient(110deg, #a5b4fc 0%, #818cf8 25%, #38bdf8 50%, #c4b5fd 75%, #a5b4fc 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 26px rgba(129, 140, 248, 0.45));
  animation: title-shimmer 7s linear infinite;
}
@keyframes title-shimmer {
  0%   { background-position: 0% 50%; }
  100% { background-position: 220% 50%; }
}
.night-sub {
  color: rgba(199, 210, 254, 0.72);
  font-size: 14.5px;
  letter-spacing: 0.2em;
  margin: 0 0 48px;
}

/* ---------- 打烊状态 ---------- */
.night-closed { padding: 40px 0 24px; }
.night-moon {
  width: 96px;
  height: 96px;
  margin: 0 auto 28px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fef9c3 0%, #fde68a 55%, #fbbf24 100%);
  box-shadow: 0 0 60px rgba(253, 230, 138, 0.35), 0 0 120px rgba(253, 230, 138, 0.15);
  position: relative;
  animation: moon-float 6s ease-in-out infinite;
}
.night-moon::after {
  content: '';
  position: absolute;
  top: 12%;
  right: -6%;
  width: 88%;
  height: 88%;
  border-radius: 50%;
  background: #050816;
}
@keyframes moon-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}
.night-closed-text {
  color: #e0e7ff;
  font-size: 18px;
  margin: 0 0 14px;
  letter-spacing: 0.06em;
}
.night-countdown {
  color: #818cf8;
  font-size: 30px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.1em;
  margin: 0 0 14px;
}
.night-closed-hint {
  color: rgba(199, 210, 254, 0.5);
  font-size: 13.5px;
  margin: 0;
}

/* ---------- 呼吸球 ---------- */
.night-stage { padding: 16px 0 8px; }
.night-orb {
  --mic-level: 0;
  position: relative;
  width: 180px;
  height: 180px;
  margin: 0 auto;
  display: block;
  border: none;
  background: transparent;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
.night-orb-core {
  position: absolute;
  inset: 30px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, #a5b4fc 0%, #6366f1 45%, #312e81 100%);
  box-shadow:
    0 0 40px rgba(99, 102, 241, 0.55),
    0 0 90px rgba(99, 102, 241, 0.25),
    inset 0 0 30px rgba(199, 210, 254, 0.35);
  animation: orb-breathe 4s ease-in-out infinite;
  transition: transform 0.15s ease-out;
  z-index: 2;
}
.night-orb-halo {
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, rgba(129, 140, 248, 0.34) 0%, rgba(56, 189, 248, 0.10) 45%, transparent 70%);
  filter: blur(14px);
  animation: halo-pulse 4s ease-in-out infinite;
  z-index: 1;
}
@keyframes halo-pulse {
  0%, 100% { transform: scale(1);    opacity: 0.75; }
  50%      { transform: scale(1.22); opacity: 1; }
}
/* 环绕小粒子 */
.night-orbit {
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  z-index: 3;
  pointer-events: none;
  animation: orbit-spin 16s linear infinite;
}
.night-orbit i {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  margin: -2.5px 0 0 -2.5px;
  border-radius: 50%;
  background: #c7d2fe;
  box-shadow: 0 0 10px 3px rgba(165, 180, 252, 0.75);
}
.night-orbit i:nth-child(1) { transform: rotate(0deg)   translateX(96px); }
.night-orbit i:nth-child(2) { transform: rotate(120deg) translateX(96px); background: #a5f3fc; box-shadow: 0 0 10px 3px rgba(165, 243, 252, 0.65); }
.night-orbit i:nth-child(3) { transform: rotate(240deg) translateX(96px); background: #ddd6fe; box-shadow: 0 0 10px 3px rgba(221, 214, 254, 0.65); }
@keyframes orbit-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.night-orb.listening .night-orb-core {
  animation: none;
  transform: scale(calc(1 + var(--mic-level) * 0.35));
}
.night-orb.speaking .night-orb-core {
  animation: orb-speak 0.9s ease-in-out infinite;
}
.night-orb.thinking .night-orb-core {
  animation: orb-think 1.6s ease-in-out infinite;
}
@keyframes orb-breathe {
  0%, 100% { transform: scale(1);    box-shadow: 0 0 40px rgba(99,102,241,0.55), 0 0 90px rgba(99,102,241,0.25), inset 0 0 30px rgba(199,210,254,0.35); }
  50%      { transform: scale(1.07); box-shadow: 0 0 55px rgba(99,102,241,0.7),  0 0 120px rgba(99,102,241,0.32), inset 0 0 36px rgba(199,210,254,0.45); }
}
@keyframes orb-speak {
  0%, 100% { transform: scale(1); }
  30%      { transform: scale(1.09); }
  60%      { transform: scale(0.97); }
}
@keyframes orb-think {
  0%, 100% { opacity: 0.85; transform: scale(1); }
  50%      { opacity: 1;    transform: scale(1.04); }
}
.night-orb-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(129, 140, 248, 0.35);
  opacity: 0;
  pointer-events: none;
}
.night-orb.listening .night-orb-ring {
  opacity: 1;
  border-color: rgba(129, 140, 248, calc(0.25 + var(--mic-level) * 0.6));
  transform: scale(calc(1 + var(--mic-level) * 0.5));
  transition: transform 0.1s ease-out, border-color 0.1s ease-out;
}
.night-orb.listening .night-orb-ring.r2 {
  transform: scale(calc(1.12 + var(--mic-level) * 0.75));
  border-color: rgba(56, 189, 248, calc(0.15 + var(--mic-level) * 0.4));
}
.night-orb.speaking .night-orb-ring.r1 {
  opacity: 1;
  animation: ring-wave 1.8s ease-out infinite;
}
.night-orb.speaking .night-orb-ring.r2 {
  opacity: 1;
  animation: ring-wave 1.8s ease-out 0.9s infinite;
}
@keyframes ring-wave {
  0%   { transform: scale(1);    opacity: 0.5; }
  100% { transform: scale(1.65); opacity: 0; }
}

/* ---------- 状态与字幕 ---------- */
.night-status {
  margin: 30px 0 10px;
  color: #c7d2fe;
  font-size: 15.5px;
  letter-spacing: 0.08em;
}
.night-subtitle {
  min-height: 30px;
  margin: 0 auto;
  max-width: 560px;
  color: #e0e7ff;
  font-size: 17px;
  line-height: 1.9;
  letter-spacing: 0.04em;
}
.night-subtitle::after {
  content: '';
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 3px;
  vertical-align: -0.12em;
  background: rgba(199, 210, 254, 0.8);
  animation: caret-blink 0.9s steps(1) infinite;
}
.night-subtitle:empty::after { display: none; }
@keyframes caret-blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0; }
}

/* ---------- 文字输入 ---------- */
.night-sample-btn {
  display: inline-block;
  margin: 4px 0 0;
  padding: 8px 20px;
  border-radius: 999px;
  border: 1px solid rgba(129, 140, 248, 0.45);
  background: rgba(79, 70, 229, 0.12);
  color: #c7d2fe;
  font-size: 13px;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: all 0.2s;
}
.night-sample-btn:hover:not(:disabled) {
  background: rgba(79, 70, 229, 0.28);
  border-color: #818cf8;
  box-shadow: 0 0 22px rgba(99, 102, 241, 0.4);
}
.night-sample-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.night-input-row {
  display: flex;
  gap: 10px;
  max-width: 560px;
  margin: 22px auto 0;
}
.night-input-row input {
  flex: 1;
  padding: 13px 18px;
  border-radius: 14px;
  border: 1px solid rgba(129, 140, 248, 0.35);
  background: rgba(15, 23, 42, 0.72);
  color: #e0e7ff;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.night-input-row input::placeholder { color: rgba(199, 210, 254, 0.4); }
.night-input-row input:focus {
  border-color: #818cf8;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
  background: rgba(15, 23, 42, 0.9);
}
.night-input-row button {
  padding: 13px 26px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}
.night-input-row button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}
.night-input-row button:disabled { opacity: 0.5; cursor: not-allowed; }

.night-rounds {
  margin: 22px 0 0;
  color: rgba(199, 210, 254, 0.45);
  font-size: 12.5px;
  letter-spacing: 0.06em;
}

@media (max-width: 640px) {
  .night-content { padding: 48px 18px 56px; }
  .night-title { font-size: 32px; }
  .night-orb { width: 150px; height: 150px; }
  .night-orb-core { inset: 24px; }
  .night-orbit i:nth-child(1) { transform: rotate(0deg)   translateX(78px); }
  .night-orbit i:nth-child(2) { transform: rotate(120deg) translateX(78px); }
  .night-orbit i:nth-child(3) { transform: rotate(240deg) translateX(78px); }
  .night-input-row { flex-direction: column; }
  .night-input-row button { width: 100%; }
  .panel[data-panel="night"] > .seo-copy { margin: 24px 16px 0; }
}
