/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 1.8rem;
    font-weight: 600;
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 20px;
}

nav ul li a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

nav ul li a:hover {
    color: #f0f0f0;
}

#language-toggle {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#language-toggle:hover {
    background: rgba(255,255,255,0.3);
}

/* 英雄区域 */
#hero {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 100px 0;
    text-align: center;
}

#hero h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: #333;
}

#hero p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    color: #666;
}

#create-room-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.1rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

#create-room-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

/* 特性区域 */
#features {
    padding: 80px 0;
    background: white;
}

#features h3 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 50px;
    color: #333;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.feature-item {
    background: #f9f9f9;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.feature-item h4 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: #333;
}

.feature-item p {
    color: #666;
}

/* 房间管理区域 */
#room-section {
    padding: 50px 0;
    background: white;
    margin: 30px 0;
    border-radius: 10px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
}

#room-section h3 {
    font-size: 1.8rem;
    margin-bottom: 30px;
    color: #333;
}

#room-info {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

#user-management {
    margin-bottom: 40px;
}

#user-management h4 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: #333;
}

.user-form {
    display: flex;
    margin-bottom: 20px;
}

#user-name {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px 0 0 5px;
    font-size: 1rem;
}

#add-user-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 0 5px 5px 0;
    cursor: pointer;
    transition: background 0.3s ease;
}

#add-user-btn:hover {
    background: #5a6fd8;
}

#user-list {
    list-style: none;
    background: #f9f9f9;
    border-radius: 8px;
    overflow: hidden;
}

#user-list li {
    padding: 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#user-list li:last-child {
    border-bottom: none;
}

#user-list li button {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s ease;
}

#user-list li button:hover {
    background: #ee5a52;
}

/* 牌局结算区域 */
#game-management {
    margin-bottom: 40px;
}

#game-management h4 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: #333;
}

#score-inputs {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.score-input-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.score-input-item label {
    width: 100px;
    font-weight: 500;
}

.score-input-item input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

#submit-score-btn {
    background: #4ecdc4;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
}

#submit-score-btn:hover {
    background: #45b7aa;
}

/* 得分历史区域 */
#score-history h4 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: #333;
}

#history-table {
    background: #f9f9f9;
    border-radius: 8px;
    overflow: hidden;
}

.history-header {
    background: #667eea;
    color: white;
    display: grid;
    grid-template-columns: 100px repeat(auto-fit, minmax(100px, 1fr));
    padding: 15px;
    font-weight: 600;
}

.history-row {
    display: grid;
    grid-template-columns: 100px repeat(auto-fit, minmax(100px, 1fr));
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.history-row:last-child {
    border-bottom: none;
}

.history-row:nth-child(even) {
    background: #f0f0f0;
}

/* 页脚样式 */
footer {
    background: #333;
    color: white;
    padding: 40px 0;
    margin-top: 50px;
}

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

footer ul {
    display: flex;
    list-style: none;
}

footer ul li {
    margin-left: 20px;
}

footer ul li a {
    color: white;
    text-decoration: none;
    transition: color 0.3s ease;
}

footer ul li a:hover {
    color: #667eea;
}

/* 响应式设计 */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        text-align: center;
    }
    
    nav ul {
        margin-top: 20px;
    }
    
    nav ul li {
        margin: 0 10px;
    }
    
    #hero h2 {
        font-size: 2rem;
    }
    
    .user-form {
        flex-direction: column;
    }
    
    #user-name {
        border-radius: 5px;
        margin-bottom: 10px;
    }
    
    #add-user-btn {
        border-radius: 5px;
    }
    
    footer .container {
        flex-direction: column;
        text-align: center;
    }
    
    footer ul {
        margin-top: 20px;
    }
    
    footer ul li {
        margin: 0 10px;
    }
}

/* 隐藏类 */
.hidden {
    display: none;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#room-section {
    animation: fadeIn 0.5s ease;
}

.feature-item {
    animation: fadeIn 0.5s ease;
}

.feature-item:nth-child(2) {
    animation-delay: 0.1s;
}

.feature-item:nth-child(3) {
    animation-delay: 0.2s;
}

.feature-item:nth-child(4) {
    animation-delay: 0.3s;
}