/* 符豆音乐训练系统样式表 */

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

body {
    font-family: 'Microsoft YaHei', '微软雅黑', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

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

/* 导航栏 */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar .nav-brand {
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
    color: white;
}

.navbar .nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    margin: 0;
}

.navbar .nav-links a {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s;
}

.navbar .nav-links a:hover {
    opacity: 0.8;
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 30px rgba(0,0,0,0.15);
}

.card-header {
    border-bottom: 2px solid #667eea;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.card-title {
    color: #667eea;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #138496;
}

/* 表单样式 */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #555;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-control:focus {
    border-color: #667eea;
    outline: none;
}

.form-control.error {
    border-color: #dc3545;
}

/* 网格布局 */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.col-md-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
    padding: 0 15px;
}

.col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
    padding: 0 15px;
}

.col-md-8 {
    flex: 0 0 66.666667%;
    max-width: 66.666667%;
    padding: 0 15px;
}

.col-md-12 {
    flex: 0 0 100%;
    max-width: 100%;
    padding: 0 15px;
}

/* 曲谱查看器样式 */
.score-viewer {
    background: white;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.score-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 5px;
}

.score-controls .progress-bar {
    flex: 1;
    height: 5px;
    background: #ddd;
    border-radius: 3px;
    appearance: none;
}

.score-controls .progress-bar::-webkit-slider-thumb {
    appearance: none;
    width: 15px;
    height: 15px;
    background: #667eea;
    border-radius: 50%;
    cursor: pointer;
}

.score-display {
    text-align: center;
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 5px;
}

.score-display canvas {
    max-width: 100%;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 5px;
}

/* 练习模块样式 */
.practice-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.practice-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.practice-card:hover {
    transform: translateY(-5px);
}

.practice-card .icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.practice-card h3 {
    color: #667eea;
    margin-bottom: 1rem;
}

/* 指法练习样式 */
.fingering-practice {
    max-width: 800px;
    margin: 0 auto;
}

.practice-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background: #667eea;
    color: white;
    border-radius: 10px;
}

.progress-info {
    display: flex;
    gap: 2rem;
    font-size: 0.9rem;
}

.question-area {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    margin-bottom: 2rem;
}

.question-image {
    max-width: 100%;
    height: auto;
    margin: 1rem 0;
    border-radius: 5px;
}

.answer-option {
    display: block;
    padding: 1rem;
    margin: 0.5rem 0;
    background: #f8f9fa;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.answer-option:hover {
    background: #e9ecef;
}

.answer-option input[type="radio"] {
    margin-right: 0.5rem;
}

.answer-feedback {
    padding: 1rem;
    border-radius: 5px;
    margin-top: 1rem;
}

.answer-feedback.correct {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.answer-feedback.incorrect {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.practice-results {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 10px;
}

.results-summary {
    display: flex;
    justify-content: space-around;
    margin: 2rem 0;
}

.result-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.result-label {
    font-weight: bold;
    color: #666;
}

.result-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
}

/* 节奏练习样式 */
.rhythm-practice {
    max-width: 900px;
    margin: 0 auto;
}

.tempo-control {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.tempo-control input[type="range"] {
    flex: 1;
    max-width: 200px;
}

.rhythm-display {
    background: white;
    padding: 1rem;
    border-radius: 10px;
    margin: 1rem 0;
    text-align: center;
}

.rhythm-display canvas {
    border: 1px solid #ddd;
    border-radius: 5px;
}

.tap-area {
    text-align: center;
    margin: 2rem 0;
}

.tap-area .btn {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    font-size: 1.5rem;
    font-weight: bold;
}

.feedback-area {
    display: flex;
    justify-content: space-around;
    background: white;
    padding: 1rem;
    border-radius: 10px;
}

/* 调音器样式 */
.guzheng-tuner {
    max-width: 1000px;
    margin: 0 auto;
}

.tuner-display {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    margin: 1rem 0;
}

.frequency-display {
    text-align: center;
    margin-bottom: 2rem;
}

.current-note {
    font-size: 4rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 0.5rem;
}

.frequency-value {
    font-size: 1.5rem;
    color: #666;
}

.tuning-meter {
    position: relative;
    height: 60px;
    margin: 2rem 0;
}

.meter-background {
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 20px;
    border-radius: 10px;
    display: flex;
}

.meter-red {
    background: linear-gradient(to right, #dc3545, #ffc107);
    width: 25%;
}

.meter-green {
    background: #28a745;
    width: 50%;
}

.meter-red.right {
    background: linear-gradient(to right, #ffc107, #dc3545);
}

.meter-scale {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #666;
}

.scale-mark.center {
    font-weight: bold;
    color: #333;
}

.meter-needle {
    position: absolute;
    top: 10px;
    width: 4px;
    height: 40px;
    background: #333;
    border-radius: 2px;
    transform: translateX(-50%);
    transition: left 0.3s;
}

.tuning-status {
    text-align: center;
    margin-top: 1rem;
}

.status-indicator {
    font-size: 1.2rem;
    font-weight: bold;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    margin-bottom: 0.5rem;
}

.status-indicator.in-tune {
    background: #d4edda;
    color: #155724;
}

.status-indicator.too-high {
    background: #fff3cd;
    color: #856404;
}

.status-indicator.too-low {
    background: #f8d7da;
    color: #721c24;
}

.cents-display {
    font-size: 1rem;
    color: #666;
}

.string-reference {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    margin: 1rem 0;
}

.string-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.string-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 5px;
}

.string-number {
    width: 30px;
    height: 30px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.string-note {
    font-weight: bold;
    color: #333;
    min-width: 40px;
}

.string-frequency {
    color: #666;
    font-size: 0.9rem;
    flex: 1;
}

.tuner-visualization {
    background: white;
    padding: 1rem;
    border-radius: 10px;
    margin: 1rem 0;
    text-align: center;
}

.tuner-visualization canvas {
    border: 1px solid #ddd;
    border-radius: 5px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .col-md-4,
    .col-md-6,
    .col-md-8,
    .col-md-12 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .navbar .nav-links {
        flex-direction: column;
        gap: 1rem;
    }
    
    .practice-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .progress-info {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .results-summary {
        flex-direction: column;
        gap: 1rem;
    }
    
    .feedback-area {
        flex-direction: column;
        gap: 1rem;
    }
    
    .string-grid {
        grid-template-columns: 1fr;
    }
    
    .string-item {
        flex-direction: column;
        text-align: center;
    }
    
    .current-note {
        font-size: 3rem;
    }
    
    .tap-area .btn {
        width: 150px;
        height: 150px;
    }
}

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

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.pulse {
    animation: pulse 1s infinite;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 通知样式 */
.alert {
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background: #cce7ff;
    color: #004085;
    border: 1px solid #b8daff;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}