/* ============================================================
   开源大模型集成 · ai-hub.css
   页面专属样式：Hero / 模型广场 / 对话工作台 / 转换工具箱
   导航与页脚桌面端样式由 ../../style.css 提供，移动端适配见文件底部
   ============================================================ */

/* ===== 工具 Hero ===== */
.tool-hero {
    position: relative;
    padding: 150px 0 72px;
    background: linear-gradient(180deg, #070b14 0%, #0e1524 55%, #141d2e 100%);
    overflow: hidden;
}
.tool-hero::before {
    content: '';
    position: absolute;
    top: -30%; right: -10%;
    width: 480px; height: 480px;
    background: radial-gradient(circle, rgba(26,110,255,0.14) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}
.tool-hero::after {
    content: '';
    position: absolute;
    bottom: -40%; left: -8%;
    width: 420px; height: 420px;
    background: radial-gradient(circle, rgba(255,107,53,0.10) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}
.tool-hero .container { position: relative; z-index: 2; }
.tool-hero .breadcrumb {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    margin-bottom: 28px;
    font-size: 13px;
    color: rgba(255,255,255,0.45);
}
.tool-hero .breadcrumb a {
    color: #60a5fa;
    text-decoration: none;
    font-weight: 500;
}
.tool-hero .breadcrumb a:hover { text-decoration: underline; }
.tool-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(26,110,255,0.15);
    border: 1px solid rgba(26,110,255,0.3);
    color: #60a5fa;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 18px;
    border-radius: 100px;
    margin-bottom: 22px;
}
.tool-hero h1 {
    font-size: clamp(30px, 5vw, 46px);
    font-weight: 900;
    color: #fff;
    line-height: 1.25;
    margin-bottom: 18px;
}
.tool-hero h1 .hl {
    background: linear-gradient(135deg, #ff6b35 0%, #ff4757 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.tool-hero-desc {
    font-size: 16px;
    color: rgba(255,255,255,0.68);
    line-height: 1.9;
    max-width: 760px;
    margin-bottom: 36px;
}
.tool-hero-stats {
    display: flex;
    gap: 48px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}
.ths .ths-num {
    font-size: 34px;
    font-weight: 900;
    color: #ff6b35;
    line-height: 1;
}
.ths .ths-num span { font-size: 18px; }
.ths .ths-label {
    font-size: 13px;
    color: rgba(255,255,255,0.5);
    margin-top: 8px;
}
.tool-hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.th-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 26px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-family: inherit;
}
.th-btn-primary {
    background: linear-gradient(135deg, #ff6b35 0%, #ff4757 100%);
    color: #fff;
    box-shadow: 0 8px 24px rgba(255,107,53,0.3);
}
.th-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(255,107,53,0.4); }
.th-btn-ghost {
    background: rgba(255,255,255,0.07);
    color: rgba(255,255,255,0.85);
    border: 1.5px solid rgba(255,255,255,0.18);
}
.th-btn-ghost:hover { background: rgba(255,255,255,0.13); color: #fff; transform: translateY(-2px); }

/* ===== 模型广场 ===== */
.model-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.model-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}
.model-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-4px);
    border-color: rgba(26,110,255,0.25);
}
.model-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}
.model-logo {
    width: 46px; height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 900;
    color: #fff;
    flex-shrink: 0;
}
.model-head-info { flex: 1; min-width: 0; }
.model-name { font-size: 16px; font-weight: 800; line-height: 1.3; }
.model-org { font-size: 12px; color: var(--text-light); margin-top: 2px; }
.model-free {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 100px;
    background: #dcfce7;
    color: #166534;
    white-space: nowrap;
    flex-shrink: 0;
}
.model-tag { font-size: 12px; color: var(--primary); font-weight: 600; margin-bottom: 10px; }
.model-feats {
    list-style: none;
    margin-bottom: 16px;
}
.model-feats li {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 3px 0 3px 16px;
    position: relative;
}
.model-feats li::before {
    content: '';
    position: absolute;
    left: 0; top: 10px;
    width: 5px; height: 5px;
    background: var(--primary);
    border-radius: 50%;
}
.model-use-btn {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    background: var(--primary-light);
    color: var(--primary);
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: var(--transition);
}
.model-use-btn:hover {
    background: var(--primary-gradient);
    color: #fff;
    border-color: transparent;
}

/* ===== 对话工作台 ===== */
.chat-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
    align-items: start;
}
.chat-side {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    position: sticky;
    top: 92px;
}
.side-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 800;
    margin-bottom: 18px;
    color: var(--text);
}
.side-title svg { color: var(--primary); }
.side-block { margin-bottom: 16px; }
.side-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}
.side-tip { font-weight: 400; color: var(--text-light); font-size: 12px; }
.side-input {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    color: var(--text);
    background: #fff;
    outline: none;
    transition: var(--transition);
}
.side-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,110,255,0.1); }
.key-row { display: flex; gap: 8px; }
.key-row .side-input { flex: 1; min-width: 0; }
.key-toggle {
    flex-shrink: 0;
    padding: 0 12px;
    border: 1.5px solid var(--border);
    background: #fff;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
}
.key-toggle:hover { border-color: var(--primary); color: var(--primary); }
.side-link {
    display: inline-block;
    font-size: 12px;
    color: var(--primary);
    margin-top: 6px;
    text-decoration: none;
}
.side-link:hover { text-decoration: underline; }
.side-range { width: 100%; accent-color: var(--primary); cursor: pointer; }
.side-actions { display: flex; gap: 10px; margin-top: 18px; }
.side-btn {
    flex: 1;
    padding: 10px 0;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    border: 1.5px solid var(--border);
    background: #fff;
    color: var(--text-secondary);
}
.side-btn:hover { border-color: var(--primary); color: var(--primary); }
.side-btn-primary {
    background: var(--primary-gradient);
    color: #fff;
    border-color: transparent;
}
.side-btn-primary:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(26,110,255,0.3); }
.side-note { font-size: 12px; color: var(--text-light); line-height: 1.7; margin-top: 14px; }

.chat-main {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.chat-messages {
    height: 480px;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: var(--bg-warm);
}
.msg { display: flex; gap: 10px; max-width: 88%; }
.msg-avatar {
    width: 34px; height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 900;
    color: #fff;
    flex-shrink: 0;
}
.msg-body { min-width: 0; flex: 1; }
.msg-meta { font-size: 11px; color: var(--text-light); margin-bottom: 4px; }
.msg-content {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.8;
    word-break: break-word;
    overflow-wrap: anywhere;
}
.msg-content p { margin-bottom: 8px; }
.msg-content p:last-child { margin-bottom: 0; }
.msg-user { align-self: flex-end; flex-direction: row-reverse; }
.msg-user .msg-avatar { background: var(--primary-gradient); }
.msg-user .msg-content { background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.msg-user .msg-meta { text-align: right; }
.msg-ai .msg-avatar { background: linear-gradient(135deg, #ff6b35 0%, #ff4757 100%); }
.msg-ai .msg-content { background: #fff; border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.msg-content pre {
    background: #0e1524;
    color: #e2e8f0;
    padding: 14px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.6;
    margin: 10px 0;
}
.msg-content code {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}
.msg-content :not(pre) > code {
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
}
.code-block { margin: 10px 0; border-radius: 8px; overflow: hidden; border: 1px solid rgba(255,255,255,0.08); }
.code-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    background: #1a2438;
    font-size: 11px;
    color: rgba(255,255,255,0.5);
}
.code-copy {
    border: none;
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.8);
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
}
.code-copy:hover { background: rgba(255,255,255,0.2); }
.code-block pre { margin: 0; border-radius: 0; }
.chat-empty {
    margin: auto;
    text-align: center;
    color: var(--text-light);
    font-size: 14px;
    line-height: 2;
}
.chat-empty .ce-icon { font-size: 40px; margin-bottom: 8px; }
.chat-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 12px 20px 0;
}
.chip {
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    padding: 6px 14px;
    border-radius: 100px;
    border: 1.5px solid var(--border);
    background: #fff;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}
.chip:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.chat-input-row {
    display: flex;
    gap: 12px;
    padding: 14px 20px 10px;
}
#chatInput {
    flex: 1;
    min-width: 0;
    resize: none;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.6;
    outline: none;
    transition: var(--transition);
    background: #fff;
}
#chatInput:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,110,255,0.1); }
.send-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 22px;
    border: none;
    border-radius: 10px;
    background: var(--primary-gradient);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 14px rgba(26,110,255,0.3);
}
.send-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(26,110,255,0.4); }
.send-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.chat-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 20px 16px;
    flex-wrap: wrap;
}
.mini-btn {
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    padding: 6px 12px;
    border-radius: 7px;
    border: 1.5px solid var(--border);
    background: #fff;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}
.mini-btn:hover { border-color: var(--primary); color: var(--primary); }
.chat-status { font-size: 12px; color: var(--text-light); }
.chat-status.busy { color: var(--warning); }
.chat-status.error { color: var(--danger); }
.typing-cursor {
    display: inline-block;
    width: 8px; height: 15px;
    background: var(--primary);
    vertical-align: -2px;
    margin-left: 2px;
    animation: blink 0.8s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ===== 转换工具箱 ===== */
.conv-layout {
    display: grid;
    grid-template-columns: 230px 1fr;
    gap: 20px;
    align-items: start;
}
.conv-tabs {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: sticky;
    top: 92px;
}
.conv-tab {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1.5px solid var(--border);
    background: var(--bg-card);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    color: var(--text-secondary);
    cursor: pointer;
    text-align: left;
    transition: var(--transition);
}
.conv-tab:hover { border-color: var(--primary); color: var(--primary); }
.conv-tab.active {
    background: var(--primary-gradient);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 14px rgba(26,110,255,0.3);
}
.conv-tab .tab-icon { font-size: 16px; }
.conv-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    min-width: 0;
}
.conv-head { margin-bottom: 18px; }
.conv-title { font-size: 17px; font-weight: 800; margin-bottom: 4px; }
.conv-desc { font-size: 13px; color: var(--text-secondary); }
.conv-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
.conv-col { min-width: 0; }
.conv-col-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
    gap: 8px;
    flex-wrap: wrap;
}
.conv-col-head > div { display: flex; gap: 6px; }
.conv-textarea {
    width: 100%;
    height: 260px;
    resize: vertical;
    padding: 14px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-family: 'SFMono-Regular', Consolas, Menlo, monospace;
    font-size: 13px;
    line-height: 1.7;
    outline: none;
    transition: var(--transition);
    background: var(--bg-warm);
    color: var(--text);
}
.conv-textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,110,255,0.1); background: #fff; }
.conv-output {
    width: 100%;
    height: 260px;
    margin: 0;
    overflow: auto;
    padding: 14px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-family: 'SFMono-Regular', Consolas, Menlo, monospace;
    font-size: 13px;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-all;
    background: var(--bg-warm);
    color: var(--text);
}
.conv-output.error { color: var(--danger); }
.conv-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.conv-run-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    background: var(--primary-gradient);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 14px rgba(26,110,255,0.3);
}
.conv-run-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(26,110,255,0.4); }
.conv-note {
    font-size: 12px;
    color: var(--text-light);
    align-self: center;
}

/* ===== 使用说明 ===== */
.note-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}
.note-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    transition: var(--transition);
}
.note-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-4px); border-color: rgba(26,110,255,0.2); }
.note-num {
    width: 40px; height: 40px;
    background: var(--primary-gradient);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 900;
    margin-bottom: 16px;
    box-shadow: 0 6px 16px rgba(26,110,255,0.3);
}
.note-card h4 { font-size: 16px; font-weight: 800; margin-bottom: 10px; }
.note-card p { font-size: 13px; color: var(--text-secondary); line-height: 1.8; }
.faq-list { max-width: 860px; margin: 0 auto; }
.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    overflow: hidden;
}
.faq-item summary {
    padding: 16px 20px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    cursor: pointer;
    list-style: none;
    position: relative;
    transition: var(--transition);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: '+';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: var(--primary);
    transition: var(--transition);
}
.faq-item[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq-item summary:hover { color: var(--primary); }
.faq-item p {
    padding: 0 20px 16px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* ============================================================
   移动端适配（导航/页脚/全部区块）
   规则与官网首页内联 <style> 保持一致
   ============================================================ */
@media (max-width: 1024px) {
    .model-grid { grid-template-columns: repeat(2, 1fr); }
    .chat-layout { grid-template-columns: 1fr; }
    .chat-side { position: static; }
    .conv-layout { grid-template-columns: 1fr; }
    .conv-tabs {
        position: static;
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 6px;
        -webkit-overflow-scrolling: touch;
    }
    .conv-tab { white-space: nowrap; flex-shrink: 0; }
    .note-grid { grid-template-columns: 1fr; }
    /* 页脚（与官网 1024px 规则一致） */
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    /* 顶部导航（与官网 768px 规则一致） */
    .nav-links {
        display: none;
        position: absolute;
        top: 72px;
        left: 0; right: 0;
        background: white;
        flex-direction: column;
        padding: 16px 24px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
        gap: 4px;
        border-bottom: 1px solid var(--border);
        z-index: 999;
    }
    .nav-links.active { display: flex; }
    .mobile-toggle { display: flex; }
    /* 页脚（与官网 768px 规则一致） */
    .footer-grid { grid-template-columns: 1fr; gap: 32px; }

    .tool-hero { padding: 120px 0 48px; }
    .tool-hero-stats { gap: 24px; }
    .ths .ths-num { font-size: 26px; }
    .tool-hero-actions .th-btn { width: 100%; justify-content: center; }
    .model-grid { grid-template-columns: 1fr; }
    .chat-messages { height: 380px; padding: 14px; }
    .msg { max-width: 100%; }
    .chat-input-row { flex-direction: column; }
    .send-btn { width: 100%; padding: 12px 0; justify-content: center; }
    .chat-toolbar { flex-direction: column; align-items: flex-start; }
    .conv-body { grid-template-columns: 1fr; }
    .conv-textarea, .conv-output { height: 200px; }
    .conv-panel { padding: 18px 16px; }
    .section { padding: 48px 0; }
}

@media (max-width: 480px) {
    .tool-hero-stats { gap: 18px; }
    .ths .ths-label { font-size: 11px; }
    .chat-chips { padding: 10px 14px 0; }
    .chat-input-row { padding: 12px 14px 8px; }
    .chat-toolbar { padding: 0 14px 14px; }
}


/* ===== 警示横幅（官网 drill 页为内联样式，本页独立补齐） ===== */
.warning-banner {
    background: linear-gradient(135deg, #fef2f2 0%, #fff7ed 100%);
    border: 1.5px solid rgba(220, 38, 38, 0.15);
    border-radius: var(--radius);
    padding: 20px 24px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 40px;
}
.warning-banner .warning-icon {
    width: 40px; height: 40px;
    background: var(--danger);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.warning-banner .warning-icon svg {
    width: 22px; height: 22px;
    color: #fff;
    flex-shrink: 0;
}
.warning-banner h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--danger);
    margin-bottom: 6px;
}
.warning-banner p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
}
@media (max-width: 768px) {
    .warning-banner { flex-direction: column; gap: 12px; padding: 16px 20px; margin-bottom: 28px; }
    .warning-banner .warning-icon { width: 36px; height: 36px; }
    .warning-banner h4 { font-size: 15px; }
    .warning-banner p { font-size: 12px; }
}
