﻿/* ===== 知阀网前台公用样式（头部/尾部/容器/面板头/搜索） ===== */

/* ===== 全局重置 & 基础 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
    -webkit-tap-highlight-color: transparent;
}

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

body {
    background: #f5f6fa;
    color: #333;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    -webkit-touch-callout: none;
    touch-action: manipulation;
}

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

input, button, textarea, select {
    -webkit-appearance: none;
    appearance: none;
    font-family: inherit;
    touch-action: manipulation;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding-left: max(24px, env(safe-area-inset-left));
    padding-right: max(24px, env(safe-area-inset-right));
    padding-top: 0;
    padding-bottom: 0;
}

/* ===== 通用面板头部 ===== */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0 12px 0;
    border-bottom: 2px solid #e8e8e8;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.panel-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: #222;
    display: flex;
    align-items: center;
    gap: 6px;
}

.panel-header h3 i {
    display: inline-block;
    width: 22px;
    height: 22px;
    background: #ff6a00;
    border-radius: 4px;
    margin-right: 4px;
}

.panel-header .more-link {
    font-size: 14px;
    color: #999;
}

.panel-header .header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
}

.panel-header .sub-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.panel-header .sub-links a {
    font-size: 14px;
    color: #666;
    padding: 2px 8px;
    border-radius: 12px;
    background: #f0f0f0;
    transition: 0.2s;
}

.panel-header .sub-links a:hover {
    background: #ff6a00;
    color: #fff;
}

/* ===== 头部 ===== */
.header {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    padding: 16px 0;
}

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

.logo img {
    width: 160px;
    height: 60px;
    object-fit: cover;
}

.search-section {
    flex: 1;
    min-width: 200px;
    max-width: 520px;
}

.search-box {
    display: flex;
    border: 2px solid #ff6a00;
    border-radius: 30px;
    overflow: hidden;
    background: #fff;
}

.search-box .search-input {
    flex: 1;
    border: none;
    padding: 10px 18px;
    font-size: 16px;
    outline: none;
    min-width: 60px;
    line-height: 1.4;
}

.search-box .search-btn {
    background: #ff6a00;
    color: #fff;
    border: none;
    padding: 10px 24px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    white-space: nowrap;
    touch-action: manipulation;
}

.search-box .search-btn:hover {
    background: #e55d00;
}

.hot-keywords {
    margin-top: 8px;
    font-size: 13px;
    color: #999;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
}

.hot-keywords a {
    color: #555;
    transition: 0.2s;
}

.hot-keywords a:hover {
    color: #ff6a00;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-right .text-info {
    text-align: right;
    line-height: 1.4;
}

.header-right .txt1 {
    font-size: 13px;
    color: #999;
}

.header-right .txt2 {
    font-size: 15px;
    font-weight: 600;
    color: #222;
}

.header-right .qr-code img {
    width: 80px;
    height: 80px;
    border-radius: 4px;
    border: 1px solid #eee;
    object-fit: cover;
}

/* ===== 底部四列信息区 ===== */
.footer-widgets {
    background: #fff;
    padding: 24px 0 30px;
    margin-top: 20px;
    border-top: 1px solid #e8e8e8;
}

.footer-widgets .container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.widget-col .panel-header {
    border-bottom: 2px solid #ff6a00;
    padding-bottom: 8px;
    margin-bottom: 12px;
}

.widget-col .panel-header h3 {
    font-size: 17px;
}

.widget-col .item-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.widget-col .item {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 8px 10px;
    transition: 0.2s;
}

.widget-col .item:hover {
    background: #f0f0f0;
}

.widget-col .item a {
    display: flex;
    align-items: center;
    gap: 10px;
}

.widget-col .item img {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.widget-col .item .title h4 {
    font-size: 14px;
    color: #222;
}

.widget-col .item .title p {
    font-size: 12px;
    color: #999;
}

/* ===== 版权信息 ===== */
.copyright {
    background: #222;
    color: #aaa;
    text-align: center;
    padding: 18px 15px;
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
    font-size: 13px;
    line-height: 1.8;
}

.copyright a {
    color: #ff6a00;
}

/* ===== 通用按钮 ===== */
.btn {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    border: none;
    transition: 0.2s;
    text-align: center;
}

.btn-primary {
    background: #ff6a00;
    color: #fff;
}

.btn-primary:hover {
    background: #e55d00;
}

.btn-outline {
    background: #fff;
    color: #ff6a00;
    border: 1px solid #ff6a00;
}

.btn-outline:hover {
    background: #fff5ee;
}

/* ===== 分页 ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin: 24px 0;
    flex-wrap: wrap;
}

.pagination a, .pagination span {
    display: inline-block;
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    color: #666;
    background: #fff;
    min-width: 36px;
    text-align: center;
}

.pagination a:hover {
    border-color: #ff6a00;
    color: #ff6a00;
}

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

.pagination .disabled {
    color: #ccc;
    cursor: not-allowed;
}

/* ============================================ */
/* ===== 响应式适配（公用部分） ===== */
/* ============================================ */
@media (max-width: 1024px) {
    .footer-widgets .container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .logo {
        text-align: center;
    }

    .logo img {
        width: 140px;
        height: 55px;
        margin: 0 auto;
    }

    .search-section {
        max-width: 100%;
    }

    .header-right {
        justify-content: center;
        gap: 10px;
    }

    .header-right .text-info {
        text-align: left;
    }

    .header-right .qr-code img {
        width: 64px;
        height: 64px;
    }

    .footer-widgets .container {
        grid-template-columns: 1fr;
    }

    .panel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .panel-header .header-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        width: 100%;
    }

    .panel-header .sub-links {
        gap: 6px;
    }

    .panel-header .sub-links a {
        font-size: 12px;
        padding: 4px 10px;
        min-height: 28px;
        display: inline-flex;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .header-right .text-info {
        display: none;
    }

    .search-box .search-btn {
        padding: 10px 16px;
        font-size: 14px;
    }

    .panel-header h3 {
        font-size: 17px;
    }

    /* 头部按钮缩小 */
    .header-right .hdr-btn { padding: 7px 16px; font-size: 12px; border-radius: 18px; }

    /* 友情链接换行对齐 */
    .friend-links { padding: 12px 0; font-size: 12px; }
    .friend-links .container { gap: 6px 10px; }
    .friend-links .fl-label { font-size: 12px; }
    .friend-links .fl-item img { height: 18px; max-width: 90px; }

    /* 版权区域适配 */
    .copyright { font-size: 12px; padding: 14px 10px; }
    .footer-pages a { margin: 0 4px; font-size: 11px; }
    .copyright-html { font-size: 11px; }
}

@media (max-width: 360px) {
    .container {
        padding-left: max(18px, env(safe-area-inset-left));
        padding-right: max(18px, env(safe-area-inset-right));
        padding-top: 0;
        padding-bottom: 0;
    }

    .search-box .search-input {
        padding: 10px 12px;
        font-size: 15px;
    }

    .panel-header h3 {
        font-size: 16px;
    }

    .header-right .hdr-btn { padding: 6px 12px; font-size: 11px; border-radius: 16px; }
    .header-right { gap: 6px; }
}
