/**
 * 猫课电商管理落地班 - 高级专业风格
 * 品牌色：猫课黄 #FFD700
 */

/* ========================================
   CSS变量 - 猫课品牌 + 专业商务
   ======================================== */
:root {
    /* 猫课品牌色 */
    --brand-yellow: #FFD700;
    --brand-yellow-light: #FFF8DC;
    --brand-yellow-dark: #E6C200;

    /* 主色调 - 专业蓝 */
    --primary-blue: #1a56db;
    --primary-blue-hover: #1e429f;
    --primary-blue-light: #e1effe;

    /* 辅助色 */
    --success-green: #0e9f6e;
    --warning-orange: #ff8a4c;
    --error-red: #f05252;
    --purple: #9061f9;
    --teal: #0694a2;

    /* 中性色 */
    --gray-900: #111827;
    --gray-800: #1f2937;
    --gray-700: #374151;
    --gray-600: #4b5563;
    --gray-500: #6b7280;
    --gray-400: #9ca3af;
    --gray-300: #d1d5db;
    --gray-200: #e5e7eb;
    --gray-100: #f3f4f6;
    --gray-50: #f9fafb;
    --white: #ffffff;

    /* 背景色 */
    --bg-primary: #fafbfc;
    --bg-card: #ffffff;
    --bg-dark: #0f172a;

    /* 边框 */
    --border-light: #e5e7eb;
    --border-medium: #d1d5db;

    /* 阴影 */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 0 40px rgba(255, 215, 0, 0.15);

    /* 圆角 */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-2xl: 24px;

    /* 过渡 */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg-primary);
    color: var(--gray-900);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

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

/* ========================================
   首页样式
   ======================================== */

/* 头部导航 */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 48px;
    padding: 20px 24px;
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
}

.logo {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-image {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    object-fit: cover;
}

.logo-text {
    font-size: 22px;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.02em;
}

.header-subtitle {
    font-size: 13px;
    color: var(--gray-500);
    padding: 6px 14px;
    background: var(--brand-yellow-light);
    border-radius: 20px;
    border: 1px solid var(--brand-yellow);
}

/* Hero区域 */
.hero {
    text-align: center;
    margin-bottom: 56px;
    padding: 64px 40px;
    background: linear-gradient(135deg, var(--white) 0%, var(--brand-yellow-light) 50%, var(--white) 100%);
    border-radius: var(--radius-2xl);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md), var(--shadow-glow);
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.1) 0%, transparent 50%);
    animation: pulse-bg 8s ease-in-out infinite;
}

@keyframes pulse-bg {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--brand-yellow);
    color: var(--gray-900);
    font-size: 13px;
    font-weight: 600;
    border-radius: 20px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.hero-badge svg {
    width: 16px;
    height: 16px;
}

.hero-title {
    font-size: 42px;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 16px;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.hero-title span {
    background: linear-gradient(135deg, var(--brand-yellow-dark), var(--warning-orange));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-desc {
    font-size: 18px;
    color: var(--gray-600);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.7;
}

/* 6大模块卡片网格 */
.modules-section {
    margin-bottom: 48px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 24px;
    background: var(--brand-yellow);
    border-radius: 2px;
}

.section-count {
    font-size: 13px;
    color: var(--gray-500);
    padding: 4px 12px;
    background: var(--gray-100);
    border-radius: 12px;
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

@media (max-width: 900px) {
    .modules-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .modules-grid {
        grid-template-columns: 1fr;
    }
}

/* 模块卡片 - 高级设计 */
.module-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: 28px;
    cursor: pointer;
    transition: all var(--transition-slow);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    overflow: hidden;
}

.module-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--card-accent, var(--brand-yellow));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-slow);
}

.module-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
    border-color: transparent;
}

.module-card:hover::before {
    transform: scaleX(1);
}

.module-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.module-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    transition: transform var(--transition-base);
}

.module-card:hover .module-icon {
    transform: scale(1.1) rotate(-5deg);
}

.module-number {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-400);
    padding: 4px 10px;
    background: var(--gray-50);
    border-radius: 8px;
}

.module-content {
    flex: 1;
}

.module-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.module-desc {
    font-size: 14px;
    color: var(--gray-600);
    margin-bottom: 12px;
    line-height: 1.6;
}

.module-subtitle {
    font-size: 12px;
    color: var(--gray-400);
    padding: 8px 12px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--card-accent, var(--brand-yellow));
}

.module-action {
    margin-top: auto;
    padding-top: 8px;
}

.btn-start {
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-md);
    color: var(--white);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.btn-start::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-start:hover::after {
    width: 300px;
    height: 300px;
}

.btn-start:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-start svg {
    transition: transform var(--transition-base);
}

.btn-start:hover svg {
    transform: translateX(4px);
}

/* 底部 */
.footer {
    text-align: center;
    padding: 32px;
    background: var(--white);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

.footer-tips {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.footer-tip {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--gray-600);
}

.footer-tip-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.footer-note {
    font-size: 12px;
    color: var(--gray-400);
}

/* ========================================
   对话页面样式
   ======================================== */
.chat-page {
    background: var(--gray-50);
}

.chat-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 960px;
    margin: 0 auto;
    background: var(--white);
    box-shadow: var(--shadow-lg);
}

/* 对话头部 */
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-light);
    background: var(--white);
    position: sticky;
    top: 0;
    z-index: 10;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--gray-600);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    background: var(--gray-50);
}

.back-btn:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    font-weight: 600;
}

.module-icon-small {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.model-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--gray-600);
}

.model-selector label {
    font-weight: 500;
}

.model-selector select {
    padding: 10px 14px;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    font-size: 13px;
    background: var(--white);
    cursor: pointer;
    transition: all var(--transition-base);
    font-weight: 500;
}

.model-selector select:hover {
    border-color: var(--gray-400);
}

.model-selector select:focus {
    outline: none;
    border-color: var(--brand-yellow);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.2);
}

/* 对话主区域 */
.chat-main {
    flex: 1;
    overflow-y: auto;
    padding: 28px;
    background: linear-gradient(180deg, var(--gray-50) 0%, var(--white) 100%);
}

.messages-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* 消息样式 */
.message {
    display: flex;
    gap: 14px;
    max-width: 85%;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message-user {
    flex-direction: row-reverse;
    margin-left: auto;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.message-user .message-avatar {
    background: linear-gradient(135deg, var(--brand-yellow), var(--brand-yellow-dark));
}

.message-content {
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    font-size: 15px;
    line-height: 1.7;
    box-shadow: var(--shadow-xs);
}

.message-assistant .message-content {
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: 4px 18px 18px 18px;
}

.message-user .message-content {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-blue-hover));
    color: var(--white);
    border-radius: 18px 4px 18px 18px;
}

/* Markdown样式 */
.message-content h1,
.message-content h2,
.message-content h3 {
    margin-top: 20px;
    margin-bottom: 10px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.message-content h1 { font-size: 20px; }
.message-content h2 { font-size: 18px; }
.message-content h3 { font-size: 16px; }

.message-content p {
    margin-bottom: 14px;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content ul,
.message-content ol {
    margin: 14px 0;
    padding-left: 24px;
}

.message-content li {
    margin-bottom: 8px;
}

.message-content strong {
    font-weight: 600;
    color: var(--gray-900);
}

.message-user .message-content strong {
    color: var(--white);
}

.message-content blockquote {
    border-left: 4px solid var(--brand-yellow);
    padding: 12px 16px;
    margin: 16px 0;
    background: var(--brand-yellow-light);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    color: var(--gray-700);
    font-style: normal;
}

.message-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 14px;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
}

.message-content th,
.message-content td {
    padding: 12px 16px;
    border: 1px solid var(--border-light);
    text-align: left;
}

.message-content th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-700);
}

.message-content code {
    background: var(--gray-100);
    padding: 3px 8px;
    border-radius: 6px;
    font-family: "SF Mono", Monaco, monospace;
    font-size: 13px;
    color: var(--gray-800);
}

.message-content pre {
    background: var(--gray-900);
    color: var(--gray-100);
    padding: 20px;
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin: 16px 0;
}

.message-content pre code {
    background: none;
    padding: 0;
    color: inherit;
    font-size: 13px;
}

/* 错误消息 */
.message-error .message-content {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--error-red);
}

/* 加载指示器 */
.loading-indicator {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    color: var(--gray-500);
    font-size: 14px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    max-width: 200px;
}

.loading-dots {
    display: flex;
    gap: 5px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background: var(--brand-yellow);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* 输入区域 */
.chat-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border-light);
    background: var(--white);
}

.input-container {
    display: flex;
    gap: 14px;
    margin-bottom: 14px;
}

.input-container textarea {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    font-size: 15px;
    resize: none;
    font-family: inherit;
    line-height: 1.5;
    max-height: 150px;
    transition: all var(--transition-base);
}

.input-container textarea:hover {
    border-color: var(--gray-300);
}

.input-container textarea:focus {
    outline: none;
    border-color: var(--brand-yellow);
    box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.15);
}

.input-container textarea::placeholder {
    color: var(--gray-400);
}

#send-btn {
    width: 52px;
    height: 52px;
    border: none;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--brand-yellow), var(--brand-yellow-dark));
    color: var(--gray-900);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
    flex-shrink: 0;
    box-shadow: var(--shadow-md);
}

#send-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

#send-btn:active:not(:disabled) {
    transform: translateY(0);
}

#send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 底部操作按钮 */
.footer-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    background: var(--white);
    color: var(--gray-600);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
}

.action-btn:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
    color: var(--gray-900);
}

/* ========================================
   响应式适配
   ======================================== */
@media (max-width: 768px) {
    .container {
        padding: 20px 16px;
    }

    .header {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .hero {
        padding: 40px 24px;
    }

    .hero-title {
        font-size: 28px;
    }

    .hero-desc {
        font-size: 16px;
    }

    .chat-header {
        flex-wrap: wrap;
        gap: 12px;
        padding: 14px 16px;
    }

    .chat-title {
        order: -1;
        width: 100%;
        justify-content: center;
    }

    .back-btn {
        padding: 8px 12px;
        font-size: 13px;
    }

    .model-selector label {
        display: none;
    }

    .message {
        max-width: 95%;
    }

    .chat-main {
        padding: 20px 16px;
    }

    .footer-actions {
        flex-direction: column;
    }

    .footer-tips {
        flex-direction: column;
        gap: 12px;
    }
}

/* ========================================
   动画效果
   ======================================== */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.module-card:nth-child(1) { animation-delay: 0s; }
.module-card:nth-child(2) { animation-delay: 0.05s; }
.module-card:nth-child(3) { animation-delay: 0.1s; }
.module-card:nth-child(4) { animation-delay: 0.15s; }
.module-card:nth-child(5) { animation-delay: 0.2s; }
.module-card:nth-child(6) { animation-delay: 0.25s; }
