/* ========================
   基础变量
   ======================== */
:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --secondary: #10b981;
    --accent: #8b5cf6;
    --warning: #f59e0b;
    --text: #1f2937;
    --text-light: #6b7280;
    --bg: #f9fafb;
    --card-bg: #ffffff;
    --border: #e5e7eb;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius: 12px;
}

/* ========================
   重置
   ======================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 18px;
}

/* ========================
   顶部标题区
   ======================== */
.header {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    padding: 60px 20px;
    text-align: center;
}

.header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
}

.header p {
    font-size: 1.3rem;
    opacity: 0.9;
}

/* ========================
   导航栏
   ======================== */
.nav {
    background: var(--card-bg);
    padding: 12px 20px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.nav-logo {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.25rem;
}

.nav-links {
    display: flex;
    gap: 12px;
    list-style: none;
    flex-wrap: wrap;
}

.nav-links a {
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    padding: 8px 18px;
    border-radius: 8px;
    transition: 0.2s;
    font-size: 1rem;
}

.nav-links a:hover,
.nav-links a.active {
    background: var(--primary);
    color: white;
}

/* ========================
   主容器
   ======================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 20px;
}

/* ========================
   章节
   ======================== */
.section {
    margin-bottom: 80px;
    padding: 40px;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px dashed var(--border);
}

.section-title h2 {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 8px;
}

.section-title p {
    color: var(--text-light);
    font-size: 1.1rem;
}

/* ========================
   提示卡片
   ======================== */
.tip-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: var(--radius);
    margin-bottom: 30px;
    text-align: center;
}

.tip-box h3 {
    margin-bottom: 12px;
    font-size: 1.5rem;
}

.tip-box p {
    font-size: 1.1rem;
}

/* ========================
   流式输出效果
   ======================== */
.stream-text {
    display: inline;
}

.stream-char {
    opacity: 0;
    animation: streamIn 0.05s forwards;
}

@keyframes streamIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 光标闪烁效果 */
.stream-cursor {
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background: white;
    margin-left: 2px;
    animation: cursorBlink 0.6s infinite;
    vertical-align: text-bottom;
}

@keyframes cursorBlink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* ========================
   模型卡片网格展示
   ======================== */
.models-grid {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.models-group h3 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.5rem;
    color: var(--text);
}

.models-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.model-card {
    background: var(--card-bg);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary);
    transition: transform 0.2s, box-shadow 0.2s;
}

.model-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.model-card h4 {
    color: var(--primary);
    margin-bottom: 6px;
    font-size: 1.4rem;
}

.model-card p {
    font-size: 1rem;
}

.model-card .company {
    color: var(--secondary);
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 10px;
    display: block;
}

.model-card .tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.model-card .tag {
    background: #e0f2fe;
    color: var(--primary);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.9rem;
}

/* ========================
   对比区（单句 vs 多轮）
   ======================== */
.compare-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.compare-box {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.compare-box.single { border-top: 4px solid var(--warning); }
.compare-box.multi  { border-top: 4px solid var(--secondary); }

.compare-box h3 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.4rem;
}

.compare-box.single h3 { color: var(--warning); }
.compare-box.multi  h3 { color: var(--secondary); }

/* ========================
   对话展示区
   ======================== */
.chat-compare {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 30px;
}

.chat-column {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.chat-column.no-context { border-top: 4px solid var(--warning); }
.chat-column.with-context { border-top: 4px solid var(--secondary); }

.chat-column-header {
    padding: 16px 20px;
    text-align: center;
}

.chat-column-header.no { background: #fef3c7; }
.chat-column-header.with { background: #d1fae5; }

.chat-column-header h3 {
    font-size: 1.2rem;
    margin-bottom: 6px;
}

.chat-column-header.no h3 { color: #d97706; }
.chat-column-header.with h3 { color: #059669; }

.chat-column-header p {
    font-size: 1rem;
    color: var(--text-light);
}

.chat-messages {
    padding: 20px;
    min-height: 200px;
}

.msg {
    display: flex;
    gap: 12px;
    margin-bottom: 14px;
}

.msg.user { flex-direction: row-reverse; }

.msg-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1rem;
    color: white;
}

.msg.assistant .msg-avatar { background: var(--primary); }
.msg.user .msg-avatar { background: var(--secondary); }

.msg-bubble {
    max-width: 80%;
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 1.1rem;
    line-height: 1.5;
}

.msg.assistant .msg-bubble {
    background: white;
    border: 1px solid var(--border);
}

.msg.user .msg-bubble {
    background: var(--primary);
    color: white;
}

.msg-bubble.wrong {
    background: #fee2e2;
    border: 1px solid #ef4444;
    color: #dc2626;
}

/* ========================
   JSON展示区
   ======================== */
.json-compare {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.json-column {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.json-column.no-context { border-top: 4px solid var(--warning); }
.json-column.with-context { border-top: 4px solid var(--secondary); }

.json-column-header {
    text-align: center;
    margin-bottom: 20px;
}

.json-column-header.no h3 { color: var(--warning); }
.json-column-header.with h3 { color: var(--secondary); }

.json-column-header h3 {
    font-size: 1.2rem;
    margin-bottom: 6px;
}

.json-column-header p {
    font-size: 1rem;
    color: var(--text-light);
}

/* 轮次JSON卡片 */
.json-round {
    background: var(--bg);
    border-radius: 8px;
    padding: 18px;
    margin-bottom: 14px;
}

.json-round:last-child {
    margin-bottom: 0;
}

.json-round-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.json-round-num {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1rem;
}

.json-round-title {
    font-size: 1rem;
    color: var(--text);
}

.json-round-title .req {
    color: var(--primary);
    font-weight: 600;
}

.json-round-title .resp {
    color: var(--secondary);
}

/* JSON代码块 */
.json-code {
    background: #1e293b;
    border-radius: 8px;
    padding: 14px 18px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.85rem;
    overflow-x: auto;
}

.json-code pre {
    color: #e2e8f0;
    margin: 0;
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.6;
}

.json-new {
    background: rgba(16, 185, 129, 0.25);
    border-radius: 2px;
}

.json-old {
    color: #94a3b8;
}

/* JSON结果标识 */
.json-result {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
}

.json-result.correct {
    background: #d1fae5;
    color: #059669;
}

.json-result.wrong {
    background: #fee2e2;
    color: #dc2626;
}

/* 流程图 */
.flow {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.flow-step {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    padding: 16px 20px;
    border-radius: var(--radius);
    text-align: center;
    min-width: 100px;
}

.flow-step .num {
    width: 32px;
    height: 32px;
    background: white;
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    font-weight: bold;
    font-size: 1rem;
}

.flow-step .txt {
    font-weight: 600;
    font-size: 1rem;
}

.flow-arrow {
    font-size: 2rem;
    color: var(--primary);
}

/* 聊天窗口 */
.chat-win {
    background: var(--bg);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

.chat-head {
    background: var(--primary);
    color: white;
    padding: 14px 18px;
    font-weight: 600;
    font-size: 1.1rem;
}

.chat-body {
    padding: 18px;
    min-height: 160px;
}

/* 对比表格 */
.compare-table {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.compare-table th,
.compare-table td {
    padding: 16px 20px;
    text-align: center;
    border-bottom: 1px solid var(--border);
    font-size: 1.05rem;
}

.compare-table th {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    font-size: 1.1rem;
}

.compare-table tr:last-child td { border-bottom: none; }

.compare-table td:first-child { text-align: left; }

.icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1rem;
}

.icon.yes { background: #d1fae5; color: #059669; }
.icon.no  { background: #fee2e2; color: #dc2626; }
.icon.half{ background: #fef3c7; color: #d97706; }

/* ========================
   System提示词板块
   ======================== */
/* 规则文件传递提示 */
.rules-notice {
    background: linear-gradient(135deg, #f97316, #ea580c);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    color: white;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

.rules-notice-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.rules-notice-content h4 {
    font-size: 1.3rem;
    margin-bottom: 8px;
}

.rules-notice-content p {
    font-size: 1.05rem;
    line-height: 1.5;
}

.rules-notice-content strong {
    background: rgba(255, 255, 255, 0.25);
    padding: 2px 8px;
    border-radius: 4px;
}

.system-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.system-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.system-card.intro { border-top: 4px solid var(--accent); }
.system-card.example { border-top: 4px solid var(--primary); }

.system-card h4 {
    font-size: 1.2rem;
    margin-bottom: 16px;
}

.system-card.intro h4 { color: var(--accent); }
.system-card.example h4 { color: var(--primary); }

.system-feature {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
    font-size: 1rem;
}

.system-feature:last-child {
    margin-bottom: 0;
}

.system-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
    background: #ede9fe;
    color: var(--accent);
}

.system-text {
    flex: 1;
}

.system-text strong {
    color: var(--text);
}

.system-text span {
    color: var(--text-light);
}

/* System JSON示例 */
.system-json-box {
    background: #1e293b;
    border-radius: var(--radius);
    padding: 0;
    overflow: hidden;
}

.system-json-header {
    background: #334155;
    color: #94a3b8;
    padding: 12px 18px;
    font-size: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.system-json-body {
    padding: 18px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
}

.system-json-body pre {
    color: #e2e8f0;
    margin: 0;
    white-space: pre-wrap;
    word-break: break-all;
}

/* System消息 - 粉色背景 */
.json-system {
    background: rgba(247, 112, 158, 0.2);
    color: #f472b6;
    padding: 1px 3px;
    border-radius: 2px;
}

/* User消息 - 蓝色 */
.json-user {
    background: rgba(59, 130, 246, 0.2);
    color: #7dd3fc;
    padding: 1px 3px;
    border-radius: 2px;
}

/* Assistant消息 - 绿色 */
.json-assistant {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
    padding: 1px 3px;
    border-radius: 2px;
}

/* System对比说明 */
.system-compare {
    background: linear-gradient(135deg, #f97316, #ea580c);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    color: white;
}

.system-compare h4 {
    font-size: 1.3rem;
    margin-bottom: 16px;
}

.system-compare-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.system-compare-item {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 16px;
}

.system-compare-item h5 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.system-compare-item p {
    font-size: 0.95rem;
    line-height: 1.5;
}

/* ========================
   Agent上下文管理板块
   ======================== */
.context-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.context-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.context-card.problem { border-top: 4px solid #ef4444; }
.context-card.solution { border-top: 4px solid var(--secondary); }

.context-card h4 {
    font-size: 1.2rem;
    margin-bottom: 16px;
}

.context-card.problem h4 { color: #dc2626; }
.context-card.solution h4 { color: #059669; }

.context-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
    font-size: 1rem;
}

.context-item:last-child {
    margin-bottom: 0;
}

.context-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.context-icon.warn { background: #fee2e2; color: #dc2626; }
.context-icon.good { background: #d1fae5; color: #059669; }

.context-text {
    flex: 1;
}

.context-text strong {
    color: var(--text);
}

.context-text span {
    color: var(--text-light);
}

/* 流程图示 */
.context-flow {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: var(--radius);
    padding: 30px;
    text-align: center;
    color: white;
}

.context-flow h4 {
    font-size: 1.3rem;
    margin-bottom: 20px;
}

.flow-steps {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.flow-step-item {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 14px 20px;
    font-size: 1rem;
}

.flow-arrow-item {
    font-size: 1.5rem;
    opacity: 0.7;
}

/* 引导提示 */
.context-lead {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: var(--radius);
    padding: 30px;
    text-align: center;
    color: white;
    margin-top: 30px;
}

.context-lead h4 {
    font-size: 1.4rem;
    margin-bottom: 12px;
}

.context-lead p {
    font-size: 1.1rem;
    line-height: 1.6;
}

.context-lead .highlight {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 6px;
    font-weight: 600;
}

/* ========================
   MCP Tool参数板块
   ======================== */
.mcp-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.mcp-card {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.mcp-card.intro { border-top: 4px solid #8b5cf6; }
.mcp-card.example { border-top: 4px solid var(--primary); }

.mcp-card h4 {
    font-size: 1.2rem;
    margin-bottom: 16px;
}

.mcp-card.intro h4 { color: #8b5cf6; }
.mcp-card.example h4 { color: var(--primary); }

.mcp-feature {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
    font-size: 1rem;
}

.mcp-feature:last-child {
    margin-bottom: 0;
}

.mcp-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
    background: #ede9fe;
    color: #8b5cf6;
}

.mcp-text {
    flex: 1;
}

.mcp-text strong {
    color: var(--text);
}

.mcp-text span {
    color: var(--text-light);
}

/* MCP JSON示例 */
.mcp-json-box {
    background: #1e293b;
    border-radius: var(--radius);
    overflow: hidden;
}

.mcp-json-header {
    background: #334155;
    color: #94a3b8;
    padding: 12px 18px;
    font-size: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mcp-json-body {
    padding: 18px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.8rem;
    line-height: 1.6;
}

.mcp-json-body pre {
    color: #e2e8f0;
    margin: 0;
    white-space: pre-wrap;
    word-break: break-all;
}

/* Tool消息 - 黄色 */
.json-tool {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    padding: 1px 3px;
    border-radius: 2px;
}

/* Tool结果 - 青色 */
.json-tool-result {
    background: rgba(20, 184, 166, 0.2);
    color: #2dd4bf;
    padding: 1px 3px;
    border-radius: 2px;
}

/* MCP工作流 */
.mcp-flow {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    border-radius: var(--radius);
    padding: 30px;
    text-align: center;
    color: white;
}

.mcp-flow h4 {
    font-size: 1.3rem;
    margin-bottom: 20px;
}

.mcp-flow-steps {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.mcp-flow-step {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 14px 20px;
    font-size: 1rem;
}

.mcp-flow-arrow {
    font-size: 1.5rem;
    opacity: 0.7;
}

/* 内置工具说明 */
.builtin-tools-notice {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    color: white;
    margin-top: 24px;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.builtin-tools-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.builtin-tools-content h4 {
    font-size: 1.3rem;
    margin-bottom: 8px;
}

.builtin-tools-content p {
    font-size: 1.05rem;
    line-height: 1.5;
    margin-bottom: 12px;
}

.builtin-tools-content strong {
    background: rgba(255, 255, 255, 0.25);
    padding: 2px 8px;
    border-radius: 4px;
}

.builtin-tools-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.builtin-tag {
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
}

/* ========================
   传递方式总结模块
   ======================== */
.delivery-table-wrap {
    margin-bottom: 24px;
}

.delivery-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.delivery-table th,
.delivery-table td {
    padding: 16px 20px;
    text-align: center;
    border-bottom: 1px solid var(--border);
    font-size: 1.05rem;
}

.delivery-table th {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    font-size: 1.1rem;
}

.delivery-table tr:last-child td {
    border-bottom: none;
}

.delivery-table td:first-child {
    text-align: left;
}

.delivery-type {
    display: flex;
    align-items: center;
    gap: 10px;
}

.delivery-icon {
    font-size: 1.5rem;
}

.delivery-type.system { color: #f97316; font-weight: 600; }
.delivery-type.tools { color: #3b82f6; font-weight: 600; }
.delivery-type.skills { color: #10b981; font-weight: 600; }

.role-tag {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
}

.role-tag.system { background: #fef3c7; color: #d97706; }
.role-tag.tools { background: #dbeafe; color: #2563eb; }
.role-tag.skills { background: #d1fae5; color: #059669; }

/* Skills触发时机 */
.skills-timing {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}

.timing-register {
    font-size: 0.9rem;
    color: var(--text);
}

.timing-register::before {
    content: "📋 ";
}

.timing-inject {
    font-size: 0.9rem;
    color: var(--text);
}

.timing-inject::before {
    content: "💉 ";
}

/* Skills传递位置 */
.skills-location {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}

.location-register {
    font-size: 0.9rem;
    color: var(--text);
}

.location-register::before {
    content: "📋 ";
}

.location-inject {
    font-size: 0.9rem;
    color: var(--text);
}

.location-inject::before {
    content: "💉 ";
}

/* JSON结构示意 */
.delivery-json-box {
    background: #1e293b;
    border-radius: var(--radius);
    overflow: hidden;
}

.delivery-json-header {
    background: #334155;
    color: #94a3b8;
    padding: 12px 18px;
    font-size: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.delivery-json-body {
    padding: 20px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
}

.delivery-json-body pre {
    color: #e2e8f0;
    margin: 0;
    white-space: pre-wrap;
    word-break: break-all;
}

/* JSON中的三种类型高亮 */
.json-delivery-system {
    background: rgba(249, 115, 22, 0.2);
    color: #fbbf24;
    padding: 1px 3px;
    border-radius: 2px;
}

.json-delivery-tools {
    background: rgba(59, 130, 246, 0.2);
    color: #7dd3fc;
    padding: 1px 3px;
    border-radius: 2px;
}

.json-delivery-skills {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
    padding: 1px 3px;
    border-radius: 2px;
}

/* Skills注册高亮 - 紫色 */
.json-delivery-skills-register {
    background: rgba(139, 92, 246, 0.2);
    color: #c4b5fd;
    padding: 1px 3px;
    border-radius: 2px;
}

/* Skills注册说明 */
.skills-register-note {
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: var(--radius);
    overflow: hidden;
    color: white;
    margin-top: 24px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.skills-register-header {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.skills-register-header h4 {
    font-size: 1.5rem;
    margin: 0;
}

.skills-register-header .skills-register-icon {
    font-size: 2rem;
}

.skills-register-body {
    padding: 24px;
}

.skills-register-item {
    margin-bottom: 20px;
}

.skills-register-item:last-child {
    margin-bottom: 0;
}

.register-phase {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 16px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.skills-register-item p {
    font-size: 1.05rem;
    line-height: 1.5;
    margin: 0;
}

.skills-register-item strong {
    background: rgba(255, 255, 255, 0.25);
    padding: 2px 8px;
    border-radius: 4px;
}

.skills-register-item code {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    border-radius: 6px;
}

/* ========================
   交互演示
   ======================== */
.demo-wrap {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
    max-width: 800px;
    margin: 0 auto;
}

.demo-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    justify-content: center;
}

.demo-tab {
    padding: 12px 26px;
    background: var(--bg);
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.2s;
    font-size: 1.05rem;
}

.demo-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary-dark);
}

.demo-tab:hover:not(.active) {
    border-color: var(--primary);
}

.demo-pane {
    display: none;
}

.demo-pane.active {
    display: block;
}

.demo-note {
    text-align: center;
    margin-top: 16px;
    color: var(--text-light);
    font-size: 1rem;
}

/* 输入框 */
.chat-input {
    padding: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 12px;
    background: white;
}

.chat-input input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1.1rem;
    outline: none;
}

.chat-input input:focus {
    border-color: var(--primary);
}

.chat-input button {
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    font-size: 1.1rem;
}

.chat-input button:hover {
    opacity: 0.9;
}

/* ========================
   代码块样式
   ======================== */
.code-block {
    background: #1e293b;
    border-radius: var(--radius);
    margin: 20px 0;
    overflow: hidden;
}

.code-header {
    background: #334155;
    color: #94a3b8;
    padding: 12px 18px;
    font-size: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.code-header span {
    font-weight: 600;
}

.code-badge {
    background: #475569;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.9rem;
}

.code-content {
    padding: 22px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 1rem;
    line-height: 1.7;
    overflow-x: auto;
}

.code-content pre {
    color: #e2e8f0;
    margin: 0;
    white-space: pre-wrap;
    word-break: break-all;
}

/* JSON语法高亮 */
.json-key { color: #7dd3fc; }
.json-str { color: #a5f3fc; }
.json-num { color: #fcd34d; }
.json-bool { color: #c4b5fd; }

/* ========================
   Footer
   ======================== */
.footer {
    background: var(--text);
    color: white;
    text-align: center;
    padding: 30px 20px;
    margin-top: 60px;
}

.footer p {
    font-size: 1.1rem;
}

.footer-note {
    margin-top: 8px;
    font-size: 1rem;
    opacity: 0.7;
}

/* ========================
   响应式
   ======================== */
@media (max-width: 768px) {
    body { font-size: 16px; }
    .header h1 { font-size: 2.2rem; }
    .header    { padding: 40px 20px; }

    .container { padding: 40px 16px; }

    .section {
        padding: 24px 16px;
        margin-bottom: 40px;
        border-radius: 12px;
    }

    .nav-inner {
        justify-content: center;
    }

    .nav-links {
        gap: 8px;
    }

    .nav-links a {
        padding: 6px 12px;
        font-size: 0.9rem;
    }

    .compare-grid {
        grid-template-columns: 1fr;
    }

    .chat-compare {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .json-compare {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .system-content {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .rules-notice {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }

    .rules-notice-icon {
        font-size: 2rem;
    }

    .rules-notice-content h4 {
        font-size: 1.1rem;
    }

    .rules-notice-content p {
        font-size: 0.95rem;
    }

    .system-compare-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .system-json-body {
        font-size: 0.75rem;
    }

    .context-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .mcp-content {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .mcp-json-body {
        font-size: 0.7rem;
    }

    .mcp-flow-steps {
        flex-direction: column;
    }

    .mcp-flow-arrow {
        transform: rotate(90deg);
    }

    .builtin-tools-notice {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }

    .builtin-tools-icon {
        font-size: 2rem;
    }

    .builtin-tools-content h4 {
        font-size: 1.1rem;
    }

    .builtin-tools-content p {
        font-size: 0.95rem;
    }

    .delivery-table th,
    .delivery-table td {
        padding: 12px 14px;
        font-size: 0.9rem;
    }

    .delivery-json-body {
        font-size: 0.75rem;
        padding: 14px;
    }

    .skills-register-note {
        border-radius: 12px;
    }

    .skills-register-header {
        padding: 16px 20px;
        justify-content: center;
    }

    .skills-register-header h4 {
        font-size: 1.2rem;
    }

    .skills-register-header .skills-register-icon {
        font-size: 1.5rem;
    }

    .skills-register-body {
        padding: 20px;
    }

    .register-phase {
        font-size: 0.9rem;
    }

    .skills-register-item p {
        font-size: 0.95rem;
    }

    .flow-steps {
        flex-direction: column;
    }

    .flow-arrow-item {
        transform: rotate(90deg);
    }

    .json-code {
        font-size: 0.75rem;
        padding: 10px 12px;
    }

    .msg-bubble {
        font-size: 1rem;
    }

    .flow {
        flex-direction: column;
    }

    .flow-arrow {
        transform: rotate(90deg);
    }

    .section-title h2 {
        font-size: 1.8rem;
    }

    .model-card {
        min-width: 260px;
    }
}
