/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

/* 左侧导航栏 */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background: linear-gradient(180deg, #2c3e50 0%, #34495e 100%);
    color: white;
    transition: transform 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
}

.sidebar.collapsed {
    transform: translateX(-220px);
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i {
    font-size: 24px;
    color: #ff6b6b;
}

.logo h2 {
    font-size: 20px;
    font-weight: 600;
}

.toggle-btn {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.toggle-btn:hover {
    background-color: rgba(255,255,255,0.1);
}

.sidebar-menu {
    padding: 20px 0;
}

.menu-section {
    margin-bottom: 30px;
}

.menu-section h3 {
    padding: 0 20px 10px;
    font-size: 14px;
    color: #bdc3c7;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.menu-section ul {
    list-style: none;
}

.menu-section li {
    margin-bottom: 2px;
}

.menu-section a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #ecf0f1;
    text-decoration: none;
    transition: all 0.3s ease;
}

.menu-section a:hover {
    background-color: rgba(255,255,255,0.1);
    transform: translateX(5px);
}

.menu-section a.active {
    background-color: rgba(255,107,107,0.2);
}

.menu-section a i {
    width: 20px;
    margin-right: 12px;
    font-size: 16px;
}

.sidebar-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: rgba(0,0,0,0.2);
}

.user-info, .points {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 14px;
}

.user-info i, .points i {
    color: #ff6b6b;
}

/* 主内容区域 */
.main-content {
    margin-left: 280px;
    min-height: 100vh;
    padding: 20px;
    transition: margin-left 0.3s ease;
    background: white;
    border-radius: 15px 0 0 0;
}

.main-content.expanded {
    margin-left: 60px;
}

.content-section {
    display: none;
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.content-section.active {
    display: block;
}

/* 首页样式 */
.welcome-banner {
    background: linear-gradient(135deg, #ff6b6b, #ffa500);
    color: white;
    padding: 40px;
    border-radius: 15px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.banner-content h1 {
    font-size: 32px;
    margin-bottom: 10px;
}

.banner-content p {
    font-size: 18px;
    opacity: 0.9;
}

.weather-widget {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.2);
    padding: 15px 20px;
    border-radius: 10px;
}

.weather-widget i {
    font-size: 24px;
}

/* 快速入口 */
.quick-access {
    margin-bottom: 30px;
}

.quick-access h2 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.quick-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.quick-card {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.quick-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
}

.quick-card i {
    font-size: 36px;
    margin-bottom: 15px;
    opacity: 0.9;
}

.quick-card h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.quick-card p {
    opacity: 0.8;
    font-size: 14px;
}

/* 每日一句 */
.daily-inspiration {
    margin-bottom: 30px;
}

.daily-inspiration h2 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.inspiration-card {
    background: linear-gradient(135deg, #ffeaa7, #fab1a0);
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    position: relative;
}

.inspiration-card i {
    font-size: 24px;
    color: #e17055;
    margin-bottom: 15px;
}

.inspiration-card p {
    font-size: 18px;
    font-style: italic;
    margin-bottom: 15px;
    color: #2d3436;
}

.inspiration-card span {
    font-size: 14px;
    color: #636e72;
}

/* 页面头部 */
.section-header {
    margin-bottom: 30px;
    text-align: center;
}

.section-header h1 {
    font-size: 28px;
    color: #2c3e50;
    margin-bottom: 10px;
}

.section-header h1 i {
    margin-right: 10px;
    color: #ff6b6b;
}

.section-header p {
    color: #7f8c8d;
    font-size: 16px;
}

/* 作业帮助页面 */
.homework-tools {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.tool-card {
    background: linear-gradient(135deg, #74b9ff, #0984e3);
    color: white;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
}

.tool-card i {
    font-size: 36px;
    margin-bottom: 15px;
    opacity: 0.9;
}

.tool-card h3 {
    font-size: 18px;
    margin-bottom: 10px;
}

.tool-card p {
    opacity: 0.8;
    margin-bottom: 20px;
}

.btn-primary {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 2px solid rgba(255,255,255,0.3);
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.btn-primary:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

.homework-list {
    margin-top: 30px;
}

.homework-list h2 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.homework-item {
    display: flex;
    align-items: center;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 15px;
    border-left: 4px solid #ddd;
}

.subject-tag {
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
    color: white;
    margin-right: 15px;
    min-width: 60px;
    text-align: center;
}

.subject-tag.math {
    background: #e74c3c;
}

.subject-tag.chinese {
    background: #3498db;
}

.homework-content {
    flex: 1;
}

.homework-content h3 {
    margin-bottom: 5px;
    color: #2c3e50;
}

.homework-content p {
    color: #7f8c8d;
    margin-bottom: 10px;
}

.homework-meta {
    display: flex;
    gap: 20px;
    font-size: 12px;
    color: #95a5a6;
}

.btn-help {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-help:hover {
    background: #e55656;
}

/* 树洞页面 */
.treehole-post {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.post-form textarea {
    width: 100%;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    font-size: 16px;
    resize: vertical;
    margin-bottom: 15px;
    font-family: inherit;
}

.post-form textarea:focus {
    outline: none;
    border-color: #ff6b6b;
}

.post-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mood-selector select {
    padding: 8px 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
}

.treehole-messages h2 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.message-item {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.message-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 14px;
    color: #7f8c8d;
}

.anonymous-name {
    font-weight: bold;
    color: #2c3e50;
}

.mood-emoji {
    font-size: 16px;
}

.message-content {
    margin-bottom: 15px;
    line-height: 1.6;
    color: #2c3e50;
}

.message-actions {
    display: flex;
    gap: 10px;
}

.btn-comfort, .btn-reply {
    background: none;
    border: 1px solid #ddd;
    padding: 6px 12px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.btn-comfort:hover {
    background: #ff6b6b;
    color: white;
    border-color: #ff6b6b;
}

.btn-reply:hover {
    background: #74b9ff;
    color: white;
    border-color: #74b9ff;
}

/* 视频通话页面 */
.call-interface {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.video-area {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
    min-height: 300px;
}

.local-video, .remote-video {
    background: #f8f9fa;
    border-radius: 15px;
    border: 2px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    position: relative;
    overflow: hidden;
}

.video-placeholder {
    text-align: center;
    padding: 40px 20px;
}

.video-placeholder i {
    font-size: 64px;
    margin-bottom: 15px;
    display: block;
    color: #adb5bd;
}

.video-placeholder p {
    font-size: 16px;
    font-weight: 500;
    margin: 0;
}

.call-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 20px 0;
}

.control-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.control-btn {
    background: #6c757d;
}

.control-btn:hover {
    background: #5a6268;
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.call-btn {
    background: #28a745;
}

.call-btn:hover {
    background: #218838;
}

.end-call-btn {
    background: #e74c3c;
}

.end-call-btn:hover {
    background: #c0392b;
}

.contact-list {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.contact-list h2 {
    margin-bottom: 25px;
    color: #2c3e50;
    font-size: 24px;
    font-weight: 600;
}

.contact-item {
    display: flex;
    align-items: center;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 15px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.contact-item:hover {
    background: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.contact-avatar {
    margin-right: 20px;
}

.contact-avatar i {
    font-size: 48px;
    color: #6c757d;
}

.contact-info {
    flex: 1;
}

.contact-info h3 {
    margin-bottom: 8px;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
}

.contact-info p {
    color: #6c757d;
    font-size: 14px;
    margin: 0;
}

.contact-actions {
    display: flex;
    gap: 12px;
}

.btn-call {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    background: #007bff;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,123,255,0.3);
}

.btn-call:hover {
    background: #0056b3;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0,123,255,0.4);
}

/* 开发中页面 */
.coming-soon {
    text-align: center;
    padding: 60px 20px;
    color: #7f8c8d;
}

.coming-soon i {
    font-size: 64px;
    margin-bottom: 20px;
    color: #ddd;
}

.coming-soon h2 {
    margin-bottom: 10px;
    color: #2c3e50;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 15px;
    }
    
    .quick-cards {
        grid-template-columns: 1fr;
    }
    
    .homework-tools {
        grid-template-columns: 1fr;
    }
    
    .video-area {
        grid-template-columns: 1fr;
    }
    
    .welcome-banner {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .banner-content h1 {
        font-size: 24px;
    }
    
    .post-options {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content-section.active {
    animation: fadeIn 0.5s ease;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #ff6b6b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}