/* ============================================
   西北狼·狼眼世界 - 移动端优化CSS
   版本: 1.0.0
   创建时间: 2026-04-22
   目标: 提升手机端浏览体验
============================================ */

/* ===== 基础重置与移动端优化 ===== */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    padding-top: 0px;  /* 已由header.php统一控制 */
  /* 由header.php全局控制 */

    margin: 0;
    padding: 0;
    overflow-x: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    line-height: 1.5;
    color: #333;
    background-color: #fff;
}

/* ===== 响应式容器 ===== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ===== 移动端优先的媒体查询 ===== */

/* 超大屏幕 (桌面) */
@media (min-width: 1200px) {
    html { font-size: 18px; }
    .container { padding: 0 30px; }
}

/* 中等屏幕 (平板横屏/小桌面) */
@media (min-width: 992px) and (max-width: 1199px) {
    html { font-size: 17px; }
    .container { padding: 0 25px; }
}

/* 小屏幕 (平板竖屏) */
@media (min-width: 768px) and (max-width: 991px) {
    html { font-size: 16px; }
    .container { padding: 0 20px; }
}

/* 超小屏幕 (手机) */
@media (max-width: 767px) {
    html { font-size: 15px; }
    .container { padding: 0 15px; }
    
    /* 移动端特殊优化 */
    img {
        max-width: 100%;
        height: auto;
    }
    
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ===== 页眉移动端优化 ===== */
@media (max-width: 767px) {
    .wolfeye-header {
        padding: 10px 0;
    }
    
    .header-desktop {
        display: flex;
        flex-direction: column;
        gap: 15px;
        padding: 10px 0;
    }
    
    .brand-section {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 10px;
    }
    
    .brand-logo {
        font-size: 24px;
    }
    
    .brand-title {
        font-size: 18px;
    }
    
    .brand-subtitle {
        font-size: 11px;
    }
    
    .info-section {
        flex-direction: column;
        gap: 15px;
        width: 100%;
    }
    
    .time-info {
        width: 100%;
        text-align: center;
    }
    
    .current-time {
        font-size: 16px;
    }
    
    .date-week {
        font-size: 12px;
        justify-content: center;
    }
    
    .weather-section {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
        width: 100%;
    }
    
    .weather-card {
        flex: 0 0 calc(33.333% - 10px);
        min-width: 0;
        padding: 8px;
    }
    
    .city-name {
        font-size: 11px;
    }
    
    .temperature {
        font-size: 14px;
    }
    
    .member-section {
        flex-direction: row;
        justify-content: center;
        width: 100%;
        gap: 15px;
    }
    
    .login-link, .register-button {
        font-size: 13px;
        padding: 6px 12px;
    }
}

/* ===== 导航菜单移动端优化 ===== */
@media (max-width: 767px) {
    .main-nav {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 10px 0;
        margin: 0 -15px;
        padding-left: 15px;
    }
    
    .nav-grid {
        display: flex;
        flex-wrap: nowrap;
        gap: 10px;
        min-width: max-content;
        padding-right: 15px;
    }
    
    .nav-item {
        flex: 0 0 auto;
        padding: 8px 12px;
        font-size: 13px;
        white-space: nowrap;
    }
    
    .nav-icon {
        margin-right: 5px;
        font-size: 14px;
    }
}

/* ===== 首页内容移动端优化 ===== */
@media (max-width: 767px) {
    .two-column-news-container {
        grid-template-columns: 1fr !important;
        gap: 20px;
        margin-bottom: 30px;
    }
    
    .section-preview {
        padding: 15px;
        margin-bottom: 20px;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    }
    
    .section-preview h3 {
        font-size: 18px;
        margin-bottom: 15px;
        padding-bottom: 8px;
        border-bottom: 2px solid #f0f0f0;
    }
    
    .preview-item {
        margin-bottom: 15px;
        padding-bottom: 15px;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .preview-item:last-child {
        border-bottom: none;
        margin-bottom: 0;
        padding-bottom: 0;
    }
    
    .preview-title a {
        font-size: 16px;
        line-height: 1.4;
        color: #1a237e;
        text-decoration: none;
        display: block;
        margin-bottom: 5px;
    }
    
    .preview-title a:hover {
        color: #0056b3;
        text-decoration: underline;
    }
    
    .preview-summary {
        font-size: 14px;
        color: #666;
        line-height: 1.5;
        margin-bottom: 8px;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .preview-meta {
        font-size: 12px;
        color: #999;
        display: flex;
        align-items: center;
        gap: 10px;
    }
    
    .more-link {
        display: inline-block;
        margin-top: 15px;
        padding: 8px 16px;
        background-color: #f8f9fa;
        border: 1px solid #e0e0e0;
        border-radius: 4px;
        color: #0056b3;
        text-decoration: none;
        font-size: 14px;
        font-weight: 500;
        transition: all 0.2s ease;
    }
    
    .more-link:hover {
        background-color: #e9ecef;
        border-color: #0056b3;
    }
}

/* ===== 页脚移动端优化 ===== */
@media (max-width: 767px) {
    .site-footer {
        padding: 20px 0;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 20px;
    }
    
    .footer-section {
        width: 100%;
        text-align: center;
    }
    
    .footer-section h3 {
        font-size: 16px;
        margin-bottom: 10px;
    }
    
    .footer-section p {
        font-size: 14px;
        line-height: 1.5;
    }
    
    .footer-menu {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        margin-top: 20px;
        padding-top: 20px;
        border-top: 1px solid #e0e0e0;
    }
    
    .copyright p {
        font-size: 13px;
        margin-bottom: 5px;
    }
    
    .filing-info {
        margin-top: 10px;
    }
    
    .filing-info a {
        font-size: 12px;
        display: block;
        margin-bottom: 5px;
    }
    
    .footer-slogan p {
        font-size: 14px;
        margin-bottom: 5px;
    }
    
    .publish-date {
        font-size: 12px;
        color: #999;
    }
}

/* ===== 触摸优化 ===== */
@media (max-width: 767px) {
    /* 增大触摸目标尺寸 */
    a, button, input[type="submit"], input[type="button"] {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* 链接触摸反馈 */
    a:active {
        opacity: 0.7;
    }
    
    /* 表单元素优化 */
    input, textarea, select {
        font-size: 16px; /* 防止iOS自动缩放 */
    }
    
    /* 按钮样式优化 */
    button, .button, input[type="submit"], input[type="button"] {
        padding: 12px 20px;
        font-size: 16px;
        border-radius: 8px;
        border: none;
        background-color: #0056b3;
        color: white;
        cursor: pointer;
        transition: all 0.2s ease;
    }
    
    button:active, .button:active {
        transform: scale(0.98);
        background-color: #004494;
    }
}

/* ===== 性能优化 ===== */
@media (max-width: 767px) {
    /* 减少动画和过渡 */
    * {
        animation-duration: 0.3s !important;
        transition-duration: 0.3s !important;
    }
    
    /* 图片懒加载占位符 */
    img[data-src] {
        background-color: #f5f5f5;
        min-height: 100px;
    }
    
    /* 减少阴影和渐变 */
    .section-preview, .weather-card, .nav-item {
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
}

/* ===== 特殊设备优化 ===== */

/* iPhone X及以上安全区域 */
@supports (padding: max(0px)) {
    @media (max-width: 767px) {
        body {
    padding-top: 0px;  /* 已由header.php统一控制 */
  /* 由header.php全局控制 */

            padding-left: env(safe-area-inset-left);
            padding-right: env(safe-area-inset-right);
            padding-top: env(safe-area-inset-top);
            padding-bottom: env(safe-area-inset-bottom);
        }
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .preview-title a {
        color: #0000cc;
    }
    
    .more-link {
        border: 2px solid #0000cc;
    }
}

/* 减少动画模式 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== 实用类 ===== */
.mobile-only {
    display: none;
}

.desktop-only {
    display: block;
}

@media (max-width: 767px) {
    .mobile-only {
        display: block;
    }
    
    .desktop-only {
        display: none;
    }
}

/* 隐藏滚动条但保持滚动功能 */
.scrollable-x {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
}

.scrollable-x::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Edge */
}

/* 文本截断 */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
/* ========== 狼眼世界 · 移动端页眉美化 ========== */
.header-desktop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #1a1a2e;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    z-index: 9999;
    padding: 10px 16px;
    box-sizing: border-box;
}
.header-desktop a,
.header-desktop .site-title,
.header-desktop .site-description {
    color: #f0c040;
    text-decoration: none;
}
.main-navigation ul {
    display: flex;
    justify-content: center;
    gap: 16px;
    list-style: none;
    margin: 8px 0 0 0;
    padding: 0;
}
.main-navigation a {
    color: #ffffff;
    font-weight: 600;
    font-size: 14px;
    transition: color 0.3s;
}
.main-navigation a:hover {
    color: #f0c040;
}
body {
    padding-top: 0px;  /* 已由header.php统一控制 */
  /* 由header.php全局控制 */

    padding-top: 90px;   /* 移动端头部稍矮，调整这个值 */
}

/* ========== 手机端底部悬浮导航条 ========== */
@media (max-width: 767px) {
    /* 隐藏桌面端页眉导航，保留页眉中的时间天气信息 */
    .site-header {
        display: none !important;
    }
    .main-navigation {
        display: none !important;
    }
    body {
    padding-top: 0px;  /* 已由header.php统一控制 */
  /* 由header.php全局控制 */

        padding-top: 0px;  /* 已由header.php统一控制 */

        padding-bottom: 70px !important;
    }
    
    /* 底部固定导航条 */
    .mobile-bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 60px;
        background: #1a1a2e;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.3);
        z-index: 99999;
        display: flex;
        justify-content: space-around;
        align-items: center;
        padding: 0 5px;
        box-sizing: border-box;
    }
    
    .mobile-bottom-nav a {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        color: #bdc3c7;
        font-size: 10px;
        padding: 4px 6px;
        transition: color 0.2s;
        min-height: 44px;
        min-width: 44px;
        flex: 1;
        max-width: 80px;
    }
    
    .mobile-bottom-nav a .nav-icon {
        font-size: 20px;
        margin-bottom: 2px;
    }
    
    .mobile-bottom-nav a .nav-label {
        font-size: 10px;
        line-height: 1.2;
        text-align: center;
        white-space: nowrap;
    }
    
    .mobile-bottom-nav a:active,
    .mobile-bottom-nav a:hover {
        color: #f39c12;
    }

    /* 音乐播放器的特殊入口（如果有的话） */
    .mobile-bottom-nav a.music-link .nav-icon {
        font-size: 22px;
    }
    .mobile-bottom-nav a.music-link {
        background: rgba(243, 156, 18, 0.15);
        border-radius: 8px;
    }
}

