* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.page {
    display: none;
    min-height: 100vh;
    padding: 20px;
}

.page.active {
    display: block;
}

.login-container {
    max-width: 450px;
    margin: 100px auto;
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    font-size: 2.5rem;
    color: #667eea;
    margin-bottom: 10px;
}

.login-header h2 {
    font-size: 1.3rem;
    color: #666;
    font-weight: normal;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: #333;
}

.form-group input {
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

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

.challenge-options {
    display: flex;
    gap: 10px;
}

.challenge-btn {
    flex: 1;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.challenge-btn:hover {
    border-color: #667eea;
}

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

.material-options {
    display: flex;
    gap: 10px;
}

.material-btn {
    flex: 1;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.material-btn:hover {
    border-color: #667eea;
}

.material-btn.active {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border-color: transparent;
}

.shake-options {
    display: flex;
    gap: 10px;
}

.shake-btn {
    flex: 1;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.shake-btn:hover {
    border-color: #f5576c;
}

.shake-btn.active {
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
    color: white;
    border-color: transparent;
}

.sink-btn {
    flex: 1;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sink-btn:hover {
    border-color: #4facfe;
}

.sink-btn.active {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border-color: transparent;
}

.section-title {
    color: #333;
    font-size: 1.4rem;
    margin: 40px 0 20px;
    padding-top: 20px;
    border-top: 2px solid #eee;
}

.material-filter {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.filter-btn {
    padding: 10px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    border-color: #667eea;
}

.filter-btn.active {
    background: #667eea;
    color: white;
    border-color: transparent;
}

.login-hint {
    margin-top: 20px;
    text-align: center;
    color: #999;
    font-size: 0.9rem;
}

.login-hint p {
    margin: 5px 0;
}

.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.student-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    color: white;
}

.student-header h1 {
    font-size: 1.8rem;
}

.student-form {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.form-section {
    margin-bottom: 20px;
}

.form-section label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
}

.form-section textarea {
    width: 100%;
    height: 100px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1rem;
    resize: vertical;
    transition: all 0.3s ease;
}

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

.image-upload {
    position: relative;
}

.image-upload input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-area {
    border: 2px dashed #e0e0e0;
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    transition: all 0.3s ease;
    background: #fafafa;
}

.upload-area:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.upload-area.has-image {
    border-style: solid;
    border-color: #667eea;
    padding: 10px;
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.upload-area span {
    color: #666;
    font-size: 1rem;
}

.upload-tip {
    font-size: 0.85rem;
    color: #999;
    margin-top: 5px;
}

.upload-area img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 10px;
    object-fit: contain;
}

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

.form-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-item label {
    font-weight: 600;
    color: #333;
}

.form-item input {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

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

.success-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
}

.success-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    animation: modalIn 0.3s ease;
}

.success-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.success-content h3 {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 10px;
}

.success-content p {
    color: #666;
    margin-bottom: 20px;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.teacher-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    color: white;
}

.teacher-header h1 {
    font-size: 2rem;
}

.teacher-actions {
    display: flex;
    gap: 10px;
}

.chart-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.control-btn {
    padding: 10px 20px;
    border: 2px solid #667eea;
    border-radius: 8px;
    background: white;
    color: #667eea;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background: #667eea;
    color: white;
}

.teacher-tabs {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255,255,255,0.2);
    color: white;
}

.tab-btn:hover {
    background: rgba(255,255,255,0.3);
}

.tab-btn.active {
    background: white;
    color: #667eea;
}

.tab-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.photo-buttons, .chart-buttons, .wordcloud-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.photo-btn, .chart-btn, .wordcloud-btn {
    padding: 12px 25px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.photo-btn:hover, .chart-btn:hover, .wordcloud-btn:hover {
    border-color: #667eea;
}

.photo-btn.active, .chart-btn.active, .wordcloud-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

.photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.photo-card {
    display: flex;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    background: #fff;
    height: 200px;
}

.photo-card > img,
.photo-card > .no-image-placeholder {
    flex: 1 1 auto;
    width: 60%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.photo-card > .no-image-placeholder {
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
}

.photo-info {
    position: static;
    flex: 0 0 40%;
    background: rgba(0,0,0,0.65);
    color: white;
    padding: 14px 16px;
    border-radius: 0;
    font-size: 1.1rem;
    max-width: none;
    transition: background 0.3s ease;
    pointer-events: auto;
    line-height: 1.35;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.photo-card:hover .photo-info {
    background: rgba(0,0,0,0.85);
}

.photo-info p {
    margin: 4px 0;
}

.photo-info p strong {
    font-size: 1.2rem;
}

.photo-info.info-highlight {
    background: rgba(245, 158, 11, 0.92);
    color: white;
}

.photo-card:hover .photo-info.info-highlight {
    background: rgba(245, 158, 11, 1);
}

.photo-card {
    cursor: pointer;
}

.photo-card.highlight {
    box-shadow: 0 0 0 3px #f5576c, 0 10px 30px rgba(245, 87, 108, 0.3);
}

.photo-card-empty {
    opacity: 0.7;
    border: 2px dashed #d0d0d0;
    cursor: default;
    box-shadow: none;
}

.photo-card-empty .empty-photo {
    flex: 1 1 auto;
    width: 60%;
    height: 100%;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 10px;
    color: #aaa;
}

.photo-card-empty .empty-photo-icon {
    font-size: 48px;
    opacity: 0.6;
}

.photo-card-empty .photo-info {
    background: rgba(150, 150, 150, 0.6);
}

.compare-item.highlight {
    border: 3px solid #f5576c;
    background: rgba(245, 87, 108, 0.05);
}

.compare-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 20px;
}

.compare-item {
    display: flex;
    gap: 15px;
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
}

.compare-item .photo-card {
    flex: 1;
}

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

#chart-canvas {
    width: 100% !important;
    height: 400px !important;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.legend-item:hover {
    background: #e9ecef;
}

.legend-item.disabled {
    opacity: 0.4;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
}

.legend-label {
    font-size: 0.9rem;
    color: #333;
}

.wordcloud-container {
    min-height: 400px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 15px;
}

.wordcloud-status {
    flex-basis: 100%;
    text-align: center;
    color: #666;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.7);
    padding: 8px 16px;
    border-radius: 8px;
    margin-bottom: 8px;
}

.wordcloud-word {
    display: inline-block;
    padding: 4px 8px;
    font-weight: bold;
    line-height: 1.1;
    transition: transform 0.3s ease;
    cursor: default;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.wordcloud-word:hover {
    transform: scale(1.15);
    z-index: 10;
}

.empty-state {
    text-align: center;
    padding: 60px;
    color: #999;
}

.coze-audio-input-button,
[class*="voice-chat"],
[class*="voice-call"],
[class*="audio-input"]:not(input):not(textarea),
[class*="VoiceCall"],
[class*="VoiceChat"],
button[aria-label*="语音"],
button[aria-label*="麦克风"],
button[aria-label*="voice" i],
button[aria-label*="audio" i] {
    display: none !important;
}

.empty-state .icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.empty-state p {
    font-size: 1rem;
}

.image-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.image-modal.show {
    display: flex;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: #ccc;
}

.modal-image-wrapper {
    width: 90%;
    height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
}

.modal-image {
    max-width: 100%;
    max-height: 100%;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    transform-origin: center center;
    transition: transform 0.2s ease;
    user-select: none;
    -webkit-user-drag: none;
}

.modal-controls {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.modal-controls button {
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.modal-controls button:hover {
    background: white;
    transform: translateY(-1px);
}

.modal-info {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    font-size: 1rem;
    text-align: center;
}

.modal-info p {
    margin: 5px 0;
}

@media (max-width: 768px) {
    .login-container {
        margin: 50px 20px;
        padding: 30px;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .teacher-tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        width: 100%;
    }
    
    .photo-buttons, .chart-buttons, .wordcloud-buttons {
        flex-direction: column;
    }
    
    .photo-btn, .chart-btn, .wordcloud-btn {
        width: 100%;
    }
    
    .photos-grid {
        grid-template-columns: 1fr;
    }

    .compare-grid {
        grid-template-columns: 1fr;
    }

    .compare-item {
        flex-direction: column;
    }

    .photo-card {
        flex-direction: column;
        height: auto;
    }

    .photo-card > img,
    .photo-card > .no-image-placeholder,
    .photo-card-empty .empty-photo {
        width: 100%;
        flex: 0 0 auto;
        height: 200px;
    }

    .photo-info {
        flex: 0 0 auto;
        height: auto;
    }
}