@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;700&display=swap');

body {
    font-family: 'Noto Sans SC', Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    padding: 30px;
    backdrop-filter: blur(10px);
}

.login-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    backdrop-filter: blur(10px);
}

h1 {
    text-align: center;
    color: #4a4a8c;
    margin-bottom: 30px;
    font-weight: 700;
    font-size: 2.2em;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

h2 {
    color: #555;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    margin-top: 0;
    font-weight: 500;
}

.scores-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-top: 20px;
}

#chord-scores {
    flex: 1;
    min-width: 300px;
    background: rgba(248, 249, 250, 0.8);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

#total-score-container {
    flex: 1;
    min-width: 300px;
    text-align: center;
    background: rgba(248, 249, 250, 0.8);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.score-display {
    font-size: 4em;
    font-weight: 700;
    padding: 20px;
    border-radius: 15px;
    margin-top: 10px;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.chord-item {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    margin: 10px 0;
    border-radius: 8px;
    background-color: #ffffff;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border-left: 4px solid #667eea;
}

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

.chord-name {
    font-weight: 500;
    font-size: 1.1em;
}

.chord-score {
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 1.1em;
}

.score-low {
    background-color: #ffeded;
    color: #ff6b6b;
    border-left-color: #ff6b6b;
}

.score-medium {
    background-color: #e3f2fd;
    color: #2196f3;
    border-left-color: #2196f3;
}

.score-high {
    background-color: #e8f5e9;
    color: #4caf50;
    border-left-color: #4caf50;
}

#status {
    margin-top: 30px;
    padding: 15px;
    text-align: center;
    border-top: 1px solid #eee;
    background: rgba(248, 249, 250, 0.5);
    border-radius: 8px;
}

#connection-status {
    font-weight: 500;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e5eb;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

button {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

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

button:active {
    transform: translateY(0);
}

.error-message {
    color: #ff6b6b;
    margin-top: 20px;
    padding: 12px;
    background-color: #ffeded;
    border-radius: 8px;
    border-left: 4px solid #ff6b6b;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.user-menu-container {
    position: relative;
    display: inline-block;
}

.user-menu-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 16px;
}

.user-menu-button:hover {
    transform: none;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.user-menu-button::after {
    content: "▼";
    font-size: 0.7em;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: white;
    min-width: 180px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-radius: 10px;
    z-index: 1000;
    overflow: hidden;
    margin-top: 5px;
    animation: fadeIn 0.3s ease;
}

.dropdown-content a {
    color: #333;
    padding: 15px 20px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.dropdown-content a:hover {
    background-color: #f8f9fa;
    border-left: 3px solid #667eea;
}

.dropdown-content.show {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.performance-item {
    border: 1px solid #e1e5eb;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    background-color: #ffffff;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

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

.performance-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.performance-timestamp {
    color: #6c757d;
    font-size: 0.9em;
}

.performance-total {
    font-size: 1.3em;
    font-weight: 700;
    padding: 5px 15px;
    border-radius: 20px;
}

.performance-chords {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.performance-chord {
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.95em;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.icon {
    font-size: 1.2em;
}

/* 头部布局优化 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #eee;
    flex-wrap: wrap;
}

.header-left {
    flex: 1;
    min-width: 300px;
}

/* 时间戳显示样式 */
.timestamp-display {
    background: rgba(102, 126, 234, 0.1);
    padding: 10px 15px;
    border-radius: 8px;
    margin-top: 10px;
    font-size: 0.9em;
    color: #555;
    border-left: 4px solid #667eea;
}

.timestamp-display i {
    color: #667eea;
    margin-right: 5px;
}

#latest-timestamp {
    font-weight: 500;
    color: #333;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        padding: 20px;
    }
    
    .scores-container {
        flex-direction: column;
        gap: 20px;
    }
    
    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .user-menu-container {
        align-self: flex-end;
    }
}

/* 移动端优化 */
@media (max-width: 768px) {
    .container {
        margin: 5px;
        padding: 15px;
    }

    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .header-left {
        order: 1;
        text-align: center;
    }

    .user-menu-container {
        order: 2;
        align-self: center;
        width: 100%;
        text-align: center;
    }

    .user-menu-button {
        width: auto;
        margin: 0 auto;
    }

    .scores-container {
        flex-direction: column;
        gap: 20px;
    }

    #chord-scores, #total-score-container {
        min-width: 100%;
    }

    .score-display {
        font-size: 3em;
        padding: 15px;
    }

    .chord-item {
        padding: 12px;
        font-size: 0.95em;
    }

    .timestamp-display {
        font-size: 0.85em;
        padding: 8px 12px;
    }

    h1 {
        font-size: 1.8em;
        margin-bottom: 15px;
    }

    h2 {
        font-size: 1.3em;
    }
}

/* 超小屏幕优化 */
@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 15px;
        margin: 0;
    }

    h1 {
        font-size: 1.6em;
    }

    .score-display {
        font-size: 2.5em;
        padding: 10px;
    }

    .chord-item {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }

    .timestamp-display {
        font-size: 0.8em;
    }

    #status {
        font-size: 0.9em;
    }
}

/* 横屏优化 */
@media (max-width: 768px) and (orientation: landscape) {
    .container {
        padding: 10px;
    }

    .scores-container {
        flex-direction: row;
        flex-wrap: wrap;
    }

    #chord-scores, #total-score-container {
        min-width: calc(50% - 15px);
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .chord-item:hover {
        transform: none;
    }

    button:hover {
        transform: none;
    }

    .user-menu-button:hover {
        transform: none;
    }

    /* 增加触摸目标大小 */
    .chord-item {
        min-height: 44px;
    }

    .dropdown-content a {
        min-height: 44px;
    }
}