:root {
    --primary-color: #ffffff;
    --secondary-color: #fbfbfd;
    --text-color: #1d1d1f;
    --text-secondary: #86868b;
    --hover-color: #2997ff;
    --border-color: #d2d2d7;
    --background-color: #f5f6fa;
    --success-color: #2ecc71;
    --error-color: #e74c3c;
    --card-background: #ffffff;
    --font-family: "Microsoft YaHei", "微软雅黑", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* 添加手动深色模式类 */
:root[data-theme="dark"] {
    --primary-color: #1d1d1f;
    --secondary-color: #2d2d2d;
    --text-color: #f5f5f7;
    --text-secondary: #a1a1a6;
    --hover-color: #0071e3;
    --border-color: #424245;
    --background-color: #1a1a1a;
    --card-background: #2d2d2d;
}

/* 主题切换按钮样式 */
.theme-toggle {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--text-color);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    color: var(--hover-color);
    background: var(--secondary-color);
}

.theme-toggle i {
    font-size: 16px;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        --primary-color: #1d1d1f;
        --secondary-color: #2d2d2d;
        --text-color: #f5f5f7;
        --text-secondary: #a1a1a6;
        --hover-color: #0071e3;
        --border-color: #424245;
        --background-color: #1a1a1a;
        --card-background: #2d2d2d;
    }

    .hero-content {
        color: var(--text-color);
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    }

    .search-box input {
        background: var(--secondary-color);
        color: var(--text-color);
    }

    .search-box input::placeholder {
        color: var(--text-secondary);
    }

    .player-card {
        background: var(--secondary-color);
    }

    .status-badge {
        border-color: var(--secondary-color);
    }

    .feature-card h2 {
        color: var(--text-color);
        background: none;
        -webkit-text-fill-color: initial;
    }

    .player-card {
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    }

    .player-card:hover {
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    }

    header {
        background: rgba(29, 29, 31, 0.8);
        backdrop-filter: saturate(180%) blur(20px);
    }

    .search-results {
        background: var(--primary-color);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }

    .search-result-item:hover {
        background-color: var(--secondary-color);
    }

    .search-result-item mark {
        background-color: rgba(255, 255, 255, 0.1);
        color: var(--hover-color);
    }

    /* 添加深色模式下的 hero 遮罩 */
    .hero-image::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.4); /* 更深的遮罩 */
        z-index: 1;
    }

    /* 确保文字在遮罩上方 */
    .hero-content {
        z-index: 2;
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    -webkit-font-smoothing: antialiased;
    line-height: 1.47059;
    color: var(--text-color);
    background-color: var(--background-color);
}

/* 头部样式 */
header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: saturate(180%) blur(20px);
    position: sticky;
    top: 0;
    z-index: 9999;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

header nav a {
    text-decoration: none;
    color: var(--text-color);
    transition: color 0.3s ease;
    font-size: 16px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

header nav a:hover {
    color: var(--hover-color);
    background: var(--secondary-color);
}

/* Logo 样式 */
.logo {
    height: 44px;
    display: flex;
    align-items: center;
}

.logo a {
    height: 100%;
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo img {
    height: 100%;
    width: auto;
    object-fit: contain;
    transition: opacity 0.3s ease;
}

.logo a:hover img {
    opacity: 0.8;
}

/* 主体布局 */
.container {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    background-color: var(--primary-color);
}

/* 侧边样式 */
.sidebar {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 300px;
    background: transparent;
    border: none;
    padding: 1rem;
    z-index: 100;
}

.search-box {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-box input {
    width: 100%;
    padding: 12px 20px;
    font-size: 16px;
    border: none;
    border-radius: 12px;
    background: var(--primary-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    color: var(--text-color);
}

.search-box input:focus {
    outline: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.search-box input::placeholder {
    color: var(--text-secondary);
    font-size: 14px;
}

.search-box::before {
    content: '\f002';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 14px;
}

.quick-links ul {
    list-style: none;
}

.quick-links a {
    color: var(--text-color);
    text-decoration: none;
    display: block;
    padding: 0.5rem 0;
    transition: color 0.3s ease;
}

.quick-links a:hover {
    color: var(--hover-color);
    transform: translateX(5px);
}

/* 页脚样式 */
footer {
    background: var(--primary-color);
    border-top: 1px solid var(--border-color);
    padding: 2rem;
    margin-top: 2rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer-section h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.footer-section a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 16px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.footer-section a:hover {
    color: var(--hover-color);
    background: var(--primary-color);
    transform: translateY(-2px);
}

.footer-bottom {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    background: var(--primary-color);
}

.footer-bottom p {
    font-size: 12px;
    color: var(--text-secondary);
}

/* 响应式设计调整 */
@media (max-width: 768px) {
    .footer-section ul {
        flex-direction: row;  /* 保持水平排列 */
        flex-wrap: wrap;      /* 允许换行 */
        gap: 1rem;
    }
}

/* 修改 hero 部分样式 */
.hero {
    position: relative;
    /* 使用 aspect-ratio 保持 16:9 的长宽比 */
    aspect-ratio: 16/9;
    width: 100%;
    height: auto;
    overflow: hidden;
    background: var(--secondary-color);
}

.hero-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    text-align: center;
    color: var(--primary-color);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    width: 100%;
    padding: 0 20px;
}

.hero h1 {
    font-size: 56px;
    line-height: 1.07143;
    font-weight: 600;
    letter-spacing: -0.005em;
    animation: fadeUp 1s ease-out forwards;
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.hero p {
    font-size: 28px;
    line-height: 1.10722;
    font-weight: 400;
    letter-spacing: .004em;
    animation: fadeUp 1s ease-out forwards;
    opacity: 0;
    animation-delay: 0.2s;
}

.hero-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    padding: 0;
}

/* 添加渐变遮罩提高文字可读性 */
.hero-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        rgba(0, 0, 0, 0.2),
        rgba(0, 0, 0, 0.1)
    );
}

/* 响应式调整 */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 40px;
    }
    
    .hero p {
        font-size: 20px;
    }
}

.feature-card {
    text-align: center;
    padding: 60px 0;
    background: var(--primary-color);
    border: none;
    box-shadow: none;
    border-radius: 15px;
    margin-top: 0;
}

.feature-card h2 {
    font-size: 48px;
    line-height: 1.08349;
    font-weight: 600;
    letter-spacing: -.003em;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--text-color);
}

.feature-card ul {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.feature-card li {
    font-size: 21px;
    line-height: 1.381;
    font-weight: 400;
    letter-spacing: .011em;
    padding: 20px;
    transition: transform 0.3s ease;
    animation: fadeUp 1s ease-out forwards;
    opacity: 0;
    animation-delay: calc(0.1s * var(--i));
}

.feature-card li:hover {
    transform: scale(1.02);
}

.sidebar {
    background: var(--secondary-color);
    border-radius: 15px;
}

footer a {
    color: var(--hover-color);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* 添加波浪装饰 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, 
        var(--accent-color) 0%,
        var(--hover-color) 100%
    );
} 

/* 动画效果 */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero h1,
.hero p,
.feature-card h2,
.feature-card li {
    animation: fadeUp 1s ease-out forwards;
    opacity: 0;
}

.hero p {
    animation-delay: 0.2s;
}

.feature-card li {
    animation-delay: calc(0.1s * var(--i));
}

/* 玩家列表样式 */
.player-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    padding: 0 20px;
    margin-top: 48px;
    transition: opacity 0.3s ease;
    opacity: 1;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.player-grid.updating {
    opacity: 0.6;
}

.player-card {
    background: var(--secondary-color);
    border-radius: 18px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    opacity: 1;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.player-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(0, 0, 0, 0.05) 50%,
        transparent 100%
    );
}

.player-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.player-avatar {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 15px;
}

.player-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.status-badge {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
}

.status-badge.online {
    background-color: #30d158;
}

.status-badge.offline {
    background-color: var(--text-secondary);
}

.player-card h3 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-color);
}

.player-title {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 0;
}

.player-stats {
    font-size: 14px;
    color: var(--text-secondary);
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

/* 添加 hero 图片样式 */
.hero-image {
    margin: 0;
    max-width: none;
}

.hero-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

/* 可选：添加图片悬停效果 */
.hero-image:hover img {
    transform: scale(1.02);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .hero {
        padding: 80px 0 0;
    }
    
    .hero-image {
        margin-top: 40px;
    }
}

/* 添加标题标样式 */
.title-icon {
    height: 40px;  /* 调整大小 */
    width: auto;
    vertical-align: middle;
    margin-left: 10px;  /* 调整与文字的间距 */
    display: inline-block;
}

/* 添加加载动画样式 */
.loading {
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--text-secondary);
}

.loading::before {
    content: '加载中...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
}

/* 添加玩家卡片的过渡动画 */
.player-card {
    /* 保持原有样式 */
    transition: all 0.3s ease;
    animation: fadeIn 0.5s ease-out;
}

/* 添加淡入动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 添加更新时的过渡效果 */
.player-grid {
    transition: opacity 0.3s ease;
}

.player-grid.updating {
    opacity: 0.6;
}

/* 移除所有 -ms-high-contrast-adjust 相关样式 */
@media (forced-colors: active) {
    /* 替代高对比模式的样式 */
    .status-badge.online {
        forced-color-adjust: none;
        background-color: CanvasText;
    }
    
    .status-badge.offline {
        forced-color-adjust: none;
        background-color: GrayText;
    }
    
    .hero-content {
        forced-color-adjust: none;
        color: CanvasText;
    }
    
    .feature-card h2 {
        forced-color-adjust: none;
        background: none;
        color: CanvasText;
        -webkit-text-fill-color: initial;
    }
}

/* 修改服务器状态样式 */
.server-status {
    display: inline-block;
    font-size: 24px;
    color: var(--text-secondary);
    margin-left: 15px;
    font-weight: normal;
    vertical-align: middle;
}

/* 调整标题样式 */
.feature-card h2 {
    font-size: 48px;
    line-height: 1.08349;
    font-weight: 600;
    letter-spacing: -.003em;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* 搜索结果样式 */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--primary-color);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-top: 10px;
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
    padding: 15px;
}

.search-result-page {
    margin-bottom: 20px;
}

.search-result-page h3 {
    margin: 0 0 10px;
    color: var(--accent-color);
    font-size: 16px;
}

.search-result-item {
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: background-color 0.2s ease;
}

.search-result-item:hover {
    background-color: var(--secondary-color);
}

.search-result-item .section {
    font-size: 12px;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 4px;
}

.search-result-item p {
    margin: 0;
    font-size: 14px;
    color: var(--text-color);
}

.search-result-item mark {
    background-color: rgba(45, 55, 72, 0.1);
    color: var(--accent-color);
    padding: 0 2px;
    border-radius: 2px;
}

.no-results {
    padding: 20px;
    text-align: center;
    color: var(--text-secondary);
}

.no-players {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    font-size: 18px;
}

.error {
    text-align: center;
    padding: 40px;
    color: #e53e3e;
    font-size: 18px;
}

/* 在现有的导航样式中添加 */
header nav a[aria-label="赞赏支持"]:hover {
    color: #e74c3c;  /* 红心颜色 */
    animation: heartbeat 1s infinite;
}

/* 添加心跳动画 */
@keyframes heartbeat {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* 添加手动深色模式的 header 样式 */
:root[data-theme="dark"] header {
    background: rgba(29, 29, 31, 0.8);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* 为手动深色模式添加相同的样式 */
:root[data-theme="dark"] .hero-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1;
}

:root[data-theme="dark"] .hero-content {
    z-index: 2;
}

/* 为手动深色模式添加相同的样式 */
:root[data-theme="dark"] .feature-card h2 {
    color: var(--text-color);
    background: none;
    -webkit-text-fill-color: initial;
}

/* 为手动深色模式添加相同的阴影效果 */
:root[data-theme="dark"] .player-card {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

:root[data-theme="dark"] .player-card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

/* 修改 main 样式以确保内容区域也使用正确的背景色 */
main {
    background-color: var(--primary-color);
    min-height: 100vh; /* 确保最小高度占满视口 */
}

/* 服务器网格布局 */
.servers-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* 服务器卡片样式 */
.server-card {
    background: var(--card-background);
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    width: 300px;
    flex-grow: 0;
    flex-shrink: 0;
}

.server-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.server-card h3 {
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: bold;
    font-size: 1.2rem;
}

.server-card.online h3 i {
    color: var(--success-color);
}

.server-card.offline h3 i {
    color: var(--error-color);
}

.server-address {
    color: var(--text-secondary);
    font-family: "Consolas", monospace;  /* 保持等宽字体，便于阅读地址 */
    margin-bottom: 1rem;
    font-size: 0.9rem;
    padding: 4px 0;
    display: block;
    word-break: break-all;
    border-bottom: 1px solid var(--border-color);
}

.server-info, .player-count {
    margin: 0.5rem 0;
    font-weight: bold;
}

.players-list {
    margin-top: 1rem;
}

.players-list h4 {
    margin: 0 0 0.5rem 0;
    font-weight: bold;
}

.players-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.players-list li {
    padding: 0.25rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.players-list li:last-child {
    border-bottom: none;
}

.error-message {
    color: var(--error-color);
    font-weight: bold;
}

.update-time {
    margin-top: 1rem;
    font-size: 0.8rem;
    color: #666;
}

/* 响应式设计 */
@media (max-width: 1400px) {
    .servers-grid {
        max-width: 1000px;
    }
}

@media (max-width: 1000px) {
    .servers-grid {
        max-width: 650px;
    }
}

@media (max-width: 700px) {
    .servers-grid {
        padding: 1rem;
    }
    
    .server-card {
        width: 100%;
        max-width: 400px;
    }
}

/* 更新日志高亮效果 */
.changelog-item {
    transition: all 0.5s ease;
    border: 2px solid transparent;
    border-radius: 18px;  /* 添加圆角 */
    overflow: hidden;     /* 确保内部内容不会超出圆角 */
}

.changelog-item.highlight {
    box-shadow: 0 0 25px rgba(41, 151, 255, 0.2);
    border: 2px solid rgba(41, 151, 255, 0.4);
    animation: highlight-pulse 3s ease-in-out infinite;
    background: linear-gradient(
        to right,
        var(--card-background),
        rgba(41, 151, 255, 0.05),
        var(--card-background)
    );
}

/* 添加淡出效果 */
.changelog-item.fade-out {
    animation: none;  /* 停止脉冲动画 */
    transition: all 1s ease;
    border-color: transparent;
    box-shadow: none;
    background: var(--card-background);
}

@keyframes highlight-pulse {
    0% {
        box-shadow: 0 0 20px rgba(41, 151, 255, 0.2);
        border-color: rgba(41, 151, 255, 0.4);
    }
    50% {
        box-shadow: 0 0 30px rgba(41, 151, 255, 0.3);
        border-color: rgba(41, 151, 255, 0.6);
    }
    100% {
        box-shadow: 0 0 20px rgba(41, 151, 255, 0.2);
        border-color: rgba(41, 151, 255, 0.4);
    }
}

/* 添加服务器卡片悬停效果 */
.server-card {
    transition: all 0.3s ease;
}

.server-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}
  