/* ========== hao123 风格导航站 —— 响应式样式 ========== */
:root {
  --green: #38a832;
  --green-dark: #2c8c27;
  --red: #f04142;
  --orange: #ff7a1a;
  --text: #222;
  --text-2: #666;
  --text-3: #999;
  --line: #e8e8e8;
  --bg: #f5f6f7;
  --card: #fff;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0, 0, 0, .06);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--green); }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* ---------- 实时天气（头部搜索框右侧） ---------- */
.weather {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
  padding-left: 24px; border-left: 1px solid var(--line);
  line-height: 1.35; user-select: none;
}
.weather-icon { width: 36px; height: 36px; display: inline-flex; flex-shrink: 0; }
.weather-icon svg { width: 100%; height: 100%; }
.wi-sun { color: #f59e0b; }
.wi-cloud-sun { color: #f59e0b; }
.wi-cloud { color: #64748b; }
.wi-fog { color: #94a3b8; }
.wi-drizzle { color: #3b82f6; }
.wi-rain { color: #2563eb; }
.wi-snow { color: #0ea5e9; }
.wi-thunder { color: #8b5cf6; }
.weather-temp { font-size: 26px; font-weight: 700; color: var(--text); letter-spacing: -0.5px; }
.weather-temp i { font-style: normal; font-size: 14px; font-weight: 500; color: var(--text-3); margin-left: 1px; }
.weather-meta { display: flex; flex-direction: column; min-width: 0; }
.weather-meta b { font-size: 13px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.weather-meta em { font-style: normal; font-size: 12px; color: var(--text-3); white-space: nowrap; }
.weather-unavail { font-size: 12px; color: var(--text-3); white-space: nowrap; }

/* ---------- 顶部细条 ---------- */
.topbar { background: #fbfbfb; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--text-2); }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; height: 32px; }
.topbar-links { display: flex; gap: 18px; }

/* ---------- 头部：Logo + 搜索 ---------- */
.header { background: var(--card); border-bottom: 1px solid var(--line); }
.header-inner {
  display: flex; align-items: center; gap: 28px;
  padding-top: 22px; padding-bottom: 22px;
}
/* 首页 h1 只承担语义，不参与布局 */
.logo-h1 { display: contents; }
/* 站标：AI spark 标记 + Kan112 字标（112 用 AI 渐变字） + 品牌后缀 */
.logo { display: flex; align-items: center; gap: 9px; flex-shrink: 0; }
.logo-mark { display: block; flex-shrink: 0; }
.logo-text { display: flex; align-items: baseline; gap: 7px; min-width: 0; }
.logo-word { font-size: 21px; font-weight: 800; letter-spacing: .2px; color: var(--text); line-height: 1; }
.logo-word em {
  font-style: normal; color: var(--green);
  background: linear-gradient(115deg, #3fc44b, #1fb6a6 52%, #2f7fd0);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
/* 极旧浏览器不支持渐变字时，退回纯色而不是看不见 */
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .logo-word em { -webkit-text-fill-color: currentColor; }
}
.logo-sub { font-size: 12.5px; color: var(--text-3); white-space: nowrap; }

.search {
  flex: 1; max-width: 620px; display: flex;
  border: 2px solid var(--green); border-radius: 999px; overflow: hidden;
  background: #fff;
}
.search-input {
  flex: 1; min-width: 0; border: 0; outline: 0;
  padding: 10px 18px; font-size: 15px;
}
.search-btn {
  border: 0; background: var(--green); color: #fff;
  font-size: 15px; padding: 0 26px; cursor: pointer; font-weight: 600;
}
.search-btn:hover { background: var(--green-dark); }

/* ---------- 主布局 ---------- */
.main { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 16px; padding-top: 12px; padding-bottom: 40px; align-items: start; }

/* 左栏（分类导航 + 速览面板，整列吸顶） */
.side-col { min-width: 0; position: sticky; top: 10px; display: flex; flex-direction: column; gap: 16px; }

/* 侧边分类 */
.sidecat {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden;
}
.sidecat a {
  display: flex; align-items: center; gap: 6px;
  padding: 11px 14px; font-size: 13px; border-left: 3px solid transparent;
  color: var(--text-2); white-space: nowrap;
}
.sidecat a:hover, .sidecat a.active {
  background: #f0f9ee; color: var(--green); border-left-color: var(--green); font-weight: 600;
}
.sidecat .ico { width: 18px; text-align: center; }

/* 内容区 */
.content { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.panel-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 18px; border-bottom: 1px solid var(--line);
}
.panel-head h1, .panel-head h2 { font-size: 16px; font-weight: 700; }
.panel-head h1::before, .panel-head h2::before {
  content: ""; display: inline-block; width: 4px; height: 14px;
  background: var(--green); border-radius: 2px; margin-right: 8px; vertical-align: -2px;
}
.panel-more { font-size: 12px; color: var(--text-3); }

/* 资讯列表 */
.news-list { display: grid; grid-template-columns: 1fr 1fr; list-style: none; padding: 10px 18px 14px; }
.news-list li { min-width: 0; }
.news-list a {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0; font-size: 14px; min-width: 0;
}
.news-list a .title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.news-list a:hover .title { color: var(--green); }
.tag {
  flex-shrink: 0; font-size: 11px; color: var(--red); border: 1px solid #ffd6d6;
  background: #fff5f5; border-radius: 4px; padding: 0 5px; line-height: 18px;
}

/* 分类链接区块 */
.link-grid { list-style: none; display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px 8px; padding: 12px 18px 16px; }
.link-grid li { min-width: 0; }
.link-grid a {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 8px; border-radius: 6px; font-size: 13px; min-width: 0;
}
.link-grid a:hover { background: #f0f9ee; }
.link-grid a .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fav {
  width: 16px; height: 16px; flex-shrink: 0; border-radius: 4px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 10px; font-weight: 700;
}
.hot-mark { color: var(--red); font-size: 11px; flex-shrink: 0; }

/* 页脚 */
.footer { border-top: 1px solid var(--line); background: #fafafa; padding: 18px 0; color: var(--text-3); font-size: 12px; text-align: center; }

/* 加载与错误 */
.loading, .error-box { text-align: center; padding: 40px 0; color: var(--text-3); }
.error-box button {
  margin-top: 10px; border: 1px solid var(--green); background: #fff; color: var(--green);
  border-radius: 6px; padding: 6px 18px; cursor: pointer;
}

/* ---------- 平板 ---------- */
@media (max-width: 900px) {
  .main { grid-template-columns: minmax(0, 1fr); }
  .side-col { position: static; }
  .sidecat {
    display: flex; overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .sidecat::-webkit-scrollbar { display: none; }
  .sidecat a { border-left: 0; border-bottom: 3px solid transparent; padding: 9px 14px; flex-shrink: 0; }
  .sidecat a:hover, .sidecat a.active { border-bottom-color: var(--green); }
  .link-grid { grid-template-columns: repeat(4, 1fr); }
  .news-list { grid-template-columns: 1fr; }
}

/* ---------- 手机 ---------- */
@media (max-width: 560px) {
  /* 头部由「竖着堆 4 行」改为「横向排列 + 换行」，用 order 重排、无需改 DOM：
     第一行 站标 ←→ 主题按钮（原来的竖排会让按钮独占一行、白占一条高度）
     第二行 搜索框占满整行
     第三行 天气占满整行 */
  .header-inner {
    flex-direction: row; flex-wrap: wrap;
    gap: 10px; padding-top: 14px; padding-bottom: 14px;
  }
  .logo { order: 1; }
  .theme-toggle { order: 2; margin-left: auto; }
  .search { order: 3; flex: 1 1 100%; max-width: none; }
  .weather { order: 4; flex: 1 1 100%; border-left: 0; padding-left: 0; gap: 8px; }

  .logo-sub { display: none; }
  .search-btn { padding: 0 18px; }
  .weather-icon { width: 30px; height: 30px; }
  .weather-temp { font-size: 22px; }
  .link-grid { grid-template-columns: repeat(3, 1fr); padding: 10px 12px 14px; }
  .panel-head { padding: 10px 14px; }
  .news-list { padding: 8px 14px 12px; }

  /* 顶栏：日期让位给链接。否则 320px 下链接只剩不到 130px，会被逐字挤成竖排 */
  .topbar-date { display: none; }
  .topbar-inner { justify-content: flex-start; }
  .topbar-links { gap: 6px; }
}

/* 极窄屏（≤340px）：5 个链接含内边距共需约 320px，装不下 320px 视口。
   「热点资讯」只是指向页内 #news-panel 的锚点，那一段本来就在首屏下方，隐藏它损失最小。 */
@media (max-width: 340px) {
  .topbar-links a[href="#news-panel"] { display: none; }
}
@media (max-width: 380px) {
  .link-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ========== 论坛 / 帖子列表 ========== */
.post-list { list-style: none; padding: 6px 18px 12px; }
.post-list li { border-bottom: 1px solid #f2f2f2; }
.post-list li:last-child { border-bottom: 0; }
.post-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; min-width: 0;
}
/* 分类角标：列表行（.post-row）与帖子详情页（.post-detail .meta）共用，
   原来详情页是在 JS 里写死了一段等价的内联样式，内联样式会压过样式表，
   导致窄屏字号兜底规则失效——统一收到这里。 */
.pcat {
  display: inline-block; flex-shrink: 0; line-height: 1.5;
  font-size: 11px; color: var(--green); background: #f0f9ee;
  border-radius: 4px; padding: 1px 6px; white-space: nowrap;
}
.post-row .ptitle {
  flex: 1; min-width: 0; font-size: 14px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.post-row .ptitle:hover { color: var(--green); }
.post-row .pmeta { flex-shrink: 0; font-size: 12px; color: var(--text-3); white-space: nowrap; }
.panel-head .link-more { font-size: 12px; color: var(--green); }

/* 论坛页工具条 */
.forum-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.chip {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 5px 14px; font-size: 13px; cursor: pointer; color: var(--text-2);
}
.chip:hover { border-color: var(--green); color: var(--green); }
.chip.active { background: var(--green); border-color: var(--green); color: #fff; font-weight: 600; }
.forum-tools .spacer { flex: 1; }
.btn-primary {
  border: 0; background: var(--green); color: #fff; border-radius: 8px;
  padding: 8px 20px; font-size: 14px; font-weight: 600; cursor: pointer;
}
.btn-primary:hover { background: var(--green-dark); }
.btn-plain { border: 1px solid #ddd; background: #fff; color: var(--text-2); border-radius: 8px; padding: 8px 20px; font-size: 14px; cursor: pointer; }

/* 帖子详情 */
.post-detail { padding: 22px 24px; }
.post-detail h1 { font-size: 20px; line-height: 1.4; margin-bottom: 10px; }
.post-detail .meta { font-size: 12px; color: var(--text-3); margin-bottom: 18px; display: flex; gap: 14px; flex-wrap: wrap; }
.post-detail .body { font-size: 15px; line-height: 1.9; white-space: pre-wrap; word-break: break-word; }
.reply-item { padding: 14px 0; border-bottom: 1px solid #f2f2f2; }
.reply-item .rhead { display: flex; gap: 10px; align-items: baseline; margin-bottom: 6px; }
.reply-item .rauthor { font-weight: 600; font-size: 13px; color: var(--green-dark); }
.reply-item .rtime { font-size: 12px; color: var(--text-3); }
.reply-item .rbody { font-size: 14px; line-height: 1.8; white-space: pre-wrap; word-break: break-word; }
.floor { color: var(--text-3); font-size: 12px; margin-left: auto; }

/* 表单（发帖 / 回复 / 提交网址） */
.form-card { padding: 18px 24px; }
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.form-row label .req { color: var(--red); margin-left: 2px; }
.form-input, .form-select, .form-textarea {
  width: 100%; border: 1px solid #ddd; border-radius: 8px;
  padding: 10px 12px; font-size: 14px; outline: 0; font-family: inherit;
  background: #fff;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--green); }
.form-input.err, .form-textarea.err, .form-select.err { border-color: var(--red); }
.form-textarea { resize: vertical; min-height: 110px; }
.form-tip { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.form-err { font-size: 12px; color: var(--red); min-height: 18px; margin-top: 4px; }
.form-actions { display: flex; gap: 10px; align-items: center; }

/* 提交成功提示 */
.result-box { text-align: center; padding: 50px 24px; }
.result-box .ico { font-size: 46px; margin-bottom: 12px; }
.result-box h2 { font-size: 18px; margin-bottom: 8px; }
.result-box p { color: var(--text-2); font-size: 14px; margin-bottom: 20px; }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .45);
  display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 50;
}
.modal {
  background: #fff; border-radius: 12px; width: 100%; max-width: 520px;
  max-height: 88dvh; overflow-y: auto; padding: 22px 24px;
}
.modal h3 { font-size: 16px; margin-bottom: 16px; }

/* 子页面简易头 */
.page-head { background: var(--card); border-bottom: 1px solid var(--line); }
.page-head .inner { display: flex; align-items: center; gap: 14px; padding-top: 14px; padding-bottom: 14px; flex-wrap: wrap; }
.page-head .logo-badge { font-size: 20px; }
.page-head .logo-num { font-size: 23px; }
.page-head .nav-link { font-size: 13px; color: var(--text-2); }
.page-head .nav-link:hover { color: var(--green); }
.page-head .nav-link.active { color: var(--green); font-weight: 700; }
.page-head .right { margin-left: auto; display: flex; gap: 14px; align-items: center; }

/* 友情链接 */
.friendlinks { padding-bottom: 22px; }
.friend-list { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 10px; padding: 14px 18px 18px; }
.friend-list li { min-width: 0; }
.friend-list a {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; min-height: 34px;
  border: 1px solid var(--line); border-radius: 6px;
  font-size: 13px; color: var(--text-2); background: #fff;
}
.friend-list a:hover { color: var(--green); border-color: var(--green); background: #f0f9ee; }
.friend-list a:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.friend-list .fic {
  width: 16px; height: 16px; flex-shrink: 0; border-radius: 4px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 10px; font-weight: 700;
}

@media (max-width: 560px) {
  .post-row { flex-wrap: wrap; gap: 6px; }
  .post-row .ptitle { flex-basis: 100%; order: 3; }
  .post-row .pmeta { margin-left: auto; }
  .post-detail { padding: 16px; }
  .form-card { padding: 16px; }
  .post-list { padding: 4px 14px 10px; }
  .friend-list { padding: 12px 14px 16px; gap: 8px; }
  .friend-list a { flex: 1 1 calc(50% - 8px); justify-content: flex-start; }
}

/* ========== 首页 站内智能助手（检索式问答，独立常驻模块） ========== */
.ai-assist { padding: 14px 16px 16px; }
.ai-assist-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 11px; }
.ai-assist-title { font-size: 15px; font-weight: 700; }
.ai-assist-title::before {
  content: AI; display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .5px;
  color: #fff; background: linear-gradient(135deg, var(--green), #2f7fd0);
  border-radius: 5px; padding: 1px 6px; margin-right: 8px; vertical-align: 1px;
}
.ai-assist-sub { font-size: 12px; color: var(--text-3); }

/* 输入区 */
.ai-ask-form { display: flex; gap: 8px; }
.ai-ask-input {
  flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 9px; padding: 10px 14px;
  font-size: 13.5px; background: var(--bg); color: var(--text); outline: 0; font-family: inherit;
  transition: border-color .18s, box-shadow .18s;
}
.ai-ask-input::placeholder { color: var(--text-3); }
.ai-ask-input:focus { border-color: var(--green); background: var(--card); box-shadow: 0 0 0 3px rgba(56, 168, 50, .13); }
.ai-ask-btn {
  flex-shrink: 0; border: 0; border-radius: 9px; padding: 10px 22px; font-size: 13.5px; font-weight: 600;
  color: #fff; background: var(--green); cursor: pointer; font-family: inherit; transition: background .18s;
}
.ai-ask-btn:hover { background: var(--green-dark); }
.ai-ask-btn:disabled { opacity: .6; cursor: not-allowed; }

/* 快捷提问 */
.ai-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ai-chip {
  border: 1px solid var(--line); background: var(--card); color: var(--text-2);
  border-radius: 999px; padding: 4px 12px; font-size: 12px; cursor: pointer; font-family: inherit;
  transition: border-color .18s, color .18s, background .18s;
}
.ai-chip:hover { border-color: var(--green); color: var(--green); background: rgba(56, 168, 50, .06); }

/* 结果区 */
.ai-answer { margin-top: 12px; padding: 12px 14px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg); }
.ai-answer.is-high { border-color: rgba(56, 168, 50, .42); }
.ai-answer.is-medium { border-color: rgba(255, 122, 26, .38); }
.ai-answer.is-none, .ai-answer.is-error { border-color: rgba(240, 65, 66, .34); }
.ai-answer-head { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.ai-conf { font-size: 10.5px; font-weight: 600; border-radius: 4px; padding: 1px 7px; }
.ai-conf.is-high { color: var(--green); background: rgba(56, 168, 50, .12); }
.ai-conf.is-medium { color: var(--orange); background: rgba(255, 122, 26, .12); }
.ai-conf.is-none { color: var(--red); background: rgba(240, 65, 66, .1); }
.ai-answer-intent { font-size: 11px; color: var(--text-3); }
.ai-answer-text { font-size: 13px; line-height: 1.7; }

.ai-answer-list { list-style: none; margin-top: 11px; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.ai-answer-list a, .ai-ans-plain {
  display: flex; gap: 9px; align-items: flex-start; height: 100%;
  padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--card);
  transition: border-color .18s, box-shadow .18s;
}
.ai-answer-list a:hover { border-color: var(--green); box-shadow: var(--shadow); }
.ai-answer-list a::after { content: ↗; margin-left: auto; font-size: 11px; color: var(--text-3); }
.ai-ans-kind { flex-shrink: 0; font-size: 10.5px; color: var(--green); background: rgba(56, 168, 50, .1); border-radius: 4px; padding: 1px 6px; margin-top: 1px; }
.ai-ans-main { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ai-ans-title { font-size: 12.5px; color: var(--text); }
.ai-ans-sub { font-size: 11px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 检索中 */
.ai-loading { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-3); }
.ai-spinner {
  width: 13px; height: 13px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid var(--line); border-top-color: var(--green);
  animation: ai-spin .7s linear infinite;
}
@keyframes ai-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ai-spinner { animation-duration: 2s; } }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

@media (max-width: 560px) {
  .ai-assist { padding: 12px 12px 14px; }
  .ai-assist-sub { display: none; }
  .ai-answer-list { grid-template-columns: minmax(0, 1fr); }
}

/* 夜晚模式 */
html[data-theme=dark] .ai-chip:hover { background: rgba(69, 201, 62, .1); }
html[data-theme=dark] .ai-answer-list a,
html[data-theme=dark] .ai-ans-plain { background: rgba(255, 255, 255, .035); }
html[data-theme=dark] .ai-conf.is-high { color: var(--green); background: rgba(69, 201, 62, .14); }
html[data-theme=dark] .ai-ans-kind { color: var(--green); background: rgba(69, 201, 62, .14); }
html[data-theme=dark] .ai-answer.is-high { border-color: rgba(69, 201, 62, .42); }
html[data-theme=dark] .ai-ask-input:focus { box-shadow: 0 0 0 3px rgba(69, 201, 62, .16); }

/* ========== 左栏速览面板（原右上角浮层迁移至此） ==========
 * 结构沿用参考图右上角那块浮层：Tab 行（当前项主题色文字 + 3px 下划线）/ 右侧 ⋮ 菜单
 * / 浅灰分隔线 / 列表内容区 / 底部灰字说明。差异：不再悬浮，改为左栏内的一张卡片，
 * 去掉了小圆钮与 ✕（已在布局中，无需收起）。
 */
.side-panel { overflow: hidden; }

.fp-head { position: relative; display: flex; align-items: center; gap: 6px; padding: 0 6px 0 12px; border-bottom: 1px solid var(--line); }
.fp-tabs { display: flex; gap: 14px; flex: 1; min-width: 0; }
.fp-tab {
  position: relative; border: 0; background: transparent; cursor: pointer; font-family: inherit;
  padding: 10px 0 8px; font-size: 13px; line-height: 1.2; color: #3c4043;
  border-bottom: 3px solid transparent; margin-bottom: -1px;
  transition: color .2s, border-color .2s;
}
.fp-tab:hover { color: #1a73e8; }
.fp-tab.is-active { color: #1a73e8; border-bottom-color: #1a73e8; }
.fp-tab:focus-visible { outline: 2px solid #1a73e8; outline-offset: -2px; }

.fp-acts { display: flex; align-items: center; flex-shrink: 0; }
.fp-ico {
  width: 28px; height: 28px; border: 0; border-radius: 50%;
  background: transparent; color: #5f6368; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s, color .2s;
}
.fp-ico svg { fill: currentColor; }
.fp-ico:hover { background: #f1f3f4; color: #202124; }
.fp-ico:focus-visible { outline: 2px solid #1a73e8; outline-offset: -2px; }

/* ⋮ 的小菜单 */
.fp-menu {
  position: absolute; top: 40px; right: 8px; z-index: 2;
  min-width: 112px; padding: 4px 0; background: #fff;
  border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 2px 10px rgba(60, 64, 67, .18);
}
.fp-menu button {
  display: block; width: 100%; text-align: left; border: 0; background: transparent;
  padding: 8px 12px; font-size: 12px; color: #3c4043; cursor: pointer; font-family: inherit;
}
.fp-menu button:hover { background: #f1f3f4; }

/* 列表内容区 */
.fp-body { max-height: 340px; overflow-y: auto; }
.fp-body[hidden] { display: none; }
.fp-body::-webkit-scrollbar { width: 6px; }
.fp-body::-webkit-scrollbar-thumb { background: #dadce0; border-radius: 3px; }

.fp-row { display: flex; align-items: flex-start; gap: 7px; padding: 7px 12px; }
.fp-row:hover { background: #f8f9fa; }
.fp-rank {
  flex-shrink: 0; width: 14px; text-align: center;
  font-size: 12px; font-weight: 700; font-style: italic; color: #bdc1c6;
  font-variant-numeric: tabular-nums;
}
.fp-rank-1 { color: #f04142; }
.fp-rank-2 { color: #ff7a1a; }
.fp-rank-3 { color: #f5b400; }
.fp-row-main { min-width: 0; flex: 1; }
.fp-row-title {
  display: block; font-size: 12px; line-height: 1.5; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fp-row:hover .fp-row-title { color: #1a73e8; }
.fp-row-heat { font-size: 11px; color: #9aa0a6; }
.fp-row-ico { font-size: 14px; line-height: 1.4; flex-shrink: 0; }
.fp-empty { padding: 20px 12px; text-align: center; font-size: 12px; color: #9aa0a6; }

.fp-foot {
  padding: 8px 12px; font-size: 11px; color: #5f6368;
  border-top: 1px solid var(--line); background: #fafafa;
}

/* ========== 右侧「页内导航」深度尺 ==========
 * 1:1 还原 pro.momoyu.cc 的 .depth-ruler：固定视口右侧、垂直居中、纵向渐变轨 + 刻度点 + 跟随指针。
 * 仅两处按本地情况调整：①原站是深色底，配色改浅色主题可读版本；②文案与刻度内容本地化为站内区块。
 * 原站为 hidden md:flex，这里因本站主体是 1200px 定宽容器，需要 ≥1400px 才有 100px 右侧留白，故断点后移。
 */
.depth-ruler { display: none; }

@media (min-width: 1400px) {
  .depth-ruler {
    display: flex; flex-direction: column; align-items: flex-end;
    position: fixed; right: 28px; top: 50%; transform: translateY(-50%);
    z-index: 50; user-select: none;
  }

  .depth-ruler-head { display: flex; align-items: baseline; gap: 4px; margin-bottom: 12px; padding-right: 4px; }
  .depth-ruler-value {
    font-size: 21.6px; font-weight: 700; line-height: 1;
    color: #14b8a6;                        /* 原站 teal-300，浅底改用 teal-500 保证对比度 */
    font-variant-numeric: tabular-nums;
  }
  .depth-ruler-unit { font-size: 10.4px; font-weight: 600; letter-spacing: 1.248px; color: rgba(0, 0, 0, .35); }

  .depth-ruler-body { position: relative; width: 72px; height: 420px; }

  .depth-ruler-bar { position: absolute; right: 0; top: 0; bottom: 0; width: 3px; border-radius: 9999px; overflow: hidden; }
  /* 前 3 段色标与原站完全一致（teal-400 → sky-400 → blue-500）；
     原站末段是接近纯黑的深海底色，在浅色页面上会变成突兀的黑线，故改为低透明度靛蓝收尾 */
  .depth-ruler-bar-fill {
    width: 100%; height: 100%;
    background: linear-gradient(rgba(45, 212, 191, .9) 0%, rgba(56, 189, 248, .6) 20%,
      rgba(59, 130, 246, .55) 42%, rgba(79, 70, 229, .5) 66%, rgba(30, 27, 75, .45) 100%);
    box-shadow: 0 0 12px rgba(45, 212, 191, .3);
  }

  /* 刻度：默认只露小圆点，hover 或处于当前区块时才显示名称（与原站一致） */
  .depth-ruler-mark {
    position: absolute; right: 0; transform: translateY(-50%);
    display: flex; align-items: center; gap: 8px;
    border: 0; background: transparent; padding: 0; cursor: pointer; font-family: inherit;
  }
  .depth-ruler-label {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 10px; letter-spacing: .025em; white-space: nowrap;
    color: rgba(0, 0, 0, .35); opacity: 0; transition: all .3s;
  }
  .depth-ruler-mark:hover .depth-ruler-label,
  .depth-ruler-mark:focus-visible .depth-ruler-label { opacity: 1; }
  .depth-ruler-mark.is-active .depth-ruler-label { opacity: 1; color: #0d9488; font-weight: 600; }

  .depth-ruler-tick {
    display: block; flex-shrink: 0; border-radius: 9999px;
    width: 6px; height: 6px; background: rgba(0, 0, 0, .18); transition: all .3s;
  }
  .depth-ruler-mark:hover .depth-ruler-tick { background: rgba(0, 0, 0, .35); }
  .depth-ruler-mark.is-active .depth-ruler-tick {
    width: 12px; height: 12px; background: #14b8a6;
    box-shadow: 0 0 10px rgba(20, 184, 166, .75);
  }

  /* 跟随滚动的指针：左右两翼 + 发光圆芯（右缘与轨道右缘对齐） */
  .depth-ruler-pointer {
    position: absolute; right: 0; transform: translateY(-50%);
    pointer-events: none; display: flex; align-items: center;
  }
  .depth-ruler-pointer-wing { display: block; width: 10px; height: 1px; background: rgba(0, 0, 0, .35); }
  .depth-ruler-pointer-wing--left { margin-right: 2px; }
  .depth-ruler-pointer-wing--right { margin-left: 2px; }
  .depth-ruler-pointer-core {
    display: block; width: 7px; height: 7px; border-radius: 9999px;
    background: #fff;
    box-shadow: 0 0 0 2px rgba(20, 184, 166, .55), 0 0 14px rgba(20, 184, 166, .75);
  }

  .depth-ruler-caption {
    margin-top: 12px; padding-right: 4px;
    font-size: 8.8px; font-weight: 600; letter-spacing: 3.08px; color: rgba(0, 0, 0, .28);
  }
}

/* ========== 首页·实用工具（站长建站常用工具导航） ========== */
.tool-group + .tool-group { border-top: 1px solid var(--line); }
.tool-group-title {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 18px; background: #fafbfc; border-bottom: 1px solid var(--line);
  font-size: 15px; font-weight: 700; color: var(--text);
}
.tool-group-title::before {
  content: ""; width: 4px; height: 14px;
  background: var(--green); border-radius: 2px;
}
.tool-list {
  list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2px 8px; padding: 12px 18px 16px;
}
.tool-list li { min-width: 0; }
.tool-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; border-radius: 8px; min-width: 0;
}
.tool-item:hover { background: #f0f9ee; }
.tool-item:focus-visible { outline: 2px solid var(--green); outline-offset: 1px; }
.tool-ic {
  width: 30px; height: 30px; flex-shrink: 0; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 14px; font-weight: 700;
}
/* 站点真实图标（本地抓取，加载失败时回落到上面的首字色块） */
img.tool-ic {
  object-fit: contain; background: #f6f7f9; padding: 3px;
  font-size: 0; /* 兜底时若退化为文本节点，避免出现字符 */
}
.tool-tx { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.tool-tx b {
  font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tool-item:hover .tool-tx b { color: var(--green); }
.tool-tx em {
  font-size: 11px; font-style: normal; color: var(--text-3); line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* 内容列比整行窄（左侧还有 132px 分类栏），1024px 起收成三列更安全 */
@media (max-width: 1024px) {
  .tool-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .tool-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 6px; padding: 10px 12px 14px; }
  .tool-item { padding: 6px; gap: 8px; }
  .tool-ic { width: 26px; height: 26px; border-radius: 7px; font-size: 13px; }
  .tool-tx b { font-size: 12px; }
  .tool-tx em { display: none; }   /* 窄屏只留名称，保证两列可读 */
  .tool-group-title { padding: 8px 14px; font-size: 14px; }
}

/* ========== 广告位 ========== */
.adslot { display: flex; flex-direction: column; gap: 12px; padding-bottom: 4px; }
.adslot[hidden] { display: none; }
.ad-card {
  position: relative; display: flex; align-items: center; justify-content: center;
  min-height: 90px; border-radius: var(--radius); overflow: hidden;
  background: linear-gradient(135deg, #38a832, #06b6d4);
  color: #fff; box-shadow: var(--shadow);
  transition: filter .2s, transform .2s;
}
.ad-card:hover { filter: brightness(1.06); }
.ad-card:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.ad-img { width: 100%; min-height: 90px; object-fit: cover; display: block; }
.ad-text { padding: 16px 28px; font-size: 16px; font-weight: 600; text-shadow: 0 1px 4px rgba(0, 0, 0, .25); text-align: center; }
.ad-badge {
  position: absolute; right: 10px; bottom: 8px;
  font-size: 11px; font-weight: 400; line-height: 1.6;
  color: #fff; background: rgba(0, 0, 0, .3);
  padding: 0 7px; border-radius: 4px;
}

@media (max-width: 560px) {
  .ad-card, .ad-img { min-height: 64px; }
  .ad-text { font-size: 14px; padding: 12px 20px; }
}

/* ========== 提交页·提交说明 ========== */
.note-body { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 16px; }
.note-sec h3 {
  display: flex; align-items: center; gap: 7px;
  font-size: 14px; font-weight: 700; margin-bottom: 6px;
}
.note-sec h3::before { content: ""; width: 3px; height: 13px; border-radius: 2px; background: var(--green); }
.note-sec.no h3::before { background: var(--red); }
.note-list { list-style: none; display: flex; flex-direction: column; gap: 3px; }
.note-list li { position: relative; padding-left: 15px; font-size: 13px; color: var(--text-2); }
.note-list li::before {
  content: ""; position: absolute; left: 2px; top: 9px;
  width: 4px; height: 4px; border-radius: 50%; background: var(--text-3);
}
.note-sec.no .note-list li::before { background: var(--red); }
.note-tip { font-size: 12px; color: var(--text-3); border-top: 1px dashed var(--line); padding-top: 10px; }

/* ========== 首页增强模块：公告 / 快捷 / 轮播 / 热搜 / 分类Tab ========== */

/* 公告栏 */
.announce-wrap { padding-bottom: 10px; }
.announce { display: flex; align-items: center; gap: 10px; background: #fff7ed; border: 1px solid #ffe0b3; border-radius: 8px; padding: 7px 12px; overflow: hidden; }
.announce-tag { flex-shrink: 0; background: var(--orange); color: #fff; font-size: 12px; padding: 2px 8px; border-radius: 4px; font-weight: 600; }
.announce-viewport { flex: 1; overflow: hidden; }
.announce-track { display: flex; white-space: nowrap; animation: marquee 22s linear infinite; }
.announce-track:hover { animation-play-state: paused; }
.announce-item { position: relative; color: #a05a00; font-size: 13px; padding: 0 30px; }
.announce-item::before { content: "•"; position: absolute; left: 10px; color: var(--orange); }
.announce-close { flex-shrink: 0; border: 0; background: transparent; color: #bbb; font-size: 18px; line-height: 1; cursor: pointer; padding: 0 4px; }
.announce-close:hover { color: var(--text-2); }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* 快捷功能入口 */
.quickbar { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 4px; padding-bottom: 6px; }
.quick-item { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 74px; padding: 10px 6px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); font-size: 12px; color: var(--text-2); }
.quick-item:hover { border-color: var(--green); color: var(--green); }
.quick-item .qi-ico { font-size: 22px; line-height: 1; }
.quick-item .qi-name { white-space: nowrap; }

/* 焦点轮播图（已从首页移除，保留样式备用） */


/* 热搜榜（已从首页移除，保留样式备用） */


@media (max-width: 560px) {
  .announce-item { font-size: 12px; padding: 0 22px; }
  .quickbar { gap: 8px; }
  .quick-item { flex: 1 1 calc(25% - 8px); width: auto; }
}

/* ========== 问答中心 ========== */

/* 页面大标题 */
.qa-hero { padding-top: 26px; text-align: center; }
.qa-hero h1 { font-size: 26px; font-weight: 800; letter-spacing: 1px; }
.qa-hero p { margin-top: 6px; font-size: 13px; color: var(--text-3); }

/* 双栏布局：主内容 + 侧栏 */
.qa-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px; align-items: start;
  padding-top: 18px; padding-bottom: 50px;
}
.qa-main { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.qa-side { min-width: 0; display: flex; flex-direction: column; gap: 16px; }

/* 头部搜索框 */
.qa-search {
  display: flex; align-items: center; height: 32px;
  border: 1px solid var(--line); border-radius: 999px; background: #fff; overflow: hidden;
}
.qa-search input {
  width: 150px; border: 0; outline: 0; background: transparent;
  padding: 0 12px; font-size: 13px; font-family: inherit; color: var(--text);
}
.qa-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.qa-search button {
  border: 0; background: transparent; color: var(--text-3); cursor: pointer;
  padding: 0 11px; height: 100%; display: flex; align-items: center;
}
.qa-search button:hover { color: var(--green); }
.qa-search:focus-within { border-color: var(--green); }

/* 「提问」按钮（红，与截图中提问入口一致） */
.btn-ask {
  display: inline-flex; align-items: center; gap: 5px;
  border: 0; background: var(--red); color: #fff;
  border-radius: 6px; padding: 7px 16px;
  font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.btn-ask:hover { background: #d8383a; }

/* 工具条：分类 chips + 排序 */
.qa-tools {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  padding: 12px 18px; border-bottom: 1px solid var(--line);
}
.qa-chips { display: flex; flex-wrap: wrap; gap: 8px; flex: 1 1 auto; min-width: 0; }
.qa-chips .chip { padding: 4px 12px; font-size: 12px; }
.qa-sorts { display: flex; gap: 6px; flex-shrink: 0; }
.qa-sorts .chip { padding: 4px 11px; font-size: 12px; }

/* 筛选条件条 */
.qa-filterbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  padding: 9px 18px; background: #fafafa; border-bottom: 1px solid var(--line);
  font-size: 12px; color: var(--text-2);
}
.qa-filter { display: inline-flex; align-items: center; gap: 6px; background: #eef7fd; border: 1px solid #cde9f8; color: #1a7fb5; border-radius: 999px; padding: 2px 6px 2px 10px; }
.qa-filter button {
  border: 0; background: transparent; color: #1a7fb5; cursor: pointer;
  font-size: 14px; line-height: 1; padding: 0 3px;
}
.qa-filter button:hover { color: var(--red); }
.qa-total { margin-left: auto; color: var(--text-3); }

/* 问题列表 */
.qa-list { list-style: none; padding: 4px 18px 8px; }
.qa-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 0; border-bottom: 1px solid #f2f2f2;
}
.qa-item:last-child { border-bottom: 0; }
.qa-item-body { flex: 1; min-width: 0; }
.qa-item-title {
  display: block; font-size: 15px; line-height: 1.5; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.qa-item-title:hover { color: var(--green); }
/* 名次徽标：1 红 / 2 橙 / 3 黄 / 其余灰（与截图一致） */
.qa-rank {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 5px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #c3c8d0; color: #fff; font-size: 12px; font-weight: 700;
  font-style: italic;
}
.qa-rank-1 { background: #f04142; }
.qa-rank-2 { background: #ff7a1a; }
.qa-rank-3 { background: #f5b400; }
.qa-item-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 7px;
  margin-top: 5px; font-size: 12px; color: var(--text-3);
}
.qa-sep { color: #d8d8d8; }
.qa-zero { color: var(--orange); }
.qa-like-mini { color: #e0607a; }
.qa-cat {
  font-size: 11px; color: var(--green); background: #f0f9ee;
  border-radius: 4px; padding: 1px 7px; white-space: nowrap;
}
.qa-cat:hover { background: #e2f4dd; }
.qa-solved {
  display: inline-block; margin-left: 8px; vertical-align: 1px;
  font-size: 11px; font-weight: 600; color: #fff;
  background: var(--green); border-radius: 4px; padding: 1px 7px;
}
.qa-solved-lg { font-size: 12px; padding: 2px 9px; }
/* 「写回答」按钮（浅蓝，与截图一致） */
.qa-write {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; color: #1a9ad6; background: #eef7fd;
  border: 1px solid #cde9f8; border-radius: 6px; padding: 6px 13px;
  white-space: nowrap;
}
.qa-write:hover { background: #dcf0fb; color: #1580b5; }
.qa-write-lg { font-size: 13px; padding: 8px 16px; }

.qa-skeleton { padding: 30px 0; text-align: center; color: var(--text-3); font-size: 13px; }
.qa-empty { padding: 34px 0; text-align: center; color: var(--text-3); font-size: 13px; }
.qa-more-wrap { padding: 12px 18px 16px; text-align: center; }
.qa-more-wrap .btn-plain { padding: 7px 26px; font-size: 13px; }
.qa-link { color: var(--green); }

/* 热门标签 */
.qa-tagcloud { display: flex; flex-wrap: wrap; gap: 7px; padding: 13px 16px 16px; }
.qa-tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--text-2);
  border: 1px solid var(--line); background: #fff;
  border-radius: 999px; padding: 4px 10px;
}
.qa-tag:hover { border-color: var(--green); color: var(--green); background: #f0f9ee; }
.qa-tag.active { background: var(--green); border-color: var(--green); color: #fff; }
.qa-tag.active .qa-tag-n { color: rgba(255, 255, 255, .85); }
.qa-tag-n { font-size: 11px; color: var(--text-3); }
.qa-tag-sm { padding: 2px 9px; font-size: 11px; }
.qa-tag-empty { font-size: 12px; color: var(--text-3); }

/* 随机问题 / 相关问题 */
.qa-randlist { list-style: none; padding: 8px 16px 14px; }
.qa-randitem { border-bottom: 1px dashed #f0f0f0; }
.qa-randitem:last-child { border-bottom: 0; }
.qa-randitem a { display: block; padding: 9px 0 9px 14px; position: relative; }
.qa-randitem a::before {
  content: ""; position: absolute; left: 2px; top: 16px;
  width: 5px; height: 5px; border-radius: 50%;
  border: 1px solid #4aa8e0; background: transparent;
}
.qa-randitem a:hover .qa-randtitle { color: var(--green); }
.qa-randtime { display: block; font-size: 11px; color: var(--text-3); }
.qa-randtitle {
  display: block; font-size: 13px; line-height: 1.6; color: var(--text-2);
  overflow: hidden; text-overflow: ellipsis;
}
.link-more { border: 0; background: transparent; font-size: 12px; color: var(--green); cursor: pointer; padding: 0; }
.link-more:hover { text-decoration: underline; }

/* ---------- 问题详情 ---------- */
.qa-detail { padding: 22px 24px 18px; }
.qa-q-title { font-size: 21px; line-height: 1.45; font-weight: 700; }
.qa-q-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin: 12px 0 10px; font-size: 12px; color: var(--text-3);
}
.qa-q-author { color: var(--green-dark); font-weight: 600; }
.qa-q-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 16px; }
.qa-q-body {
  font-size: 15px; line-height: 1.9; white-space: pre-wrap; word-break: break-word;
  padding-bottom: 16px; border-bottom: 1px solid #f2f2f2;
}
.qa-q-ops { display: flex; align-items: center; gap: 12px; padding-top: 14px; flex-wrap: wrap; }
.qa-q-extra { margin-left: auto; font-size: 12px; color: var(--text-3); }
.qa-avatar {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 12px; font-weight: 700;
}
.qa-like {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid #f0c8d2; background: #fff5f7; color: #d9526f;
  border-radius: 999px; padding: 7px 16px;
  font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.qa-like:hover { background: #ffe9ee; }
.qa-like:disabled { opacity: .6; cursor: default; }
.qa-like-ico { font-size: 13px; line-height: 1; }
.qa-like.liked { background: #f04142; border-color: #f04142; color: #fff; }
.qa-like-sm { padding: 4px 12px; font-size: 12px; }

/* 回答列表 */
.qa-answer { position: relative; padding: 16px 24px; border-bottom: 1px solid #f2f2f2; }
.qa-answer:last-child { border-bottom: 0; }
.qa-answer.best { background: #f6fcf4; }
.qa-best-flag {
  position: absolute; top: 0; right: 0;
  font-size: 11px; font-weight: 600; color: #fff;
  background: var(--green); padding: 3px 10px; border-bottom-left-radius: 8px;
}
.qa-answer-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.qa-answer-author { font-size: 13px; font-weight: 600; color: var(--green-dark); }
.qa-answer-time { font-size: 12px; color: var(--text-3); }
.qa-floor { margin-left: auto; font-size: 12px; color: var(--text-3); }
.qa-answer-body { font-size: 14px; line-height: 1.85; white-space: pre-wrap; word-break: break-word; }
.qa-answer-ops { margin-top: 10px; }
.lbl-tip { font-weight: 400; color: var(--text-3); font-size: 12px; margin-left: 6px; }

/* ---------- 应答式 ---------- */
@media (max-width: 900px) {
  .qa-layout { grid-template-columns: minmax(0, 1fr); }
  .qa-side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qa-side .adslot { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .qa-hero { padding-top: 18px; }
  .qa-hero h1 { font-size: 21px; }
  .qa-layout { padding-top: 14px; padding-bottom: 34px; }
  .qa-side { grid-template-columns: minmax(0, 1fr); }
  .qa-search input { width: 100px; }
  .qa-tools { padding: 10px 14px; }
  .qa-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .qa-chips::-webkit-scrollbar { display: none; }
  .qa-chips .chip { flex-shrink: 0; }
  .qa-list { padding: 2px 14px 6px; }
  /* 窄屏：标题独占一行，元信息与「写回答」并排 */
  .qa-item { flex-wrap: wrap; gap: 8px; }
  .qa-item-body { flex: 1 1 100%; order: 2; }
  .qa-item-title { white-space: normal; font-size: 14px; }
  .qa-rank { order: 1; }
  .qa-write { order: 3; margin-left: auto; }
  .qa-detail { padding: 16px; }
  .qa-q-title { font-size: 18px; }
  .qa-q-extra { display: none; }
  .qa-answer { padding: 14px 16px; }
  .qa-filterbar { padding: 8px 14px; }
  .qa-total { width: 100%; margin-left: 0; }
}

/* ========== 夜晚模式 ==========
 * 由 js/theme.js 在首屏前把 data-theme 写到 <html> 上（本地记忆 > 系统偏好）。
 * 选择器统一加 html 前缀：admin.html 里另有一段 :root，与 [data-theme] 同优先级时会按加载顺序覆盖，
 * 写成 html[data-theme="dark"]（0,1,1）可稳定胜出，不受引入顺序影响。
 * 思路：先替换基础变量，再对散落的硬编码浅色逐条覆盖；品牌色在深底上适度提亮。
 */
html[data-theme="dark"] {
  color-scheme: dark;
  background: #16181c;
  --green: #45c93e;
  --green-dark: #5fd858;
  --red: #ff5f60;
  --orange: #ff9243;
  --text: #e6e8eb;
  --text-2: #a9b0b8;
  --text-3: #7f868e;
  --line: #313640;
  --bg: #16181c;
  --card: #1f2227;
  --shadow: 0 1px 3px rgba(0, 0, 0, .5);
  scrollbar-color: #3a4048 transparent;
}

/* ---------- 主题切换按钮（白天显示月亮 / 夜晚显示太阳） ---------- */
.theme-toggle {
  width: 34px; height: 34px; flex-shrink: 0; padding: 0;
  border: 1px solid var(--line); border-radius: 50%;
  background: var(--card); color: var(--text-2);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: color .2s, border-color .2s, transform .2s;
}
.theme-toggle:hover { color: var(--green); border-color: var(--green); transform: translateY(-1px); }
.theme-toggle:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.theme-toggle .ico-sun { display: none; }
html[data-theme="dark"] .theme-toggle .ico-moon { display: none; }
html[data-theme="dark"] .theme-toggle .ico-sun { display: block; }

/* ---------- 顶栏 / 底栏 / 浅色底纹 ---------- */
html[data-theme="dark"] .topbar { background: #1a1d22; }
html[data-theme="dark"] .footer { background: #1a1d22; }
html[data-theme="dark"] .tool-group-title { background: #1b1e23; }
html[data-theme="dark"] .qa-filterbar { background: #1b1e23; }
html[data-theme="dark"] img.tool-ic { background: #2b3037; }

/* ---------- 输入框 / 弹窗 / 按钮等白底控件 ---------- */
html[data-theme="dark"] .search { background: var(--card); }
html[data-theme="dark"] .search-input { background: transparent; color: var(--text); }
html[data-theme="dark"] .chip { background: var(--card); }
html[data-theme="dark"] .btn-plain { background: var(--card); border-color: var(--line); }
html[data-theme="dark"] .error-box button { background: var(--card); }
html[data-theme="dark"] .modal { background: var(--card); }
html[data-theme="dark"] .friend-list a { background: var(--card); }
html[data-theme="dark"] .qa-search { background: var(--card); }
html[data-theme="dark"] .qa-tag { background: var(--card); }
html[data-theme="dark"] .form-input,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] .form-textarea { background: #262a30; border-color: var(--line); color: var(--text); }
html[data-theme="dark"] .fp-menu { background: var(--card); }

/* ---------- 浅绿 hover / 角标底（原 #f0f9ee） ---------- */
html[data-theme="dark"] .sidecat a:hover,
html[data-theme="dark"] .sidecat a.active,
html[data-theme="dark"] .link-grid a:hover,
html[data-theme="dark"] .tool-item:hover,
html[data-theme="dark"] .qa-tag:hover,
html[data-theme="dark"] .friend-list a:hover { background: rgba(69, 201, 62, .14); }
html[data-theme="dark"] .pcat,
html[data-theme="dark"] .qa-cat { background: rgba(69, 201, 62, .16); }

/* ---------- 细分割线（原 #f2f2f2） ---------- */
html[data-theme="dark"] .post-list li,
html[data-theme="dark"] .reply-item,
html[data-theme="dark"] .qa-item,
html[data-theme="dark"] .qa-answer,
html[data-theme="dark"] .qa-q-body { border-bottom-color: #2b3037; }
html[data-theme="dark"] .qa-randitem { border-bottom-color: #2b3037; }

/* ---------- 资讯标签 / 公告条 ---------- */
html[data-theme="dark"] .tag { background: rgba(255, 95, 96, .14); border-color: rgba(255, 95, 96, .35); }
html[data-theme="dark"] .announce { background: rgba(255, 146, 67, .12); border-color: rgba(255, 146, 67, .32); }
html[data-theme="dark"] .announce-item { color: #e9b071; }

/* ---------- 问答中心 ---------- */
html[data-theme="dark"] .qa-filter { background: rgba(90, 190, 235, .14); border-color: rgba(90, 190, 235, .34); color: #79cdf0; }
html[data-theme="dark"] .qa-filter button { color: #79cdf0; }
html[data-theme="dark"] .qa-write { background: rgba(90, 190, 235, .13); border-color: rgba(90, 190, 235, .3); color: #7fd0f2; }
html[data-theme="dark"] .qa-write:hover { background: rgba(90, 190, 235, .22); color: #9adcff; }
html[data-theme="dark"] .qa-like { background: rgba(217, 82, 111, .16); border-color: rgba(217, 82, 111, .4); color: #ff92ab; }
html[data-theme="dark"] .qa-like:hover { background: rgba(217, 82, 111, .26); }
html[data-theme="dark"] .qa-like.liked { background: var(--red); border-color: var(--red); color: #fff; }
html[data-theme="dark"] .qa-rank { background: #4a5058; }
html[data-theme="dark"] .qa-answer.best { background: rgba(69, 201, 62, .08); }
html[data-theme="dark"] .qa-best-flag { color: #10210f; }
html[data-theme="dark"] .qa-solved { color: #10210f; }

/* ---------- 左栏速览面板（原为 Material 浅色） ---------- */
html[data-theme="dark"] .fp-tab { color: #b6bcc4; }
html[data-theme="dark"] .fp-tab:hover,
html[data-theme="dark"] .fp-tab.is-active { color: #7fb4ff; border-bottom-color: #7fb4ff; }
html[data-theme="dark"] .fp-ico { color: #9aa0a6; }
html[data-theme="dark"] .fp-ico:hover { background: #2b3037; color: #e6e8eb; }
html[data-theme="dark"] .fp-menu button { color: #cdd2d8; }
html[data-theme="dark"] .fp-menu button:hover { background: #2b3037; }
html[data-theme="dark"] .fp-row:hover { background: #252a31; }
html[data-theme="dark"] .fp-row:hover .fp-row-title { color: #7fb4ff; }
html[data-theme="dark"] .fp-row-heat { color: #868d95; }
html[data-theme="dark"] .fp-rank { color: #6b727a; }
html[data-theme="dark"] .fp-rank-1 { color: #ff5f60; }
html[data-theme="dark"] .fp-rank-2 { color: #ff9243; }
html[data-theme="dark"] .fp-rank-3 { color: #ffc93c; }
html[data-theme="dark"] .fp-foot { background: #1a1d22; color: #8b9198; }
html[data-theme="dark"] .fp-body::-webkit-scrollbar-thumb { background: #3a4048; }

/* ---------- 页内导航深度尺：深色下正好用回原站 pro.momoyu.cc 的原始配色 ---------- */
html[data-theme="dark"] .depth-ruler-value { color: rgba(94, 234, 212, .95); }
html[data-theme="dark"] .depth-ruler-unit { color: rgba(255, 255, 255, .35); }
html[data-theme="dark"] .depth-ruler-label { color: rgba(255, 255, 255, .35); }
html[data-theme="dark"] .depth-ruler-mark.is-active .depth-ruler-label { color: #5eead4; }
html[data-theme="dark"] .depth-ruler-tick { background: rgba(255, 255, 255, .25); }
html[data-theme="dark"] .depth-ruler-mark:hover .depth-ruler-tick { background: rgba(255, 255, 255, .5); }
html[data-theme="dark"] .depth-ruler-mark.is-active .depth-ruler-tick { background: #5eead4; box-shadow: 0 0 10px rgb(45 212 191 / .75); }
html[data-theme="dark"] .depth-ruler-pointer-wing { background: rgba(255, 255, 255, .55); }
html[data-theme="dark"] .depth-ruler-pointer-core { box-shadow: 0 0 0 2px rgba(45, 212, 191, .55), 0 0 14px rgba(45, 212, 191, .75); }
html[data-theme="dark"] .depth-ruler-caption { color: rgba(255, 255, 255, .28); }

/* ---------- 滚动条 ---------- */
html[data-theme="dark"] .fp-body::-webkit-scrollbar-thumb,
html[data-theme="dark"] .sidecat::-webkit-scrollbar-thumb { background: #3a4048; }

/* ========== 触屏适配（≤1024px）：点击热区 ≥40px、辅助文字 ≥12px ==========
 * 口径：可交互元素（a / button / input）的热区以 40×40 CSS px 为基线。
 * 参照 WCAG 2.5.5（44px）与 Lighthouse 的 48px，取 40 作为本项目的工程基线——
 * 既明显高于桌面鼠标的使用精度，又不会把移动端界面撑得过于松散。
 * 正文/辅助文字一律不低于 12px（iOS 上 <12px 中文明显发虚）。
 *
 * 两种手法：
 *  ① 真放大：撑高所在整行（顶栏、搜索框、公告条、速览面板 Tab 行）——这些本来就是独立控件行；
 *  ② 负外边距撑热区：padding 放大 + 等量负 margin 抵消（见 .link-more），热区变大但排版位置与视觉完全不变。
 *
 * 放在文件末尾：同特异性时按顺序覆盖前面的移动端规则。
 */
@media (max-width: 1024px) {
  /* --- 顶栏：链接撑满整条，并允许横向滚动兜底 --- */
  .topbar-inner { height: auto; min-height: 40px; gap: 12px; }
  .topbar-links {
    min-width: 0; overflow-x: auto;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .topbar-links::-webkit-scrollbar { display: none; }
  .topbar-links a {
    display: inline-flex; align-items: center;
    min-height: 40px; padding: 0 8px;        /* 两字链接（论坛）只有 24px 宽，靠内边距补到 40px */
    white-space: nowrap; flex-shrink: 0;
  }
  .topbar-date { flex-shrink: 0; }

  /* --- 头部：站标 / 主题按钮 / 搜索框 --- */
  .logo { min-height: 40px; }
  .theme-toggle { width: 40px; height: 40px; }
  .search-input { padding-top: 12px; padding-bottom: 12px; }  /* 37px → 41px，按钮随 flex 拉伸同步变高 */
  .search-btn { min-height: 42px; }

  /* --- 公告条：条目本身是链接，给足高度；条内边距相应收紧，整条只增到 44px --- */
  .announce { padding-top: 2px; padding-bottom: 2px; }
  .announce-item { display: inline-flex; align-items: center; min-height: 40px; }
  .announce-close {
    width: 40px; height: 40px; padding: 0; margin-right: -8px;
    display: inline-flex; align-items: center; justify-content: center;
  }

  /* --- 左栏速览面板：Tab 行与 ⋮ 按钮 --- */
  .fp-head { padding-left: 6px; padding-right: 6px; }
  .fp-tabs { gap: 8px; }
  .fp-tab {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 40px; min-height: 40px; padding: 0 10px;
  }
  .fp-ico { width: 40px; height: 40px; }

  /* --- 站内智能助手：快捷提问 chips --- */
  .ai-chip {
    display: inline-flex; align-items: center;
    min-height: 40px; padding-top: 0; padding-bottom: 0;
  }
  .ai-ask-btn { min-height: 42px; }

  /* --- 内容区列表行 ---
     桌面鼠标点 33~39px 的链接没问题，触屏上偏窄，统一抬到 40px。
     这几处都是 display:flex，直接给 min-height 即可，不必动内边距。 */
  .tool-item, .news-list a, .link-grid a, .friend-list a { min-height: 40px; }

  /* 「进入论坛 ›」：19px 的行内链接。真加 padding 会把面板头撑高，
     所以用「padding 放大 + 等量负 margin 抵消」，热区 41px、排版与视觉完全不变。 */
  .panel-head .link-more { padding: 11px 4px; margin: -11px -4px; }
  /* 「换一批」：按钮形态的链接，直接抬高度最省事 */
  button.link-more { display: inline-flex; align-items: center; min-height: 40px; }

  /* --- 子页面头（论坛 / 问答 / 提交 / 帖子） --- */
  .page-head .inner { gap: 8px; padding-top: 8px; padding-bottom: 8px; }
  .page-head .nav-link { display: inline-flex; align-items: center; min-height: 40px; padding: 0 7px; }

  /* --- 通用按钮与筛选 chip：高度统一 40px（宽度本来就够） --- */
  .chip, .btn-primary, .btn-plain, .btn-ask, .qa-write, .qa-tag, .qa-tag-sm,
  .qa-like, .qa-like-sm {
    display: inline-flex; align-items: center; justify-content: center; min-height: 40px;
  }

  /* --- 问答页 --- */
  .qa-search { height: 42px; }            /* 32px 的胶囊搜索框，输入区只有 17px 高 */
  .qa-search input { align-self: stretch; }
  .qa-search button { padding: 0 13px; }
  .qa-item-title { padding-top: 10px; padding-bottom: 10px; }   /* 21px → 41px */
  /* 分类角标：20px 高，是元信息行里的小徽标，真撑高会把整行拉变形。
     用绝对定位透明覆盖层把热区扩到 40px，视觉与排版零变化。 */
  .qa-cat { position: relative; }
  .qa-cat::after { content: ""; position: absolute; inset: -10px -4px; }

  /* --- 页脚正文里的行内链接（如 mailto:）--- 同为覆盖层扩热区 --- */
  .footer p a { position: relative; }
  .footer p a::after { content: ""; position: absolute; inset: -12px -6px; }

  /* --- 辅助文字下限 12px --- */
  .fp-row-heat, .fp-rank, .fp-foot, .fp-empty,
  .tool-tx em, .pcat, .panel-more, .link-more,
  .tag, .hot-mark, .ad-badge, .announce-item, .qa-filterbar,
  .qa-cat, .qa-solved, .qa-best-flag, .qa-tag-sm, .qa-tag-n, .qa-randtime,
  .ai-conf, .ai-answer-intent, .ai-ans-kind, .ai-ans-sub { font-size: 12px; }
}
