/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

:root {
    --primary-color: #4caf50;
    --primary-dark: #2e7d32;
    --primary-light: #c8e6c9;
    --accent-color: #7cb342;
    --online-color: #4caf50;
    --offline-color: #f44336;
    --background-color: #f0f4f8;
    --card-bg: rgba(255, 255, 255, 0.5);
    --glass-bg: rgba(255, 255, 255, 0.5);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-primary: #333333;
    --text-secondary: #666666;
    --border-radius: 12px;
    --box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    --transition: all 0.2s ease;
}

body {
    background-color: var(--background-color);
    background-image: url('../img/background.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    padding: 0;
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* 页头样式 */
header {
    text-align: center;
    padding: 30px 0;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--text-primary);
    border-radius: var(--border-radius);
    margin-bottom: 30px;
    box-shadow: var(--box-shadow);
    position: relative;
    overflow: hidden;
    animation: fadeIn 0.8s ease;
    border: 1px solid var(--glass-border);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 2;
    color: var(--primary-dark);
}

header p {
    position: relative;
    z-index: 2;
    font-size: 1.05rem;
    color: var(--text-secondary);
}

/* 副标题样式 */
.subtitle {
    margin: 5px 0 10px 0;
    color: var(--primary-dark);
    font-weight: 500;
    font-size: 1.4rem;
    position: relative;
    z-index: 2;
}

/* 主内容区域 */
main {
    flex-grow: 1;
}

/* 服务器分区样式 */
.server-section {
    margin-bottom: 30px;
}

.section-title {
    font-size: 1.5rem;
    color: var(--primary-dark);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.section-title i {
    margin-right: 10px;
    color: var(--primary-color);
}

/* 基岩版分区特殊样式 */
.bedrock-section .section-title {
    color: #00a8ff;
}

.bedrock-section .section-title i {
    color: #00a8ff;
}

.bedrock-section .server-list-header {
    border-bottom: 2px solid rgba(0, 168, 255, 0.3);
    color: #00a8ff;
}

.bedrock-section .line-name h2::after {
    background-color: #00a8ff;
}

.bedrock-section .copy-btn {
    background-color: #00a8ff;
}

.bedrock-section .copy-btn:hover {
    background-color: #0088cc;
}

.bedrock-section .online .status-indicator {
    background-color: #00a8ff;
    box-shadow: 0 0 8px #00a8ff;
}

.bedrock-section .online .status-text {
    color: #00a8ff;
}

/* 服务器列表样式 - 现代列表式设计 */
.server-list {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    background-color: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    position: relative;
    animation: slideIn 0.6s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.server-list-header {
    display: grid;
    grid-template-columns: 4fr 4fr 2fr;
    padding: 16px 20px;
    background-color: rgba(255, 255, 255, 0.6);
    color: var(--primary-dark);
    font-weight: bold;
    border-top-left-radius: var(--border-radius);
    border-top-right-radius: var(--border-radius);
    position: relative;
    z-index: 10;
    border-bottom: 2px solid rgba(76, 175, 80, 0.3);
    align-items: center;
}

/* 添加对齐样式 */
.server-list-header > div:last-child {
    text-align: center;
    display: flex;
    justify-content: center;
}

.server-line {
    display: grid;
    grid-template-columns: 4fr 4fr 2fr;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    align-items: center;
    transition: transform 0.2s ease, background-color 0.3s ease;
    position: relative;
    animation: fadeInStaggered 0.5s ease backwards;
}

.server-line:nth-child(2) { animation-delay: 0.1s; }
.server-line:nth-child(3) { animation-delay: 0.2s; }
.server-line:nth-child(4) { animation-delay: 0.3s; }
.server-line:nth-child(5) { animation-delay: 0.4s; }
.server-line:nth-child(6) { animation-delay: 0.5s; }

@keyframes fadeInStaggered {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.server-line:last-child {
    border-bottom: none;
}

.server-line:hover {
    background-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.line-name {
    display: flex;
    flex-direction: column;
}

.line-name h2 {
    font-size: 1.1rem;
    margin: 0;
    color: var(--text-primary);
    position: relative;
    display: inline-block;
}

.line-name h2::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.server-line:hover .line-name h2::after {
    width: 100%;
}

.line-name .description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 6px;
}

.line-address {
    display: flex;
    align-items: center;
    position: relative;
    justify-content: space-between;
}

.line-address span {
    display: inline-block;
    padding: 5px 10px;
    background-color: rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    font-family: 'Segoe UI', 'Roboto', 'Open Sans', sans-serif;
    font-size: 0.95rem;
    color: var(--text-primary);
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-weight: 500;
    letter-spacing: 0.3px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    flex-grow: 1;
    margin-right: 10px;
}

.server-line:hover .line-address span {
    background-color: rgba(255, 255, 255, 0.3);
}

/* 复制按钮样式 */
.copy-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background-color 0.3s ease, transform 0.2s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    width: 85px;
}

.copy-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

.copy-btn:active {
    transform: translateY(0);
}

.copy-btn .fa-copy {
    margin-right: 5px;
}

/* 复制按钮动画 */
.copy-btn.copied {
    background-color: #4CAF50;
    animation: copiedAnimation 0.4s ease;
}

@keyframes copiedAnimation {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.copy-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.2),
        rgba(255, 255, 255, 0.2)
    );
    border-radius: 4px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.copy-btn:hover::before {
    opacity: 1;
}

/* 线路详情样式 */
.line-details {
    text-align: center;
}

.line-details .latency {
    font-size: 0.85rem;
    background-color: rgba(255, 255, 255, 0.2);
    padding: 3px 8px;
    border-radius: 12px;
    transition: var(--transition);
}

.server-line:hover .line-details .latency {
    background-color: rgba(255, 255, 255, 0.3);
}

/* 服务器状态样式 */
.line-status {
    display: flex;
    align-items: center;
    justify-content: center; /* 确保状态指示器居中 */
    transition: transform 0.3s ease;
    text-align: center; /* 文本居中 */
}

.status-change {
    animation: statusChange 0.6s ease;
}

@keyframes statusChange {
    0% { transform: scale(0.8); opacity: 0.5; }
    70% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.status-indicator {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    margin-right: 8px;
}

.online .status-indicator {
    background-color: var(--online-color);
    box-shadow: 0 0 8px var(--online-color);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.offline .status-indicator {
    background-color: var(--offline-color);
    box-shadow: 0 0 8px var(--offline-color);
}

.status-text {
    font-size: 0.9rem;
    font-weight: 500;
}

.online .status-text {
    color: var(--online-color);
}

.offline .status-text {
    color: var(--offline-color);
}

/* 页脚样式 */
footer {
    text-align: center;
    padding: 20px 0;
    margin-top: 30px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

/* 页脚版权信息 */
footer p {
    margin-top: 20px;
    padding: 10px 0;
    color: white;
    font-weight: 500;
    font-size: 1rem;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5), 
                 -1px -1px 3px rgba(0, 0, 0, 0.5),
                 1px -1px 3px rgba(0, 0, 0, 0.5),
                 -1px 1px 3px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.5px;
}

/* 刷新按钮容器 */
.refresh-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 25px;
    flex-wrap: wrap;
}

.refresh-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 30px;
    padding: 10px 20px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
}

.refresh-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

.refresh-btn:active {
    transform: translateY(0);
}

.refresh-btn i {
    margin-right: 8px;
    transition: transform 0.3s ease;
}

.refresh-btn:hover i {
    transform: rotate(180deg);
}

/* 刷新按钮旋转动画 */
.refresh-btn.rotating i {
    animation: rotating 1s linear;
}

@keyframes rotating {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.last-update {
    margin-left: 15px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    background-color: rgba(255, 255, 255, 0.4);
    padding: 6px 12px;
    border-radius: 20px;
}

/* 刷新时间更新动画 */
.time-updated {
    animation: timeUpdate 1s ease;
}

@keyframes timeUpdate {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); color: var(--primary-color); }
    100% { transform: scale(1); }
}

/* 页脚链接 */
.footer-links {
    display: flex;
    justify-content: center;
    margin-top: 15px;
    gap: 20px;
    flex-wrap: wrap;
    animation: fadeIn 1s ease;
}

.footer-link {
    color: var(--text-primary);
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: background-color 0.3s ease, transform 0.2s ease;
    background-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    font-weight: 500;
}

.footer-link:hover {
    background-color: rgba(255, 255, 255, 0.5);
    color: var(--primary-dark);
    transform: translateY(-2px);
}

.footer-link i {
    margin-right: 5px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .server-list-header {
        display: none;
    }
    
    .server-line {
        grid-template-columns: 1fr;
        grid-gap: 12px;
        padding: 18px;
    }
    
    .line-name, .line-address, .line-details, .line-status {
        width: 100%;
    }
    
    .line-name {
        margin-bottom: 12px;
    }
    
    .line-address {
        margin-bottom: 12px;
        display: flex;
        justify-content: space-between;
    }
    
    .line-address span {
        flex-grow: 1;
        margin-right: 10px;
    }
    
    .line-details {
        display: flex;
        justify-content: space-between;
        text-align: left;
        margin-bottom: 12px;
    }
    
    .line-status {
        justify-content: flex-start;
        text-align: left; /* 在移动设备上左对齐 */
    }
    
    /* 移动端标题调整 */
    header {
        padding-top: 20px; /* 减小顶部内边距，移除了为logo留出的空间 */
    }
}

/* 更小屏幕的适配 */
@media (max-width: 480px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    header p {
        font-size: 0.9rem;
    }
    
    .copy-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
        width: 70px; /* 在小屏幕上减小宽度 */
    }
    
    .line-name h2 {
        font-size: 1rem;
    }
    
    .line-address span {
        font-size: 0.85rem; /* 减小地址字体大小 */
    }
}

/* 服务器线路更新动画 */
.server-line.updating {
    animation: updating 0.8s ease;
}

@keyframes updating {
    0% { background-color: rgba(255, 255, 255, 0.1); }
    50% { background-color: rgba(124, 179, 66, 0.2); }
    100% { background-color: rgba(255, 255, 255, 0.1); }
}

@keyframes fadeScale {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
} 