/* 云亮知识平台共享导航。原三套应用的样式只在这里按前缀做布局补偿。 */
:root {
  --zp-bg: #151b19;
  --zp-panel: #202a26;
  --zp-text: #d8d3c5;
  --zp-muted: #9aa79f;
  --zp-gold: #c0a66b;
  --zp-seal: #bd7461;
  --zp-sage: #718c7b;
  --zp-line: #35413b;
}
.platform-header {
  position: relative;
  z-index: 1000;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 24px;
  box-sizing: border-box;
  background: var(--zp-bg);
  color: var(--zp-text);
  border-bottom: 1px solid var(--zp-line);
  font: 13px/1 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}
.platform-header a {
  color: var(--zp-muted);
  text-decoration: none;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}
.platform-header a:hover, .platform-header a:focus-visible { color: var(--zp-text); }
.platform-header a:focus-visible { outline: 2px solid var(--zp-gold); outline-offset: 2px; }
.platform-home { font-weight: 650; color: var(--zp-text) !important; letter-spacing: .04em; }
.platform-home[aria-current="page"] { color: var(--zp-gold) !important; }
.platform-nav { display: flex; align-items: center; gap: 4px; }
.platform-nav a { position: relative; padding: 0 13px; }
.platform-nav a.on { color: var(--zp-gold); }
.platform-nav a.on::after {
  content: "";
  position: absolute;
  left: 13px;
  right: 13px;
  bottom: 2px;
  height: 2px;
  background: var(--zp-gold);
}
.platform-back { margin-left: auto; font-size: 12px; }
.platform-back::after { content: "↗"; margin-left: 5px; color: var(--zp-gold); }

/* 道德经：平台导航和原顶栏都可吸顶，原章节栏对应下移。 */
.platform-daodejing .platform-header { position: sticky; top: 0; }
.platform-daodejing .topbar { top: 44px; }
.platform-daodejing .chapter-sidebar { top: 112px; height: calc(100vh - 112px); }
.platform-daodejing .deep-chapters { top: 112px; max-height: calc(100vh - 112px); }

/* 另外两套原应用占满一屏，给平台导航让出 44px。 */
.platform-models #app, .platform-huangdi #app { height: calc(100vh - 44px) !important; }
.platform-models .side-expand, .platform-huangdi .side-expand { top: 56px; }

@media (max-width: 640px) {
  .platform-header { gap: 8px; padding: 0 10px; }
  .platform-home { font-size: 12px; letter-spacing: 0; }
  .platform-nav { gap: 0; }
  .platform-nav a { padding: 0 8px; font-size: 12px; }
  .platform-nav a.on::after { left: 8px; right: 8px; }
  .platform-back { display: none !important; }
  .platform-models .sidebar, .platform-huangdi .sidebar { display: none !important; }
  .platform-models .main-top .crumb, .platform-huangdi .main-top .crumb { display: none !important; }
}

/* 手机目录抽屉：原应用把侧栏压成 0 且没有打开入口，这里接住原目录内容。 */
.platform-scrim { display: none; }
@media (max-width: 640px) {
  .platform-models .sidebar, .platform-huangdi .sidebar {
    display: flex !important;
    position: fixed;
    left: 0;
    top: 44px;
    bottom: 0;
    width: min(270px, 78vw);
    z-index: 900;
    transform: translateX(-102%);
    visibility: hidden;
    transition: transform .22s ease-out, visibility .22s;
  }
  .platform-menu-open .sidebar {
    transform: translateX(0);
    visibility: visible;
  }
  .platform-models .side-expand, .platform-huangdi .side-expand {
    display: flex !important;
    align-items: center;
    justify-content: center;
    top: 56px;
    left: 0;
    width: 30px;
    height: 40px;
    z-index: 940;
    border-radius: 0 8px 8px 0;
    font-size: 17px;
    cursor: pointer;
  }
  .platform-menu-open .side-expand { visibility: hidden; }
  .platform-scrim {
    position: fixed;
    inset: 44px 0 0;
    z-index: 899;
    background: rgba(20, 22, 20, .48);
  }
  .platform-menu-open .platform-scrim { display: block; }
}

/* 首页 */
.zp-home {
  margin: 0;
  min-height: 100vh;
  background: var(--zp-bg);
  color: var(--zp-text);
  font: 15px/1.75 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
.zp-home * { box-sizing: border-box; }
.zp-home .platform-header { position: sticky; top: 0; }
.zp-main { width: min(1180px, calc(100% - 64px)); margin: 0 auto; }
.zp-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, .6fr);
  gap: 72px;
  align-items: end;
  padding: 88px 0 68px;
}
.zp-intro h1 {
  margin: 0;
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  font-size: clamp(42px, 5.2vw, 72px);
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: .03em;
}
.zp-intro p { margin: 0 0 8px; color: var(--zp-muted); max-width: 31em; }
.zp-shelf-label {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--zp-muted);
  font-size: 13px;
  margin-bottom: 8px;
}
.zp-shelf-label::after { content: ""; height: 1px; flex: 1; background: var(--zp-line); }
.zp-book {
  --book-accent: var(--zp-gold);
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) 150px;
  gap: 38px;
  align-items: center;
  min-height: 230px;
  padding: 34px 0;
  border-bottom: 1px solid var(--zp-line);
  color: inherit;
  text-decoration: none;
}
.zp-book.dao { --book-accent: var(--zp-seal); }
.zp-book.huangdi { --book-accent: var(--zp-sage); }
.zp-book:focus-visible { outline: 2px solid var(--book-accent); outline-offset: 8px; }
.zp-visual { width: 150px; height: 150px; display: grid; place-items: center; color: var(--book-accent); }
.zp-visual svg { width: 100%; height: 100%; overflow: visible; }
.zp-book:hover .zp-visual, .zp-book:focus-visible .zp-visual { transform: translateY(-3px); }
.zp-visual { transition: transform .18s ease-out; }
.zp-copy .zp-kind { color: var(--book-accent); font-size: 13px; margin-bottom: 6px; }
.zp-copy h2 {
  margin: 0 0 12px;
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  font-size: 32px;
  font-weight: 600;
  letter-spacing: .06em;
}
.zp-copy p { margin: 0; color: var(--zp-muted); max-width: 40em; }
.zp-quote { margin-top: 12px !important; color: var(--zp-text) !important; font-family: "Songti SC", "STSong", serif; }
.zp-meta { justify-self: end; min-width: 130px; }
.zp-meta span { display: block; color: var(--zp-muted); font-size: 13px; padding: 2px 0; }
.zp-meta b { color: var(--zp-text); font-weight: 550; margin-right: 5px; }
.zp-enter { display: inline-flex; align-items: center; min-height: 40px; margin-top: 15px; color: var(--book-accent) !important; font-size: 14px; }
.zp-enter::after { content: "进入"; border-bottom: 1px solid currentColor; }
.zp-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 36px 0 42px;
  color: var(--zp-muted);
  font-size: 12px;
}
.zp-footer a { color: var(--zp-muted); text-decoration: none; }
.zp-footer a:hover { color: var(--zp-text); }
.zp-footer .zp-wb { color: var(--zp-gold); min-height: 40px; display: inline-flex; align-items: center; }

@media (max-width: 800px) {
  .zp-main { width: min(100% - 36px, 620px); }
  .zp-intro { grid-template-columns: 1fr; gap: 24px; padding: 56px 0 42px; }
  .zp-intro h1 { font-size: clamp(38px, 11vw, 54px); }
  .zp-book { grid-template-columns: 100px minmax(0, 1fr); gap: 20px; min-height: 0; padding: 30px 0; }
  .zp-visual { width: 96px; height: 96px; }
  .zp-copy h2 { font-size: 27px; }
  .zp-copy p { font-size: 14px; }
  .zp-meta { grid-column: 2; display: flex; flex-wrap: wrap; gap: 0 14px; min-width: 0; justify-self: start; }
  .zp-enter { margin-top: 8px; }
  .zp-footer { align-items: flex-start; flex-direction: column; gap: 4px; }
}
@media (max-width: 420px) {
  .zp-book { grid-template-columns: 72px minmax(0, 1fr); gap: 16px; }
  .zp-visual { width: 70px; height: 70px; }
  .zp-copy h2 { font-size: 24px; }
  .zp-copy .zp-kind { font-size: 12px; }
  .zp-quote { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .zp-visual { transition: none; }
  .zp-book:hover .zp-visual, .zp-book:focus-visible .zp-visual { transform: none; }
}
