/* ========================================
   飞行教练团页面样式
   ======================================== */

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #f0f7ff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Microsoft YaHei", sans-serif;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ========================================
   顶部标题栏
   ======================================== */

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2000;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 16px 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.header-plane {
    color: #5dade2;
    margin-right: 6px;
    font-size: 22px;
    transform: rotate(-15deg);
    display: inline-block;
    animation: planeBob 3s ease-in-out infinite;
}

@keyframes planeBob {
    0%, 100% { transform: rotate(-15deg) translateY(0); }
    50% { transform: rotate(-10deg) translateY(-3px); }
}

.btn-back {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-2px);
}

.btn-back i {
    font-size: 10px;
}

.header-title {
    text-align: center;
    flex: 1;
    margin: 0 10px;
}

.header-right {
    min-width: 60px;
    text-align: right;
}

.header-subtitle {
    font-size: 12px;
    opacity: 0.85;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
}

@media (max-width: 768px) {
    .header {
        padding: 12px 14px;
    }
    
    .header h1 {
        font-size: 16px;
    }
    
    .header-plane {
        font-size: 18px;
        margin-right: 4px;
    }
    
    .btn-back {
        font-size: 10px;
        padding: 3px 6px;
        gap: 2px;
    }
    
    .btn-back i {
        font-size: 9px;
    }
    
    .header-subtitle {
        font-size: 11px;
    }
    
    .header-title {
        margin: 0 6px;
    }
}

/* ========================================
   主容器
   ======================================== */

.aicoach-container {
    display: flex;
    max-width: 1400px;
    height: calc(100% - 68px);
    margin: 0 auto;
    margin-top: 68px;
    width: 100%;
    padding: 0 20px;
    overflow: hidden;
}

/* ========================================
   左侧聊天区域 (桌面端)
   ======================================== */

.chat-area {
    width: 500px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    background: #f0f7ff;
    border-right: 1px solid #e4e7ed;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-header {
    display: none;
    padding: 16px 20px;
    background: white;
    border-bottom: 1px solid #ebeef5;
    flex-shrink: 0;
    align-items: center;
    justify-content: space-between;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #ecf5ff;
    border: 1px solid #dcdfe6;
    border-radius: 6px;
    color: #409eff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.back-btn:hover {
    background: #dbeafe;
    border-color: #409eff;
}

.chat-title {
    font-size: 16px;
    font-weight: 600;
    color: #303133;
}

.chat-iframe-wrapper {
    flex: 1;
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
}

.chat-iframe {
    width: 100%;
    height: 100%;
    min-height: 100%;
    border: none;
    background: transparent;
    display: block;
}

/* ========================================
   右侧教练列表区域
   ======================================== */

.sidebar-area {
    flex: 1 1 auto;
    width: auto;
    background: white;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 300px;
    max-width: 900px;
    height: 100%;
}

.sidebar-header {
    padding: 20px 24px;
    background: white;
    border-bottom: 1px solid #ebeef5;
    flex-shrink: 0;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.header-logo i {
    font-size: 22px;
    color: #409eff;
}

.sidebar-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #303133;
    margin: 0;
}

.sidebar-header p {
    font-size: 13px;
    color: #909399;
}

.search-box {
    padding: 12px 20px;
    background: white;
    flex-shrink: 0;
}

.search-box input {
    width: 100%;
    padding: 10px 14px 10px 38px;
    border: 1px solid #dcdfe6;
    border-radius: 8px;
    font-size: 14px;
    color: #606266;
    background: #f5f7fa url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23909399' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cpath d='m21 21-4.3-4.3'%3E%3C/path%3E%3C/svg%3E") no-repeat 12px center;
    outline: none;
    transition: all 0.2s;
}

.search-box input:focus {
    border-color: #409eff;
    background-color: white;
}

.search-box input::placeholder {
    color: #c0c4cc;
}

.assistant-grid {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.assistant-card {
    background: #fafbfc;
    border: 1px solid #ebeef5;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
}

.assistant-card:hover {
    border-color: #c6e2ff;
    background: #f0f7ff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(64, 158, 255, 0.1);
}

.assistant-card.active {
    background: #ecf5ff;
    border-color: #409eff;
    box-shadow: 0 2px 12px rgba(64, 158, 255, 0.15);
}

.assistant-card.active .assistant-name {
    color: #409eff;
}

.assistant-card.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #409eff 0%, #66b1ff 100%);
    border-radius: 10px 10px 0 0;
}

.assistant-name {
    font-size: 15px;
    font-weight: 600;
    color: #303133;
    margin-bottom: 8px;
    line-height: 1.4;
}

.assistant-desc {
    font-size: 13px;
    color: #606266;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.assistant-grid::-webkit-scrollbar {
    width: 4px;
}

.assistant-grid::-webkit-scrollbar-track {
    background: transparent;
}

.assistant-grid::-webkit-scrollbar-thumb {
    background: #c5d0de;
    border-radius: 2px;
}

.assistant-grid::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* ========================================
   响应式设计
   ======================================== */

@media (max-width: 992px) {
    .chat-area {
        width: 50%;
    }
    
    .sidebar-area {
        max-width: none;
    }
}

@media (max-width: 768px) {
    .aicoach-container {
        flex-direction: column;
    }
    
    .chat-area {
        width: 100%;
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 100;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        border-right: none;
        border-bottom: 1px solid #e4e7ed;
    }
    
    .chat-area.show {
        transform: translateX(0);
    }
    
    .chat-header {
        display: flex;
    }
    
    .sidebar-area {
        width: 100%;
        max-width: none;
        min-width: auto;
        position: relative;
        z-index: 1;
    }
    
    .assistant-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 10px 12px;
    }
    
    .assistant-card {
        padding: 14px;
    }
    
    .sidebar-header {
        padding: 16px 18px;
    }
    
    .header-logo i {
        font-size: 20px;
    }
    
    .sidebar-header h2 {
        font-size: 17px;
    }
    
    .sidebar-header p {
        font-size: 12px;
    }
    
    .search-box {
        padding: 10px 14px;
    }
    
    .search-box input {
        padding: 9px 12px 9px 34px;
        font-size: 13px;
    }
    
    .assistant-name {
        font-size: 14px;
    }
    
    .assistant-desc {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .back-btn span {
        display: none;
    }
    
    .back-btn {
        padding: 8px;
    }
    
    .chat-header {
        padding: 12px 16px;
    }
    
    .chat-title {
        font-size: 15px;
    }
    
    .sidebar-header {
        padding: 14px 16px;
    }
    
    .sidebar-header h2 {
        font-size: 16px;
    }
    
    .assistant-card {
        padding: 12px;
    }
}