/* ===== onenav-style article (applied only when class "art-on" is on <body>) ===== */

:root {
  --art-bg: #f6f8fa;
  --art-card: #ffffff;
  --art-text: #1f2937;
  --art-muted: #6b7280;
  --art-accent: #2c98b5;
  --art-accent-soft: #e6f4f7;
  --art-border: #e7eaee;
  --art-shadow: 0 6px 24px rgba(15, 23, 42, 0.06);
  --art-radius: 14px;
}

body.art-on { background: var(--art-bg) !important; color: var(--art-text) !important; font-family: "Source Sans Pro", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif !important; }
body.art-on.darkmode { background: #0f172a !important; color: #e2e8f0 !important; }

/* 隐藏 Quartz 默认侧栏与原 page 容器布局
   用更稳的 selector 组合：sidebar / explorer / footer 等 */
body.art-on #quartz-root { display: block !important; max-width: 1240px !important; margin: 0 auto !important; padding: 24px 20px 60px !important; }
body.art-on #quartz-body { display: grid !important; grid-template-columns: 1fr !important; gap: 0 !important; max-width: none !important; }
body.art-on .left.sidebar,
body.art-on .right.sidebar,
body.art-on .sidebar,
body.art-on .explorer,
body.art-on .desktop-explorer,
body.art-on .mobile-explorer,
body.art-on footer,
body.art-on .page-footer,
body.art-on #quartz-body > .sidebar { display: none !important; }
body.art-on .center,
body.art-on article.popover-hint { max-width: 100% !important; }
body.art-on .page-header { background: transparent !important; }

/* 顶部菜单栏（抽屉触发 + 顶部分类胶囊） */
.art-topbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 12px; padding: 12px 18px; margin: -24px -20px 24px; background: rgba(255,255,255,0.85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--art-border); }
body.art-on.darkmode .art-topbar { background: rgba(15,23,42,0.85); border-color: #1e293b; }
.art-topbar .art-back { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--art-accent-soft); color: var(--art-accent); text-decoration: none; font-size: 13px; font-weight: 600; }
.art-topbar .art-back:hover { background: var(--art-accent); color: #fff; }
.art-topbar .art-cats { display: flex; gap: 6px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.art-topbar .art-cats::-webkit-scrollbar { display: none; }
.art-topbar .art-cat { padding: 6px 12px; border-radius: 999px; background: transparent; border: 1px solid var(--art-border); color: var(--art-muted); text-decoration: none; font-size: 12.5px; white-space: nowrap; }
.art-topbar .art-cat:hover { color: var(--art-accent); border-color: var(--art-accent); }
body.art-on.darkmode .art-topbar .art-cat { background: transparent; border-color: #334155; color: #94a3b8; }

/* 抽屉（左侧导航） */
.art-drawer { position: fixed; top: 0; left: -340px; width: 320px; max-width: 90vw; height: 100vh; background: #fff; border-right: 1px solid var(--art-border); box-shadow: 0 12px 32px rgba(15,23,42,0.12); z-index: 100; transition: left .25s ease; display: flex; flex-direction: column; }
body.art-on.darkmode .art-drawer { background: #111827; border-color: #1f2937; }
.art-drawer.open { left: 0; }
.art-drawer-head { padding: 14px 16px; border-bottom: 1px solid var(--art-border); display: flex; align-items: center; gap: 10px; }
body.art-on.darkmode .art-drawer-head { border-color: #1f2937; }
.art-drawer-head strong { flex: 1; font-size: 15px; }
.art-drawer-close { border: 0; background: transparent; font-size: 20px; cursor: pointer; color: var(--art-muted); }
.art-drawer .art-drawer-search { padding: 12px 16px; border-bottom: 1px solid var(--art-border); }
body.art-on.darkmode .art-drawer .art-drawer-search { border-color: #1f2937; }
.art-drawer input { width: 100%; padding: 8px 12px; border: 1px solid var(--art-border); border-radius: 8px; font-size: 13px; box-sizing: border-box; background: #fff; }
body.art-on.darkmode .art-drawer input { background: #0f172a; border-color: #334155; color: #e2e8f0; }
.art-drawer-body { padding: 12px 16px; overflow-y: auto; flex: 1; }
.art-drawer-body .art-group { margin-bottom: 16px; }
.art-drawer-body .art-group-h { font-size: 12px; font-weight: 700; color: var(--art-muted); padding: 4px 0; text-transform: uppercase; letter-spacing: .04em; }
.art-drawer-body .art-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--art-text); font-size: 13px; }
.art-drawer-body .art-item:hover { background: var(--art-accent-soft); color: var(--art-accent); }
.art-drawer-body .art-item .art-ic { width: 22px; height: 22px; border-radius: 6px; background: var(--art-accent-soft); color: var(--art-accent); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 11px; flex-shrink: 0; }
.art-drawer-mask { display: none; position: fixed; inset: 0; background: rgba(15,23,42,0.4); z-index: 99; }
.art-drawer-mask.open { display: block; }

/* 抽屉触发按钮 */
.art-menu-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 10px; background: transparent; border: 1px solid var(--art-border); color: var(--art-text); cursor: pointer; font-size: 18px; }
body.art-on.darkmode .art-menu-btn { border-color: #334155; color: #e2e8f0; }
.art-menu-btn:hover { background: var(--art-accent-soft); color: var(--art-accent); }

/* hero 详情卡 */
.art-hero { background: var(--art-card); border-radius: var(--art-radius); box-shadow: var(--art-shadow); padding: 32px 32px 28px; margin-bottom: 24px; position: relative; overflow: hidden; }
body.art-on.darkmode .art-hero { background: #1f2937; }
.art-hero::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: linear-gradient(90deg, var(--art-accent) 0%, #4db6ac 50%, #80cbc4 100%); }
.art-hero .art-crumbs { font-size: 13px; color: var(--art-muted); margin-bottom: 16px; }
.art-hero .art-crumbs a { color: var(--art-muted); text-decoration: none; }
.art-hero .art-crumbs a:hover { color: var(--art-accent); }
.art-hero .art-crumbs .sep { margin: 0 6px; }
.art-hero-head { display: flex; align-items: flex-start; gap: 18px; }
.art-hero-ic { width: 64px; height: 64px; border-radius: 16px; background: linear-gradient(135deg, var(--art-accent), #4db6ac); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 26px; flex-shrink: 0; }
.art-hero-body { flex: 1; min-width: 0; }
.art-hero h1 { font-size: 26px; line-height: 1.35; margin: 0 0 8px; color: var(--art-text); font-weight: 700; word-wrap: break-word; }
body.art-on.darkmode .art-hero h1 { color: #f1f5f9; }
.art-hero .art-sub { color: var(--art-muted); font-size: 14.5px; line-height: 1.65; margin: 8px 0 14px; }
.art-hero .art-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.art-hero .art-tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; background: var(--art-accent-soft); color: var(--art-accent); font-size: 12px; text-decoration: none; }
body.art-on.darkmode .art-hero .art-tag { background: rgba(44,152,181,0.18); color: #67c4d8; }
.art-hero .art-meta { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; color: var(--art-muted); padding-top: 14px; border-top: 1px dashed var(--art-border); }
body.art-on.darkmode .art-hero .art-meta { border-color: #334155; }
.art-hero .art-meta span { display: inline-flex; align-items: center; gap: 5px; }

/* 中央内容容器 */
.art-content { background: var(--art-card); border-radius: var(--art-radius); box-shadow: var(--art-shadow); padding: 36px 44px; }
body.art-on.darkmode .art-content { background: #1f2937; }

body.art-on .markdown-preview-view,
body.art-on article.popover-hint .markdown-preview-view { background: transparent !important; padding: 0 !important; }
body.art-on .markdown-rendered { font-size: 16px !important; line-height: 1.85 !important; color: var(--art-text) !important; word-break: break-word; }
body.art-on.darkmode .markdown-rendered { color: #e2e8f0 !important; }
body.art-on .markdown-rendered h1,
body.art-on .markdown-rendered h2,
body.art-on .markdown-rendered h3,
body.art-on .markdown-rendered h4 { color: var(--art-text) !important; font-weight: 700 !important; line-height: 1.4 !important; margin: 1.6em 0 .8em !important; }
body.art-on.darkmode .markdown-rendered h1,
body.art-on.darkmode .markdown-rendered h2,
body.art-on.darkmode .markdown-rendered h3,
body.art-on.darkmode .markdown-rendered h4 { color: #f1f5f9 !important; }
body.art-on .markdown-rendered h2 { font-size: 22px !important; padding-bottom: 8px; border-bottom: 2px solid var(--art-accent-soft); }
body.art-on .markdown-rendered h3 { font-size: 18px !important; }
body.art-on .markdown-rendered h4 { font-size: 16px !important; }
body.art-on .markdown-rendered p { margin: 0 0 14px !important; }
body.art-on .markdown-rendered a { color: var(--art-accent) !important; text-decoration: none; border-bottom: 1px solid transparent; }
body.art-on .markdown-rendered a:hover { border-bottom-color: var(--art-accent); }
body.art-on .markdown-rendered strong { color: var(--art-text); font-weight: 700; }
body.art-on.darkmode .markdown-rendered strong { color: #fff; }
body.art-on .markdown-rendered blockquote { border-left: 4px solid var(--art-accent) !important; background: var(--art-accent-soft) !important; padding: 14px 18px !important; border-radius: 0 10px 10px 0 !important; margin: 16px 0 !important; color: var(--art-text) !important; }
body.art-on.darkmode .markdown-rendered blockquote { background: rgba(44,152,181,0.12) !important; color: #cbd5e1 !important; }
body.art-on .markdown-rendered ul,
body.art-on .markdown-rendered ol { padding-left: 1.6em !important; margin: 0 0 14px !important; }
body.art-on .markdown-rendered li { margin-bottom: 4px !important; }
body.art-on .markdown-rendered img { max-width: 100% !important; height: auto !important; border-radius: 8px; display: block; margin: 16px auto; box-shadow: 0 4px 16px rgba(15,23,42,.08); }
body.art-on .markdown-rendered hr { border: 0; border-top: 1px solid var(--art-border); margin: 28px 0; }
body.art-on.darkmode .markdown-rendered hr { border-color: #334155; }

/* 表格 */
body.art-on .markdown-rendered table { width: 100% !important; border-collapse: separate !important; border-spacing: 0 !important; margin: 18px 0 !important; border: 1px solid var(--art-border) !important; border-radius: 10px !important; overflow: hidden !important; font-size: 14px !important; }
body.art-on .markdown-rendered th { background: var(--art-accent-soft) !important; color: var(--art-text) !important; padding: 10px 14px !important; text-align: left !important; font-weight: 700 !important; border: 0 !important; border-bottom: 1px solid var(--art-border) !important; }
body.art-on.darkmode .markdown-rendered th { background: rgba(44,152,181,0.16) !important; color: #cbd5e1 !important; border-color: #334155 !important; }
body.art-on .markdown-rendered td { padding: 10px 14px !important; border: 0 !important; border-bottom: 1px solid var(--art-border) !important; }
body.art-on.darkmode .markdown-rendered td { border-color: #1f2937 !important; }
body.art-on .markdown-rendered tr:last-child td { border-bottom: 0 !important; }

/* 代码块 */
body.art-on .markdown-rendered code { background: #f1f5f9 !important; color: #d6336c !important; padding: 2px 6px !important; border-radius: 4px !important; font-size: 13px !important; font-family: "JetBrains Mono", "Fira Code", "Courier New", monospace !important; }
body.art-on .markdown-rendered pre { background: #1e293b !important; color: #e2e8f0 !important; padding: 16px 18px !important; border-radius: 10px !important; overflow-x: auto !important; margin: 14px 0 !important; line-height: 1.65 !important; }
body.art-on .markdown-rendered pre code { background: transparent !important; color: inherit !important; padding: 0 !important; font-size: 13.5px !important; }

/* Properties 表（meta）原本样式太紧凑：让它折叠 */
body.art-on .note-properties { display: none !important; }

/* ===== 页脚区：上下篇紧凑横条 =====
   - 左右两块小卡片，高约 78px，一行内显示方向+分类+标题
   - prev 左对齐（含 ic），next 右对齐（含 ic），arr 箭头在最外侧
   - empty 占位保持均衡布局，不再让一篇占满整行
*/
.art-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 24px; }
.art-foot .art-card {
  background: var(--art-card);
  border-radius: 10px;
  box-shadow: var(--art-shadow);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--art-text);
  min-height: 64px;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  border: 1px solid transparent;
  overflow: hidden;
}
body.art-on.darkmode .art-foot .art-card { background: #1f2937; }
.art-foot .art-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(15,23,42,0.10);
  border-color: var(--art-accent);
}
.art-foot .art-card .art-ic {
  width: 36px; height: 36px;
  border-radius: 9px;
  background: var(--art-accent-soft);
  color: var(--art-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700; font-size: 14px;
  flex-shrink: 0;
}
body.art-on.darkmode .art-foot .art-card .art-ic { background: rgba(44,152,181,0.18); color: #67c4d8; }
.art-foot .art-card .art-info {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  gap: 2px;
}
.art-foot .art-card .art-dir {
  font-size: 11.5px; color: var(--art-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.art-foot .art-card .art-ttl {
  font-size: 13.5px; font-weight: 600; line-height: 1.4;
  color: var(--art-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
body.art-on.darkmode .art-foot .art-card .art-ttl { color: #f1f5f9; }
.art-foot .art-card .arr {
  font-size: 22px; color: var(--art-accent);
  flex-shrink: 0; line-height: 1;
}
/* prev 卡片：标题左对齐，arr 在最右 */
.art-foot .art-card.prev { flex-direction: row; }
/* next 卡片：信息块靠右排列，arr 在最右 */
.art-foot .art-card.next .art-info { text-align: right; }
.art-foot .art-card.next .art-dir,
.art-foot .art-card.next .art-ttl { text-align: right; }
/* empty 占位 */
.art-foot .art-card.empty {
  background: transparent;
  box-shadow: none;
  border: 1px dashed var(--art-border);
  color: var(--art-muted);
  cursor: default;
}
.art-foot .art-card.empty:hover { transform: none; box-shadow: none; border-color: var(--art-border); }
.art-foot .art-card.empty .art-ttl { color: var(--art-muted); font-weight: 400; font-size: 12.5px; }
.art-foot .art-card.empty .art-ic { display: none; }
.art-foot .art-card.empty .arr { display: none; }

/* 右侧同分类推荐侧栏 - 桌面端 */
.art-aside { display: none; }
body.art-on #quartz-body { display: grid !important; grid-template-columns: minmax(0, 1fr) !important; }
@media (min-width: 1200px) {
  body.art-on #quartz-root { max-width: 1320px !important; }
  body.art-on #quartz-body { grid-template-columns: minmax(0, 1fr) 280px !important; gap: 24px !important; align-items: start; }
  body.art-on .center { order: 1; min-width: 0; }
  .art-aside { display: block; order: 2; position: sticky; top: 80px; }
  body.art-on { background: var(--art-bg); }
}
.art-aside-card { background: var(--art-card); border-radius: var(--art-radius); box-shadow: var(--art-shadow); padding: 18px 20px; margin-bottom: 16px; }
body.art-on.darkmode .art-aside-card { background: #1f2937; }
.art-aside-card h3 { font-size: 14px; font-weight: 700; color: var(--art-text); margin: 0 0 12px; display: flex; align-items: center; gap: 6px; }
body.art-on.darkmode .art-aside-card h3 { color: #f1f5f9; }
.art-aside-list { list-style: none; padding: 0; margin: 0; }
.art-aside-list li { margin-bottom: 6px; }
.art-aside-list a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; text-decoration: none; color: var(--art-text); font-size: 13px; line-height: 1.45; transition: background .15s ease; }
body.art-on.darkmode .art-aside-list a { color: #cbd5e1; }
.art-aside-list a:hover { background: var(--art-accent-soft); color: var(--art-accent); }
.art-aside-list .mini-ic { width: 26px; height: 26px; border-radius: 7px; background: var(--art-accent-soft); color: var(--art-accent); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; flex-shrink: 0; }
.art-aside-list .mini-title { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* 响应式 */
@media (max-width: 768px) {
  body.art-on #quartz-root { padding: 12px !important; }
  body.art-on .art-hero { padding: 22px 18px 18px; }
  body.art-on .art-hero h1 { font-size: 20px; }
  body.art-on .art-hero-head { gap: 12px; }
  body.art-on .art-hero-ic { width: 50px; height: 50px; font-size: 22px; }
  body.art-on .art-content { padding: 22px 18px; }
  body.art-on .markdown-rendered { font-size: 15px !important; }
  body.art-on .art-foot { grid-template-columns: 1fr; }
  body.art-on .art-topbar { margin: -12px -12px 16px; padding: 10px 12px; }
}

/* 暗色覆盖 */
body.art-on.darkmode .art-aside-list a:hover { background: rgba(44,152,181,0.16); color: #67c4d8; }
body.art-on.darkmode .art-crumbs { color: #94a3b8; }
body.art-on.darkmode .art-crumbs a { color: #94a3b8; }
body.art-on.darkmode .art-sub { color: #94a3b8; }
body.art-on.darkmode .art-meta { color: #94a3b8; }
body.art-on.darkmode .art-menu-btn:hover { background: rgba(44,152,181,0.18); color: #67c4d8; }
body.art-on.darkmode .art-foot .art-card.empty { border-color: #334155; color: #94a3b8; }
body.art-on.darkmode .art-foot .art-card.empty .art-ttl { color: #94a3b8; }
