/* ==================== 1. 字体定义 ==================== */
@font-face {
    font-family: 'HanYiShangWei';
    src: url('../fonts/HanYiShangWei.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* ==================== 2. 核心变量 ==================== */
:root {
    --primary-color: #00f3ff;
    --secondary-color: #0077be;
    --accent-color: #ffbb00;
    --danger-color: #ff0055;
    --bg-primary: #000508;
    --bg-secondary: #001014;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.8);
    --font-tech: "Segoe UI", "Consolas", monospace;
    --font-title: "HanYiShangWei", "Impact", "Arial Black", sans-serif;
    --glow-primary: 0 0 20px var(--primary-color);
    --glow-accent: 0 0 15px var(--accent-color);
}

/* ==================== 2. 基础样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-tech);
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    background: radial-gradient(circle at center, rgba(0, 243, 255, 0.1) 0%, var(--bg-primary) 70%);
}

/* ==================== 3. 背景粒子效果 ==================== */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, var(--primary-color), transparent),
        radial-gradient(2px 2px at 40px 70px, var(--secondary-color), transparent),
        radial-gradient(1px 1px at 90px 40px, var(--accent-color), transparent),
        radial-gradient(1px 1px at 130px 80px, var(--primary-color), transparent),
        radial-gradient(2px 2px at 160px 30px, var(--secondary-color), transparent);
    background-repeat: repeat;
    background-size: 200px 100px;
    animation: sparkle 20s linear infinite;
}

@keyframes sparkle {
    0% { transform: translateY(0px); }
    100% { transform: translateY(-200px); }
}

@keyframes twinkle {
    0% { opacity: 0.2; }
    100% { opacity: 1; }
}

/* ==================== 4. 头部区域 ==================== */
.header {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 60px 20px 40px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 20px;
    position: relative;
}

.logo-ring {
    width: 80px;
    height: 80px;
    border: 2px dashed var(--primary-color);
    border-radius: 50%;
    position: relative;
    animation: spin 10s linear infinite;
}

.logo-ring::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border-top: 2px solid var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    border-left: 1px solid transparent;
    border-right: 1px solid transparent;
    border-radius: 50%;
    animation: spin-reverse 6s linear infinite;
}

.logo h1 {
    font-size: 3.5rem;
    font-weight: 900;
    letter-spacing: 8px;
    text-shadow: var(--glow-primary);
    margin: 0;
}

.version {
    font-size: 1.2rem;
    color: var(--accent-color);
    text-shadow: var(--glow-accent);
    align-self: flex-end;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes spin-reverse {
    0% { transform: rotate(360deg); }
    100% { transform: rotate(0deg); }
}

/* ==================== 5. 主内容区域 ==================== */
.main-content {
    flex: 1;
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    gap: 80px;
    align-items: center;
    position: relative;
    z-index: 10;
}

.game-info {
    flex: 1;
    max-width: 600px;
}

.game-info h2 {
    font-size: 3.5rem;
    margin-bottom: 25px;
    background: linear-gradient(45deg, var(--primary-color), var(--accent-color), #ff0055);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 400;
    font-family: var(--font-title);
    letter-spacing: 8px;
    text-shadow: 
        0 0 20px rgba(0, 243, 255, 0.8),
        0 0 40px rgba(255, 187, 0, 0.6),
        0 0 60px rgba(255, 0, 85, 0.4);
    position: relative;
    display: inline-block;
    animation: titleGlow 3s ease-in-out infinite alternate;
}

.game-info h2::before {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    z-index: -1;
    background: linear-gradient(45deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: blur(2px);
    opacity: 0.7;
    font-family: var(--font-title);
}

@keyframes titleGlow {
    0% { 
        text-shadow: 
            0 0 20px rgba(0, 243, 255, 0.8),
            0 0 40px rgba(255, 187, 0, 0.6),
            0 0 60px rgba(255, 0, 85, 0.4);
    }
    100% { 
        text-shadow: 
            0 0 30px rgba(0, 243, 255, 1),
            0 0 50px rgba(255, 187, 0, 0.8),
            0 0 70px rgba(255, 0, 85, 0.6),
            0 0 90px rgba(0, 243, 255, 0.3);
    }
}

.description {
    font-size: 1.3rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 40px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

/* ==================== 6. 玩家输入区域 ==================== */
.player-input {
    margin-bottom: 40px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 350px;
}

.input-group label {
    color: var(--primary-color);
    font-size: 1.1rem;
    font-weight: 600;
    text-shadow: var(--glow-primary);
    letter-spacing: 1px;
}

.input-group input {
    padding: 15px 20px;
    background: rgba(0, 243, 255, 0.1);
    border: 2px solid rgba(0, 243, 255, 0.3);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-tech);
    font-size: 1.1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    outline: none;
}

.input-group input::placeholder {
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
}

.input-group input:focus {
    border-color: var(--primary-color);
    background: rgba(0, 243, 255, 0.2);
    box-shadow: var(--glow-primary);
    transform: translateY(-2px);
}

.input-hint {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-top: 5px;
}

/* ==================== 6. 功能特性展示 ==================== */
.features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: rgba(0, 243, 255, 0.1);
    border: 1px solid rgba(0, 243, 255, 0.3);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.feature-item:hover {
    background: rgba(0, 243, 255, 0.2);
    transform: translateY(-3px);
    box-shadow: var(--glow-primary);
}

.feature-icon {
    font-size: 2rem;
    width: 50px;
    text-align: center;
}

.feature-item span {
    font-size: 1.1rem;
    font-weight: 500;
}

/* ==================== 7. 玩家输入区域 ==================== */
.player-input {
    margin-bottom: 40px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 350px;
}

.input-group label {
    color: var(--primary-color);
    font-size: 1.1rem;
    font-weight: 600;
    text-shadow: var(--glow-primary);
    letter-spacing: 1px;
}

.input-group input {
    padding: 15px 20px;
    background: rgba(0, 243, 255, 0.1);
    border: 2px solid rgba(0, 243, 255, 0.3);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-tech);
    font-size: 1.1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    outline: none;
}

.input-group input::placeholder {
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
}

.input-group input:focus {
    border-color: var(--primary-color);
    background: rgba(0, 243, 255, 0.2);
    box-shadow: var(--glow-primary);
    transform: translateY(-2px);
}

.input-hint {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-top: 5px;
}

/* ==================== 8. 按钮控件 ==================== */
.controls {
    display: flex;
    gap: 25px;
    align-items: center;
}

.btn {
    position: relative;
    padding: 18px 36px;
    font-family: var(--font-tech);
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 160px;
}

.btn-primary {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: #000;
    border-radius: 8px;
    box-shadow: var(--glow-primary);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 30px var(--primary-color);
}

.btn-secondary {
    background: rgba(0, 243, 255, 0.1);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: 8px;
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: #000;
    box-shadow: var(--glow-primary);
}

.btn-glow {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover .btn-glow {
    left: 100%;
}

/* ==================== 8. 游戏预览区域 ==================== */
.preview-area {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.game-preview {
    width: 450px;
    height: 300px;
    background: rgba(0, 20, 30, 0.8);
    border: 2px solid var(--primary-color);
    border-radius: 15px;
    padding: 30px;
    box-shadow: var(--glow-primary);
    position: relative;
    overflow: hidden;
}

.game-preview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(0, 243, 255, 0.1) 2px,
            rgba(0, 243, 255, 0.1) 4px
        );
    pointer-events: none;
}

.preview-hud {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.hud-element {
    padding: 8px 12px;
    background: rgba(0, 243, 255, 0.1);
    border: 1px solid rgba(0, 243, 255, 0.3);
    border-radius: 4px;
}

.preview-text {
    text-align: center;
    font-size: 3rem;
    font-weight: 900;
    letter-spacing: 8px;
    margin-top: 20px;
}

.text-done {
    color: var(--text-primary);
    text-shadow: 0 0 20px #fff;
}

.text-todo {
    color: var(--primary-color);
    opacity: 0.6;
}

.cursor-demo {
    display: inline-block;
    width: 20px;
    height: 4px;
    background: var(--accent-color);
    animation: blink 1s infinite;
    vertical-align: bottom;
    margin-left: 10px;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ==================== 9. 模态框样式 ==================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--bg-secondary);
    margin: 5% auto;
    padding: 0;
    border: 2px solid var(--primary-color);
    border-radius: 15px;
    width: 80%;
    max-width: 700px;
    box-shadow: var(--glow-primary);
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: #000;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: #000;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.modal-close:hover {
    transform: rotate(90deg);
}

.modal-body {
    padding: 30px;
    color: var(--text-primary);
}

.instruction-section {
    margin-bottom: 30px;
}

.instruction-section h4 {
    color: var(--primary-color);
    font-size: 1.3rem;
    margin-bottom: 15px;
    text-shadow: var(--glow-primary);
}

.instruction-section ul {
    list-style: none;
    padding-left: 0;
}

.instruction-section li {
    margin-bottom: 12px;
    padding-left: 30px;
    position: relative;
    line-height: 1.6;
}

.instruction-section li::before {
    content: '▶';
    color: var(--accent-color);
    position: absolute;
    left: 0;
    top: 0;
}

kbd {
    background: rgba(0, 243, 255, 0.2);
    color: var(--primary-color);
    padding: 4px 8px;
    border-radius: 4px;
    font-family: var(--font-tech);
    font-size: 0.9rem;
    border: 1px solid rgba(0, 243, 255, 0.3);
    box-shadow: 0 0 5px rgba(0, 243, 255, 0.2);
}

/* ==================== 10. 页脚区域 ==================== */
.footer {
    position: relative;
    z-index: 10;
    padding: 30px 40px;
    text-align: center;
    border-top: 1px solid rgba(0, 243, 255, 0.3);
    background: rgba(0, 20, 30, 0.5);
}

.footer-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

.footer-link {
    color: var(--primary-color);
    text-decoration: none;
    padding: 8px 15px;
    border: 1px solid rgba(0, 243, 255, 0.3);
    border-radius: 4px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.footer-link:hover {
    background: rgba(0, 243, 255, 0.1);
    border-color: var(--primary-color);
    text-shadow: var(--glow-primary);
    transform: translateY(-2px);
}

/* ==================== 11. 响应式设计 ==================== */
@media (max-width: 1200px) {
    .main-content {
        flex-direction: column;
        gap: 50px;
        text-align: center;
    }
    
    .game-info {
        max-width: 100%;
    }
    
    .preview-area {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 0 20px;
    }
    
    .logo h1 {
        font-size: 2.5rem;
        letter-spacing: 4px;
    }
    
    .game-info h2 {
        font-size: 2rem;
    }
    
    .features {
        grid-template-columns: 1fr;
    }
    
    .controls {
        flex-direction: column;
        width: 100%;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
    }
    
    .game-preview {
        width: 100%;
        height: 250px;
    }
    
    .preview-text {
        font-size: 2rem;
        letter-spacing: 4px;
    }
    
    .footer-info {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 10px;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .modal-body {
        padding: 20px;
    }
}