/**
 * ========================================
 * 金色港湾资讯网 - 自适应视图优化样式
 * 文件说明：增强首页移动端和平板端的响应式体验
 * 创建日期：2026-05-09
 * ========================================
 */

/* ==============================
   1. 全局优化
   ============================== */
html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

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

/* ==============================
   2. 热搜词区域优化
   ============================== */
.colored-box {
    width: 100% !important;
    padding: 12px 18px !important;
    height: auto !important;
    min-height: 40px;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    flex-wrap: wrap;
    gap: 4px 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    background-color: #87CEFA;
    color: white;
    font-family: Arial, sans-serif;
    box-sizing: border-box;
}

.colored-box a {
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 3px;
    white-space: nowrap;
    font-size: 0.875em;
    transition: background 0.2s;
}

.colored-box a:hover {
    background: rgba(255, 255, 255, 0.35);
    color: #fff;
}

/* ==============================
   3. 轮播图与头条区域自适应
   ============================== */
.focus {
    height: auto !important;
}

.focus ul li img,
.flexslider {
    height: auto !important;
    aspect-ratio: 410 / 387;
}

.flex-viewport {
    max-height: none !important;
}

@media only screen and (max-width: 747px) {
    .flex-control-nav {
        bottom: 15px;
    }
    .flex-caption {
        font-size: 12px;
        line-height: 16px;
        white-space: normal;
        padding: 8px 10px;
    }
}

/* 平板：轮播与头条上下排列 */
@media only screen and (max-width: 980px) {
    .focus {
        width: 100%;
        float: none;
        margin-bottom: 20px;
    }
    .top {
        width: 100%;
        float: none;
        height: auto;
    }
    .top ul li {
        padding-bottom: 12px;
        margin-bottom: 12px;
    }
    .top p {
        height: auto;
    }
}

/* ==============================
   4. 文章列表缩略图自适应
   ============================== */
.section .thumbnail {
    width: 180px;
}

.section .thumbnail img {
    height: 135px;
    object-fit: cover;
}

@media only screen and (max-width: 640px) {
    .section {
        padding-bottom: 15px;
        margin-bottom: 15px;
    }
    .section .thumbnail {
        width: 130px;
        height: auto;
        padding-right: 12px;
        padding-top: 0;
    }
    .section .thumbnail img {
        height: 97px;
        object-fit: cover;
    }
    .section .excerpt p {
        height: auto;
        max-height: 72px;
        overflow: hidden;
    }
}

@media only screen and (max-width: 480px) {
    .section {
        padding: 0 15px 15px;
    }
    .section .thumbnail {
        width: 100px;
        float: none;
        padding-right: 0;
        padding-bottom: 8px;
    }
    .section .thumbnail img {
        width: 100%;
        height: auto;
        max-height: 160px;
        object-fit: cover;
    }
    .section h2 {
        font-size: 1em;
        margin-bottom: 8px;
        white-space: normal;
    }
    .section .excerpt p {
        font-size: 0.85em;
        height: auto;
        max-height: 64px;
    }
}

/* ==============================
   5. 金港互帮（问答列表）优化
   ============================== */
.ask-list li {
    padding: 15px 18px;
}

.ask-list .date {
    width: 50px;
    min-width: 50px;
    margin-right: 15px;
    padding-right: 12px;
}

.ask-list .dateline {
    font-size: 20px;
}

/* 移动端：日期改为行内显示 */
@media only screen and (max-width: 992px) {
    .ask-list li {
        padding: 12px 15px;
    }
    .ask-list .date {
        display: flex !important;
        flex-direction: row;
        align-items: baseline;
        width: auto;
        min-width: auto;
        margin-right: 0;
        margin-bottom: 8px;
        padding-right: 0;
        border-right: none;
        border-bottom: 1px solid #eee;
        padding-bottom: 8px;
    }
    .ask-list .dateline {
        font-size: 18px;
        margin-right: 6px;
    }
    .ask-list .txt a {
        font-size: 14px;
        line-height: 1.5;
    }
    .ask-list .txt:last-child {
        font-size: 11px;
    }
}

/* ==============================
   6. 金港推荐（左右双列）优化
   ============================== */
.hots ul li .thumbnail {
    width: 120px;
    height: 90px;
}

.hots ul li img {
    height: 90px;
    object-fit: cover;
}

@media only screen and (max-width: 640px) {
    .hots ul li .thumbnail {
        width: 100px;
        height: 75px;
        padding-top: 5px;
    }
    .hots ul li img {
        height: 75px;
    }
    .hots ul li h4 {
        font-size: 0.9em;
    }
    .hots ul li p {
        height: auto;
        max-height: 44px;
        line-height: 1.5em;
        font-size: 0.85em;
    }
}

@media only screen and (max-width: 480px) {
    .hots ul li {
        width: 100% !important;
        float: none !important;
        padding-bottom: 15px;
    }
    .hots ul li .thumbnail {
        width: 100%;
        height: auto;
        float: none;
        padding: 0 0 8px 0;
    }
    .hots ul li img {
        width: 100%;
        height: auto;
        max-height: 180px;
        object-fit: cover;
    }
    .hots ul li h4 {
        font-size: 0.95em;
        white-space: normal;
    }
    .hots ul li p {
        font-size: 0.85em;
        height: auto;
    }
}

/* ==============================
   7. 侧边栏优化
   ============================== */
.widget ul li {
    margin-bottom: 10px;
}

.widget ul li i {
    padding: 2px 7px;
    font-size: 0.75em;
    min-width: 20px;
    text-align: center;
}

.widget ul li i.a1,
.widget ul li i.a2,
.widget ul li i.a3 {
    color: #fff;
}

/* 侧边栏搜索框优化 */
.ss318 .w318 {
    width: 100%;
}

.ss318 .search_form {
    width: 100%;
    margin: 14px auto 0;
}

.ss318 .search_form .stxt {
    width: calc(100% - 60px);
}

@media only screen and (max-width: 980px) {
    .sidebar {
        width: 100%;
    }
    .widget .follow img {
        width: 140px;
        height: 140px;
        margin: 0 10px;
    }
}

@media only screen and (max-width: 480px) {
    .widget {
        margin-bottom: 12px;
    }
    .widget h3 {
        font-size: 1.1em;
        margin: 15px 0;
    }
    .widget ul {
        padding: 0 12px 3px;
    }
    .widget ul li {
        margin-bottom: 8px;
        font-size: 0.85em;
    }
    .widget .follow img {
        width: 120px;
        height: 120px;
    }
    .widget .follow p {
        margin-bottom: 12px;
        font-size: 0.85em;
    }
}

/* ==============================
   8. 内容区域与整体布局优化
   ============================== */
.content,
.hots {
    border-radius: 4px;
}

.section-title h3 {
    font-size: 1.2em;
}

/* 内容区块间距优化 */
@media only screen and (max-width: 768px) {
    .content {
        margin-bottom: 12px;
    }
    .section-title h3 {
        font-size: 1.1em;
    }
}

/* ==============================
   9. 底部友情链接优化
   ============================== */
.friendlinks ul li {
    margin: 4px 8px;
}

.friendlinks .section-title span {
    display: block;
    margin-left: 0;
    margin-top: 5px;
    font-size: 0.8em;
    color: #999;
}

@media only screen and (max-width: 768px) {
    .friendlinks {
        margin-bottom: 12px;
    }
    .friendlinks .section-title {
        padding: 8px 12px;
        font-size: 0.85em;
    }
    .friendlinks ul {
        padding: 0 8px 8px;
    }
    .friendlinks ul li {
        font-size: 0.75em;
        margin: 3px 6px;
    }
}

/* ==============================
   10. 返回顶部按钮优化
   ============================== */
.fixed-widget {
    right: 15px;
    bottom: 80px;
    top: auto;
}

.fixed-widget ul li {
    width: 42px;
    height: 42px;
    line-height: 42px;
    font-size: 1.5em;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.fixed-widget ul li:hover {
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

@media only screen and (max-width: 768px) {
    .fixed-widget {
        right: 10px;
        bottom: 60px;
    }
    .fixed-widget ul li {
        width: 38px;
        height: 38px;
        line-height: 38px;
        font-size: 1.3em;
    }
}

/* ==============================
   11. 页脚优化
   ============================== */
.footer {
    padding: 15px 0;
}

.footer .copyright,
.footer .other {
    font-size: 0.75em;
    margin: 3px 0;
}

@media only screen and (max-width: 768px) {
    .footer {
        text-align: center;
        padding: 12px 0;
    }
    .footer .copyright,
    .footer .other {
        float: none;
        text-align: center;
        font-size: 0.7em;
        line-height: 1.8;
    }
    .footer .other img {
        max-width: 100%;
        height: auto;
    }
}

/* ==============================
   12. 导航栏优化
   ============================== */
@media only screen and (max-width: 980px) {
    .top-other .icon-menu {
        display: block;
    }
    .nav .menu > ul {
        padding: 0;
    }
    .nav .menu ul li a {
        padding: 0 20px;
        font-size: 1em;
    }
}

@media only screen and (max-width: 480px) {
    .header {
        height: 45px;
    }
    .logo {
        width: 140px;
        height: 45px;
    }
    .logo img {
        height: 45px;
    }
    .top-other ul li {
        line-height: 45px;
    }
    .top-other ul li i {
        padding: 0 10px;
    }
    .top-other ul li .social-share {
        top: 45px;
    }
    .nav {
        top: 45px;
    }
    .nav .menu {
        padding-bottom: 40px;
    }
}

/* ==============================
   13. 搜索框优化
   ============================== */
.search-form .s {
    border-radius: 3px;
    font-size: 0.9em;
}

@media only screen and (max-width: 768px) {
    .search-bg {
        padding: 12px 0;
    }
    .search-form .s {
        width: 85%;
        font-size: 0.85em;
    }
    .search-form button {
        height: 30px;
    }
}

/* ==============================
   14. 顶部广告横幅优化
   ============================== */
.topad img,
.mainad img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

@media only screen and (max-width: 480px) {
    .topad {
        margin-bottom: 10px;
    }
    .mainad {
        margin-bottom: 12px;
    }
}

/* ==============================
   15. 整体间距与容器优化
   ============================== */
.blank {
    height: 12px;
}

.inner {
    box-sizing: border-box;
}

@media only screen and (max-width: 980px) {
    .inner {
        width: 96%;
        padding: 0 2%;
    }
}

@media only screen and (max-width: 480px) {
    .inner {
        width: 100%;
        padding: 0 3%;
    }
    .blank {
        height: 8px;
    }
}

/* ==============================
   16. 登录注册区域优化
   ============================== */
.widget center {
    line-height: 2;
    font-size: 0.9em;
}

.widget center a {
    margin: 0 5px;
    padding: 2px 6px;
    border-radius: 3px;
    background: #f5f5f5;
    font-size: 0.9em;
    transition: background 0.2s;
}

.widget center a:hover {
    background: #e8e8e8;
}

@media only screen and (max-width: 480px) {
    .widget center {
        font-size: 0.85em;
        line-height: 2.2;
    }
    .widget center a {
        margin: 2px 3px;
        padding: 3px 8px;
    }
}

/* ==============================
   17. 动画性能优化
   ============================== */
.wow {
    visibility: visible !important;
    animation-name: none !important;
}

@media only screen and (min-width: 769px) {
    .wow {
        visibility: visible !important;
    }
}

/* ==============================
   18. 打印样式优化
   ============================== */
@media print {
    .header, .sidebar, .fixed-widget, .footer,
    .main-im, .top-other, .search-bg, .mainad,
    .topad, .colored-box {
        display: none !important;
    }
    .main {
        width: 100%;
        float: none;
    }
    body {
        background: #fff;
    }
}
