/* ============================================================
   GM游戏基地 - 全站样式
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --theme-color: #f04494;
    --focus-color: #f04494;
    --focus-color-opacity1: rgba(240, 68, 148, .1);
    --key-color: #333;
    --main-color: #4e5358;
    --muted-2-color: #999;
    --muted-3-color: #b1b1b1;
    --body-bg-color: #f5f6f7;
    --main-bg-color: #fff;
    --main-border-color: rgba(50, 50, 50, .06);
    --main-shadow: rgba(116, 116, 116, .08);
    --main-radius: 8px;
    --mian-max-width: 1400px;
    --posts-card-scale: 70%;
    --header-bg: rgba(255, 255, 255, .78);
    --tabs-bg: rgba(255, 255, 255, .82);
    --footer-bg: #fff;
    --footer-color: #999;
    --header-height: 60px;
}

body.dark-theme {
    --key-color: #f8fafc;
    --main-color: #e5eef7;
    --muted-2-color: #888a8f;
    --muted-3-color: #636469;
    --body-bg-color: #292a2d;
    --main-bg-color: #323335;
    --main-border-color: rgba(114, 114, 114, .1);
    --main-shadow: rgba(24, 24, 24, .1);
    --header-bg: rgba(50, 51, 53, .78);
    --tabs-bg: rgba(50, 51, 53, .82);
    --footer-bg: #323335;
    --footer-color: #888a8f;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    background-color: var(--body-bg-color);
    color: var(--main-color);
    transition: background-color .3s, color .3s;
}
body.nav-fixed { padding-top: var(--header-height); }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
ul { list-style: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; color: inherit; }

/* ========== 顶部导航 ========== */
.header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 999;
    background: var(--header-bg);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--main-border-color);
    transition: transform .35s cubic-bezier(.4, 0, .2, 1), box-shadow .3s;
}
.header.scrolled { box-shadow: 0 4px 12px rgba(0, 0, 0, .08); }
.header.header-hidden { transform: translateY(-100%); }

.header-inner {
    max-width: calc(var(--mian-max-width) + 180px);
    margin: 0 auto;
    padding: 0 20px;
    height: var(--header-height);
    display: flex;
    align-items: center;
    gap: 24px;
}
.logo { display: flex; align-items: center; gap: 6px; font-weight: bold; font-size: 18px; color: var(--theme-color); flex-shrink: 0; }
.logo img { height: 36px; }
.logo-text { color: var(--theme-color); display: none; }

.nav { display: flex; gap: 4px; flex: 1; }
.nav a {
    padding: 6px 12px; border-radius: 4px; font-size: 15px;
    color: var(--main-color); transition: color .2s, background .2s; cursor: pointer;
}
.nav a:hover, .nav a.active { color: var(--theme-color); background: var(--focus-color-opacity1); }

.header-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.search-icon-btn {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--main-color);
    background: var(--main-border-color);
    transition: background .2s, color .2s;
}
.search-icon-btn:hover { background: var(--focus-color-opacity1); color: var(--theme-color); }

.btn-qq {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 5px 14px; border-radius: 50px;
    background: linear-gradient(135deg, #59c3fb 10%, #268df7 100%);
    color: #fff; font-size: 13px; transition: opacity .2s;
}
.btn-qq:hover { opacity: .85; }

.theme-toggle {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--main-border-color);
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; color: var(--main-color);
    transition: background .2s, transform .2s;
}
.theme-toggle:hover { background: var(--focus-color-opacity1); transform: rotate(20deg); }

/* ========== 搜索浮层 ========== */
.search-overlay {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 10000;
    background: var(--main-bg-color);
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .15);
    transform: translateY(-110%);
    transition: transform .35s cubic-bezier(.4, 0, .2, 1);
    border-bottom: 1px solid var(--main-border-color);
}
.search-overlay.show { transform: translateY(0); }
.search-overlay-inner form {
    max-width: 800px; margin: 0 auto;
    display: flex; gap: 10px; position: relative;
}
.search-overlay-inner input {
    flex: 1; height: 50px; padding: 0 100px 0 20px;
    font-size: 16px;
    border: 2px solid var(--main-border-color);
    border-radius: 25px;
    outline: none;
    background: var(--body-bg-color);
    color: var(--main-color);
    transition: border-color .2s;
}
.search-overlay-inner input:focus { border-color: var(--theme-color); }
.search-submit-btn {
    position: absolute; right: 60px; top: 50%; transform: translateY(-50%);
    padding: 8px 20px; background: var(--theme-color); color: #fff;
    border-radius: 20px; font-size: 14px; font-weight: 500;
    cursor: pointer; transition: opacity .2s;
}
.search-submit-btn:hover { opacity: .85; }
.search-close-btn {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    width: 40px; height: 40px; font-size: 20px;
    color: var(--muted-2-color); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: background .2s;
}
.search-close-btn:hover { background: var(--main-border-color); color: var(--theme-color); }

/* ========== 顶部功能区 ========== */
.top-tools { max-width: var(--mian-max-width); margin: 20px auto 0; padding: 0 16px; }
.tools-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.tool-card {
    display: flex; align-items: center; gap: 12px;
    padding: 15px; background: var(--main-bg-color);
    border-radius: var(--main-radius);
    box-shadow: 0 0 10px var(--main-shadow);
    transition: transform .2s, box-shadow .2s;
}
.tool-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px var(--main-shadow); }
.tool-icon {
    width: 45px; height: 45px; border-radius: 50%;
    background: linear-gradient(135deg, #eabe7b 10%, #edc788 100%);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; flex-shrink: 0;
}
.tool-title { font-size: 14px; font-weight: bold; color: var(--key-color); }
.tool-desc { font-size: 13px; color: var(--muted-2-color); margin-top: 2px; }

/* ========== 搜索栏 ========== */
.search-section { max-width: var(--mian-max-width); margin: 20px auto 0; padding: 0 16px; }
.search-box { max-width: 800px; margin: 0 auto; display: flex; gap: 10px; }
.search-box input {
    flex: 1; height: 48px; padding: 0 25px; font-size: 16px;
    border: none; border-radius: 50px; background: var(--main-bg-color);
    box-shadow: 0 6px 25px rgba(0, 0, 0, .1); color: var(--main-color);
    outline: none; transition: box-shadow .3s, transform .3s;
}
.search-box input:focus { box-shadow: 0 6px 25px rgba(0, 0, 0, .15); transform: translateY(-2px); }
.search-box button {
    padding: 0 30px; height: 48px; border-radius: 50px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff; font-size: 16px; font-weight: 600;
    transition: transform .2s;
}
.search-box button:hover { transform: translateY(-2px); }

/* ========== 分类菜单（悬浮 + 毛玻璃） ========== */
.category-tabs-wrap {
    position: sticky;
    top: var(--header-height);
    z-index: 998;
    margin-top: 20px;
    background: var(--tabs-bg);                    /* ★ 半透明 */
    -webkit-backdrop-filter: saturate(180%) blur(20px);   /* ★ 毛玻璃 */
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--main-border-color);
    transition: box-shadow .3s, top .35s cubic-bezier(.4, 0, .2, 1);
}
.category-tabs-wrap.scrolled {
    box-shadow: 0 4px 12px var(--main-shadow);
}
.category-tabs { max-width: var(--mian-max-width); margin: 0 auto; padding: 10px 16px; }
.tabs-wrap { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-start; align-items: center; }
.tab {
    display: inline-block; padding: 6px 16px; border-radius: 20px;
    font-size: 14px; font-weight: 500; color: var(--main-color);
    background: transparent; cursor: pointer;
    transition: color .2s, background .2s;
    white-space: nowrap; line-height: 1.6;
}
.tab:hover { color: var(--theme-color); }
.tab.active { background: var(--theme-color); color: #fff; }

/* ========== 主体内容 ========== */
.main-content { max-width: var(--mian-max-width); margin: 24px auto 0; padding: 0 16px 100px; }
.section-title {
    font-size: 15px; font-weight: bold; margin-bottom: 15px;
    padding-left: 1.2em; position: relative; color: var(--key-color);
}
.section-title::before {
    content: ''; position: absolute; left: 2px; top: 10%; bottom: 10%;
    width: 4px; border-radius: 5px; background: var(--theme-color);
}

/* ========== 卡片网格 ========== */
.posts-row { margin: -8px; display: flex; flex-wrap: wrap; }
.posts-item.card {
    width: calc(25% - 16px); margin: 8px;
    display: inline-block; background: var(--main-bg-color);
    border-radius: var(--main-radius);
    box-shadow: 0 0 10px var(--main-shadow);
    overflow: hidden;
    transition: transform .3s, box-shadow .3s;
    position: relative; padding: 0;
}
.posts-item.card:hover { transform: translateY(-3px); box-shadow: 0 4px 16px var(--main-shadow); }
.posts-item.card .item-thumbnail {
    width: 100%; height: 0; padding-bottom: var(--posts-card-scale);
    position: relative; overflow: hidden;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: var(--main-radius) var(--main-radius) 0 0;
}
.posts-item.card .item-thumbnail img {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    object-fit: cover; transition: transform .3s;
}
.posts-item.card:hover .item-thumbnail img { transform: scale(1.05); }
.posts-item.card .item-body { padding: 10px; }

.img-badge {
    position: absolute; top: .6em; left: 0;
    padding: .2em .6em; font-size: 12px; line-height: 1.2; color: #fff;
    background: linear-gradient(135deg, #fd7a64 10%, #fb2d2d 100%);
    border-radius: 0 50px 50px 0; z-index: 1;
}
.item-heading {
    font-size: 14px; font-weight: bold; line-height: 1.4em;
    min-height: 2.8em; max-height: 2.8em; margin-bottom: 5px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; color: var(--key-color);
}
.item-heading:hover { color: var(--theme-color); }
.item-tags { min-height: 23px; margin-bottom: 6px; display: flex; flex-wrap: wrap; gap: 5px; }
.meta-pay {
    display: inline-block; padding: 2px 5px; font-size: 11px;
    border-radius: 4px;
    background: linear-gradient(135deg, #f59f54 10%, #ff6922 100%);
    color: #fff;
}
.item-meta {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 12px; color: var(--muted-2-color);
}
.item-meta .date { padding-left: 8px; position: relative; }
.item-meta .date::before {
    content: ''; width: 5px; height: 5px;
    border: 1px solid var(--theme-color); border-radius: 50%;
    position: absolute; left: 0; top: 50%; transform: translateY(-50%);
}
.item-meta .meta-right { display: flex; gap: 8px; align-items: center; font-size: 12px; }
.item-meta .meta-right span { white-space: nowrap; }

/* ========== 自动加载指示器 ========== */
.load-more-indicator {
    width: 100%;
    padding: 30px 0;
    display: flex;
    justify-content: center;
    align-items: center;
}
.loading-dots {
    display: inline-flex;
    gap: 6px;
}
.loading-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--theme-color);
    animation: dotBounce 1.4s ease-in-out infinite both;
    opacity: .6;
}
.loading-dots span:nth-child(2) { animation-delay: .2s; }
.loading-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes dotBounce {
    0%, 80%, 100% { transform: scale(.6); opacity: .4; }
    40% { transform: scale(1); opacity: 1; }
}

.list-end-tip {
    text-align: center;
    padding: 30px 0 10px;
    color: var(--muted-3-color);
    font-size: 13px;
    letter-spacing: 2px;
}

/* ========== 空状态 ========== */
.empty-tip { width: 100%; text-align: center; padding: 60px 0; color: var(--muted-2-color); font-size: 14px; }

/* ========== 详情页 ========== */
.breadcrumb { padding: 10px 8px; font-size: 13px; color: var(--muted-2-color); }
.breadcrumb a:hover { color: var(--theme-color); }
.breadcrumb li { display: inline-block; }
.breadcrumb li+li::before { content: '/'; margin: 0 6px; opacity: .5; }

.article-detail {
    background: var(--main-bg-color);
    border-radius: var(--main-radius);
    box-shadow: 0 0 10px var(--main-shadow);
    padding: 30px; margin-bottom: 30px;
}
.article-detail .article-title { font-size: 24px; font-weight: 700; color: var(--key-color); line-height: 1.4; margin-bottom: 12px; }
.article-detail .article-meta {
    font-size: 13px; color: var(--muted-2-color);
    padding-bottom: 15px; border-bottom: 1px solid var(--main-border-color);
    margin-bottom: 20px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.article-detail .article-meta .date { padding-left: 10px; position: relative; }
.article-detail .article-meta .date::before {
    content: ''; width: 6px; height: 6px;
    border: 1px solid var(--theme-color); border-radius: 50%;
    position: absolute; left: 0; top: 50%; transform: translateY(-50%);
}
.article-detail .article-body { font-size: 16px; line-height: 2; color: var(--main-color); margin-bottom: 20px; }
.article-detail .article-body p { margin-bottom: 20px; }
.article-detail .article-body img {
    max-width: 100%; height: auto; margin: 10px auto;
    border-radius: var(--main-radius); cursor: zoom-in; transition: opacity .2s;
}
.article-detail .article-body img:hover { opacity: .92; }
.article-detail .article-body a { color: var(--theme-color); text-decoration: underline; }

.article-detail .article-tags {
    padding-top: 20px; border-top: 1px solid var(--main-border-color);
    display: flex; flex-wrap: wrap; gap: 8px;
}
.article-tag {
    display: inline-block; padding: 4px 12px; font-size: 12px;
    border-radius: 4px; background: var(--focus-color-opacity1);
    color: var(--theme-color); transition: background .2s;
}
.article-tag:hover { background: var(--theme-color); color: #fff; }

.like-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 28px; border-radius: 50px;
    border: 1px solid var(--theme-color);
    background: transparent; color: var(--theme-color);
    font-size: 15px; font-weight: 500; cursor: pointer; transition: all .2s;
}
.like-btn:hover { background: var(--theme-color); color: #fff; }
.like-btn.liked { background: var(--theme-color); color: #fff; cursor: default; opacity: .8; }

.copyright-box {
    margin-top: 30px; padding: 22px 20px 16px;
    border: 1.5px dashed var(--theme-color);
    border-radius: var(--main-radius);
    background: var(--body-bg-color);
    font-size: 13px; line-height: 2; color: var(--muted-2-color); position: relative;
}
.copyright-box .copyright-title {
    position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
    padding: 2px 16px; border-radius: 999px;
    background: linear-gradient(to right, #FFCC99, #FF99CC);
    border: 1.5px dashed var(--theme-color);
    color: #333; font-size: 13px; font-weight: 700; white-space: nowrap;
}
.copyright-box p { margin: 4px 0; color: var(--muted-2-color); }
.copyright-box a { color: var(--theme-color); text-decoration: none; }
.copyright-box a:hover { text-decoration: underline; }

.detail-loading, .detail-404 { text-align: center; padding: 80px 20px; color: var(--muted-2-color); }
.detail-404 a { color: var(--theme-color); text-decoration: underline; }

/* ========== 图片灯箱 ========== */
.img-lightbox {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, .95); z-index: 99999;
    display: none; align-items: center; justify-content: center;
    overflow: hidden; cursor: zoom-out;
    -webkit-tap-highlight-color: transparent;
    touch-action: none; -webkit-user-select: none; user-select: none;
}
.img-lightbox.show { display: flex; animation: lbFadeIn .25s ease; }
.img-lightbox img {
    max-width: 100%; max-height: 100%; width: auto; height: auto;
    object-fit: contain; box-shadow: 0 0 50px rgba(0, 0, 0, .6);
    cursor: grab; transform-origin: center center; will-change: transform;
    touch-action: none; pointer-events: auto;
}
.img-lightbox-close {
    position: absolute; top: 18px; right: 22px;
    width: 44px; height: 44px; border-radius: 50%;
    background: rgba(255, 255, 255, .15); color: #fff;
    font-size: 26px; display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: background .2s, transform .2s; z-index: 2;
    touch-action: manipulation;
}
.img-lightbox-close:hover { background: rgba(255, 255, 255, .3); transform: rotate(90deg); }
@keyframes lbFadeIn { from { opacity: 0; } to { opacity: 1; } }

body.lightbox-open { overflow: hidden; touch-action: none; }

/* ========== 页脚 ========== */
.footer { background: var(--footer-bg); color: var(--footer-color); padding: 30px; font-size: 13px; transition: background .3s; }
.footer-inner {
    max-width: calc(var(--mian-max-width) + 180px);
    margin: 0 auto; display: grid; grid-template-columns: 2fr 1.2fr;
    gap: 40px; padding-bottom: 20px;
}
.footer-col h4 { font-size: 15px; color: var(--key-color); margin-bottom: 12px; }
.footer-col p { font-size: 13px; line-height: 2; color: var(--footer-color); word-break: break-word; }
.footer-col a { color: var(--theme-color); }
.footer-col a:hover { text-decoration: underline; }
.footer-bottom {
    max-width: calc(var(--mian-max-width) + 180px);
    margin: 0 auto; border-top: 1px solid var(--main-border-color);
    padding-top: 18px; text-align: center;
    font-size: 12px; color: var(--muted-3-color);
}

/* ========== 手机适配 ========== */
@media (max-width: 1200px) {
    .posts-item.card { width: calc(33.333% - 16px); }
}
@media (max-width: 992px) {
    .nav { display: none; }
    .posts-item.card { width: calc(33.333% - 16px); }
    .btn-qq { display: none; }
}
@media (max-width: 767px) {
    :root { --header-height: 56px; }
    body.nav-fixed { padding-top: 56px; }
    .header-inner { height: 56px; padding: 0 10px; gap: 10px; }
    .logo { font-size: 16px; }
    .logo-text { display: inline-block; font-size: 15px; }
    .btn-qq { display: none; }
    .header-right { gap: 8px; }
    .search-icon-btn { width: 34px; height: 34px; }
    .search-icon-btn svg { width: 18px; height: 18px; }
    .theme-toggle { width: 34px; height: 34px; }

    .top-tools, .search-section, .main-content { padding: 0 10px; }
    .tools-wrap { gap: 10px; }
    .tool-card { padding: 10px; }
    .tool-icon { width: 40px; height: 40px; font-size: 18px; }
    .tool-title { font-size: 13px; }
    .tool-desc { font-size: 12px; }
    .search-box input { height: 44px; padding: 0 18px; font-size: 14px; }
    .search-box button { padding: 0 20px; height: 44px; font-size: 14px; }

    .category-tabs { padding: 10px 10px; }
    .tabs-wrap { gap: 4px; justify-content: flex-start; }
    .tab { padding: 5px 12px; font-size: 13px; }

    .main-content { padding: 0 10px 80px; }
    .posts-row { margin: -5px; }
    .posts-item.card { width: calc(50% - 10px); margin: 5px; }
    .item-heading { font-size: 13px; }
    .item-meta { font-size: 11px; }

    .footer { padding: 24px 16px; }
    .footer-inner { grid-template-columns: 1fr; gap: 20px; padding-bottom: 16px; }
    .footer-col h4 { font-size: 14px; margin-bottom: 8px; }
    .footer-col p { font-size: 12px; line-height: 1.9; }
    .footer-bottom { font-size: 11px; padding-top: 14px; }

    .article-detail { padding: 15px; }
    .article-detail .article-title { font-size: 18px; }
    .article-detail .article-body { font-size: 15px; }
    .copyright-box { font-size: 12px; padding: 20px 14px 12px; }

    .img-lightbox-close { top: 10px; right: 12px; width: 38px; height: 38px; font-size: 22px; }

    .search-overlay { padding: 15px; }
    .search-overlay-inner input { height: 44px; padding: 0 90px 0 16px; font-size: 15px; }
    .search-submit-btn { right: 54px; padding: 7px 16px; font-size: 13px; }
    .search-close-btn { width: 36px; height: 36px; font-size: 18px; }

    .load-more-indicator { padding: 20px 0; }
}
