/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 100vh;
    font-family: Arial, sans-serif;
    background-color: #fff;
}

a {
    color: #101010;
    text-decoration: none;
}

/* 布局组件 */
#header {
    flex-shrink: 0;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding-bottom: 10px;
    height: 140px;
    background-image: url('img/header.png');
    background-color: #fff;
    background-position: left top;
    background-repeat: no-repeat;
    background-size: contain;
}

#header span {
    display: none;
}

.container-wl {
    width: 100%;
    max-width: 1200px;
    margin: 30px auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
    padding: 20px;
    overflow: hidden;
}

.channel {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Microsoft YaHei", sans-serif;
    width: 100%;
    display: flex;
    justify-content: space-around;
    flex-direction: row;
    align-items: center;
    padding-bottom: 5px;
    border-bottom: 1px solid rgb(59, 134, 202);
}

.channel .left {
    flex: 1;
    font-size: 18px;
    line-height: 1.8em !important;
    color: #026199;
}

.channel .right {
    flex: 1;
    color: #026199;
    font-size: 12px;
    line-height: 1.2em !important;
    text-align: right;
}


.header {
    text-align: center;
    margin: 30px 0;
    padding-bottom: 15px;
    border-bottom: 1px solid #eaeef2;
}
.header h1 {
    font-size: 24px;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.header h2 {
    font-size: 18px;
    color: #409EFF;
    margin: 10px 0;
}

.header p {
    color: #666;
    font-size: 14px;
}

.chart-container-wl {
    height: 400px;
    width: 100%;
    margin-bottom: 20px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.stat-card {
    background: #f9fafc;
    border-radius: 10px;
    padding: 18px 20px;
    text-align: center;
    border-left: 4px solid #409EFF;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-card.max {
    border-left-color: #f56c6c;
}

.stat-card.min {
    border-left-color: #67c23a;
}

.stat-card.avg {
    border-left-color: #e6a23c;
}

.stat-card.range {
    border-left-color: #909399;
}

.stat-card h3 {
    margin: 0;
    color: #606266;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #303133;
    margin: 5px 0;
}

.stat-time {
    color: #909399;
    font-size: 13px;
    margin-top: 5px;
}

.loading {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 400px;
    font-size: 18px;
    color: #666;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #409EFF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 400px;
    font-size: 18px;
    color: #f56c6c;
}

.error-icon {
    font-size: 36px;
    margin-bottom: 15px;
}

.sub-block {
    display: flex;
    justify-content: space-between;
    flex-direction: row;
    align-items: center;
    margin-top: 15px;
}

.last-update {
    flex: 1;
    text-align: left;
}

.share-container {
    flex: 0;
}

.last-update {
    text-align: center;
    
    color: #909399;
    font-size: 13px;
}

.share-container {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.share-buttons {
    display: flex;
    gap: 10px;
}

.share-btn {
    width: 24px;
    height: 24px;
    display: block;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    cursor: pointer;
    transition: transform 0.2s ease;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.share-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.wechat-btn {
    background-image: url('img/wechat.png');
}

.wechat-btn:hover {
    background-image: url('img/wechat_on.png');
}

.weibo-btn {
    background-image: url('img/weibo.png');
}

.weibo-btn:hover {
    background-image: url('img/weibo_on.png');
}

/* 模态框样式 */
.share-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.share-modal.active {
    opacity: 1;
    pointer-events: all;
}

.share-modal-content {
    background: white;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    width: 90%;
    max-width: 320px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    transform: translateY(20px);
    transition: transform 0.4s ease;
}

.share-modal.active .share-modal-content {
    transform: translateY(0);
}

.share-modal h3 {
    margin-top: 0;
    color: #2c3e50;
    margin-bottom: 15px;
}

.qrcode-container {
    width: 160px;
    height: 160px;
    margin: 10px auto;
    background: white;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
}

.qrcode-url {
    background: #f5f5f5;
    padding: 12px;
    border-radius: 6px;
    margin-top: 15px;
    font-size: 0.85rem;
    word-break: break-all;
    color: #555;
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.5rem;
    cursor: pointer;
    color: #888;
    background: none;
    border: none;
    font-weight: bold;
}

.close-modal:hover {
    color: #333;
}


        
/* 页脚样式 */
footer {
    flex-shrink: 0;
    width: 100%;
    background-color: rgb(170, 218, 240);
}

.footer-block {
    width: 100%;
    max-width: 1200px;
    margin: 18px auto 20px;
    display: flex;
    justify-content: space-around;
    flex-direction: row;
    align-items: center;
}

.footer-left {
    flex: 1;
    background-color: rgb(170, 218, 240);
}

.footer-left dt {
    font: 20px / 2em "Microsoft YaHei", Arial;
    color: rgb(41, 91, 162);
}

.footer-left dd {
    font: 14px / 2em "Microsoft YaHei", Arial;
    color: rgb(41, 91, 162);
}

.footer-left dd a {
    color: rgb(41, 91, 162);
}

.footer-right {
    flex: 0 158px;
    height: 158px;
    background-image: url('img/logo_small.png');
    background-color: rgb(170, 218, 240);
    background-position: center center;
    background-repeat: no-repeat;
    background-size: contain;
}


/* 响应式设计 */
@media screen and (orientation: landscape) and (min-width: 480px) and (max-width: 900px) {
    #header {
        width: 100% !important;
        height: 80px !important;
        padding-bottom: 0 !important;
        background-size: contain !important;
    }
    
    .container-wl {
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    .channel {
        align-items: stretch !important;
    }

    .header h1 {
        font-size: 16px;
    }
    
    .header h2 {
        font-size: 14px;
    }

    .header p {
        font-size: 12px;
    }

    .chart-container-wl {
        height: 300px;
    }

    .stats {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .stat-card {
        padding: 15px;
    }

    .stat-value {
        font-size: 20px;
    }

    .sub-block {
        display: none;
    }

    .footer-block {
        max-width: 90vw !important;
        margin: 15px 5vw 20px !important;
        flex-direction: row !important;
    }

    .footer-left dt {
        font-size: 14px;
    }

    .footer-left dd {
        font-size: 12px;
        line-height: 1.25em;
    }

    .footer-right {
        flex: 0 90px !important;
        height: 90px !important;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    #header {
        width: 100% !important;
        height: 80px !important;
        padding-bottom: 0 auto !important;
        background-size: 100% !important;
    }

    .container-wl {
        padding: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    .channel {
        flex-direction: column !important;
        align-items: stretch !important;
        margin-bottom: 1em;
    }

    .channel .left {
        display: none !important;
    }

    .channel .right {
        text-align: left !important;
        font-size: 0.75rem !important;
    }

    .chart-container-wl {
        height: 250px;
    }

    .stat-value {
        font-size: 18px;
    }

    .header h1 {
        font-size: 16px;
    }
    
    .header h2 {
        font-size: 14px;
    }

    .header p {
        font-size: 12px;
    }

    .sub-block {
        display: none;
    }

    .footer-block {
        max-width: 100vw !important;
        margin: 15px auto 20px;
        flex-direction: column;
    }

    .footer-left dt {
        font-size: 14px;
    }

    .footer-left dd {
        font-size: 12px;
        line-height: 1.25em;
    }

    .footer-right {
        display: none !important;
    }
}