/* --- 1. 全局样式基础 --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft YaHei", -apple-system, sans-serif;
}
html {
    scroll-behavior: smooth;
}
body {
    background-color: #0b0c10;
    color: #c5c6c7;
    background-image: url('https://hw4f.com/static/image/bg.jpg'); /* 默认背景，JS加载后会被随机图覆盖 */
    background-attachment: fixed; 
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 12, 16, 0.75); 
    z-index: -1;
}
.container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 20px;
    flex: 1; 
}
/* --- 2. 头部区域 --- */
header {
    padding: 50px 0 10px 0;
}
.main-title {
    font-size: 3.2rem;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: 2px;
    background: linear-gradient(45deg, #ff0055, #ffcc00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip; 
}
.sub-title {
    font-size: 1.1rem;
    color: #66fcf1;
    letter-spacing: 1px;
    opacity: 0.8;
    line-height: 1.5;
}
.nav-menu {
    display: flex;
    gap: 15px;
    margin-top: 35px;
    flex-wrap: wrap;
}
.nav-item {
    background: rgba(31, 40, 51, 0.6);
    color: #ffffff;
    text-decoration: none;
    padding: 12px 25px;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: bold;
    border: 1px solid rgba(102, 252, 241, 0.2);
    transition: all 0.3s ease;
}
.nav-item:hover {
    background: #66fcf1;
    color: #0b0c10;
    box-shadow: 0 0 15px rgba(102, 252, 241, 0.4);
    transform: translateY(-2px);
}
.notice-bar {
    margin-top: 35px;
    background: none; 
    border: none; 
    border-radius: 0;
    padding: 0 10px;
    display: flex;
    gap: 15px;
    align-items: flex-start;
    backdrop-filter: none;
    box-shadow: none; 
}

.notice-icon {
    font-size: 1.3rem;
    line-height: 1.4;
    color: #66fcf1; 
    animation: pulse 2s infinite;
    text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000;
}
.notice-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.notice-item {
    font-size: 0.95rem;
    color: #ffffff; 
    line-height: 1.5;
    text-align: left;
    font-weight: bold;
    text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000;
}
.notice-item strong {
    color: #ffcc00;
}
@keyframes pulse {
    0% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 0.8; }
}
.section-divider {
    height: 1px;
    margin: 40px 0 20px 0;
    background: linear-gradient(90deg, rgba(255, 204, 0, 0) 0%, rgba(255, 204, 0, 0.3) 15%, rgba(102, 252, 241, 0.3) 85%, rgba(102, 252, 241, 0) 100%);
    border: none;
}
.section-title {
    font-size: 1.6rem;
    color: #fff;
    margin: 20px 0 25px 0;
    padding-left: 12px;
    border-left: 4px solid #ffcc00;
    display: flex;
    align-items: center;
    justify-content: space-between;
    scroll-margin-top: 30px; 
}
.section-title span {
    font-size: 0.9rem;
    color: #66fcf1;
    font-weight: normal;
}
.game-grid, .tool-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}
.game-card, .tool-card {
    background: rgba(31, 40, 51, 0.5); 
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(5px); 
}
.game-card:hover, .tool-card:hover {
    transform: translateY(-5px);
    border-color: rgba(102, 252, 241, 0.4);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
}
.game-img-box, .tool-img-box {
    position: relative;
    width: 100%;
    padding-top: 60%;
    background-color: #1f2833;
}
.game-img-box img, .tool-img-box img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.game-tag, .tool-tag {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 0, 85, 0.85);
    color: #ffffff;
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: bold;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
}
.style-laobandianfu .game-tag {
    background: rgba(255, 136, 102, 0.9);
    color: #000;
}
.tool-tag {
    background: rgba(0, 200, 150, 0.9);
}
.game-info, .tool-info {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.game-name, .tool-name {
    font-size: 1.15rem;
    color: #ffcc00;
    font-weight: bold;
    margin-bottom: 12px;
    text-align: center;
}
.tool-name {
    color: #ffffff;
}
.info-item {
    font-size: 0.85rem;
    margin-bottom: 6px;
    color: #959da5;
    display: flex;
    justify-content: space-between;
}
.info-item .label { color: #8f9aa6; }
.info-item .val { color: #ffffff; }
.info-item.highlight .val { color: #ff0055; font-weight: bold; }
.info-item.time .val { color: #66fcf1; }
.game-card.style-laobandianfu .info-item.time .val {
    color: #ff8866;
    font-weight: bold;
}
.tool-desc-list {
    margin: 4px 0 10px 0;
    padding: 8px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 4px;
    font-size: 0.8rem;
    color: #959da5;
    line-height: 1.5;
    text-align: left;
}
.btn-enter, .btn-download {
    display: block;
    text-align: center;
    background: #1f2833;
    color: #66fcf1;
    text-decoration: none;
    padding: 8px 0;
    border-radius: 4px;
    font-weight: bold;
    margin-top: 6px;
    font-size: 0.9rem;
    border: 1px solid rgba(102, 252, 241, 0.3);
    transition: all 0.3s;
}
.game-card:hover .btn-enter {
    background: linear-gradient(90deg, #ff0055, #ffcc00);
    color: #fff;
    border-color: transparent;
}
.tool-card:hover .btn-download {
    background: linear-gradient(90deg, #00c896, #ffcc00);
    color: #000;
    border-color: transparent;
}
.floating-controls {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column-reverse;
    gap: 12px;
    z-index: 9999;
}
.float-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    color: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    position: relative;
    background: #1f2833;
}
#btn-back-to-top {
    background: linear-gradient(135deg, #ff0055, #ffcc00);
    display: none; 
}
#btn-back-to-top:hover {
    box-shadow: 0 6px 20px rgba(255, 0, 85, 0.5);
    color: #0b0c10;
}
#btn-music-toggle {
    background: rgba(31, 40, 51, 0.95);
    border-color: rgba(102, 252, 241, 0.4);
    color: #66fcf1;
}
#btn-music-toggle:hover {
    background: #66fcf1;
    color: #0b0c10;
    box-shadow: 0 0 15px rgba(102, 252, 241, 0.6);
}
.music-rotating {
    animation: rotateMusic 3s linear infinite;
}
@keyframes rotateMusic {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.btn-contact-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
#btn-contact-kf {
    background: linear-gradient(135deg, #00c896, #66fcf1);
    color: #0b0c10;
    font-weight: bold;
    font-size: 0.95rem;
}

.contact-popover {
    position: absolute;
    right: 60px;
    bottom: 0;
    background: rgba(11, 12, 16, 0.95);
    border: 1px solid #66fcf1;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    border-radius: 8px;
    padding: 15px 20px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transform: translateX(20px);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 8px;
    backdrop-filter: blur(10px);
}
.contact-popover p {
    font-size: 0.9rem;
    color: #c5c6c7;
}
.contact-popover strong {
    color: #ffcc00;
    font-family: Consolas, Monaco, monospace;
    font-size: 1rem;
    margin-left: 5px;
}
.highlight-notice {
    font-size: 1.05rem !important;
    color: #ffcc00 !important;
    font-weight: bold !important;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 6px;
    margin-top: 2px;
    text-shadow: 0 0 8px rgba(255, 204, 0, 0.5);
}

.btn-contact-wrapper.active .contact-popover {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}
.btn-contact-wrapper.active #btn-contact-kf {
    box-shadow: 0 0 20px rgba(102, 252, 241, 0.6);
    transform: scale(1.05);
}

.btn-contact-wrapper:hover #btn-contact-kf {
    transform: scale(1.05);
}
footer {
    background: rgba(6, 7, 10, 0.9);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 25px 0;
    margin-top: 80px;
    font-size: 0.9rem;
    color: #667380;
}
.footer-content {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}
.footer-left p { color: #959da5; }
.footer-right { text-align: right; }
@media (max-width: 1200px) {
    .game-grid, .tool-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .main-title {
        font-size: 9.2vw; 
        margin-bottom: 8px;
        letter-spacing: 1px;
    }
    header {
        padding: 30px 0 15px 0;
    }
    .nav-menu {
        margin-top: 20px;
    }
    .notice-bar {
        margin-top: 20px;
        padding: 0 10px;
    }
    .game-grid, .tool-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-content { flex-direction: column; text-align: center; }
    .footer-right { text-align: center; }
    .floating-controls { bottom: 20px; right: 20px; }
    .float-btn { width: 44px; height: 44px; font-size: 1.1rem; }
    .contact-popover { right: 55px; }
}
@media (max-width: 480px) {
    .game-grid, .tool-grid { grid-template-columns: 1fr; }
}