/* ========== XIAMU 首页专用样式 ========== */

/* 链接卡片网格（用于操作手册等） */
.union-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin: 8px;
}

.union-grid a {
    text-decoration: none;
    color: #3498db;
    font-weight: bold;
    font-size: 18px;
    padding: 15px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    display: block;
    text-align: center;
    transition: background-color 0.3s, transform 0.2s, box-shadow 0.3s;
}

.union-grid a:hover {
    background-color: #ecf0f1;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

/* ========== AI 工具箱 ========== */

/* 搜索栏 */
.ai-search-bar {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
}

.ai-search-bar .mdi-magnify {
    color: #aaa;
    font-size: 20px;
    margin-right: 8px;
}

.ai-search-bar input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    color: #333;
    padding: 4px 0;
}

.ai-search-bar input::placeholder {
    color: #bbb;
}

/* 分类标签 */
.ai-category-tabs {
    display: flex;
    gap: 6px;
    padding: 10px 16px;
    border-bottom: 1px solid #eee;
    flex-wrap: wrap;
}

.ai-tab {
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 13px;
    color: #666;
    background: #f0f0f0;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.ai-tab:hover {
    background: #e0e0e0;
    color: #333;
}

.ai-tab.active {
    background: #3498db;
    color: #fff;
}

/* 卡片网格 */
.ai-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
    padding: 16px;
}

.ai-card {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 22px 10px 16px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.3s cubic-bezier(.4,0,.2,1);
    cursor: pointer;
    border: 1px solid #eee;
    min-height: 150px;
    position: relative;
}

.ai-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.12);
    border-color: #3498db;
}

.ai-card[data-cat]:not([data-cat="all"]).hidden {
    display: none;
}

/* Logo 图标容器 */
.ai-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 12px;
    flex-shrink: 0;
    background: #f5f5f5;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.ai-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
    border-radius: 10px;
}

/* 降级背景色（onerror 回退） */
.ai-deepseek { background: linear-gradient(135deg, #4F46E5, #7C3AED); }
.ai-yuanbao  { background: linear-gradient(135deg, #0052D9, #00A6FF); }
.ai-nami     { background: linear-gradient(135deg, #10B981, #34D399); }
.ai-doubao   { background: linear-gradient(135deg, #FF6B35, #FF8F00); }
.ai-qianwen  { background: linear-gradient(135deg, #1677FF, #69B1FF); }
.ai-jimeng   { background: linear-gradient(135deg, #F472B6, #EC4899); }
.ai-kimi     { background: linear-gradient(135deg, #8B5CF6, #A78BFA); }
.ai-glm      { background: linear-gradient(135deg, #059669, #34D399); }
.ai-xinghuo  { background: linear-gradient(135deg, #E53935, #FF6F00); }
.ai-wenxin   { background: linear-gradient(135deg, #1E88E5, #42A5F5); }
.ai-midjourney { background: linear-gradient(135deg, #000000, #333333); }
.ai-stable   { background: linear-gradient(135deg, #7B1FA2, #AB47BC); }
.ai-tongyi   { background: linear-gradient(135deg, #FF6F00, #FFA000); }
.ai-canva    { background: linear-gradient(135deg, #00C4CC, #00D4AA); }
.ai-copilot  { background: linear-gradient(135deg, #8957E5, #B388FF); }
.ai-cursor   { background: linear-gradient(135deg, #1a1a2e, #16213e); }
.ai-devin    { background: linear-gradient(135deg, #E91E63, #F06292); }
.ai-runway   { background: linear-gradient(135deg, #1A1A2E, #E94560); }
.ai-topaz    { background: linear-gradient(135deg, #0D47A1, #1565C0); }
.ai-perplexity { background: linear-gradient(135deg, #1E3A5F, #3B82F6); }

/* 名称 */
.ai-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    text-align: center;
    line-height: 1.3;
}

.ai-desc {
    font-size: 11px;
    color: #999;
    text-align: center;
    line-height: 1.3;
}

/* 标签徽章 */
.ai-tag {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    line-height: 1.4;
}

.tag-hot {
    background: #fff0e6;
    color: #e65100;
}

.tag-new {
    background: #e3f2fd;
    color: #1565c0;
}

/* 头部徽章 */
.header-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: normal;
    background: rgba(255,255,255,0.2);
    padding: 2px 10px;
    border-radius: 12px;
    margin-left: 8px;
    vertical-align: middle;
}

.group-box-footer {
    padding: 10px 16px;
    text-align: center;
    border-top: 1px solid #eee;
    font-size: 12px;
    color: #999;
}

/* ========== 分组容器 ========== */
.group-box {
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.group-box-header {
    background-color: #3498db;
    color: #fff;
    padding: 10px;
    text-align: center;
    font-size: 20px;
}

/* ========== 响应式 ========== */
@media (max-width: 1200px) {
    .ai-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 992px) {
    .ai-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .union-grid { grid-template-columns: repeat(3, 1fr); }
    .ai-grid { grid-template-columns: repeat(2, 1fr); }
    .ai-card { min-height: 130px; }
}

@media (max-width: 480px) {
    .union-grid { grid-template-columns: repeat(2, 1fr); }
    .ai-grid { grid-template-columns: repeat(2, 1fr); }
    .ai-card { min-height: 120px; padding: 16px 8px 12px; }
    .ai-icon { width: 44px; height: 44px; font-size: 14px; }
    .ai-name { font-size: 13px; }
    .ai-desc { font-size: 10px; }
}

/* ========== WPF.UI / Tool 动态加载内容样式 ========== */
.wpf-page-content {
    padding: 15px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(0,0,0,0.05);
    margin: 8px 0;
}

.wpf-page-content h1 {
    font-size: 24px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
    margin-bottom: 20px;
    color: #333;
}

.wpf-page-content h2 {
    font-size: 20px;
    margin: 20px 0 10px;
    color: #444;
}

.wpf-page-content h3 {
    font-size: 18px;
    margin: 16px 0 8px;
    color: #555;
}

.wpf-page-content p {
    line-height: 1.8;
    margin: 8px 0;
    color: #555;
}

.wpf-page-content blockquote {
    border-left: 4px solid #3498db;
    padding: 8px 16px;
    margin: 12px 0;
    background: #f8f9fa;
    color: #666;
}

.wpf-page-content pre {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 12px;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.6;
    margin: 10px 0;
}

.wpf-page-content code {
    font-family: Consolas, "Courier New", monospace;
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 13px;
}

.wpf-page-content pre code {
    background: none;
    padding: 0;
}

.wpf-page-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
}

.wpf-page-content th,
.wpf-page-content td {
    border: 1px solid #ddd;
    padding: 8px 12px;
    text-align: left;
}

.wpf-page-content th {
    background: #3498db;
    color: #fff;
}

.wpf-page-content tr:nth-child(even) {
    background: #f9f9f9;
}

.wpf-page-content img {
    max-width: 100%;
    border-radius: 4px;
    margin: 10px 0;
}

.wpf-page-content ul,
.wpf-page-content ol {
    padding-left: 24px;
    margin: 8px 0;
}

.wpf-page-content li {
    margin: 4px 0;
    color: #555;
}

.wpf-page-content .CodeMirror {
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
    line-height: 1.5;
}
