/*
 * MacchiatoHome 全站公共样式 V1.3 · 2026-11-15
 * 涵盖：左侧导航、面包屑、内容统计、明暗模式按钮、栏目顶距与全宽内容、文章正文排版。
 * 用法：<link rel="stylesheet" href="/css/mh-site-shared-style-v1-3.css?v=1">
 * 稳定依赖：mh-navigation-v1.css?v=16（导航的完整既有样式与响应行为）
 *           mh-article-typography-v1.css?v=1（已确认的中文文章正文规范）
 * 应用端继续加载 mh-dark-theme-v1.css?v=2，使用 mh-ui-theme-v1.js?v=1 处理切换。
 */
@import url("/css/mh-navigation-v1.css?v=16");
@import url("/css/mh-article-typography-v1.css?v=1");

:root {
  --mh-shared-column-top: 50px;
  --mh-shared-crumb-row-height: 36px;
}

/* 左侧导航栏：沿用已确认的宽度、折叠结构与原有完整菜单样式。 */
@media (min-width: 761px) {
  .app { --sidebar: 260px; }
  .app .side { width: 260px; }
  .app.sidebar-collapsed .side { width: 68px; }
  .app .top { width: var(--sidebar); }
  .app.sidebar-collapsed .top { width: 64px; }
}
.app .side .mh-sidebar-heading,
.app .side #navigation a.nav { font-size: 12px; }

/* 所有栏目主内容：全宽、上方留 50px，保留既有横向响应式内边距。 */
.app .taxonomy-page > .taxonomy-main {
  box-sizing: border-box;
  width: 100%;
  max-width: none !important;
  padding-top: var(--mh-shared-column-top) !important;
  padding-right: clamp(14px, 2vw, 30px) !important;
  padding-left: clamp(14px, 2vw, 30px) !important;
}
.app .taxonomy-page > .taxonomy-main > .mh-vp,
.app .taxonomy-page > .taxonomy-main > .mh-home,
.app .taxonomy-page > .taxonomy-main > .mh-collection-page,
.app .taxonomy-page > .taxonomy-main .mh-collection-page {
  box-sizing: border-box;
  width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* 面包屑、发布数量与模式切换按钮：同一行、同一起点与高度。 */
.app .taxonomy-page > .taxonomy-main > .mh-breadcrumb {
  display: flex;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: var(--mh-shared-crumb-row-height);
  min-height: var(--mh-shared-crumb-row-height);
  align-items: center;
  justify-content: space-between;
  column-gap: 16px;
  margin-bottom: 14px;
}
.app .mh-breadcrumb ol {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  align-items: center;
  flex-wrap: nowrap;
  white-space: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.app .mh-breadcrumb ol::-webkit-scrollbar { display: none; }
.app .mh-breadcrumb a,
.app .mh-breadcrumb a:hover,
.app .mh-breadcrumb a:focus-visible { text-decoration: none !important; }
.app .taxonomy-page > .taxonomy-main > .mh-breadcrumb > .mh-page-toolbar {
  display: flex;
  flex: 0 0 auto;
  box-sizing: border-box;
  height: var(--mh-shared-crumb-row-height);
  min-height: var(--mh-shared-crumb-row-height);
  align-items: center;
  align-self: center;
  justify-content: flex-end;
  gap: 11px;
  margin-left: auto;
  padding: 0;
}
.app .mh-published-count { font-size: 12px; }
.app .mh-page-toolbar .mh-theme-toggle,
.app .mh-page-toolbar .mh-theme-toggle:hover,
.app .mh-page-toolbar .mh-theme-toggle:active {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
/* 键盘导航保留绿色焦点提示，避免黑色浏览器轮廓。 */
.app .mh-page-toolbar .mh-theme-toggle:focus-visible {
  outline: 2px solid #86b69a;
  outline-offset: 2px;
  border-radius: 5px;
}

@media (max-width: 760px) {
  /* 手机顶部已有 62px 站名栏：面包屑实际页面纵坐标为 62px + 50px = 112px。 */
  .app .taxonomy-page > .taxonomy-main {
    padding-top: var(--mh-shared-column-top) !important;
    padding-left: 14px !important;
    padding-right: 14px !important;
  }
  .app .taxonomy-page > .taxonomy-main > .mh-breadcrumb { column-gap: 8px; }
  .app .taxonomy-page > .taxonomy-main > .mh-breadcrumb > .mh-page-toolbar { gap: 7px; }
  .app .mh-published-count { font-size: 11px; }
}

/* 文章正文统一使用 .mh-article-typography：字号、行距、两端对齐、首行不缩进
 * 均来自上述固定版本的中文文章规范。业务文章模板必须显式添加这个类。 */

/* 首页使用 .mh-home > .mh-breadcrumb：与其他栏目统一 50px 顶部及 36px 行高。 */
.app .mh-home > .mh-breadcrumb {
  box-sizing: border-box;
  height: var(--mh-shared-crumb-row-height);
  min-height: var(--mh-shared-crumb-row-height);
  align-items: center;
}
.app .mh-home > .mh-breadcrumb > .mh-page-toolbar {
  box-sizing: border-box;
  height: var(--mh-shared-crumb-row-height);
  min-height: var(--mh-shared-crumb-row-height);
  align-self: center;
}

/* 经折叠交互实测，现网侧边栏与顶栏在折叠态的最终宽度均为 64px。 */
@media (min-width: 761px) {
  .app.sidebar-collapsed .side { width: 64px !important; }
  .app.sidebar-collapsed .top { width: 64px !important; }
}

/* V1.3｜四大侧边栏主栏目的图标、文字与右侧箭头共用一致的水平基线。
   “精选视频”采用独立 h2 标题容器，统一到其他 summary 栏目的几何尺寸。
   仅作用于侧边导航展开状态，不修改子菜单、站名和顶部导航。 */
.app:not(.sidebar-collapsed) .side .sidebar-scroll-content > .mh-sidebar-heading {
  box-sizing: border-box;
  width: 100%;
  height: 37px;
  min-height: 37px;
  margin: 16px 0 8px;
  padding: 0 6px 0 13px;
  gap: 7px;
  align-items: center;
}
.app:not(.sidebar-collapsed) .side .sidebar-scroll-content > .mh-sidebar-heading > .mh-video-toggle {
  margin: 0 0 0 auto;
}
