/* ============================================================
 * artist_home.php 书家首页样式
 * ============================================================ */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

/* ============ 主区域：左对话 + 右课程 ============ */
.main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 32px;
    align-items: start;
}

/* ============ 左：AI 对话区 ============ */
.chat-section {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 620px;
    position: sticky;
    top: 88px;
}
.chat-section .chat-header {
    background: linear-gradient(135deg, #4a6741 0%, #2c3e50 100%);
    color: #fff;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.chat-section .chat-header .avatar-mini {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "STKaiti", "KaiTi", serif;
    font-size: 18px;
    flex-shrink: 0;
}
.chat-section .chat-header .title {
    font-size: 15px;
    font-weight: 600;
}
.chat-section .chat-header .sub {
    font-size: 12px;
    opacity: 0.8;
    margin-top: 2px;
}

#chatMessages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    background: #f9f9f9;
    font-size: 14px;
    line-height: 1.7;
}
#chatMessages::-webkit-scrollbar { width: 6px; }
#chatMessages::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

.chat-system {
    text-align: center;
    color: #bbb;
    font-size: 12px;
    margin-bottom: 14px;
}
.chat-msg {
    display: flex;
    margin-bottom: 12px;
}
.chat-msg.user { justify-content: flex-end; }
.chat-msg.ai { justify-content: flex-start; }
.chat-msg .bubble {
    padding: 9px 13px;
    border-radius: 12px;
    max-width: 80%;
    word-break: break-word;
    white-space: pre-wrap;
    font-size: 13.5px;
}
.chat-msg.user .bubble {
    background: #4a6741;
    color: #fff;
    border-radius: 12px 12px 0 12px;
}
.chat-msg.ai .bubble {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px 12px 12px 0;
}
.chat-msg .loading { color: #999; font-size: 12px; }

.chat-upgrade {
    background: linear-gradient(135deg, #fdf6e3 0%, #fef9ec 100%);
    border: 1px solid #f0d98a;
    border-radius: 10px;
    padding: 14px;
    margin: 12px 0;
    text-align: center;
}
.chat-upgrade .upgrade-title {
    font-size: 14px;
    color: #b8860b;
    font-weight: 600;
    margin-bottom: 8px;
}
.chat-upgrade .upgrade-desc { font-size: 12px; color: #666; margin-bottom: 8px; }
.chat-upgrade .upgrade-list {
    text-align: left;
    list-style: none;
    font-size: 12px;
    color: #555;
    margin: 10px 0;
    padding-left: 8px;
}
.chat-upgrade .upgrade-list li {
    padding: 3px 0 3px 18px;
    position: relative;
}
.chat-upgrade .upgrade-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #b8860b;
    font-weight: 600;
}
.chat-upgrade .upgrade-btn {
    display: inline-block;
    background: linear-gradient(135deg, #d4a017 0%, #b8860b 100%);
    color: #fff;
    padding: 7px 20px;
    border-radius: 18px;
    font-size: 13px;
    margin-top: 6px;
}

.chat-input-area {
    border-top: 1px solid #eee;
    padding: 12px 16px;
    display: flex;
    gap: 8px;
    background: #fff;
    flex-shrink: 0;
}
.chat-input-area input {
    flex: 1;
    height: 40px;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 0 16px;
    font-size: 14px;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s;
}
.chat-input-area input:focus {
    border-color: #4a6741;
    box-shadow: 0 0 0 3px rgba(74,103,65,0.08);
}
.chat-input-area button {
    height: 40px;
    padding: 0 22px;
    background: #4a6741;
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}
.chat-input-area button:hover { background: #3d5636; }
.chat-input-area button:disabled {
    background: #aaa;
    cursor: not-allowed;
}

/* ============ 右：课程列表 ============ */
.courses-section {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    padding: 20px;
    min-height: 620px;
}
.courses-section .section-title {
    font-size: 17px;
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: 18px;
    padding-left: 12px;
    border-left: 4px solid #4a6741;
    letter-spacing: 1px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.courses-section .section-title .count {
    font-size: 12px;
    color: #999;
    font-weight: normal;
}

.course-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.course-card {
    display: flex;
    gap: 14px;
    background: #fafafa;
    border-radius: 10px;
    padding: 12px;
    border: 1px solid #f0f0f0;
    transition: all 0.25s;
    text-decoration: none;
    color: inherit;
}
.course-card:hover {
    background: #fff;
    border-color: #4a6741;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(74,103,65,0.12);
}
.course-card .cover {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.course-card .cover img {
    width: 150% !important;
    object-fit: cover;
}
.course-card .cover .placeholder {
    font-size: 32px;
    color: #d0d0d0;
    font-family: "STKaiti", "KaiTi", serif;
}
.course-card .info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.course-card .info .title {
    font-size: 15px;
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.course-card .info .meta {
    font-size: 12px;
    color: #999;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}
.course-card .info .meta .tag {
    background: #e8f0fa;
    color: #3498db;
    padding: 1px 8px;
    border-radius: 8px;
    font-size: 11px;
}
.course-card .info .action {
    font-size: 12px;
    color: #4a6741;
    font-weight: 600;
}
.course-card:hover .info .action {
    color: #3d5636;
}
.course-card .info .progress {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
}

.empty {
    text-align: center;
    color: #bbb;
    padding: 60px 20px;
    font-size: 14px;
}

/* ============ 底部：书家信息 ============ */
.artist-info {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    padding: 32px;
    display: flex;
    gap: 32px;
    align-items: flex-start;
}
.artist-info .avatar {
    width: 140px;
    height: 140px;
    border-radius: 12px;
    background: linear-gradient(135deg, #4a6741 0%, #2c3e50 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 56px;
    font-family: "STKaiti", "KaiTi", serif;
    flex-shrink: 0;
    overflow: hidden;
}
.artist-info .avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.artist-info .info {
    flex: 1;
}
.artist-info .info .label {
    font-size: 12px;
    color: #999;
    margin-bottom: 8px;
    letter-spacing: 2px;
}
.artist-info .name {
    font-size: 24px;
    color: #2c3e50;
    font-weight: 600;
    letter-spacing: 2px;
    margin-bottom: 12px;
}
.artist-info .meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}
.artist-info .meta .tag {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 13px;
    background: #e8f4e8;
    color: #4a6741;
}
.artist-info .meta .tag.blue { background: #e8f0fa; color: #3498db; }
.artist-info .meta .tag.gray { background: #f0f0f0; color: #888; }
.artist-info .bio {
    color: #555;
    font-size: 14px;
    line-height: 1.9;
}

/* ============ 响应式 ============ */
@media (max-width: 992px) {
    .main-grid {
        grid-template-columns: 1fr;
    }
    .chat-section {
        position: static;
        height: 500px;
    }
    .courses-section {
        min-height: auto;
    }
}
@media (max-width: 768px) {
    .container { padding: 16px; }
    .artist-info {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 24px;
    }
    .artist-info .avatar { width: 100px; height: 100px; font-size: 40px; }
    .artist-info .meta { justify-content: center; }
    #chatMessages { padding: 12px 14px; }
    .chat-msg .bubble { max-width: 88%; }
    .chat-input-area { padding: 10px 12px; }
    .chat-input-area button { padding: 0 18px; }
    .chat-section { height: 460px; }
}