/**
 * 电子报系统 - 前台样式
 * 版本: 1.0.0
 */

/* ========== 全局重置 ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

a { color: #4fc3f7; text-decoration: none; }
a:hover { color: #3ba8d6; }

img { max-width: 100%; height: auto; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ========== 头部 ========== */
.header {
    background: #1a2332;
    color: #fff;
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.logo {
    font-size: 22px;
    font-weight: 700;
}

.logo a { color: #fff; text-decoration: none; }
.logo img { max-height: 50px; }

.nav {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.nav a {
    color: #aab8c9;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
    padding: 5px 0;
}

.nav a:hover { color: #fff; }
.nav a.active { color: #4fc3f7; }

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
}

/* ========== 搜索栏 ========== */
.search-section {
    background: #fff;
    padding: 15px 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.search-form {
    display: flex;
    gap: 10px;
    max-width: 600px;
    margin: 0 auto;
}

.search-form input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #dce1e8;
    border-radius: 4px;
    font-size: 15px;
    transition: border-color 0.3s;
}

.search-form input:focus {
    outline: none;
    border-color: #4fc3f7;
}

.search-form button {
    padding: 10px 25px;
    background: #4fc3f7;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 15px;
    transition: background 0.3s;
    white-space: nowrap;
}

.search-form button:hover { background: #3ba8d6; }

/* ========== 主要内容布局 ========== */
.main-content {
    display: grid;
    grid-template-columns: 1fr 320px 260px;
    gap: 20px;
    margin: 20px 0;
}

@media (max-width: 992px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

/* ========== 左侧面板 ========== */
.left-panel {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.edition-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.edition-header h2 { font-size: 18px; color: #1a2332; }

.btn-pdf {
    display: inline-block;
    padding: 6px 14px;
    background: #f44336;
    color: #fff;
    border-radius: 4px;
    font-size: 13px;
    text-decoration: none;
    transition: background 0.3s;
}

.btn-pdf:hover { background: #d32f2f; color: #fff; }

.edition-image {
    position: relative;
    overflow: hidden;
    background: #f8f9fa;
    border-radius: 4px;
}

.edition-image img {
    display: block;
    width: 100%;
    height: auto;
}

.hotspot {
    position: absolute;
    border: 2px solid rgba(255, 0, 0, 0.5);
    background: rgba(255, 0, 0, 0.08);
    cursor: pointer;
    transition: all 0.3s;
}

.hotspot:hover {
    border-color: #4fc3f7;
    background: rgba(79, 195, 247, 0.2);
}

.hotspot-label {
    position: absolute;
    bottom: 5px;
    right: 5px;
    font-size: 10px;
    color: #fff;
    background: rgba(0,0,0,0.6);
    padding: 2px 6px;
    border-radius: 3px;
    opacity: 0;
    transition: opacity 0.3s;
}

.hotspot:hover .hotspot-label { opacity: 1; }

/* ========== 中间面板 ========== */
.center-panel {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.center-panel h2 { font-size: 18px; color: #1a2332; margin-bottom: 12px; }

.article-list { list-style: none; }
.article-list li {
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}
.article-list li:last-child { border-bottom: none; }

.article-title {
    color: #1a2332;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: color 0.3s;
}

.article-title:hover { color: #4fc3f7; }

.article-meta {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

.article-meta span { margin-right: 12px; }

/* ========== 右侧面板 ========== */
.right-panel {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.right-panel h2 { font-size: 16px; color: #1a2332; margin-bottom: 12px; }

.edition-list { list-style: none; }
.edition-list li {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}
.edition-list li:last-child { border-bottom: none; }

.edition-list a {
    color: #1a2332;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
    display: block;
}

.edition-list a:hover { color: #4fc3f7; }
.edition-list a.active { color: #4fc3f7; font-weight: 600; }

/* ========== 分享按钮 ========== */
.share-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.share-label { font-size: 14px; color: #6b7a8a; }

.share-buttons { display: flex; gap: 8px; flex-wrap: wrap; }

.share-btn {
    display: inline-block;
    padding: 4px 12px;
    border: none;
    border-radius: 3px;
    color: #fff;
    cursor: pointer;
    font-size: 12px;
    text-decoration: none;
    transition: opacity 0.3s;
}

.share-btn:hover { opacity: 0.8; color: #fff; }
.share-btn.wechat { background: #07c160; }
.share-btn.weibo { background: #e6162d; }
.share-btn.qq { background: #12b7f5; }
.share-btn.qzone { background: #fdb933; color: #333; }

/* ========== 近期报刊 ========== */
.recent-section {
    background: #fff;
    padding: 20px 0;
    margin: 20px 0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.recent-section h2 {
    font-size: 18px;
    color: #1a2332;
    margin-bottom: 15px;
    padding: 0 15px;
}

.newspaper-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
    padding: 0 15px;
}

.newspaper-item {
    background: #f8f9fa;
    border-radius: 6px;
    overflow: hidden;
    transition: transform 0.3s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.newspaper-item:hover { transform: translateY(-3px); }

.newspaper-item a { display: block; text-decoration: none; color: #333; }

.newspaper-item img {
    width: 100%;
    height: auto;
    display: block;
}

.newspaper-item .info { padding: 10px; }
.newspaper-item .info h3 {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 2px;
}
.newspaper-item .info .date {
    font-size: 11px;
    color: #999;
}
.newspaper-item .info .issue {
    font-size: 11px;
    color: #4fc3f7;
}

/* ========== 友情链接 ========== */
.links-section {
    background: #fff;
    padding: 20px 0;
    margin: 20px 0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    padding: 0 15px;
}

.link-group h3 {
    font-size: 15px;
    color: #1a2332;
    margin-bottom: 10px;
}

.link-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.link-list a {
    display: inline-block;
    padding: 4px 12px;
    background: #f5f7fa;
    border: 1px solid #e8ecf0;
    border-radius: 4px;
    font-size: 13px;
    color: #555;
    text-decoration: none;
    transition: all 0.3s;
}

.link-list a:hover {
    background: #4fc3f7;
    color: #fff;
    border-color: #4fc3f7;
}

/* ========== 底部 ========== */
.footer {
    background: #1a2332;
    color: #aab8c9;
    padding: 30px 0 15px;
    margin-top: 30px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.footer-content h4 {
    color: #fff;
    font-size: 15px;
    margin-bottom: 8px;
}

.footer-content p { font-size: 13px; }
.footer-content a { color: #aab8c9; text-decoration: none; }
.footer-content a:hover { color: #fff; }

.footer-bottom {
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid #2c3e50;
    font-size: 13px;
}

.footer-link {
    color: #aab8c9;
    text-decoration: none;
    margin-left: 10px;
}

.footer-link:hover { color: #fff; }

.powered-by {
    color: #4fc3f7;
    margin-left: 10px;
}

/* ========== 分页 ========== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: 8px 12px;
    border: 1px solid #dce1e8;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    min-width: 36px;
    text-align: center;
}

.pagination a:hover {
    background: #4fc3f7;
    color: #fff;
    border-color: #4fc3f7;
}

.pagination .active {
    background: #4fc3f7;
    color: #fff;
    border-color: #4fc3f7;
}

/* ========== 空状态 ========== */
.empty-state {
    text-align: center;
    padding: 30px 20px;
    color: #999;
}

.empty-state .icon { font-size: 40px; margin-bottom: 10px; }

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .nav {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 8px;
        padding: 10px 0;
    }
    .nav.open { display: flex; }
    .nav-toggle { display: block; }
    
    .search-form { flex-wrap: wrap; }
    .search-form input { width: 100%; }
    .search-form button { width: 100%; }
    
    .newspaper-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
    
    .links-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .logo { font-size: 18px; }
    .logo img { max-height: 40px; }
    .edition-header { flex-direction: column; align-items: stretch; gap: 10px; }
    .btn-pdf { text-align: center; }
    .newspaper-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}