/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 0 10px;
}

.title {
    font-size: 1.8rem;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header-nav {
    display: flex;
    gap: 20px;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Main content */
.main {
    flex: 1;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 20px;
}

/* Level display */
.level-row {
    width: 100%;
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.level {
    font-size: 2rem;
    font-weight: 700;
    color: #667eea;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 5px;
}

.digits-tip {
    font-size: 1.1rem;
    color: #666;
    font-style: italic;
    font-weight: 400;
}

/* Timer area */
.timer-area {
    width: 100%;
    max-width: 400px;
    margin-bottom: 30px;
    background: linear-gradient(135deg, #f8f9ff 0%, #e8eaff 100%);
    border-radius: 15px;
    padding: 25px 20px;
    border: 2px solid rgba(102, 126, 234, 0.2);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.timer-label {
    font-size: 1.3rem;
    font-weight: 600;
    color: #444;
    margin-bottom: 15px;
    text-align: center;
    order: 1;
}

.progress-bar-bg {
    order: 2;
}

.progress-bar-bg {
    width: 100%;
    height: 14px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 7px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 7px;
    transition: width linear;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.4);
}

/* Number display */
.number {
    font-size: 3.5rem;
    font-weight: 900;
    color: #333;
    letter-spacing: 0.15em;
    margin: 40px 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    line-height: 1.2;
    word-break: break-all;
    padding: 20px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 15px;
    border: 2px dashed rgba(102, 126, 234, 0.3);
}

/* Input area */
.input-area {
    width: 100%;
    max-width: 450px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
    margin: 30px 0;
}

.input-group {
    width: 100%;
}

#userInput {
    width: 100%;
    padding: 18px 20px;
    font-size: 1.3rem;
    border: 3px solid #e0e0e0;
    border-radius: 12px;
    text-align: center;
    letter-spacing: 0.1em;
    outline: none;
    transition: all 0.3s ease;
    background: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

#userInput:focus {
    border-color: #667eea;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
    transform: translateY(-2px);
}

/* Virtual keyboard */
.virtual-keyboard {
    width: 100%;
    max-width: 300px;
    display: grid;
    gap: 12px;
}

.keyboard-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.keyboard-key {
    padding: 18px 12px;
    font-size: 1.2rem;
    font-weight: 600;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: white;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.keyboard-key:hover {
    background: #f8f9ff;
    border-color: #667eea;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.2);
}

.keyboard-key:active {
    transform: translateY(-1px);
    background: #667eea;
    color: white;
}

/* Buttons */
.btn {
    padding: 18px 40px;
    font-size: 1.2rem;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn:active {
    transform: translateY(-1px);
}

.submit-bottom {
    width: 100%;
    max-width: 250px;
}

/* Game description */
.game-desc {
    margin: 30px 0;
    max-width: 500px;
}

#gameDescText {
    font-size: 1rem;
    color: #555;
    line-height: 1.8;
    text-align: left;
    background: rgba(102, 126, 234, 0.05);
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid #667eea;
}

/* Message display - 隐藏原来的消息显示 */
.message {
    display: none;
}

/* 弹窗样式 */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.popup-message {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    transform: scale(0.8);
    animation: popupAppear 0.3s ease forwards;
}

@keyframes popupAppear {
    to {
        transform: scale(1);
    }
}

.popup-content {
    font-size: 1.3rem;
    font-weight: 600;
    text-align: center;
    padding: 20px 0 15px 0;
    line-height: 1.6;
}

.popup-confirm {
    display: block;
    margin: 0 auto;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.popup-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.popup-confirm:active {
    transform: translateY(0);
}

.popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: #999;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.popup-close:hover {
    background: #f0f0f0;
    color: #666;
}

.popup-message.correct .popup-content {
    color: #155724;
}

.popup-message.wrong .popup-content {
    color: #721c24;
}

.popup-message.correct {
    border: 4px solid #28a745;
}

.popup-message.wrong {
    border: 4px solid #dc3545;
}

.popup-message.correct .popup-confirm {
    background: linear-gradient(45deg, #28a745, #20c997);
}

.popup-message.wrong .popup-confirm {
    background: linear-gradient(45deg, #dc3545, #fd7e14);
}

/* Footer */
.footer {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    margin-top: 20px;
    backdrop-filter: blur(10px);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    text-align: center;
}

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

.footer-links a {
    color: white;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.footer-links a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* About page specific styles */
.about-page .container {
    max-width: 800px;
}

.about-main {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    margin-bottom: 20px;
}

.about-content {
    line-height: 1.8;
    color: #333;
}

.about-content h1 {
    font-size: 2.5rem;
    color: #667eea;
    margin-bottom: 30px;
    text-align: center;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.1);
}

.about-content h2 {
    font-size: 1.8rem;
    color: #667eea;
    margin: 30px 0 20px 0;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.about-content h3 {
    font-size: 1.4rem;
    color: #764ba2;
    margin: 25px 0 15px 0;
}

.about-content h4 {
    font-size: 1.2rem;
    color: #555;
    margin: 20px 0 10px 0;
}

.section {
    margin-bottom: 30px;
}

.section p {
    margin-bottom: 15px;
    text-align: justify;
}

.section ul {
    margin: 15px 0 15px 30px;
}

.section li {
    margin-bottom: 8px;
    color: #555;
}

.author-list {
    list-style: none;
    margin: 0;
}

.author-list li {
    background: #f8f9fa;
    padding: 10px 15px;
    margin: 10px 0;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

/* Contact page specific styles */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

.contact-card {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.contact-card h3 {
    color: #667eea;
    margin-bottom: 15px;
}

.contact-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.contact-link:hover {
    color: #764ba2;
    text-decoration: underline;
}

.contact-note {
    background: #e8f4fd;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
    margin: 20px 0;
    font-style: italic;
}

.feedback-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 25px 0;
}

.feedback-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid #764ba2;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.feedback-item h4 {
    color: #764ba2;
    margin-bottom: 10px;
}

.contact-info {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 15px;
    margin-top: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Donation section */
.donation-section {
    display: flex;
    align-items: center;
    gap: 30px;
    margin: 25px 0;
    background: #f8f9fa;
    padding: 25px;
    border-radius: 15px;
    border: 2px solid #e0e0e0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.paypal-qr {
    text-align: center;
    flex-shrink: 0;
}

.qr-code {
    width: 150px;
    height: 150px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.qr-description {
    margin-top: 12px;
    font-size: 0.9rem;
    color: #666;
}

.donation-text {
    flex: 1;
}

.company-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 700;
}

.company-link:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header {
        flex-wrap: wrap;
        gap: 10px;
        margin-bottom: 25px;
    }
    
    .title {
        font-size: 1.4rem;
        flex: 1;
        min-width: 200px;
    }
    
    .header-nav {
        flex-shrink: 0;
        gap: 15px;
    }
    
    .nav-link {
        padding: 6px 12px;
        font-size: 0.9rem;
    }
    
    .main {
        padding: 30px 20px;
    }
    
    .level {
        font-size: 1.8rem;
    }
    
    .digits-tip {
        font-size: 1rem;
    }
    
    .timer-area {
        padding: 20px 15px;
        margin-bottom: 25px;
    }
    
    .timer-label {
        font-size: 1.2rem;
    }
    
    .number {
        font-size: 2.5rem;
        margin: 30px 0;
        padding: 15px;
    }
    
    .virtual-keyboard {
        max-width: 280px;
    }
    
    .keyboard-key {
        padding: 15px 10px;
        font-size: 1.1rem;
        min-height: 50px;
    }
    
    #userInput {
        padding: 16px 18px;
        font-size: 1.2rem;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .donation-section {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
    }
    
    .about-content h1 {
        font-size: 2.2rem;
    }
    
    .popup-message {
        padding: 25px;
        max-width: 350px;
    }
    
    .popup-content {
        font-size: 1.2rem;
        padding: 15px 0;
    }
    
    .popup-confirm {
        padding: 10px 25px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 15px;
    }
    
    .title {
        font-size: 1.2rem;
        flex: none;
        min-width: 0;
    }
    
    .header-nav {
        gap: 12px;
    }
    
    .nav-link {
        padding: 5px 10px;
        font-size: 0.85rem;
    }
    
    .level {
        font-size: 1.6rem;
    }
    
    .digits-tip {
        font-size: 0.95rem;
    }
    
    .timer-area {
        padding: 18px 12px;
        margin-bottom: 20px;
    }
    
    .timer-label {
        font-size: 1.1rem;
    }
    
    .progress-bar-bg {
        height: 12px;
    }
    
    .number {
        font-size: 2rem;
        margin: 25px 0;
        padding: 12px;
    }
    
    .virtual-keyboard {
        max-width: 260px;
        gap: 10px;
    }
    
    .keyboard-row {
        gap: 10px;
    }
    
    .keyboard-key {
        padding: 12px 8px;
        font-size: 1rem;
        min-height: 45px;
    }
    
    #userInput {
        padding: 14px 16px;
        font-size: 1.1rem;
    }
    
    .btn {
        padding: 16px 35px;
        font-size: 1.1rem;
    }
    
    .qr-code {
        width: 120px;
        height: 120px;
    }
    
    .about-content h1 {
        font-size: 2rem;
    }
    
    .popup-message {
        padding: 20px;
        max-width: 300px;
    }
    
    .popup-content {
        font-size: 1.1rem;
        padding: 15px 0;
    }
    
    .popup-close {
        font-size: 20px;
        width: 25px;
        height: 25px;
    }
    
    .popup-confirm {
        padding: 8px 20px;
        font-size: 0.95rem;
    }
}

/* Print styles */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .header-nav,
    .footer,
    .btn,
    .virtual-keyboard {
        display: none;
    }
    
    .main,
    .about-main {
        box-shadow: none;
        background: white;
    }
} 