/* 百度新闻H5移动端样式 */

/* 基础设置 */
:root {
    --primary-color: #1890ff;
    --secondary-color: #52c41a;
    --danger-color: #ff4d4f;
    --warning-color: #faad14;
    --text-primary: #1a1a1a;
    --text-secondary: #666;
    --text-light: #999;
    --border-color: #e8e8e8;
    --bg-white: #ffffff;
    --bg-gray: #f5f5f5;
    --bg-light: #fafafa;
    --bg-hover: #f0f0f0;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.15);
    --shadow-lg: 0 8px 16px rgba(0,0,0,0.2);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
}

/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 基础字体和排版 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-gray);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
}

/* 字体大小系统 */
html {
    font-size: 16px;
    line-height: 1.5;
}

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

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

/* 标题层级 */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.9rem; }

/* 文本元素 */
p {
    margin-bottom: 1rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    text-decoration: underline;
}

/* 链接样式 */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    text-decoration: underline;
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    touch-action: manipulation;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #40a9ff;
    transform: translateY(-1px);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
}

/* 输入框样式 */
input, textarea, select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
    background: var(--bg-white);
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

input::placeholder, textarea::placeholder, select::placeholder {
    color: var(--text-light);
}

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

/* 导航栏样式 */
.news-nav {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: var(--transition);
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

.nav-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    min-height: 60px;
}

.logo {
    font-size: 18px;
    font-weight: bold;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.logo i {
    font-size: 20px;
}

.search-box {
    flex: 1;
    max-width: 300px;
    margin: 0 15px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 8px 35px 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

.search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.1);
}

.search-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 5px 8px;
    cursor: pointer;
    border-radius: 50%;
    transition: var(--transition);
}

.search-btn:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

.nav-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.nav-icon {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: var(--transition);
    position: relative;
}

.nav-icon:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

.nav-icon.active {
    color: var(--primary-color);
}

/* 分类导航样式 */
.category-nav {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 60px;
    z-index: 999;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

.category-list {
    display: flex;
    overflow-x: auto;
    padding: 10px 15px;
    gap: 12px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.category-list::-webkit-scrollbar {
    display: none;
}

.category-item {
    flex-shrink: 0;
    padding: 8px 16px;
    background: var(--bg-light);
    border-radius: var(--radius-lg);
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    user-select: none;
}

.category-item.active {
    background: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-sm);
}

.category-item:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* 热点标签 */
.hot-badge {
    background: var(--danger-color);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: normal;
    margin-left: 8px;
    vertical-align: middle;
}

/* 段落标题 */
.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-primary);
    padding: 0 15px;
}

.section-title i {
    font-size: 18px;
    color: var(--primary-color);
}

/* 头条新闻样式 */
.headline-section {
    margin: 20px 15px;
}

.headline-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin-bottom: 15px;
    transition: var(--transition);
    cursor: pointer;
    display: block;
}

.headline-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.headline-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--bg-light);
    transition: var(--transition);
}

.headline-card:hover .headline-image {
    transform: scale(1.05);
}

.headline-content {
    padding: 15px;
}

.headline-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.headline-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-light);
}

.headline-source {
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

.headline-time {
    font-weight: 400;
}

/* 新闻列表样式 */
.news-section {
    margin: 20px 15px;
}

.news-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.news-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 15px;
    display: flex;
    gap: 12px;
    transition: var(--transition);
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.news-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary-color);
    transform: translateX(-100%);
    transition: var(--transition);
}

.news-card:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-md);
}

.news-card:hover::before {
    transform: translateX(0);
}

.news-image {
    width: 100px;
    height: 75px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-light);
    transition: var(--transition);
}

.news-card:hover .news-image {
    transform: scale(1.05);
}

.news-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.news-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-summary {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.news-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text-light);
    margin-top: auto;
}

.news-source {
    font-weight: 500;
}

/* 加载更多样式 */
.load-more {
    text-align: center;
    padding: 30px 15px;
    margin-bottom: 20px;
}

.load-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.load-btn:hover {
    background: #40a9ff;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.load-btn:disabled {
    background: var(--text-light);
    cursor: not-allowed;
    transform: none;
}

.load-btn i {
    font-size: 16px;
}

/* 底部导航 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-white);
    border-top: 1px solid var(--border-color);
    z-index: 1000;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

.nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 0;
    min-height: 60px;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-size: 12px;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    user-select: none;
}

.nav-item.active {
    color: var(--primary-color);
    background: var(--bg-light);
}

.nav-item:hover {
    color: var(--primary-color);
}

.nav-item i {
    font-size: 20px;
}

.nav-item span {
    font-weight: 500;
}

/* 滚动提示 */
.scroll-hint {
    position: fixed;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    background: var(--primary-color);
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    z-index: 999;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    opacity: 0.7;
}

.scroll-hint:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
    box-shadow: var(--shadow-lg);
}

.scroll-hint i {
    font-size: 16px;
}

/* 通知样式 */
.notification {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    z-index: 10000;
    font-weight: 500;
    max-width: 90%;
    text-align: center;
    box-shadow: var(--shadow-md);
}

/* 工具类 */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }
.inline { display: inline; }

/* 响应式设计 */
@media (max-width: 768px) {
    .headline-image {
        height: 180px;
    }
    
    .news-card {
        padding: 12px;
        gap: 10px;
    }
    
    .news-image {
        width: 80px;
        height: 60px;
    }
    
    .news-title {
        font-size: 13px;
    }
    
    .news-summary {
        font-size: 11px;
    }
    
    .news-meta {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .nav-content {
        padding: 8px 10px;
        min-height: 50px;
    }
    
    .logo {
        font-size: 16px;
    }
    
    .search-box {
        max-width: 200px;
        margin: 0 10px;
    }
    
    .category-list {
        padding: 8px 10px;
        gap: 8px;
    }
    
    .category-item {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .headline-image {
        height: 150px;
    }
    
    .headline-title {
        font-size: 14px;
    }
    
    .headline-content {
        padding: 12px;
    }
    
    .news-card {
        flex-direction: column;
        padding: 12px;
    }
    
    .news-image {
        width: 100%;
        height: 120px;
    }
    
    .news-content {
        width: 100%;
    }
    
    .nav-items {
        padding: 6px 0;
        min-height: 50px;
    }
    
    .nav-item i {
        font-size: 18px;
    }
    
    .nav-item span {
        font-size: 11px;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

/* 图片加载效果 */
.news-image, .headline-image {
    background: linear-gradient(90deg, var(--bg-light) 25%, var(--bg-gray) 50%, var(--bg-light) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* 高DPI优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .headline-image, .news-image {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* 暗色模式支持 */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #ffffff;
        --text-secondary: #d9d9d9;
        --text-light: #bfbfbf;
        --border-color: #434343;
        --bg-white: #1f1f1f;
        --bg-gray: #141414;
        --bg-light: #262626;
        --bg-hover: #2a2a2a;
    }
    
    .news-nav, .category-nav, .bottom-nav {
        background: rgba(31, 31, 31, 0.95);
        border-color: #434343;
    }
    
    .news-card {
        background: var(--bg-white);
    }
    
    .category-item {
        background: var(--bg-light);
    }
}

/* 打印样式 */
@media print {
    .news-nav,
    .category-nav,
    .bottom-nav,
    .scroll-hint,
    .search-box,
    .nav-actions {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .news-card,
    .headline-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* 无障碍支持 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 焦点样式 */
*:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.btn:focus,
.nav-icon:focus,
.category-item:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.3);
}