/* 话术库网页样式 - 优化版 */
:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --bg-main: #fafbfc;
    --bg-card: #ffffff;
    --bg-sidebar: #f8f9fb;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --accent-orange: #f97316;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.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-main);
    color: var(--text-primary);
    line-height: 1.8;
    font-size: 15px;
}

/* 侧边导航栏 */
.sidebar {
    width: 200px;
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    position: fixed;
    left: 0;
    top: 0;
    padding: 15px 0;
    overflow-y: auto;
    z-index: 100;
}

.logo {
    font-size: 1.2rem;
    font-weight: 700;
    padding: 10px 18px 18px;
    color: var(--primary);
    border-bottom: 1px solid var(--border);
}

.search-box {
    padding: 12px 15px;
}

.search-box input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s;
}

.search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.nav-list {
    list-style: none;
    padding: 8px 0;
}

.nav-list li a {
    display: block;
    padding: 10px 18px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.nav-list li a:hover {
    background: rgba(99, 102, 241, 0.06);
    color: var(--primary);
}

.nav-list li a.active {
    background: rgba(99, 102, 241, 0.08);
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 500;
}

/* 主内容区 - 动态布局 */
.content {
    margin-left: 200px;
    padding: 25px 30px;
    max-width: 100%;
}

.header {
    text-align: center;
    padding: 30px 0 35px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 30px;
}

.header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.header h1 span {
    color: var(--primary);
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.tips {
    color: var(--text-light);
    font-size: 0.85rem;
    margin-top: 10px;
    padding: 8px 15px;
    background: var(--border-light);
    border-radius: 20px;
    display: inline-block;
}

/* 板块标题 */
.section {
    margin-bottom: 35px;
    scroll-margin-top: 20px;
}

.section h2 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    padding: 12px 18px;
    background: var(--bg-card);
    border-left: 4px solid var(--primary);
    border-radius: 0 8px 8px 0;
    margin-bottom: 18px;
    box-shadow: var(--shadow);
}

/* 卡片网格布局 */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 18px;
}

/* 卡片样式 */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 18px 20px;
    transition: all 0.2s;
    box-shadow: var(--shadow);
}

.card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-hover);
}

.card h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card h3::after {
    content: "📋";
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.card h3:hover::after {
    opacity: 1;
}

.card h3:hover {
    color: var(--accent-green);
}

.card ul {
    list-style: none;
}

.card ul li {
    padding: 8px 0 8px 20px;
    position: relative;
    color: var(--text-secondary);
    font-size: 0.92rem;
    border-bottom: 1px dashed var(--border-light);
    cursor: pointer;
    transition: all 0.15s;
    border-radius: 4px;
    margin: 0 -8px;
    padding-left: 28px;
    padding-right: 8px;
}

.card ul li:last-child {
    border-bottom: none;
}

.card ul li::before {
    content: "•";
    position: absolute;
    left: 10px;
    color: var(--primary-light);
    font-weight: bold;
}

.card ul li:hover {
    background: rgba(99, 102, 241, 0.05);
    color: var(--text-primary);
}

.card ul li:active {
    background: rgba(16, 185, 129, 0.1);
}

.card ul li.copied {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

/* 特殊卡片样式 */
.card.highlight {
    border-left: 3px solid var(--accent-orange);
}

.card.highlight h3 {
    color: var(--accent-orange);
}

.card.urgent {
    border-left: 3px solid var(--accent-red);
}

.card.urgent h3 {
    color: var(--accent-red);
}

/* 复制提示 */
.toast {
    position: fixed;
    bottom: 25px;
    right: 25px;
    background: var(--accent-green);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 30px 0;
    border-top: 1px solid var(--border);
    margin-top: 40px;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        width: 100%;
        height: auto;
        max-height: 50vh;
        bottom: 0;
        top: auto;
        left: 0;
        border-right: none;
        border-top: 1px solid var(--border);
        background: var(--bg-card);
        transform: translateY(calc(100% - 50px));
        transition: transform 0.3s ease;
        z-index: 200;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    }

    .sidebar.open {
        transform: translateY(0);
    }

    .logo {
        text-align: center;
        padding: 12px;
        cursor: pointer;
        border-bottom: none;
    }

    .logo::after {
        content: " ▲";
        font-size: 0.7rem;
    }

    .sidebar.open .logo::after {
        content: " ▼";
    }

    .search-box {
        display: none;
    }

    .sidebar.open .search-box {
        display: block;
    }

    .nav-list {
        display: none;
        max-height: 40vh;
        overflow-y: auto;
    }

    .sidebar.open .nav-list {
        display: block;
    }

    .nav-list li a {
        padding: 12px 20px;
        border-left: none;
    }

    .content {
        margin-left: 0;
        padding: 20px 15px 80px;
    }

    .header h1 {
        font-size: 1.4rem;
    }

    .cards-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .card {
        padding: 15px;
    }

    .section h2 {
        font-size: 1.05rem;
        padding: 10px 15px;
    }
}

/* 平板适配 */
@media (min-width: 769px) and (max-width: 1024px) {
    .sidebar {
        width: 180px;
    }

    .content {
        margin-left: 180px;
        padding: 20px;
    }

    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

/* 大屏适配 */
@media (min-width: 1400px) {
    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    }
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

/* 打印样式 */
@media print {
    .sidebar {
        display: none;
    }

    .content {
        margin-left: 0;
    }

    .card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}