:root {
    --primary: #1a73e8;
    --secondary: #0d47a1;
    --accent: #ff6b35;
    --light: #f8f9fa;
    --dark: #202124;
    --gray: #5f6368;
    --success: #34a853;
    --warning: #fbbc04;
    --danger: #ea4335;
    --border: #dadce0;
    --shadow: 0 4px 12px rgba(0,0,0,0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
    color: var(--dark);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
}

/* 侧边导航 */
.sidebar {
    width: 280px;
    background: linear-gradient(180deg, var(--primary), var(--secondary));
    color: white;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    padding: 20px 0;
    box-shadow: var(--shadow);
    z-index: 100;
    overflow-y: auto;
    transition: var(--transition);
}

.sidebar-header {
    text-align: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 20px;
}

.sidebar-header h3 {
    font-size: 1.4em;
    margin: 10px 0;
    font-weight: 600;
}

.sidebar-logo {
    width: 60px;
    height: 60px;
    background: white;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    color: var(--primary);
    font-size: 28px;
    box-shadow: var(--shadow);
}

.nav-menu {
    list-style: none;
    padding: 0 15px;
}

.nav-item {
    margin: 8px 0;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    border-radius: 12px;
    transition: var(--transition);
    font-weight: 500;
    gap: 12px;
}

.nav-link:hover, .nav-link.active {
    background: rgba(255,255,255,0.15);
    color: white;
    transform: translateX(4px);
}

.nav-link i {
    width: 24px;
    text-align: center;
}

/* 主内容区 */
.main-content {
    flex: 1;
    margin-left: 280px;
    min-height: 100vh;
}

.header {
    background: white;
    padding: 15px 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 90;
}

.page-title {
    font-size: 1.8em;
    color: var(--dark);
    font-weight: 600;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--light);
    border-radius: 25px;
    padding: 8px 15px;
    width: 280px;
}

.search-box input {
    border: none;
    background: transparent;
    outline: none;
    padding: 5px 10px;
    font-size: 0.95em;
    color: var(--gray);
    width: 100%;
}

.search-box i {
    color: var(--gray);
    margin-right: 8px;
}

.content {
    padding: 30px;
    max-width: 1400px;
    margin: 0 auto;
}

.card {
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 25px;
    margin-bottom: 25px;
    transition: var(--transition);
    border: 1px solid var(--border);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border);
}

.card-title {
    font-size: 1.5em;
    color: var(--primary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title i {
    background: var(--primary);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 流程图 */
.process-container {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
    margin: 30px 0;
}

.process-step {
    flex: 1;
    min-width: 220px;
    text-align: center;
    position: relative;
    padding: 20px;
}

.process-step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 50%;
    right: -10px;
    width: 20px;
    height: 2px;
    background: var(--primary);
    transform: translateY(-50%);
}

.step-number {
    width: 50px;
    height: 50px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3em;
    font-weight: bold;
    margin: 0 auto 15px;
}

.step-title {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 10px;
}

.step-desc {
    color: var(--gray);
    font-size: 0.95em;
}

/* 标签页 */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab {
    padding: 12px 24px;
    background: var(--light);
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    color: var(--gray);
}

.tab.active, .tab:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.tab-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 高亮样式 */
.highlight {
    background: linear-gradient(120deg, #e3f2fd, #bbdefb);
    padding: 2px 6px;
    border-radius: 6px;
    font-weight: 600;
    color: var(--primary);
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    margin: 5px;
}

.badge-primary { background: #deebff; color: var(--primary); }
.badge-success { background: #d1f0d1; color: var(--success); }
.badge-warning { background: #fff4e5; color: #d97706; }
.badge-danger { background: #ffebee; color: var(--danger); }

/* 提示框 */
.alert {
    padding: 16px 20px;
    border-radius: 12px;
    margin: 15px 0;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-weight: 500;
}

.alert i {
    font-size: 20px;
    min-width: 24px;
}

.alert-info {
    background: #e3f2fd;
    border-left: 4px solid var(--primary);
    color: #1565c0;
}

.alert-success {
    background: #e8f5e8;
    border-left: 4px solid var(--success);
    color: #2e7d32;
}

.alert-warning {
    background: #fff8e1;
    border-left: 4px solid var(--warning);
    color: #f57f17;
}

.alert-danger {
    background: #ffebee;
    border-left: 4px solid var(--danger);
    color: #c62828;
}

/* 对话示例 */
.chat-demo {
    background: #f1f3f4;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    font-family: 'Courier New', monospace;
}

.chat-item {
    margin: 10px 0;
    padding: 8px 12px;
    border-radius: 8px;
    max-width: 80%;
}

.chat-client {
    background: white;
    color: var(--dark);
    align-self: flex-end;
    margin-left: auto;
}

.chat-agent {
    background: var(--primary);
    color: white;
}

/* 响应式 */
@media (max-width: 992px) {
    .sidebar {
        width: 80px;
        padding: 20px 0;
    }
    
    .sidebar-header {
        display: none;
    }
    
    .nav-link span {
        display: none;
    }
    
    .nav-link {
        justify-content: center;
        padding: 16px;
    }
    
    .main-content {
        margin-left: 80px;
    }
    
    .process-step:not(:last-child)::after {
        display: none;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 15px;
    }
    
    .page-title {
        font-size: 1.5em;
    }
    
    .search-box {
        width: 180px;
    }
    
    .content {
        padding: 20px;
    }
    
    .card {
        padding: 20px;
    }
}

/* 动画效果 */
.fade-in {
    animation: fadeIn 0.6s ease forwards;
}

.stagger {
    opacity: 0;
    transform: translateY(20px);
    animation: slideUp 0.6s ease forwards;
}

@keyframes slideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

[data-delay="0"] { animation-delay: 0s; }
[data-delay="1"] { animation-delay: 0.2s; }
[data-delay="2"] { animation-delay: 0.4s; }
[data-delay="3"] { animation-delay: 0.6s; }
[data-delay="4"] { animation-delay: 0.8s; }

/* 复制按钮与可复制话术块样式 */
.copyable-script {
    position: relative;
}
.copyable-script .copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}
.copyable-script .copy-btn:hover {
    background: var(--accent);
}
.copyable-script .copy-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

/* 复制块标题：显示但不参与复制 */
.copyable-script .script-title {
    font-weight: 600;
    color: var(--primary);
    margin: 0 64px 6px 0; /* 右侧为复制按钮预留空间 */
}

/* 说明块样式 */
.explain-block {
    background: #fff8e1;
    border-left: 4px solid var(--warning);
    border-radius: 12px;
    padding: 14px;
    margin: 12px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    font-family: 'Courier New', monospace;
}
.explain-block .script-title {
    font-weight: 700;
    color: #d97706;
    margin-bottom: 8px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.explain-block .script-title::before {
    content: "⚠";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fde68a;
    color: #b45309;
    font-size: 12px;
}
.explain-block .script-content {
    line-height: 1.9;
    color: var(--dark);
}
@media (max-width: 768px) {
    .explain-block {
        padding: 12px;
        margin: 10px 0;
    }
}

/* 电话全流程话术：step卡片布局 */
#phone-scripts .step-card {
    background: #fff;
    border-left: 4px solid var(--primary);
    border-radius: 12px;
    padding: 16px 16px 12px 16px;
    margin: 16px 0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
#phone-scripts .step-card h3 {
    margin-top: 0;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}
#phone-scripts .step-card p {
    line-height: 1.7;
    margin: 8px 0;
}
#phone-scripts .step-card ul {
    padding-left: 24px;
}

/* 常见问题：统一step卡片样式，缓解拥挤感 */
#faq .step-card {
    background: #fff;
    border-left: 4px solid var(--primary);
    border-radius: 12px;
    padding: 16px 16px 12px 16px;
    margin: 16px 0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
#faq .step-card .script-content {
    line-height: 1.8;
    color: var(--gray);
}
#faq .step-card .script-title {
    margin-bottom: 8px;
}

/* 移动端优化：FAQ卡片间距与内边距适配小屏 */
@media (max-width: 768px) {
    #faq .step-card {
        padding: 14px 14px 10px 14px;
        margin: 12px 0;
    }
}

#connect-flow .step-card {
    background: #fff;
    border-left: 4px solid var(--primary);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
#connect-flow .step-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
#connect-flow .step-index {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}
#connect-flow .step-head h3 {
    margin: 0;
    font-size: 1.05em;
    color: var(--dark);
}
#connect-flow .step-body {
    padding-left: 22px;
}
#connect-flow .step-body li {
    margin: 6px 0;
    color: var(--gray);
}
.flow-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
@media (max-width: 992px) {
    .flow-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 768px) {
    .flow-grid {
        grid-template-columns: 1fr;
    }
    #connect-flow .step-card {
        padding: 14px;
    }
}

/* 移动端菜单按钮基础样式 */
.menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
}

/* 移动端适配：侧边栏改为抽屉、头部换行、遮罩 */
@media (max-width: 768px) {
    .header {
        gap: 10px;
        flex-wrap: wrap;
    }
    .menu-btn {
        display: inline-flex;
    }
    .page-title {
        order: 2;
        flex: 1;
    }
    .search-box {
        order: 3;
        width: 100%;
    }
    .sidebar {
        width: 260px;
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .nav-link span {
        display: inline;
    }
    .nav-link {
        justify-content: flex-start;
        padding: 14px 20px;
    }
    body.sidebar-open::after {
        content: "";
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.3);
        z-index: 90;
    }
}

#execution .step-card {
    background: #fff;
    border-left: 4px solid var(--primary);
    border-radius: 12px;
    padding: 16px;
    margin: 12px 0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
#execution .step-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
#execution .step-index {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}
#execution .step-head h3 {
    margin: 0;
    font-size: 1.05em;
    color: var(--dark);
}
#execution .step-body {
    padding-left: 22px;
}
#execution .step-body li {
    margin: 6px 0;
    color: var(--gray);
}
@media (max-width: 768px) {
    #execution .step-card { padding: 14px; }
}

.topic-images {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 8px 0;
}
.topic-images img {
    width: 240px;
    max-width: 100%;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.chat-box {
    background: var(--light);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    height: 380px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.msg {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    max-width: 70%;
}
.msg.assistant { flex-direction: row; }
.msg.user { flex-direction: row-reverse; align-self: flex-end; }
.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    min-width: 32px;
    min-height: 32px;
    flex-shrink: 0;
}
.msg.assistant .avatar { background: var(--gray); }
.bubble {
    padding: 10px 12px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}
.msg.assistant .bubble {
    background: #fff;
    color: var(--dark);
    border: 1px solid var(--border);
}
.msg.user .bubble {
    background: #4CAF50;
    color: #fff;
}
.chat-input {
    display: flex;
    gap: 10px;
    align-items: center;
}
.chat-input textarea {
    flex: 1;
    resize: vertical;
    min-height: 52px;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    background: #fff;
    transition: var(--transition);
}
.chat-input textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(26,115,232,0.15);
}
@media (max-width: 768px) {
    .msg { max-width: 85%; }
    .chat-box { height: 320px; }
}

.flat .card {
    box-shadow: none;
    border: 1px solid var(--border);
    border-radius: 10px;
}
.flat .chat-box {
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: none;
}
.flat .avatar {
    box-shadow: none;
}
.flat .bubble {
    box-shadow: none;
}
.flat .msg.assistant .bubble {
    background: #f6f7f8;
    color: var(--dark);
}
.flat .msg.user .bubble {
    background: #d9fdd3;
    color: var(--dark);
    border: 1px solid #c6e5be;
}
.flat .tab {
    box-shadow: none;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 18px;
    height: 52px;
    border-radius: 12px;
    border: 1px solid transparent;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}
.btn i { font-size: 16px; }
.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover { background: #1669d4; }
.btn-secondary {
    background: #eef2f7;
    color: var(--dark);
    border-color: var(--border);
}
.btn-secondary:hover { background: #e6ebf3; }

@media (max-width: 768px) {
    .btn { height: 44px; padding: 0 12px; font-size: 14px; }
    .btn .btn-text { display: none; }
}

.btn-accent {
    background: var(--accent);
    color: #fff;
}
.btn-accent:hover { background: #e85722; }

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
}
.modal.open { display: flex; }
.modal-content {
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--border);
    width: min(760px, 92vw);
    max-height: 80vh;
    overflow: auto;
    box-shadow: var(--shadow);
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}
.modal-body {
    padding: 16px;
    line-height: 1.8;
    color: var(--dark);
}
.modal-close {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 18px;
}
