/* ============================================================
   布局样式：头部 / 跑马灯 / 广告 / 底部导航 / 页面结构
   ============================================================ */

/* ---------- 头部 ---------- */
.hq-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid #e5e7eb;
}
.dark .hq-header {
    background: rgba(17, 24, 39, .92);
    border-bottom-color: #374151;
}

.hq-header__bar {
    max-width: 640px;
    margin: 0 auto;
    padding: .7rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hq-header__brand {
    display: flex;
    align-items: center;
    gap: .5rem;
    text-decoration: none;
    color: inherit;
}

.hq-header__logo {
    width: 2rem;
    height: 2rem;
    border-radius: .5rem;
    object-fit: cover;
}

.hq-header__logo-default {
    width: 2rem;
    height: 2rem;
    border-radius: .5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fbbf24, #d97706);
    color: #fff;
}

.hq-header__logo-default svg { width: 1.25rem; height: 1.25rem; }

.hq-header__name { font-weight: 700; font-size: 1.05rem; }

.hq-theme-btn {
    border: none;
    background: transparent;
    color: inherit;
    border-radius: .6rem;
    cursor: pointer;
    transition: background-color .2s;
}
.hq-theme-btn:hover { background: rgba(0, 0, 0, .05); }
.dark .hq-theme-btn:hover { background: rgba(255, 255, 255, .08); }

/* 主题按钮图标（日间太阳，夜间月亮） */
.hq-icon-moon { display: none; }
.dark .hq-icon-sun { display: none; }
.dark .hq-icon-moon { display: block; }

/* ---------- 广告跑马灯（位于行情卡片上方，仅首页；宽度与卡片对齐） ---------- */
.hq-marquee {
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
    margin: 0 0 .65rem;
    border-radius: .65rem;
    background: linear-gradient(90deg, #fffbeb, #fef3c7);
    color: #92400e;
    font-size: .92rem;
    font-weight: 500;
    padding: .5rem 1rem;
}
.dark .hq-marquee {
    background: linear-gradient(90deg, #1f2937, #78350f);
    color: #fde68a;
}

/* 滚动轨道：从右滚入 → 停留可完整阅读 → 滚出（单条循环，无断流空白期） */
.hq-marquee__track {
    display: inline-block;
    white-space: nowrap;
    animation: hq-marquee 12s ease-in-out infinite;
}
.hq-marquee:hover .hq-marquee__track { animation-play-state: paused; }

@keyframes hq-marquee {
    0%   { transform: translateX(100%); }   /* 从右侧进入 */
    30%  { transform: translateX(0); }      /* 停留：完整阅读 */
    80%  { transform: translateX(0); }      /* 继续停留 */
    100% { transform: translateX(-100%); }  /* 向左滚出 */
}

/* ---------- 图片广告（位于跑马灯下方、行情卡片上方，仅首页） ---------- */
.hq-banner {
    width: 100%;
    margin: 0 0 .75rem;
}
.hq-banner img {
    width: 100%;
    border-radius: .75rem;
    display: block;
}

/* ---------- 页面主区 ---------- */
.hq-main {
    max-width: 640px;
    margin: 0 auto;
    padding: .75rem 1rem 1.5rem;
}

/* 为底部导航留出空间 */
.hq-page { padding-bottom: 76px; }

/* ---------- 底部导航 ---------- */
.hq-tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    background: rgba(255, 255, 255, .95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid #e5e7eb;
}
.dark .hq-tabbar {
    background: rgba(17, 24, 39, .95);
    border-top-color: #374151;
}

.hq-tabbar__inner {
    max-width: 640px;
    margin: 0 auto;
    display: flex;
}

.hq-tab {
    flex: 1;
    min-height: 56px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-decoration: none;
    color: #9ca3af;
    font-size: .68rem;
    padding: .35rem 0;
    transition: color .2s;
}
.hq-tab svg { width: 1.4rem; height: 1.4rem; opacity: .65; }

.hq-tab.is-active { color: #d97706; font-weight: 600; }
.hq-tab.is-active svg { opacity: 1; }
.dark .hq-tab.is-active { color: #fbbf24; }
