/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    width: 100%;
}

/* 全局样式 */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    line-height: 1.6;
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    width: 100%;
    overflow-x: hidden;
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 60px;
    animation: fadeInUp 0.8s ease-out;
}

.logo {
    font-size: 3rem;
    font-weight: 700;
    color: white;
    margin-bottom: 20px;
    text-shadow: 0 4px 8px rgba(0,0,0,0.3);
    user-select: none;
}

.subtitle {
    font-size: 1.2rem;
    color: rgba(255,255,255,0.9);
    margin-bottom: 30px;
    font-weight: 400;
}

/* 搜索框 */
.search-box {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-input {
    width: 100%;
    padding: 15px 50px 15px 20px;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    outline: none;
    transition: all 0.3s ease;
    font-family: inherit;
}

.search-input:focus {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
    background: rgba(255,255,255,1);
}

.search-input::placeholder {
    color: rgba(0,0,0,0.5);
}

.search-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(45deg, #ff6b6b, #ffa500);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

/* 统计数据 */
.stats {
    display: flex;
    justify-content: space-around;
    margin: 40px 0;
    padding: 30px;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.2);
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.stat-item {
    text-align: center;
    color: white;
    flex: 1;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 5px;
    color: #fff;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
    font-weight: 500;
}

/* 区域网格 */
.regions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 50px;
    padding-top: 20px;
    width: 100%;
    overflow-x: hidden;
}

/* 区域卡片 */
.region-card {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 30px;
    border: 1px solid rgba(255,255,255,0.2);
    transition: all 0.3s ease;
    animation: fadeInUp 0.8s ease-out;
    cursor: pointer;
    position: relative;
    overflow: visible;
    margin-top: 15px;
    width: 100%;
    max-width: 100%;
    min-width: 0; /* 防止内容撑开容器 */
}

.region-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.region-card:hover::before {
    transform: translateX(100%);
}

.region-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    background: rgba(255,255,255,0.15);
}

/* 不同类型站点的特殊样式 */
.main-service {
    border: 2px solid rgba(102, 126, 234, 0.5);
}

.main-service::after {
    content: "主站";
    position: absolute;
    top: -12px;
    right: 15px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    padding: 6px 14px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    z-index: 10;
}

.proxy-service {
    border: 2px solid rgba(255, 107, 107, 0.3);
}

.proxy-service::after {
    content: "站点";
    position: absolute;
    top: -12px;
    right: 15px;
    background: linear-gradient(45deg, #ff6b6b, #ffa500);
    color: white;
    padding: 6px 14px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
    z-index: 10;
}

.store-service {
    border: 2px solid rgba(76, 175, 80, 0.5);
}

.store-service::after {
    content: "商店";
    position: absolute;
    top: -12px;
    right: 15px;
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
    padding: 6px 14px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
    z-index: 10;
}

.contact-service {
    border: 2px solid rgba(33, 150, 243, 0.5);
}

.contact-service::after {
    content: "联系";
    position: absolute;
    top: -12px;
    right: 15px;
    background: linear-gradient(45deg, #2196F3, #1976D2);
    color: white;
    padding: 6px 14px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
    z-index: 10;
}

/* 区域标题 */
.region-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: white;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.region-flag {
    width: 30px;
    height: 20px;
    border-radius: 4px;
    display: inline-block;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* 区域URL */
.region-url {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    padding: 12px 20px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    display: block;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255,255,255,0.2);
    font-weight: 500;
    word-break: break-all; /* 防止长URL撑开容器 */
    overflow-wrap: break-word;
}

.region-url:hover {
    background: rgba(255,255,255,0.2);
    transform: translateX(5px);
    text-decoration: none;
    color: white;
}

/* 区域描述 */
.region-description {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.7);
    line-height: 1.6;
    margin-bottom: 15px;
}

/* 状态指示器 */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4CAF50;
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.5);
    animation: pulse 2s infinite;
}

.status-text {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.8);
    font-weight: 500;
}

/* 底部 */
.footer {
    text-align: center;
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.7);
}

.footer-content p {
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.footer-info {
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 0.8rem;
    flex-wrap: wrap;
}

.status-indicator-small {
    color: #4CAF50;
    font-size: 0.8rem;
}

/* 动态背景效果 */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.bg-circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    animation: float 6s ease-in-out infinite;
}

.bg-circle:nth-child(1) {
    width: 80px;
    height: 80px;
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.bg-circle:nth-child(2) {
    width: 60px;
    height: 60px;
    top: 60%;
    left: 80%;
    animation-delay: -2s;
}

.bg-circle:nth-child(3) {
    width: 100px;
    height: 100px;
    top: 80%;
    left: 20%;
    animation-delay: -4s;
}

/* 动画定义 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%, 100% { 
        transform: translateY(0px); 
    }
    50% { 
        transform: translateY(-20px); 
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 8px rgba(76, 175, 80, 0.5);
    }
    50% {
        box-shadow: 0 0 16px rgba(76, 175, 80, 0.8);
    }
    100% {
        box-shadow: 0 0 8px rgba(76, 175, 80, 0.5);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden;
        width: 100%;
        max-width: 100vw;
    }
    
    .container {
        padding: 20px 15px;
        width: 100%;
        max-width: 100%;
    }
    
    .logo {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .search-input {
        font-size: 0.9rem;
        padding: 12px 45px 12px 16px;
        width: 100%;
        max-width: 100%;
    }
    
    .search-btn {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .regions-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        width: 100%;
        padding-left: 0;
        padding-right: 0;
    }
    
    .region-card {
        padding: 25px 20px;
        margin-left: 0;
        margin-right: 0;
        width: 100%;
        max-width: 100%;
    }
    
    .region-url {
        font-size: 1rem;
        padding: 10px 16px;
        word-break: break-all;
    }
    
    .stats {
        flex-direction: column;
        gap: 20px;
        padding: 25px 20px;
        margin-left: 0;
        margin-right: 0;
        width: 100%;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .footer-info {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px 10px;
        width: 100%;
    }
    
    .logo {
        font-size: 1.8rem;
    }
    
    .region-card {
        padding: 20px 15px;
        width: 100%;
    }
    
    .region-title {
        font-size: 1.3rem;
    }
    
    .region-url {
        font-size: 0.9rem;
        padding: 10px 14px;
        word-break: break-all;
    }
    
    .regions-grid {
        gap: 15px;
    }
    
    .stats {
        padding: 20px 15px;
        gap: 15px;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .search-input {
        background: rgba(255,255,255,0.9);
        color: #333;
    }
    
    .search-input::placeholder {
        color: rgba(0,0,0,0.6);
    }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
    .region-card {
        border: 2px solid rgba(255,255,255,0.5);
    }
    
    .region-url {
        border: 2px solid rgba(255,255,255,0.4);
    }
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .bg-circle {
        animation: none;
    }
    
    .status-dot {
        animation: none;
    }
}