/* ============================================================
   layout.responsive.css - 统一响应式布局
   含：基础重置 / mobile drawer / footer / bottom bar
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Microsoft YaHei', 'PingFang SC', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #f4f6fb;
    overflow-x: hidden;
    color: #1a1a2e;
}

img { max-width: 100%; height: auto; }
a { text-decoration: none; }

.page-main-content { min-height: 100vh; }

/* ============================================================
   移动端侧边抽屉 (mobile-nav-wrapper / mobile-nav-drawer)
   默认完全隐藏，由 JS 添加 .active 展开
   ============================================================ */

.mobile-nav-wrapper {
    display: none;          /* 默认隐藏 */
    position: fixed;
    inset: 0;
    z-index: 9500;
}

.mobile-nav-wrapper.active {
    display: block;
}

.mobile-nav-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(2px);
}

.mobile-nav-drawer {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    max-width: 80vw;
    background: #fff;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
}

.mobile-nav-wrapper.active .mobile-nav-drawer {
    transform: translateX(0);
}

/* 抽屉头部 */
.mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 16px;
    background: linear-gradient(135deg, #5D3FD3, #7B61FF);
    color: #fff;
}

.mobile-nav-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: 700;
}

.mobile-nav-close {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255,255,255,0.2);
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

/* 抽屉菜单项 */
.mobile-nav-menu {
    padding: 12px 0;
}

.mobile-nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    color: #333;
    font-size: 0.97rem;
    font-weight: 500;
    text-decoration: none;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.2s, color 0.2s;
}

.mobile-nav-item:hover {
    background: #f0edff;
    color: #5D3FD3;
}

.mobile-nav-item i {
    width: 20px;
    text-align: center;
    color: #5D3FD3;
    font-size: 1rem;
}

.mobile-nav-divider {
    height: 8px;
    background: #f5f5f5;
    margin: 4px 0;
}

/* 登录/注册按钮组 */
.mobile-nav-auth {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
}

.mobile-nav-auth-btn {
    flex: 1;
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    border: 2px solid #5D3FD3;
    color: #5D3FD3;
    transition: all 0.2s;
}

.mobile-nav-auth-btn.primary {
    background: #5D3FD3;
    color: #fff;
}

.mobile-nav-logout {
    margin: 0;
    padding: 0;
    width: 100%;
    border: none;
    background: none;
}

.mobile-nav-logout button {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    width: 100%;
    background: none;
    border: none;
    border-bottom: 1px solid #f5f5f5;
    color: #e53e3e;
    font-size: 0.97rem;
    font-weight: 500;
    cursor: pointer;
}

/* ============================================================
   底部导航栏（移动端）
   ============================================================ */

.mobile-bottom-bar {
    display: none;
}

@media (max-width: 768px) {
    html { font-size: 14px; }

    body {
        padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
    }

    .mobile-bottom-bar {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 56px;
        background: #fff;
        border-top: 1px solid #e8e8f0;
        z-index: 900;
        box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
        padding-bottom: env(safe-area-inset-bottom, 0px);
        align-items: stretch;
    }

    .mobile-bottom-bar .bar-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        color: #888;
        font-size: 0.68rem;
        text-decoration: none;
        transition: color 0.2s;
        padding: 6px 0;
    }

    .mobile-bottom-bar .bar-item i { font-size: 1.25rem; display: block; }
    .mobile-bottom-bar .bar-item.active { color: #5D3FD3; }
    .mobile-bottom-bar .bar-item.publish i { font-size: 1.8rem; color: #5D3FD3; }
}

/* ============================================================
   Footer 完整样式
   ============================================================ */

.footer {
    background: linear-gradient(135deg, #1a1a2e 0%, #2d1b6e 100%);
    color: #fff;
    padding: 60px 0 0;
    flex-shrink: 0;
    width: 100%;
}

.footer-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    padding-bottom: 48px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-section h4 {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #5D3FD3;
    display: inline-block;
}

.footer-section a {
    display: block;
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.9rem;
    margin-bottom: 10px;
    text-decoration: none;
    transition: color 0.2s, padding-left 0.2s;
}

.footer-section a:hover {
    color: #fff;
    padding-left: 6px;
}

.footer-bottom {
    padding: 20px 0;
    text-align: center;
}

.footer-bottom p {
    margin: 0;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.45);
}

.footer-bottom a {
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-bottom a:hover { color: #fff; }

/* Footer 响应式 */
@media (max-width: 768px) {
    .footer { padding: 40px 0 0; }
    .footer-container { padding: 0 20px; }
    .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 24px; padding-bottom: 32px; }
}

@media (max-width: 480px) {
    .footer-grid { grid-template-columns: 1fr; gap: 20px; }
}

/* ============================================================
   右侧浮动操作按钮
   ============================================================ */

.floating-actions {
    position: fixed;
    right: 24px;
    bottom: 120px;
    z-index: 800;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.floating-action-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #5D3FD3, #7B61FF);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: 0 4px 16px rgba(93, 63, 211, 0.35);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.floating-action-btn:hover {
    transform: translateX(-4px) scale(1.1);
    box-shadow: 0 6px 24px rgba(93, 63, 211, 0.5);
    color: #fff;
}

/* Tooltip */
.floating-action-btn::before {
    content: attr(data-tooltip);
    position: absolute;
    right: 58px;
    background: rgba(26, 26, 46, 0.9);
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.floating-action-btn:hover::before { opacity: 1; }

/* 移动端隐藏浮动按钮 */
@media (max-width: 768px) {
    .floating-actions { display: none; }
}

/* ============================================================
   实时行情 Ticker Bar（全局，位于导航栏下方）
   ============================================================ */

.ticker-bar {
    display: flex;
    align-items: center;
    background: #1a1a2e;
    color: #fff;
    height: 44px;
    overflow: hidden;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.ticker-label {
    flex-shrink: 0;
    background: #5D3FD3;
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 700;
    white-space: nowrap;
}

.ticker-track-wrapper {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.ticker-track {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    animation: tickerMove 32s linear infinite;
}

.ticker-track:hover { animation-play-state: paused; }

@keyframes tickerMove {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.ticker-item {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.82);
    padding: 0 18px;
}

.ticker-item em { font-style: normal; font-weight: 700; }
.ticker-item .up   { color: #4ade80; }
.ticker-item .down { color: #f87171; }
.ticker-item .flat { color: #94a3b8; }

.ticker-sep {
    color: rgba(255,255,255,0.18);
    font-size: 0.9rem;
}

.ticker-more {
    flex-shrink: 0;
    padding: 0 18px;
    color: #F5C842;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    border-left: 1px solid rgba(255,255,255,0.08);
    height: 100%;
    transition: background 0.2s;
}
.ticker-more:hover { background: rgba(255,255,255,0.06); color: #fff; }

/* 移动端缩小 ticker */
@media (max-width: 768px) {
    .ticker-bar  { height: 38px; }
    .ticker-label { padding: 0 12px; font-size: 0.78rem; }
    .ticker-item  { padding: 0 12px; font-size: 0.78rem; }
    .ticker-more  { padding: 0 12px; font-size: 0.75rem; }
}
