/* ============ AI工具集 仿制样式 ============ */
:root {
  --primary: #6c4cf1;
  --primary-light: #8b6ef5;
  --primary-bg: #f1edfe;
  --bg: #f4f6fa;
  --card-bg: #ffffff;
  --text: #26272e;
  --text-2: #6b7280;
  --text-3: #9ca3af;
  --border: #eceef2;
  --shadow: 0 1px 3px rgba(30, 30, 60, .06);
  --shadow-hover: 0 8px 24px rgba(108, 76, 241, .14);
  --sidebar-w: 220px;
  --radius: 12px;
}

html[data-theme="dark"] {
  --primary: #8b6ef5;
  --primary-light: #a48ef8;
  --primary-bg: #2a2440;
  --bg: #14151a;
  --card-bg: #1e2028;
  --text: #e8e9ed;
  --text-2: #9aa0ac;
  --text-3: #6b7280;
  --border: #2b2e38;
  --shadow: 0 1px 3px rgba(0, 0, 0, .3);
  --shadow-hover: 0 8px 24px rgba(0, 0, 0, .45);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background .3s, color .3s;
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ============ 侧边栏 ============ */
.sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--card-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform .3s, background .3s;
}

.sidebar-logo {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
}

.logo-link { display: flex; align-items: center; gap: 8px; }
.logo-icon { font-size: 26px; }
.logo-text { font-size: 21px; font-weight: 800; letter-spacing: .5px; }
.logo-text em { font-style: normal; color: var(--primary); }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--text-2);
  font-size: 14px;
  margin-bottom: 2px;
  transition: all .2s;
}

.nav-item:hover { background: var(--primary-bg); color: var(--primary); }
.nav-item.active { background: var(--primary); color: #fff; font-weight: 600; }
.nav-item .nav-icon { font-size: 16px; width: 20px; text-align: center; }
.nav-item .nav-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-3);
  background: var(--bg);
  border-radius: 10px;
  padding: 0 7px;
}
.nav-item.active .nav-count { background: rgba(255,255,255,.25); color: #fff; }

.sidebar-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-3);
}

.sidebar-mask {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 99;
}

/* ============ 主区域 ============ */
.main-wrapper {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 顶栏 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 56px;
  padding: 0 24px;
  background: color-mix(in srgb, var(--card-bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
}
.menu-toggle span {
  width: 20px; height: 2px;
  background: var(--text);
  border-radius: 2px;
}

.topbar-nav { display: flex; gap: 4px; }
.topbar-nav a {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-2);
  transition: all .2s;
}
.topbar-nav a:hover { color: var(--primary); background: var(--primary-bg); }
.topbar-nav a.active { color: var(--primary); background: var(--primary-bg); font-weight: 600; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.theme-toggle {
  font-size: 17px;
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid; place-items: center;
  transition: background .2s;
}
.theme-toggle:hover { background: var(--primary-bg); }

/* ============ 内容区 ============ */
.content {
  flex: 1;
  padding: 28px 28px 0;
  max-width: 1500px;
  width: 100%;
}

/* Hero 搜索区 */
.hero { text-align: center; padding: 26px 0 30px; }

.hero-title { font-size: 34px; font-weight: 800; letter-spacing: 1px; }
.hero-title span {
  background: linear-gradient(120deg, var(--primary), #b06ef5 60%, #f56ec0);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-sub { color: var(--text-2); margin-top: 8px; font-size: 15px; }

.search-box {
  max-width: 640px;
  margin: 22px auto 0;
}

.search-tabs {
  display: flex;
  gap: 4px;
  justify-content: flex-start;
  padding-left: 18px;
}
.s-tab {
  padding: 6px 16px;
  font-size: 13px;
  color: var(--text-2);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  opacity: .75;
}
.s-tab.active {
  color: var(--primary);
  font-weight: 600;
  opacity: 1;
  position: relative;
  z-index: 2;
}

.search-input-row {
  display: flex;
  background: var(--card-bg);
  border: 2px solid var(--primary);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 6px 22px rgba(108, 76, 241, .12);
  position: relative;
  z-index: 1;
}

#searchInput {
  flex: 1;
  border: none;
  outline: none;
  padding: 14px 18px;
  font-size: 15px;
  background: transparent;
  color: var(--text);
}

.search-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 26px;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  transition: background .2s;
}
.search-btn:hover { background: var(--primary-light); }

.search-hot {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-3);
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.search-hot a { color: var(--text-2); cursor: pointer; transition: color .2s; }
.search-hot a:hover { color: var(--primary); }

/* ============ 热门推荐 ============ */
.hot-section {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 34px;
}

.hot-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow);
  transition: all .25s;
  cursor: pointer;
}
.hot-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary);
}
.hot-card .hot-name { font-size: 14px; font-weight: 600; }
.hot-card .hot-desc {
  font-size: 11px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hot-card .hot-info { min-width: 0; }

/* ============ 分类区块 ============ */
.category-section { margin-bottom: 38px; scroll-margin-top: 76px; }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 19px;
  font-weight: 700;
}
.section-title .cat-icon { font-size: 20px; }
.section-title em {
  font-style: normal;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-3);
}

.more-link {
  font-size: 13px;
  color: var(--text-3);
  transition: color .2s;
}
.more-link:hover { color: var(--primary); }

/* 子标签 */
.sub-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.sub-tab {
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 20px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--text-2);
  transition: all .2s;
}
.sub-tab:hover, .sub-tab.active {
  background: var(--primary-bg);
  border-color: var(--primary);
  color: var(--primary);
}

/* 工具卡片网格 */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}

.tool-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  transition: all .25s;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.tool-card::after {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--primary), #f56ec0);
  opacity: 0;
  transition: opacity .25s;
}

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: transparent;
}
.tool-card:hover::after { opacity: 1; }

.tool-logo {
  flex-shrink: 0;
  width: 42px; height: 42px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  user-select: none;
}

.tool-info { min-width: 0; }
.tool-name {
  font-size: 14.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tool-desc {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
}

/* 搜索结果 */
.clear-search {
  font-size: 13px;
  color: var(--text-2);
  padding: 5px 12px;
  border-radius: 8px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  transition: all .2s;
}
.clear-search:hover { color: var(--primary); border-color: var(--primary); }

.no-result {
  text-align: center;
  color: var(--text-3);
  padding: 50px 0;
  font-size: 15px;
}

.search-result { margin-bottom: 40px; }

.hl { color: var(--primary); font-weight: 700; }

/* ============ 页脚 ============ */
.footer {
  border-top: 1px solid var(--border);
  padding: 24px 0 30px;
  text-align: center;
  font-size: 13px;
  color: var(--text-3);
  margin-top: 10px;
}
.footer a { color: var(--primary); }

/* 返回顶部 */
.back-top {
  position: fixed;
  right: 26px;
  bottom: 30px;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 18px;
  box-shadow: 0 4px 14px rgba(108, 76, 241, .4);
  opacity: 0;
  pointer-events: none;
  transition: all .3s;
  z-index: 80;
}
.back-top.show { opacity: 1; pointer-events: auto; }
.back-top:hover { transform: translateY(-3px); }

/* ============ 响应式 ============ */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 20px rgba(0,0,0,.15); }
  .sidebar-mask.show { display: block; }
  .main-wrapper { margin-left: 0; }
  .menu-toggle { display: flex; }
}

@media (max-width: 640px) {
  .content { padding: 18px 14px 0; }
  .hero-title { font-size: 25px; }
  .topbar-nav a { padding: 6px 8px; font-size: 13px; }
  .tool-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .hot-section { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .search-btn span { display: none; }
  .search-btn { padding: 0 16px; }
}

/* 窄屏防横向溢出：clip 不产生滚动容器，不影响页内 sticky 定位 */
body { overflow-x: clip; }
.main-wrapper, .content { min-width: 0; }

/* ============ AI资讯页 ============ */
/* 主列对齐 ai-bot.cn 后再向左延伸 240px：右缘保持不变，多出的宽度全部给时间线主列 */
.news-content {
  max-width: 1280px;
  margin: 0 max(0px, calc((100% - 1280px) / 2 + 120px)) 0 auto;
  min-width: 0;
}
.news-main { min-width: 0; }
.news-intro, .news-title, .news-text { overflow-wrap: break-word; }

.news-hero {
  padding: 30px 0 26px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 26px;
}
.news-hero h1 {
  font-size: 27px;
  font-weight: 800;
  letter-spacing: .5px;
}
.news-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-3);
}
.badge {
  background: linear-gradient(120deg, var(--primary), #f56ec0);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 999px;
}
.news-intro {
  margin-top: 14px;
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.8;
}

.news-search {
  display: flex;
  margin-top: 18px;
  max-width: 460px;
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color .2s;
}
.news-search:focus-within { border-color: var(--primary); }
.news-search input {
  flex: 1;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text);
  background: transparent;
}
.news-search button {
  padding: 0 16px;
  color: var(--text-3);
  display: grid;
  place-items: center;
  transition: color .2s;
}
.news-search button:hover { color: var(--primary); }

/* ============ 工具详情页 ============ */
.tool-detail { max-width: 960px; margin: 0 auto; }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 22px 0 18px;
  font-size: 13px;
  color: var(--text-3);
}
.breadcrumb a { color: var(--text-2); transition: color .2s; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb em {
  font-style: normal;
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tool-head-card {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 26px 28px;
  box-shadow: var(--shadow);
  margin-bottom: 30px;
}
.tool-logo-lg {
  width: 76px; height: 76px;
  border-radius: 18px;
  font-size: 34px;
}
.tool-head-info { flex: 1; min-width: 240px; }
.tool-head-info h1 { font-size: 24px; font-weight: 800; }
.tool-head-desc {
  margin-top: 6px;
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.7;
}
.tool-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.tool-tag {
  display: inline-block;
  padding: 3px 12px;
  font-size: 12.5px;
  color: var(--text-2);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
}
a.tool-tag:hover { color: var(--primary); border-color: var(--primary); }

.visit-btn {
  display: inline-block;
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(120deg, var(--primary), #8f6ef5);
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(108, 76, 241, .35);
  transition: all .25s;
}
.visit-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(108, 76, 241, .45); }

.detail-section { margin-bottom: 34px; }
.tool-intro {
  margin-top: 14px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 24px;
  font-size: 14px;
  color: var(--text-2);
  line-height: 2;
}
.tool-intro p + p { margin-top: 8px; }
.tool-intro b { color: var(--text); }

/* 详情页内目录 */
.detail-toc {
  position: sticky;
  top: 58px;
  z-index: 6;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 0 14px;
  margin-bottom: 8px;
  background: var(--bg);
}
.detail-toc a {
  padding: 5px 13px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: all .2s;
}
.detail-toc a:hover {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}
.detail-section { scroll-margin-top: 120px; }

/* 功能列表 / 使用步骤 */
.feature-list, .usage-list {
  margin-top: 14px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 24px 18px 44px;
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.9;
}
.feature-list li, .usage-list li { margin: 6px 0; }
.feature-list li::marker { color: var(--primary); }
.feature-list b { color: var(--text); }
.usage-list li::marker { color: var(--primary); font-weight: 700; }
.usage-tip {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-3);
}

/* FAQ 折叠 */
.faq-list { margin-top: 14px; display: grid; gap: 10px; }
.faq-item {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 18px;
  overflow: hidden;
}
.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 13px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  position: relative;
  padding-right: 26px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "⌄";
  position: absolute;
  right: 2px;
  top: 10px;
  color: var(--text-3);
  transition: transform .2s;
}
.faq-item[open] summary::after { transform: rotate(180deg); top: 14px; }
.faq-item p {
  padding: 0 0 14px;
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.9;
  border-top: 1px dashed var(--border);
  padding-top: 12px;
}

/* 评论区 */
.comment-form {
  margin-top: 14px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
}
.comment-form input,
.comment-form textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-size: 13.5px;
  padding: 9px 12px;
  font-family: inherit;
  resize: vertical;
}
.comment-form input:focus,
.comment-form textarea:focus {
  outline: none;
  border-color: var(--primary);
}
.comment-form-row { margin-bottom: 10px; }
.comment-form-row input { max-width: 260px; }
.comment-form-foot {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}
.comment-hint { font-size: 12.5px; color: var(--text-3); }
.comment-submit {
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
}
.comment-list { margin-top: 18px; display: grid; gap: 14px; }
.comment-item {
  display: flex;
  gap: 12px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}
.comment-item.is-admin { border-color: var(--primary); }
.comment-avatar {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
}
.comment-body { flex: 1; min-width: 0; }
.comment-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
}
.comment-role {
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--tag-bg, rgba(108, 76, 241, .08));
  color: var(--primary);
}
.comment-item.is-admin .comment-role {
  background: var(--primary);
  color: #fff;
}
.comment-time { font-size: 12px; color: var(--text-3); }
.comment-text {
  margin-top: 6px;
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.8;
  word-break: break-word;
}
.comment-empty {
  text-align: center;
  padding: 22px 0;
  color: var(--text-3);
  font-size: 13.5px;
  list-style: none;
}

@media (max-width: 640px) {
  .tool-head-card { padding: 20px 18px; }
  .tool-head-info h1 { font-size: 20px; }
  .tool-head-actions { width: 100%; }
  .visit-btn { display: block; text-align: center; }
}

/* 日期日历导航（吸顶按钮 + 弹出月历） */
.date-cal {
  position: sticky;
  top: 58px;
  z-index: 6;
  padding: 10px 0 14px;
  background: var(--bg);
}
.cal-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: all .2s;
}
.cal-toggle:hover { color: var(--primary); border-color: var(--primary); }
.cal-toggle i { font-style: normal; font-size: 10px; color: var(--text-3); }

.cal-panel {
  position: absolute;
  top: calc(100% - 6px);
  left: 0;
  width: 300px;
  max-width: calc(100vw - 28px);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-hover);
  padding: 12px 14px 14px;
  z-index: 30;
}
.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.cal-head b { font-size: 14px; color: var(--text); }
.cal-nav {
  width: 28px; height: 28px;
  border-radius: 8px;
  font-size: 17px;
  line-height: 1;
  color: var(--text-2);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all .2s;
}
.cal-nav:hover { background: var(--primary-bg); color: var(--primary); }

.cal-week, .cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.cal-week span {
  text-align: center;
  font-size: 11px;
  color: var(--text-3);
  padding: 4px 0;
}
.cal-cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  font-size: 13px;
  border-radius: 9px;
}
.cal-off { color: var(--text-3); opacity: .35; }
.cal-has {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  transition: all .15s;
}
.cal-has::after {
  content: "";
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--primary);
}
.cal-has:hover { background: var(--primary-bg); color: var(--primary); }
.cal-has.active { background: var(--primary); color: #fff; }
.cal-has.active::after { background: #fff; }

/* 时间线 */
.timeline { position: relative; padding-bottom: 30px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.day-group {
  position: relative;
  padding-left: 34px;
  margin-bottom: 34px;
  scroll-margin-top: 80px;
}
.day-group::before {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 2px var(--primary);
}

.day-badge {
  position: sticky;
  top: 112px;
  z-index: 5;
  margin-bottom: 14px;
}
.day-badge span {
  display: inline-block;
  background: linear-gradient(120deg, var(--primary), #8f6ef5);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  padding: 6px 18px;
  border-radius: 999px;
  box-shadow: 0 3px 10px rgba(108, 76, 241, .3);
}

.day-items {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.news-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 22px;
  transition: all .25s;
}
.news-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: transparent;
}
.news-title {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.45;
}
.news-link {
  color: inherit;
  text-decoration: none;
}
.news-link:hover {
  color: var(--primary);
}
.news-text {
  margin-top: 10px;
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.65;
}
.news-source {
  font-size: 12px;
  color: var(--text-3);
}

/* 卡片底部：来源 + 阅读全文入口 */
.news-foot {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.news-more {
  font-size: 12.5px;
  color: var(--primary);
  text-decoration: none;
  white-space: nowrap;
}
.news-more:hover { text-decoration: underline; }

@media (max-width: 640px) {
  .news-hero { padding: 22px 0 18px; }
  .news-hero h1 { font-size: 22px; }
  .news-meta { flex-wrap: wrap; }
  .news-search { max-width: 100%; }
  .day-group { padding-left: 26px; }
  .news-card { padding: 16px 16px; }
  .news-title { font-size: 16px; }
  .news-text { font-size: 13.5px; }
  .day-badge { top: 106px; }
  .date-cal { top: 52px; }
}

/* ============ 公共右侧栏组件（js/rightbar.js） ============ */
.with-rightbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 22px;
  align-items: start;
}
.rightbar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 74px;
}

/* 广告位 */
.rb-ad {
  position: relative;
  border-radius: 14px;
  padding: 22px 16px;
  text-align: center;
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  background: linear-gradient(135deg, var(--primary), #9b6ef5);
}

/* 卡片 */
.rb-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
}
.rb-card h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

/* 工具胶囊（两列） */
.rb-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}
.rb-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  border-radius: 9px;
  background: var(--bg);
  border: 1px solid transparent;
  font-size: 13px;
  color: var(--text);
  min-width: 0;
  transition: all .2s;
}
.rb-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-bg);
}
.rb-pill-logo {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}
.rb-pill-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 最新文章 */
.rb-articles { display: flex; flex-direction: column; gap: 14px; }
.rb-article { display: flex; gap: 11px; min-width: 0; }
.rb-thumb {
  flex-shrink: 0;
  width: 64px;
  height: 48px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}
.rb-article-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rb-article-title {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color .2s;
}
.rb-article:hover .rb-article-title { color: var(--primary); }
.rb-article-time { font-size: 12px; color: var(--text-3); }

.rb-error { font-size: 13px; color: var(--text-3); text-align: center; padding: 20px 0; }

/* 窄屏隐藏右侧栏，主内容占满 */
@media (max-width: 1100px) {
  .with-rightbar { grid-template-columns: 1fr; }
  .rightbar { display: none; }
}
.visit-btn.is-disabled {
  cursor: not-allowed;
  opacity: 0.55;
  box-shadow: none;
  user-select: none;
}
