/* =========================================
   单页通栏布局系统 (One-Page Tool Layout)
   ========================================= */

/* --- 全局重置 --- */
:root {
    --primary: #2563EB;        /* 皇室蓝 */
    --primary-hover: #1D4ED8;
    --bg-page: #FFFFFF;        /* 纯白背景 */
    --text-main: #0F172A;
    --text-muted: #64748B;
    --border: #E2E8F0;
    --radius-lg: 16px;         /* 卡片大圆角 */
    --radius-md: 8px;          /* 控件圆角 */
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body, .container, .index, #app {
    background-color: var(--bg-page) !important;
    background-image: none !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", Roboto, sans-serif;
    color: var(--text-main);
}

a { text-decoration: none; color: inherit; }

/* --- 主容器：居中单栏 --- */
.main-container:not(.auth-wrapper) {
    max-width: 1200px;
    min-height: calc(100vh - 160px);
    margin: 0 auto;
    padding: 0 20px 40px;
    display: block;
    position: relative;
    z-index: 1;
}

/* --- 顶部标题 (Hero) --- */
.page-hero {
    text-align: center;
    margin-bottom: 48px;
}

.hero-title {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: -1px;
    background: linear-gradient(135deg, #0F172A 0%, #334155 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 16px;
    color: var(--text-muted);
}

/* --- 通用卡片样式 --- */
.app-card {
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 40px;        /* 宽敞的内边距 */
    margin-bottom: 32px;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.05); /* 优质的悬浮阴影 */
    transition: transform 0.2s;
}

.card-header { 
    margin-bottom: 24px; 
    padding-bottom: 16px; 
    border-bottom: 1px dashed var(--border); 
}

.card-title { 
    font-size: 18px; 
    font-weight: 600; 
    color: var(--text-main); 
    margin: 0; 
}

.card-body {
    /* 内容区域 */
}

.empty-state { 
    text-align: center; 
    color: var(--text-muted); 
    padding: 40px 0; 
    font-style: italic; 
}

/* --- 表单控件美化 (适配 ask.html) --- */
.form-group { 
    margin-bottom: 24px; 
}

.form-section {
    margin-bottom: 32px;
}

.section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
}

label { 
    display: block; 
    margin-bottom: 8px; 
    font-weight: 600; 
    font-size: 14px; 
    color: var(--text-main);
}

input[type="text"], 
input[type="password"],
input[type="number"],
textarea, 
select, 
.form-control {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background-color: #F8FAFC; /* 极浅灰背景 */
    color: var(--text-main);
    transition: all 0.2s;
    outline: none;
}

input:focus, 
textarea:focus, 
select:focus,
.form-control:focus {
    background-color: #FFFFFF;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

textarea, 
textarea.form-control { 
    min-height: 140px; 
    resize: vertical; 
}

/* --- 按钮美化 --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary,
.doMakeContent {
    width: 100%;               /* 通栏大按钮 */
    padding: 16px;
    background-color: var(--primary);
    color: white;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    margin-top: 10px;
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.2);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-primary:hover,
.doMakeContent:hover { 
    background-color: var(--primary-hover); 
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(37, 99, 235, 0.3);
}

.btn-outline {
    background-color: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 10px 16px;
}

.btn-outline:hover {
    background-color: #F8FAFC;
    color: var(--text-main);
    border-color: var(--text-muted);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 16px;
}

.btn-block { 
    width: 100%; 
    display: flex; 
}

/* --- 折叠面板 --- */
.collapse-panel {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-top: 24px;
}

.collapse-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #F8FAFC;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-main);
    transition: all 0.2s;
}

.collapse-header:hover {
    background: #F1F5F9;
}

.collapse-header i {
    transition: transform 0.3s;
}

.collapse-panel.open .collapse-header i {
    transform: rotate(180deg);
}

.collapse-body {
    display: none;
    padding: 24px;
    border-top: 1px solid var(--border);
    background: #FFFFFF;
}

.collapse-panel.open .collapse-body {
    display: block;
}

/* --- API 输出组 --- */
.api-output-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.api-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* --- 内容输出区 --- */
.content-output {
    max-height: 400px;
    overflow: auto;
    border-radius: var(--radius-md);
}

/* --- 旧导航栏样式已移除，使用新的 .app-header 样式 --- */

/* --- 辅助类 --- */
.text-center { text-align: center; }
.mt-4 { margin-top: 24px; }
.mb-4 { margin-bottom: 24px; }
.hidden { display: none !important; }

/* --- 动画 --- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    animation: fadeIn 0.4s ease-out;
}

/* --- 响应式 --- */
@media (max-width: 768px) {
    .main-container {
        margin: 30px auto;
        padding: 0 16px;
    }
    
    .page-hero {
        margin-bottom: 32px;
    }
    
    .hero-title {
        font-size: 28px;
    }
    
    .app-card {
        padding: 24px 20px;
        border-radius: 12px;
    }
    
    .btn-primary,
    .doMakeContent {
        padding: 14px;
    }
    
    .api-actions {
        flex-direction: column;
    }
    
    .api-actions .btn {
        width: 100%;
    }
}

/* --- Footer --- */
.footer {
    padding: 32px 16px;
    text-align: center;
    color: var(--text-muted);
    background: #FFFFFF;
    border-top: 1px solid var(--border);
    margin-top: 60px;
}

/* --- 返回顶部 --- */
.go-top {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 500;
}

.go-top:hover {
    background: var(--primary-hover);
}

/* --- 隐藏旧布局元素 --- */
.app-layout-wrapper,
.app-sidebar,
.sidebar-menu {
    display: none !important;
}


/* =========================================
   纯手工打造的配置区样式 (Hand-crafted UI)
   ========================================= */

/* 容器布局 */
.advanced-settings-content {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px dashed #E2E8F0;
    display: flex;
    flex-direction: column;
    gap: 24px;
    text-align: left; /* 强制左对齐 */
}

.config-group { 
    display: flex; 
    flex-direction: column; 
    gap: 10px; 
}

.config-row { 
    display: flex; 
    gap: 20px; 
}

.flex-1 { 
    flex: 1; 
}

/* 标题样式 */
.config-title {
    font-size: 14px;
    font-weight: 600;
    color: #334155;
}

/* 选项排列容器 */
.config-options {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

/* --- 自定义单选框 (Radio) --- */
.custom-radio {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

/* 隐藏原生 input */
.custom-radio input { 
    display: none; 
}

/* 手绘圆圈 */
.radio-mark {
    width: 18px;
    height: 18px;
    border: 1px solid #CBD5E1;
    border-radius: 50%;
    margin-right: 8px;
    position: relative;
    transition: all 0.2s;
    background: #fff;
}

/* 选中后的外圈颜色 */
.custom-radio input:checked + .radio-mark {
    border-color: #2563EB;
    background-color: #fff;
}

/* 选中后的中间实心点 */
.custom-radio input:checked + .radio-mark::after {
    content: '';
    position: absolute;
    top: 3px; 
    left: 3px;
    width: 10px; 
    height: 10px;
    background-color: #2563EB;
    border-radius: 50%;
}

.label-text { 
    font-size: 14px; 
    color: #475569; 
}

/* --- 自定义复选框 (Checkbox) --- */
.custom-checkbox {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.custom-checkbox input { 
    display: none; 
}

/* 手绘方块 */
.checkbox-mark {
    width: 18px;
    height: 18px;
    border: 1px solid #CBD5E1;
    border-radius: 4px;
    margin-right: 8px;
    position: relative;
    transition: all 0.2s;
    background: #fff;
}

/* 选中后的方块背景 */
.custom-checkbox input:checked + .checkbox-mark {
    background-color: #2563EB;
    border-color: #2563EB;
}

/* 选中后的对勾 (用 CSS 画) */
.custom-checkbox input:checked + .checkbox-mark::after {
    content: '';
    position: absolute;
    left: 6px; 
    top: 2px;
    width: 4px; 
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* --- 输入框与下拉框美化 --- */
.custom-input, 
.custom-select, 
.custom-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    background: #F8FAFC;
    font-size: 14px;
    color: #0F172A;
    outline: none;
    transition: border 0.2s;
}

.custom-input:focus, 
.custom-textarea:focus, 
.custom-select:focus {
    border-color: #2563EB;
    background: #fff;
}

.custom-textarea { 
    min-height: 80px; 
    resize: vertical; 
}

.custom-select-wrapper {
    position: relative;
}

/* 响应式适配 */
@media (max-width: 768px) {
    .config-row {
        flex-direction: column;
        gap: 16px;
    }
    
    .config-options {
        flex-direction: column;
        gap: 12px;
    }
}


/* --- 站点管理：居中布局专用 --- */
.site-page-header {
    text-align: center;
    margin-bottom: 40px;
    padding-top: 20px;
}
.site-title {
    font-size: 32px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 12px;
}
.site-subtitle {
    color: #94a3b8;
    font-size: 16px;
}

/* 顶部大按钮组 */
.site-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
}
.btn-hero {
    padding: 12px 32px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    color: white;
}
.btn-hero.blue {
    background-color: #2563EB;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.3);
}
.btn-hero.blue:hover {
    background-color: #1D4ED8;
    transform: translateY(-2px);
}

/* 表格内操作按钮组 */
.ops-btn-group {
    display: flex;
    gap: 8px;
}
.btn-op {
    padding: 6px 12px;
    font-size: 12px;
    border: 1px solid #E2E8F0;
    background: #fff;
    color: #475569;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-op:hover {
    border-color: #2563EB;
    color: #2563EB;
}
.btn-op.delete {
    color: #EF4444;
    border-color: #FECACA;
    background: #FEF2F2;
}
.btn-op.delete:hover {
    border-color: #EF4444;
    background: #FEE2E2;
}

/* 状态徽章 */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}
.status-warning {
    background-color: #FFF7ED;
    color: #EA580C;
    border: 1px solid #FED7AA;
}
.status-success {
    background-color: #F0FDF4;
    color: #16A34A;
    border: 1px solid #BBF7D0;
}


/* =========================================
   授权中心终极美化 (Auth Center Pro)
   ========================================= */

.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    min-height: calc(100vh - 90px);
    width: 100%;
    max-width: 100%;
    margin: -20px 0 0;
    padding: 0;
    background-color: #FFFFFF;
}

.auth-card {
    background: #FFFFFF;
    width: 440px; /* 黄金比例宽度 */
    max-width: 100%;
    padding: clamp(32px, 6vw, 48px) clamp(24px, 5vw, 40px);
    border-radius: 8px;
    border: 1px solid #F1F5F9;
    /* 高级悬浮阴影 */
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 
                0 8px 10px -6px rgba(0, 0, 0, 0.01);
    text-align: center;
    position: relative;
    top: -20px;
    margin: 0 auto;
}

/* 顶部图标 */
.auth-icon-wrap {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    transition: all 0.3s ease;
}

.auth-icon-wrap.icon-locked {
    background: #FEF2F2;
    color: #EF4444;
}

.auth-icon-wrap.icon-unlocked {
    background: #ECFDF5;
    color: #10B981;
}

.auth-icon-wrap.icon-pending {
    background: #EFF6FF;
    color: #3B82F6;
}

.auth-title {
    font-size: 22px;
    font-weight: 700;
    color: #0F172A;
    margin-bottom: 8px;
    letter-spacing: 0;
}

.auth-desc {
    font-size: 14px;
    color: #64748B;
    margin-bottom: 32px;
    line-height: 1.6;
}

/* 机器码卡片 */
.machine-code-box {
    background: #F8FAFC;
    border: 1px dashed #CBD5E1;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 28px;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.machine-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.machine-label {
    font-size: 11px;
    color: #94A3B8;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.machine-value {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 14px;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.copy-link {
    font-size: 13px;
    color: #2563EB;
    cursor: pointer;
    font-weight: 500;
    white-space: nowrap;
    margin-left: 10px;
}

.copy-link:hover {
    text-decoration: underline;
}

/* 输入框美化 */
.auth-wrapper .form-group {
    text-align: left;
    margin-bottom: 20px;
}

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 8px;
    display: block;
}

.form-control-lg {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    background: #F8FAFC;
    transition: all 0.2s;
    outline: none;
}

.form-control-lg:focus {
    border-color: #2563EB;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* 按钮美化 */
.auth-wrapper .btn-block {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    border-radius: 8px;
    justify-content: center;
    margin-top: 10px;
}

/* 授权信息列表 */
.license-list {
    text-align: left;
    background: #F0FDF4;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #BBF7D0;
}

.license-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
    color: #166534;
}

.license-item:last-child {
    margin-bottom: 0;
}

.license-item strong {
    font-weight: 600;
}

/* --- 全局强制纯白重置 (Global Reset) --- */
html, body {
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

/* 修复因移除 Tailwind 导致的布局塌陷 (基础补丁) */
ul, li { list-style: none; padding: 0; margin: 0; }


/* --- 极简底部专用样式 (Footer Reset) --- */
.app-footer {
    width: 100%;
    background-color: #FFFFFF; /* 确保纯白 */
    border-top: 1px solid #F1F5F9; /* 极淡分割线 */
    padding: 40px 0;
    margin-top: auto; /* 自动沉底 */
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    font-size: 14px;
}

.footer-links a {
    color: #64748B;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #2563EB; /* 悬停高亮色 */
}

.footer-links .sep {
    color: #E2E8F0;
    font-size: 12px;
}

.copyright {
    color: #94A3B8;
    font-size: 13px;
    margin: 0;
}

.version {
    margin-left: 8px;
    opacity: 0.6;
    font-family: monospace;
}


/* =========================================
   设置页面专用样式 (Settings Page)
   ========================================= */

/* 设置卡片容器 */
.setting-card {
    max-width: 900px;
    margin: 0 auto;
}

/* 设置区块 */
.setting-section {
    margin-bottom: 40px;
}

.setting-section:last-of-type {
    margin-bottom: 32px;
}

.setting-section .section-title {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.setting-section .section-title i {
    font-size: 20px;
    color: #2563EB;
}

/* 表单网格布局 */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

/* 空状态盒子 */
.empty-state-box {
    background: #f8fafc;
    border: 2px dashed #e2e8f0;
    border-radius: 12px;
    padding: 60px 40px;
    text-align: center;
}

.empty-icon {
    font-size: 64px;
    color: #cbd5e1;
    margin-bottom: 16px;
}

.empty-icon i {
    font-size: 64px;
}

.empty-text {
    font-size: 16px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 8px;
}

.empty-sub {
    font-size: 14px;
    color: #94a3b8;
    margin: 0;
}

/* 表单底部 */
.form-footer {
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: center;
}

/* 响应式适配 */
@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .empty-state-box {
        padding: 40px 20px;
    }
    
    .empty-icon {
        font-size: 48px;
    }
    
    .empty-icon i {
        font-size: 48px;
    }
}


/* --- AI 配置页专用样式 (Setting Page) --- */
.setting-card {
    max-width: 900px; /* 增加宽度以容纳折叠卡片 */
    margin: 0 auto;
    padding: 40px;
    background: #FFFFFF;
    border-radius: 16px;
    border: 1px solid #F1F5F9;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
}

/* 模型列表容器 */
.model-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

/* 单个模型卡片 */
.model-item {
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    overflow: hidden;
    background: #FFFFFF;
    transition: all 0.2s;
}

.model-item:hover {
    border-color: #CBD5E1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* 模型头部 (可点击折叠) */
.model-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #F8FAFC;
    cursor: pointer;
    transition: background 0.2s;
}

.model-header:hover {
    background: #F1F5F9;
}

.model-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    font-weight: 600;
    color: #1E293B;
}

.model-icon {
    font-size: 20px;
    color: #2563EB;
}

.provider-name {
    color: #334155;
}

/* 模型操作按钮 */
.model-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-text {
    background: none;
    border: none;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-text.delete {
    color: #EF4444;
}

.btn-text.delete:hover {
    background: #FEE2E2;
}

.arrow {
    font-size: 20px;
    color: #94A3B8;
    transition: transform 0.2s;
}

.arrow.rotate {
    transform: rotate(180deg);
}

/* 模型内容区 (折叠部分) */
.model-body {
    padding: 24px 20px;
    border-top: 1px solid #E2E8F0;
    display: none; /* 默认折叠 */
}

.model-body .form-group {
    margin-bottom: 20px;
}

.model-body .form-group:last-child {
    margin-bottom: 0;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #475569;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
    outline: none;
    background: #FFFFFF;
}

.form-control:focus {
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-control::placeholder {
    color: #94A3B8;
}

/* 添加模型按钮区域 */
.add-model-wrapper {
    margin-bottom: 32px;
}

.btn-dashed {
    width: 100%;
    padding: 16px;
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    background: #F8FAFC;
    color: #64748B;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-dashed:hover {
    border-color: #2563EB;
    background: #EFF6FF;
    color: #2563EB;
}

.btn-dashed i {
    font-size: 18px;
}

/* 底部保存按钮 */
.form-footer {
    text-align: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #F1F5F9;
}

/* 响应式适配 */
@media (max-width: 768px) {
    .setting-card {
        padding: 24px 16px;
    }
    
    .model-header {
        padding: 12px 16px;
    }
    
    .model-body {
        padding: 20px 16px;
    }
    
    .model-title {
        font-size: 14px;
    }
    
    .btn-dashed {
        padding: 14px;
        font-size: 13px;
    }
}


/* --- AI 模型列表专用样式 (Accordion Style) --- */
.setting-card {
    max-width: 800px;
    margin: 0 auto;
    padding: 30px;
    min-height: 400px; /* 保证空状态也有高度 */
}

/* 虚线添加按钮 */
.add-model-wrapper { 
    margin-top: 20px; 
    margin-bottom: 40px; 
}

.btn-dashed {
    width: 100%;
    border: 2px dashed #E2E8F0;
    background: #F8FAFC;
    color: #64748B;
    padding: 16px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-dashed:hover {
    border-color: #2563EB;
    color: #2563EB;
    background: #EFF6FF;
}

/* 模型卡片 (Accordion Item) */
.model-item {
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    margin-bottom: 16px;
    overflow: hidden;
    background: #fff;
    transition: box-shadow 0.2s;
}

.model-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* 卡片头部 */
.model-header {
    padding: 16px 20px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
}

.model-header:hover { 
    background: #FAFAFA; 
}

.model-title { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    font-weight: 600; 
    color: #1E293B; 
}

.model-icon { 
    color: #2563EB; 
    font-size: 18px; 
}

.model-actions { 
    display: flex; 
    align-items: center; 
    gap: 15px; 
}

.btn-text.delete { 
    color: #EF4444; 
    font-size: 13px; 
    background: none; 
    border: none; 
    cursor: pointer; 
}

.btn-text.delete:hover { 
    text-decoration: underline; 
}

.arrow { 
    color: #94A3B8; 
    transition: transform 0.2s; 
}

.arrow.rotate { 
    transform: rotate(180deg); 
}

/* 卡片内容区 */
.model-body {
    padding: 24px;
    border-top: 1px solid #F1F5F9;
    background: #fff;
    /* 默认不隐藏，或者在 JS 里控制初始状态 */
}


/* =========================================
   全局 Toast 通知系统样式 (Toast Notification)
   ========================================= */

/* Toast 容器 - 固定在屏幕顶部中央 */
.toast-container {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
    width: auto;
    max-width: 90%;
}

/* Toast 消息基础样式 */
.toast-message {
    background: rgba(15, 23, 42, 0.95);
    color: #FFFFFF;
    padding: 14px 24px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    min-width: 300px;
    max-width: 500px;
    text-align: center;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
    pointer-events: auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Toast 成功状态 */
.toast-success {
    background: rgba(16, 185, 129, 0.95);
}

/* Toast 错误状态 */
.toast-error {
    background: rgba(239, 68, 68, 0.95);
}

/* Toast 信息状态 */
.toast-info {
    background: rgba(59, 130, 246, 0.95);
}

/* Toast 显示动画 */
.toast-message.show {
    opacity: 1;
    transform: translateY(0);
}

/* Toast 隐藏动画 */
.toast-message.hide {
    opacity: 0;
    transform: translateY(-20px);
}

/* 响应式适配 */
@media (max-width: 768px) {
    .toast-container {
        top: 80px;
        max-width: 95%;
    }
    
    .toast-message {
        min-width: 250px;
        max-width: 100%;
        padding: 12px 20px;
        font-size: 13px;
    }
}




/* Grid 容器 */
.category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 24px;
}

/* 响应式断点 */
@media (max-width: 1200px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .category-grid {
        grid-template-columns: 1fr;
    }
}

/* 分类卡片 */
.category-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 20px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.category-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
}

/* 卡片头部 */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.category-name {
    font-size: 16px;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
}

.category-id {
    font-size: 12px;
    color: #94a3b8;
    background: #f8fafc;
    padding: 4px 8px;
    border-radius: 4px;
}

/* 卡片主体 */
.card-body {
    flex: 1;
    min-height: 80px;
}

.keyword-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.keyword-tag {
    display: inline-block;
    background: #dbeafe;
    color: #1e40af;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
}

.keyword-more {
    display: inline-block;
    color: #64748b;
    padding: 6px 12px;
    font-size: 13px;
    font-style: italic;
}

.keyword-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #94a3b8;
    gap: 8px;
}

.keyword-empty i {
    font-size: 32px;
}

.keyword-empty span {
    font-size: 14px;
}

/* 卡片底部 */
.card-footer {
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
}

.btn-edit {
    width: 100%;
    padding: 10px 16px;
    background: #3b82f6;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-edit:hover {
    background: #2563eb;
    transform: scale(1.02);
}

.btn-edit i {
    font-size: 16px;
}

/* ========================================
   模态框样式
   ======================================== */

/* 模态框遮罩层 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 模态框容器 */
.modal-container {
    background: #ffffff;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 模态框头部 */
.modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.modal-title {
    margin: 0;
    color: #1e293b;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.4;
}

.modal-close.close {
    appearance: none;
    border: 0;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    font-size: 26px;
    font-weight: 400;
    line-height: 1;
    padding: 0;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, transform 0.2s ease;
}

.modal-close.close:hover {
    color: #475569;
    transform: scale(1.06);
}

.modal-close.close:focus {
    outline: none;
    color: #2563eb;
}

.modal-body {
    padding: 22px 24px;
    overflow-y: auto;
}

.modal-textarea {
    font-family: inherit;
    min-height: 220px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    transition: border-color 0.2s;
}

.modal-textarea:focus {
    outline: none;
    border-color: #3b82f6;
}

.modal-hint {
    margin-top: 12px;
    margin-bottom: 0;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.text-muted {
    color: #64748b;
}

.modal-hint i {
    font-size: 16px;
}

/* 模态框底部 */
.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn-modal-cancel {
    padding: 10px 20px;
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-modal-cancel:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.btn-modal-save {
    padding: 10px 20px;
    background: #3b82f6;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-modal-save:hover {
    background: #2563eb;
}

.btn-modal-save i {
    font-size: 16px;
}


/* =========================================
   折叠卡片样式 (Accordion for AI Config)
   ========================================= */

/* 折叠卡片容器 */
.model-accordion {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 单个折叠项 */
.accordion-item {
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    overflow: hidden;
    background: #FFFFFF;
    transition: all 0.2s;
}

.accordion-item:hover {
    border-color: #CBD5E1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* 折叠头部 (可点击) */
.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    background: #F8FAFC;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.accordion-header:hover {
    background: #F1F5F9;
}

.accordion-header .header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    font-weight: 600;
    color: #1E293B;
}

.accordion-header .header-left i {
    font-size: 22px;
    color: #6366f1;
}

/* 箭头图标 */
.arrow-icon {
    font-size: 20px;
    color: #94A3B8;
    transition: transform 0.3s ease;
}

.arrow-icon.rotate {
    transform: rotate(180deg);
}

/* 折叠内容区 */
.accordion-body {
    padding: 24px;
    border-top: 1px solid #E2E8F0;
    background: #FFFFFF;
    display: none; /* 默认隐藏 */
}

/* 展开状态 */
.accordion-item.active .accordion-body {
    display: block;
}

/* 表单样式优化 */
.accordion-body .form-group {
    margin-bottom: 20px;
}

.accordion-body .form-group:last-of-type {
    margin-bottom: 0;
}

.accordion-body .form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #475569;
}

.accordion-body .form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
    outline: none;
    background: #FFFFFF;
}

.accordion-body .form-control:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.accordion-body .form-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #6b7280;
}

.accordion-body .form-hint a {
    color: #6366f1;
    text-decoration: none;
}

.accordion-body .form-hint a:hover {
    text-decoration: underline;
}

/* 信息提示框 */
.accordion-body .info-box {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    color: #1e40af;
    font-size: 14px;
    margin-top: 20px;
    margin-bottom: 20px;
}

.accordion-body .info-box i {
    font-size: 18px;
    margin-right: 8px;
}

/* 表单底部按钮区 */
.accordion-body .form-footer {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

/* 响应式适配 */
@media (max-width: 768px) {
    .accordion-header {
        padding: 14px 16px;
    }
    
    .accordion-body {
        padding: 20px 16px;
    }
    
    .accordion-header .header-left {
        font-size: 14px;
    }
    
    .accordion-header .header-left i {
        font-size: 20px;
    }
}
