/* ============================================================
   3QYYDS 主题 · layout.css — 布局：侧边栏 / 头部 / 主内容 / 页脚
   ============================================================ */

/* ── 全局网格：左侧边栏(固定) + 右主内容 ── */
.qy-page {
  display: flex;
  min-height: 100vh;
}
.qy-sidebar {
  flex: 0 0 168px;
  width: 168px;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 40;
  display: flex; flex-direction: column;
  background: var(--qy-bg);
  border-right: 1px solid var(--qy-line);
  overflow-y: auto; overflow-x: hidden;
  scrollbar-width: none;
  transition: transform .3s ease;
}
/* 隐藏侧边栏滚动条（Firefox + Chrome） */
.qy-sidebar::-webkit-scrollbar { display: none; }
.qy-sidebar__logo {
  padding: 16px 12px 12px; text-align: center;
  border-bottom: 1px solid var(--qy-line);
}
.qy-sidebar__logo .qy-logo__text { font-size: 18px; }
/* 侧边栏导航 */
.qy-sidebar__nav {
  flex: 1; overflow-y: auto; padding: 8px 0;
  scrollbar-width: none;
}
.qy-sidebar__nav::-webkit-scrollbar { display: none; }

.qy-sidenav__item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; font-size: 15px; color: var(--qy-text-2);
  text-decoration: none; border-left: 3px solid transparent;
  transition: all .15s ease; white-space: nowrap;
  line-height: 1.6; font-family: "Noto Sans SC", "Source Han Sans CN", "PingFang SC", "Microsoft YaHei", sans-serif; letter-spacing: .4px;
}
.qy-sidenav__item:hover {
  color: var(--qy-cyan); background: rgba(0,229,255,0.05);
  border-left-color: var(--qy-cyan);
}
.qy-sidenav__item.active {
  color: var(--qy-cyan); background: rgba(0,229,255,0.08);
  border-left-color: var(--qy-cyan); font-weight: 600;
}
.qy-sidenav__icon {
  flex: 0 0 20px; height: 20px; display: grid; place-items: center;
  font-size: 15px; opacity: .75;
}
/* SVG 图标自适应 */
.qy-sidenav__icon svg {
  width: 18px; height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.qy-sidenav__item:hover .qy-sidenav__icon,
.qy-sidenav__item.active .qy-sidenav__icon { opacity: 1; }
/* 分隔线 */
.qy-sidenav__hr {
  height: 1px; margin: 6px 12px; background: var(--qy-line);
}
/* Badge（今日更新数字） */
.qy-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 18px; padding: 0 5px; margin-left: auto;
  border-radius: 999px; font-size: 11px; font-weight: 700;
  background: #e50914; color: #fff; line-height: 1;
}

/* 扩展链接区标签 */
.qy-sidenav__ext-label { pointer-events: none; }

/* ── 主内容区 ── */
.qy-body {
  flex: 1; margin-left: 168px; /* 与侧边栏同宽 */
  min-width: 0; /* 防止 flex 子项溢出 */
}
.qy-main {
  margin-left: 168px; /* 与侧边栏同宽，所有内页统一右移 */
  min-width: 0;
}
/* 首页嵌套修正：.qy-body 内的 .qy-main 取消二次偏移，避免 ~168px 空白间隙 */
.qy-body > .qy-main { margin-left: 0; }

/* ── 头部 Header（sticky，独立于侧边栏，需右移避开 fixed 侧栏）── */
.qy-header {
  position: sticky; top: 0; z-index: 50;
  margin-left: 168px; /* 与侧边栏同宽，使 Header 整体位于侧栏右侧 */
  background: var(--qy-bg-glass);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--qy-line);
}
.qy-header__box {
  display: flex; align-items: center; gap: 16px;
  height: 60px; padding: 0 16px 0 8px; max-width: 100%;
}
.qy-logo { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.qy-logo img { height: 30px; width: auto; }
.qy-logo__text {
  font-family: var(--qy-font-display); font-weight: 700; font-size: 20px;
  letter-spacing: 1px;
}
.qy-logo__text b { font-weight: 700; }

/* 头部Logo：桌面端隐藏（侧边栏已有），仅移动端显示 */
.qy-logo--header { display: none; }

/* —— 搜索框（带语音+AI）—— */
.qy-search { flex: 1 1 auto; max-width: 520px; position: relative; }
.qy-search__bar {
  display: flex; align-items: center; gap: 4px;
  height: 42px; padding: 0 12px; border-radius: 999px;
  background: var(--qy-bg-2); border: 1px solid var(--qy-line);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.qy-search__bar:focus-within {
  border-color: var(--qy-cyan); box-shadow: var(--qy-glow);
}
.qy-search input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--qy-text); font-size: 14px; min-width: 120px;
}
.qy-search input::placeholder { color: var(--qy-text-3); }
/* 语音搜索按钮 */
.qy-search__voice {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 999px;
  background: none; border: none; cursor: pointer;
  color: var(--qy-text-3); transition: color .2s ease;
  flex-shrink: 0;
}
.qy-search__voice:hover { color: var(--qy-cyan); }
.qy-search__voice svg { width: 20px; height: 20px; display: block; }
.qy-search__voice.listening { color: var(--qy-cyan); animation: qyVoicePulse 1.2s ease-in-out infinite; }
@keyframes qyVoicePulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.55;transform:scale(1.15)} }
/* 搜索提交按钮 */
.qy-search__go {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 999px;
  background: none; border: none; cursor: pointer;
  color: var(--qy-text-3); transition: color .2s;
  flex-shrink: 0;
}
.qy-search__go:hover { color: var(--qy-cyan); }
.qy-search__go svg { width: 18px; height: 18px; display: block; }
/* AI 按钮 */
.qy-search__ai {
  display: inline-flex; align-items: center; gap: 4px;
  height: 30px; padding: 0 12px; border-radius: 8px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff; font-size: 13px; font-weight: 600;
  text-decoration: none; cursor: pointer; border: none;
  white-space: nowrap; flex-shrink: 0;
  transition: transform .2s, box-shadow .2s;
}
.qy-search__ai:hover {
  transform: scale(1.05); box-shadow: 0 2px 10px rgba(102,126,234,.45);
  color: #fff;
}
/* 热搜下拉 */
.qy-search__hot {
  position: absolute; top: 48px; left: 0; right: 0; z-index: 60;
  background: var(--qy-bg-1); border: 1px solid var(--qy-line);
  border-radius: var(--qy-r); padding: 12px; display: none; box-shadow: var(--qy-shadow);
}
.qy-search__hot.show { display: block; animation: qyFadeIn .2s ease; }
.qy-search__hot a { display: inline-block; margin: 4px 6px 4px 0; font-size: 13px; color: var(--qy-text-2); }
.qy-search__hot a.hot { color: var(--qy-lime); }
.qy-search__hot a:hover { color: var(--qy-cyan); }

/* —— 右上角工具按钮组（7个，统一青色系）—— */
.qy-tools {
  display: flex; align-items: center; gap: 4px; flex: 0 0 auto;
  margin-left: auto;
}
.qy-tool {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; width: 48px; height: 44px; border-radius: 8px;
  border: none; background: rgba(0,229,255,0.07); cursor: pointer; text-decoration: none;
  color: #8ee7ff; font-size: 11px; transition: all .15s ease;
  padding: 3px 2px; line-height: 1.1;
}
.qy-tool:hover {
  color: #fff; background: var(--qy-cyan);
  box-shadow: 0 0 12px rgba(0,229,255,0.25);
}
.qy-tool__icon {
  width: 20px; height: 20px; display: grid; place-items: center;
  font-size: 16px; opacity: .9;
}
.qy-tool:hover .qy-tool__icon { opacity: 1; }
.qy-tool__label { font-size: 10px; letter-spacing: .3px; }

/* —— 下拉面板（历史 / 天气）—— */
.qy-tool--dropdown { position: relative; }
.qy-dropdown {
  display: none; position: absolute; top: 100%; right: 0;
  z-index: 200; min-width: 260px; max-width: 340px;
  background: var(--qy-bg-1); border: 1px solid var(--qy-line);
  border-radius: var(--qy-r); padding: 0;
  box-shadow: 0 8px 32px rgba(0,0,0,.45), 0 2px 12px rgba(0,229,255,.15);
  animation: qyFadeIn .18s ease;
}
.qy-dropdown.is-open { display: block; }
.qy-dropdown--wide { min-width: 300px; max-width: 320px; }
/* ===== 天气下拉（tianqi.com iframe 容器）===== */
.qy-dropdown--weather {
  padding: 0 !important; overflow: visible;
  background: #ffffff; border: none;
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
  border-radius: 8px;
  width: 250px !important; max-width: 250px !important; min-width: 250px !important;
}
.qy-dropdown--weather iframe { display: block; border-radius: 6px; }
.qy-dropdown__head {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-bottom: 1px solid var(--qy-line);
  font-size: 13px; color: var(--qy-text); white-space: nowrap;
}
.qy-dropdown__body { padding: 6px 0; max-height: 360px; overflow-y: auto; scrollbar-width: thin; }
.qy-dropdown__body::-webkit-scrollbar { width: 4px; }
.qy-dropdown__body::-webkit-scrollbar-thumb { background: var(--qy-line); border-radius: 2px; }
.qy-dropdown__empty {
  padding: 24px 14px; text-align: center; color: var(--qy-text-3); font-size: 13px;
}

/* 历史记录项 */
.qy-history__item {
  display: block; padding: 8px 14px; text-decoration: none;
  color: var(--qy-text-2); font-size: 13px; transition: background .12s;
  border-left: 2px solid transparent;
}
.qy-history__item:hover {
  color: var(--qy-cyan); background: rgba(0,229,255,.05);
  border-left-color: var(--qy-cyan);
}
.qy-history__name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qy-history__meta { font-size: 11px; color: var(--qy-text-3); margin-top: 2px; }

/* —— 旧导航条（隐藏，已移到侧边栏）—— */
.qy-nav { display: none; }

/* —— 页面主体容器 ── */
.qy-main { padding: 0 16px 0 8px; max-width: 100%; }
.qy-content { display: block; }

/* —— 页脚 ── */
.qy-footer {
  margin-top: 36px; border-top: 1px solid var(--qy-line);
  background: var(--qy-bg-1);
}
.qy-footer__box {
  max-width: 1100px; margin: 0 auto; padding: 24px 28px;
  display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; align-items: center;
  color: var(--qy-text-3); font-size: 13px;
}
.qy-footer a { color: var(--qy-text-2); }
.qy-footer a:hover { color: var(--qy-cyan); }
.qy-footer__links { display: flex; flex-wrap: wrap; gap: 14px; }
.qy-footer__brand .qy-logo__text { font-size: 20px; }
.qy-footer__copy { border-top: 1px solid var(--qy-line); background: var(--qy-bg); }

/* —— 回到顶部 ── */
.qy-totop {
  position: fixed; right: 22px; bottom: 22px; z-index: 80;
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; font-size: 20px; font-weight: 700;
  background: var(--qy-grad); color: #04101a; box-shadow: var(--qy-glow);
  opacity: 0; transform: translateY(12px); pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.qy-totop.show { opacity: 1; transform: none; pointer-events: auto; }
.qy-totop:hover { transform: translateY(-2px); }

/* —— 移动端菜单按钮（默认隐藏）—— */
.qy-menu-toggle { display: none; }

/* 通用淡入动画 */
@keyframes qyFadeIn { from{opacity:0;transform:translateY(-6px)} to{opacity:1;transform:none} }

/* ============================================================
   播放页专用布局（body.qy-play-page）
   - 隐藏左侧固定侧边栏，全宽
   - 分类导航内嵌到 header 行：LOGO | 6分类+更多 | 搜索 | 工具按钮
   ============================================================ */

/* 隐藏侧边栏 + 全宽 */
.qy-play-page .qy-sidebar { display: none !important; }
.qy-play-page .qy-body   { margin-left: 0 !important; }
.qy-play-page .qy-main  { margin-left: 0 !important; padding: 0 20px 0 20px; }
.qy-play-page .qy-header {
  margin-left: 0 !important;
  left: 0; right: 0;
}
.qy-play-page .qy-logo--header { display: flex !important; }
.qy-play-page .qy-menu-toggle    { display: none !important; }

/* 播放页头部内嵌分类导航（直接写在 head.html 中，无需 JS 注入） */
.qy-pnav-inline {
  display: none; /* 默认隐藏，非播放页不显示 */
}
.qy-play-page .qy-pnav-inline {
  display: flex; align-items: center; gap: 3px;
  margin-right: 8px; flex-shrink: 0;
}

/* ---- 头部行内嵌分类导航（直接在 head.html 中渲染） ---- */

/* 主分类链接（6个） */
.qy-pnav-item {
  display: inline-flex; align-items: center;
  padding: 5px 13px; border-radius: 8px;
  font-size: 13.5px; color: var(--qy-text-2);
  text-decoration: none; transition: all .18s ease;
  line-height: 1.4; letter-spacing: .3px; white-space: nowrap;
}
.qy-pnav-item:hover {
  color: var(--qy-cyan); background: rgba(0,229,255,.07);
}
.qy-pnav-item.active {
  color: #fff; background: linear-gradient(135deg, #e50914, #b00710);
  font-weight: 600;
}

/* "更多" 下拉触发器 */
.qy-pnav-more {
  cursor: pointer; padding: 6px 14px; gap: 4px;
  border-radius: 8px; transition: all .18s ease;
  display: inline-flex; align-items: center;
}
.qy-pnav-more:hover {
  color: var(--qy-cyan); background: rgba(0,229,255,.06);
}
.qy-pnav-more__text {
  font-size: 13.5px; color: var(--qy-text-2);
  white-space: nowrap;
}

/* 下拉面板：全部分类网格 */
.qy-dropdown--cats {
  position: absolute; top: calc(100% + 6px); left: 50%;
  transform: translateX(-50%);
  width: 520px; max-height: 380px; overflow-y: auto;
  padding: 16px 16px 12px; border-radius: 14px;
  background: rgba(15,17,23,.96);
  border: 1px solid var(--qy-line);
  box-shadow: 0 12px 40px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.03) inset;
  backdrop-filter: blur(20px); z-index: 200;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.08) transparent;
}
.qy-dropdown--cats::-webkit-scrollbar { width: 6px; }
.qy-dropdown--cats::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 3px; }

/* 分类网格（chip 风格） */
.qy-cats-grid {
  display: flex; flex-wrap: wrap; gap: 7px;
  margin-bottom: 10px;
}
.qy-cat-chip {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 5px 14px; border-radius: 999px;
  font-size: 12.5px; color: var(--qy-text-2);
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08);
  text-decoration: none; transition: all .15s ease;
  white-space: nowrap;
}
.qy-cat-chip:hover {
  color: var(--qy-cyan); border-color: rgba(0,229,255,.25);
  background: rgba(0,229,255,.08);
}
.qy-cat-chip.active {
  color: #fff; background: linear-gradient(135deg, #e50914, #b00710);
  border-color: transparent; font-weight: 600;
}

/* 底部功能链接行 */
.qy-cats-extra {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,.06);
}
.qy-cats-extra a {
  font-size: 11.5px; color: var(--qy-text-3);
  text-decoration: none; padding: 3px 8px;
  border-radius: 5px; transition: all .15s;
}
.qy-cats-extra a:hover {
  color: var(--qy-cyan); background: rgba(0,229,255,.06);
}

/* ── 响应式：平板以下隐藏侧边栏 ── */
@media (max-width: 900px) {
  .qy-sidebar { transform: translateX(-100%); z-index: 90; box-shadow: 4px 0 20px rgba(0,0,0,.35); }
  .qy-sidebar.is-open { transform: translateX(0); }
  .qy-body { margin-left: 0; }
  .qy-main { margin-left: 0; }
  .qy-header { margin-left: 0; }
  .qy-logo--header { display: flex; } /* 移动端显示头部Logo */
  .qy-menu-toggle { display: grid; place-items: center; }
  .qy-tools { gap: 0; }
  .qy-tool { width: 44px; }
  .qy-tool__label { display: none; }
}
