/* ===== mcj2 主题: Tab + 折叠子分组 + 卡片链接 ===== */
:root {
  --mcj2-bg: #f4f6f8;
  --mcj2-card: #fff;
  --mcj2-text: #2d2d2d;
  --mcj2-muted: #7b8993;
  --mcj2-border: #e8ecf0;
  --mcj2-accent: #009dff;
  --mcj2-accent-light: #e8f4ff;
  --mcj2-shadow: 0 1px 6px rgba(0,0,0,0.06);
  --mcj2-shadow-hover: 0 4px 14px rgba(0,157,255,0.12);
  --mcj2-radius: 10px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--mcj2-bg); color: var(--mcj2-text); font-size: 14px; line-height: 1.5; font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif; }
button, input { margin: 0; font: inherit; }
img, svg { vertical-align: middle; }
a { text-decoration: none; color: inherit; }
a:hover { text-decoration: none; }

/* ===== 背景 ===== */
.mcj2-bg { position: absolute; top: 0; left: 0; width: 100%; height: 100vh; overflow: hidden; z-index: -1; }
.mcj2-bg img { width: 100%; height: 100%; object-fit: cover; }
.mcj2-bg-cover { position: absolute; bottom: 0; left: 0; width: 100%; height: 40%; background: linear-gradient(rgba(244,248,251,0) 0%, rgba(244,248,251,0.6) 50%, rgba(244,248,251,1) 100%); }

.mcj2-wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; position: relative; z-index: 1; }

/* ===== 顶部导航 - 透明浮动 ===== */
.mcj2-topbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 34px 0 22px; position: relative; z-index: 10; }
.mcj2-topbar-left { display: flex; align-items: center; gap: 18px; flex: 1 1 0; min-width: 0; }
.mcj2-logo img { height: 32px; width: 32px; border-radius: 6px; vertical-align: middle; }
.mcj2-topbar-left a { font-size: 14px; color: rgba(255,255,255,0.9); font-weight: 500; text-shadow: 0 1px 2px rgba(0,0,0,0.3); transition: color .15s; white-space: nowrap; }
.mcj2-topbar-left a:hover { color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,0.5); }
/* 中部参与布局(不再绝对定位悬浮), 引文限宽省略, 避免遮挡两侧链接 */
.mcj2-topbar-center { flex: 0 1 auto; min-width: 0; text-align: center; }
.mcj2-hero-title { color: #fff; font-size: 26px; font-weight: 700; margin: 0; text-shadow: 0 2px 8px rgba(0,0,0,0.4); }
.mcj2-hero-quote { color: rgba(255,255,255,0.8); font-size: 12px; margin: 4px auto 0; text-shadow: 0 1px 3px rgba(0,0,0,0.4); max-width: 420px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mcj2-topbar-right { flex: 1 1 0; min-width: 0; display: flex; justify-content: flex-end; }
.mcj2-clock-block { text-align: right; text-shadow: 0 1px 4px rgba(0,0,0,0.4); }
.mcj2-clock-block .show-date { color: rgba(255,255,255,0.85); font-size: 13px; }
.mcj2-clock-block .show-time { color: #fff; font-size: 28px; font-weight: 700; line-height: 1.2; font-family: 'Courier New', monospace; }
/* 中等宽度: 隐藏引文给左侧链接让位 */
@media (max-width: 1180px) {
  .mcj2-topbar-center .mcj2-hero-quote { display: none; }
}
/* 较窄桌面: 左侧链接允许换行, 永不与中部重叠 */
@media (max-width: 1100px) {
  .mcj2-topbar-left { flex-wrap: wrap; row-gap: 6px; }
}
@media (max-width: 768px) {
  .mcj2-topbar-center { display: none; }
  .mcj2-topbar-left { flex-wrap: wrap; }
}

/* ===== Hero 区 (搜索) ===== */
.mcj2-hero { margin: 0 0 16px; position: relative; z-index: 10; }

/* ===== 搜索 ===== */
.mcj2-search { }
.mcj2-search-inner { background: rgba(255,255,255,0.95); border-radius: var(--mcj2-radius); box-shadow: 0 2px 12px rgba(0,0,0,0.1); padding: 14px 18px; }
.mcj2-search-types { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 10px; }
.mcj2-search-type { display: inline-flex; align-items: center; padding: 5px 13px; border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--mcj2-muted); transition: all .15s; }
.mcj2-search-type:hover { background: var(--mcj2-accent-light); color: var(--mcj2-accent); }
.mcj2-search-type input { display: none; }
.mcj2-search-type input:checked + span { color: var(--mcj2-accent); font-weight: 500; }
.mcj2-search-type span { display: inline-flex; align-items: center; gap: 3px; }
.mcj2-search-type span svg { width: 14px; height: 14px; flex-shrink: 0; fill: currentColor; vertical-align: middle; }
.mcj2-search-type span img { width: 14px; height: 14px; vertical-align: middle; flex-shrink: 0; }
.mcj2-search-inner form { display: flex; gap: 8px; }
.mcj2-search-inner input[type="text"] { flex: 1; height: 42px; padding: 0 16px; border: 1px solid var(--mcj2-border); border-radius: 8px; font-size: 14px; outline: none; transition: border .15s; }
.mcj2-search-inner input[type="text"]:focus { border-color: var(--mcj2-accent); }
.mcj2-search-inner button { height: 42px; padding: 0 24px; background: var(--mcj2-accent); color: #fff; border: none; border-radius: 8px; font-size: 14px; cursor: pointer; transition: background .15s; }
.mcj2-search-inner button:hover { background: #0080d6; }

/* ===== Tab 栏 ===== */
.mcj2-tabs { display: flex; gap: 4px; overflow-x: auto; margin-bottom: 16px; scrollbar-width: thin; padding: 4px; background: #fff; border-radius: var(--mcj2-radius); box-shadow: var(--mcj2-shadow); }
.mcj2-tab { flex: 0 0 auto; padding: 9px 20px; border-radius: 7px; cursor: pointer; font-size: 14px; color: var(--mcj2-text); background: transparent; border: none; transition: all .18s; white-space: nowrap; }
.mcj2-tab:hover { background: #f0f4f8; }
.mcj2-tab.active { background: var(--mcj2-accent); color: #fff; font-weight: 500; }
.mcj2-tab .mcj2-tab-count { margin-left: 6px; font-size: 12px; opacity: .75; }

/* ===== 面板 ===== */
.mcj2-panel { display: none; }
.mcj2-panel.active { display: block; }

/* ===== 第一栏: 置顶/精选固定栏 (mcj3) ===== */
.mcj3-fixed { background: #fff; border-radius: var(--mcj2-radius); box-shadow: var(--mcj2-shadow); margin-bottom: 16px; overflow: hidden; }
.mcj3-fixed-head { display: flex; align-items: center; gap: 10px; padding: 8px 18px; background: linear-gradient(90deg, var(--mcj2-accent-light), #ffffff); }
.mcj3-fixed-icon { width: 30px; height: 30px; border-radius: 7px; background: var(--mcj2-accent-light); color: var(--mcj2-accent); display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; overflow: hidden; }
.mcj3-fixed-icon svg { width: 18px; height: 18px; fill: var(--mcj2-accent); }
.mcj3-fixed-icon img { width: 18px; height: 18px; object-fit: contain; border-radius: 2px; }
.mcj3-fixed-title { flex: 1; font-size: 17px; font-weight: 700; }
.mcj3-fixed-badge { font-size: 11px; color: #fff; background: var(--mcj2-accent); border-radius: 20px; padding: 2px 9px; flex-shrink: 0; }
.mcj3-fixed-body { padding: 0 14px 16px; }
.mcj3-fixed-body .mcj2-subgroup:first-child { margin-top: 14px; }
.mcj3-tab-pin { font-size: 11px; }

/* ===== 子分组 ===== */
.mcj2-subgroup { background: #fff; border-radius: var(--mcj2-radius); box-shadow: var(--mcj2-shadow); margin-bottom: 12px; overflow: hidden; }
.mcj2-subgroup-head { display: flex; align-items: center; gap: 10px; padding: 8px 18px; cursor: pointer; user-select: none; border-bottom: 1px solid var(--mcj2-border); transition: background .15s; }
.mcj2-subgroup-head:hover { background: #fafbfc; }
.mcj2-subgroup-icon { width: 28px; height: 28px; border-radius: 6px; background: var(--mcj2-accent-light); color: var(--mcj2-accent); display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.mcj2-subgroup-icon svg { width: 18px; height: 18px; fill: var(--mcj2-accent); }
.mcj2-subgroup-icon img { width: 18px; height: 18px; border-radius: 2px; }
.mcj2-subgroup-title { flex: 1; font-size: 15px; font-weight: 600; }
.mcj2-subgroup-count { font-size: 12px; color: var(--mcj2-muted); }
.mcj2-subgroup-arrow { font-size: 12px; color: var(--mcj2-muted); transition: transform .2s; }
.mcj2-subgroup.open .mcj2-subgroup-arrow { transform: rotate(0deg); }
.mcj2-subgroup:not(.open) .mcj2-subgroup-arrow { transform: rotate(-90deg); }
.mcj2-subgroup-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; padding: 14px 18px 18px; }
.mcj2-subgroup:not(.open) .mcj2-subgroup-body { display: none; }

/* ===== 链接卡片 ===== */
.mcj2-card { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: #fafbfc; border: 1px solid transparent; border-radius: 8px; transition: all .18s; }
.mcj2-card:hover { background: #fff; border-color: var(--mcj2-accent); box-shadow: var(--mcj2-shadow-hover); transform: translateY(-1px); }
.mcj2-card-icon { width: 32px; height: 32px; border-radius: 6px; background: #fff; border: 1px solid var(--mcj2-border); display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; }
.mcj2-card-icon svg { width: 18px; height: 18px; fill: var(--mcj2-accent); }
.mcj2-card-icon img { width: 100%; height: 100%; object-fit: contain; }
.mcj2-card-icon-text { font-size: 13px; font-weight: 600; color: var(--mcj2-accent); display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.mcj2-card-body { min-width: 0; flex: 1; }
.mcj2-card-name { display: block; font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mcj2-card-desc { display: -webkit-box; font-size: 11.5px; color: var(--mcj2-muted); white-space: normal; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }

/* ===== LyToday 容器 ===== */
.mcj2-lytoday { width:100%; background:#fff; border-radius:var(--mcj2-radius); box-shadow:var(--mcj2-shadow); padding:10px 16px; margin-bottom:12px; }

/* ===== Tooltip ===== */
#mcj2-tip {
  position: fixed; z-index: 99999; pointer-events: none;
  background: rgba(45,45,45,0.95); color: #f5f5f5;
  padding: 6px 12px; border-radius: 8px; font-size: 12px; line-height: 1.5;
  max-width: 260px; text-align: center; word-break: break-all;
  opacity: 0; transition: opacity .18s;
  transform: translate(-50%, calc(-100% - 8px));
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
#mcj2-tip.show { opacity: 1; }
#mcj2-tip::after {
  content: ''; position: absolute; left: 50%; bottom: -5px;
  transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: rgba(45,45,45,0.95);
}

/* ===== 底部 ===== */
.mcj2-footer { text-align: center; padding: 24px 0 40px; font-size: 12px; color: var(--mcj2-muted); }
.mcj2-footer a { color: var(--mcj2-muted); }
.mcj2-footer a:hover { color: var(--mcj2-accent); }

/* ===== 左侧悬浮目录 (mcj3 TOC) ===== */
.mcj3-toc {
  position: fixed; top: 96px; left: 14px; width: 204px;
  max-height: calc(100vh - 140px); overflow-y: auto; scrollbar-width: thin;
  background: rgba(255,255,255,0.93);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid var(--mcj2-border); border-radius: var(--mcj2-radius);
  box-shadow: var(--mcj2-shadow); padding: 10px; z-index: 1000;
}
.mcj3-toc-title { font-size: 12px; font-weight: 600; color: var(--mcj2-muted); padding: 2px 8px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mcj3-toc-group { font-size: 12px; font-weight: 600; color: var(--mcj2-muted); padding: 6px 8px 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mcj3-toc-group:first-child { padding-top: 2px; }
.mcj3-toc-item {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 8px; margin-bottom: 2px; border-radius: 7px;
  font-size: 13px; color: var(--mcj2-text); transition: background .15s, color .15s;
  white-space: nowrap; overflow: hidden;
}
.mcj3-toc-item:hover { background: var(--mcj2-accent-light); color: var(--mcj2-accent); }
.mcj3-toc-item.active { background: var(--mcj2-accent); color: #fff; font-weight: 500; }
/* 子分组条目: 相对小节标题缩进, 体现层级 */
.mcj3-toc-item.mcj3-toc-sub { padding-left: 20px; }
/* 树形引导线: 组 -> 子分组的归属关系(文件管理器风格) */
.mcj3-toc-tree .mcj3-toc-sub { position: relative; padding-left: 30px; }
.mcj3-toc-tree .mcj3-toc-sub::before { /* 竖线段: 逐条相连, 末项折半收尾 */
  content: ''; position: absolute; left: 7px; top: -2px; bottom: -2px; width: 1px;
  background: rgba(0,0,0,0.25);
}
.mcj3-toc-tree .mcj3-toc-sub:first-child::before { top: 0; }
.mcj3-toc-tree .mcj3-toc-sub:last-child::before { bottom: 50%; }
.mcj3-toc-tree .mcj3-toc-sub:only-child::before { display: none; }
.mcj3-toc-tree .mcj3-toc-sub::after { /* 横线: 从竖线连接到条目文字 */
  content: ''; position: absolute; left: 7px; top: 50%; width: 14px; height: 1px;
  background: rgba(0,0,0,0.25);
}
.mcj3-toc-icon {
  width: 20px; height: 20px; border-radius: 5px; flex-shrink: 0;
  background: var(--mcj2-accent-light); color: var(--mcj2-accent);
  display: flex; align-items: center; justify-content: center; font-size: 11px; overflow: hidden;
}
.mcj3-toc-icon img { width: 14px; height: 14px; object-fit: contain; border-radius: 2px; }
.mcj3-toc-icon svg { width: 13px; height: 13px; fill: var(--mcj2-accent); }
.mcj3-toc-item.active .mcj3-toc-icon { background: rgba(255,255,255,0.22); color: #fff; }
.mcj3-toc-item.active .mcj3-toc-icon svg { fill: #fff; }
.mcj3-toc-count { margin-left: auto; font-size: 11px; color: var(--mcj2-muted); flex-shrink: 0; }
.mcj3-toc-item.active .mcj3-toc-count { color: rgba(255,255,255,0.8); }

/* 目录显示时内容右移让位 (仅宽屏生效) */
body.mcj3-toc-on .mcj2-wrap { margin-left: 232px; }
@media (max-width: 1439px) {
  .mcj3-toc { display: none; }
  body.mcj3-toc-on .mcj2-wrap { margin-left: 0; }
}

/* ===== 响应式 ===== */
@media (max-width: 640px) {
  .mcj2-nav-links { display: none; }
  .mcj2-quote { display: none; }
  .mcj2-hero-quote { font-size: 12px; }
  .mcj2-tabs { padding: 4px; gap: 3px; }
  .mcj2-tab { padding: 7px 14px; font-size: 13px; }
  .mcj2-subgroup-body { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); padding: 10px 12px 14px; }
  .mcj2-card-desc { display: -webkit-box; font-size: 10.5px; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
}
