/* 基础样式 */
:root {
    --primary-color: #00ff9d;
    --primary-color-rgb: 0, 255, 157;
    --secondary-color: #00b4ff;
    --background-color: #0a0a1a;
    --text-color: #ffffff;
    --card-bg: #1a1a2e;
    --modal-bg: rgba(10, 10, 26, 0.9);
    --border-color: #00ff9d;
    --font-main: 'Orbitron', sans-serif;
    --gradient-start: #00ff9d;
    --gradient-end: #00b4ff;
    --card-shadow: 0 8px 32px rgba(0, 255, 157, 0.2);
    --hover-shadow: 0 12px 40px rgba(0, 255, 157, 0.4);
    --glow-intensity: 0 0 20px;
}

body {
    font-family: var(--font-main);
    background: linear-gradient(135deg, #0a0a1a, #1a1a2e);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    min-height: 100vh;
}

/* 导航栏样式 */
header {
    background: rgba(10, 10, 26, 0.9);
    backdrop-filter: blur(15px);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 30px rgba(0, 255, 157, 0.4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
}

.nav-left {
    display: flex;
    align-items: center;
}

.nav-right {
    display: flex;
    align-items: center;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logo-container:hover {
    transform: translateY(-2px);
}

.logo-icon {
    width: 32px;
    height: 32px;
    filter: drop-shadow(0 0 10px var(--primary-color));
    transition: all 0.3s ease;
}

.logo-container:hover .logo-icon {
    filter: drop-shadow(0 0 15px var(--primary-color));
    transform: rotate(15deg);
}

.logo-text {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary-color);
    text-shadow: var(--glow-intensity) var(--primary-color);
    animation: glow 2s infinite alternate;
    letter-spacing: 1px;
}

.logo {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-right: auto;
    text-shadow: var(--glow-intensity) var(--primary-color);
    animation: glow 2s infinite alternate;
    letter-spacing: 1px;
}

@keyframes glow {
    from {
        text-shadow: 0 0 5px var(--primary-color);
    }
    to {
        text-shadow: 0 0 15px var(--primary-color), 0 0 20px var(--secondary-color);
    }
}

.loading-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 10, 26, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--primary-color);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: var(--background-color);
    font-size: 28px;
    display: none;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    border: none;
    box-shadow: var(--card-shadow),
                0 0 0 8px rgba(0, 255, 157, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
}

#back-to-top:hover {
    background: linear-gradient(135deg, var(--gradient-end), var(--gradient-start));
    transform: scale(1.15);
    box-shadow: var(--hover-shadow),
                0 0 0 10px rgba(0, 255, 157, 0.15);
}

.error-message {
    color: #ff5555;
    text-align: center;
    padding: 2rem;
    font-size: 1.2rem;
}

nav ul {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 1.5rem;
    align-items: center; /* 垂直居中对齐 */
    height: 100%; /* 确保ul高度与nav一致 */
}

nav ul li {
    margin: 0; /* 移除原有右边距 */
    display: flex;
    align-items: center; /* 垂直居中 */
}

nav ul li a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    padding: 0.8rem 1.2rem;
    border-radius: 20px;
    font-size: 1.1rem;
    white-space: nowrap; /* 防止文字换行 */
}

nav ul li a:hover {
    color: var(--primary-color);
    background: rgba(0, 255, 157, 0.1);
    transform: translateY(-2px);
    text-shadow: var(--glow-intensity) var(--primary-color);
}

/* 日期时间显示样式优化 */
#datetime-display {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    color: var(--text-color);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.2;
    padding: 0.5rem 0;
    margin: 0;
    height: 100%; /* 与导航项高度一致 */
}

#current-datetime {
    font-family: 'Orbitron', monospace;
    letter-spacing: 0.5px;
    text-align: right;
}

/* 导航栏整体布局优化 */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 2rem;
    height: 70px; /* 固定高度确保一致 */
}

.nav-left, .nav-right {
    display: flex;
    align-items: center;
    height: 100%; /* 确保左右部分高度一致 */
}

/* 设置按钮样式微调 */
#settings-btn {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 搜索框样式 */
.search-container {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
}

.search-box {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    border-radius: 30px;
    padding: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--card-shadow);
    max-width: 500px;
    width: 90%;
}

#search-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-color);
    padding: 0.8rem 1rem;
    font-size: 1rem;
    outline: none;
}

#search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

#search-btn {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: var(--background-color);
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

#search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 255, 157, 0.4);
}

/* 分类标签样式 */
.category-tabs {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
    gap: 1rem;
    flex-wrap: wrap;
}

.tab-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
    color: var(--text-color);
    padding: 1rem 2rem;
    cursor: pointer;
    border-radius: 30px;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 1.1rem;
    backdrop-filter: blur(10px);
}

.tab-btn.active,
.tab-btn:hover {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: var(--background-color);
    border-color: transparent;
    transform: translateY(-3px);
    box-shadow: var(--card-shadow);
}

/* 卡片容器样式 */
.cards-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    padding: 1.5rem;
    max-width: 1600px;
    margin: 0 auto;
}

/* 响应式适配 */
@media (min-width: 1201px) {
    .cards-container {
        grid-template-columns: repeat(4, 1fr);
        max-width: 1600px;
    }
}

@media (max-width: 1200px) {
    .cards-container {
        grid-template-columns: repeat(3, 1fr);
        max-width: 1200px;
    }
}

@media (max-width: 1200px) {
    .cards-container {
        grid-template-columns: repeat(2, 1fr);
        max-width: 900px;
    }
}

@media (max-width: 768px) {
    .cards-container {
        grid-template-columns: 1fr;
        max-width: 500px;
        padding: 1rem;
    }
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--modal-bg);
    z-index: 200;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.modal-content {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    max-width: 400px;
    width: 90%;
}

.modal-content h3 {
    color: var(--primary-color);
    margin: 0 0 1.5rem 0;
    text-align: center;
    font-size: 1.5rem;
}

.settings-group {
    margin-bottom: 1.5rem;
}

.settings-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--text-color);
}

.settings-group select {
    width: 100%;
    padding: 0.5rem;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    border-radius: 8px;
    margin-top: 0.5rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.modal-actions button {
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.modal-actions button:first-child {
    background: var(--primary-color);
    color: var(--background-color);
}

.modal-actions button:last-child {
    background: transparent;
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

/* 页脚样式 */
.site-footer {
    background: rgba(10, 10, 26, 0.8);
    backdrop-filter: blur(15px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 3rem 2rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.footer-logo-icon {
    width: 40px;
    height: 40px;
    filter: drop-shadow(0 0 15px var(--primary-color));
    transition: all 0.3s ease;
}

.footer-logo:hover .footer-logo-icon {
    filter: drop-shadow(0 0 20px var(--primary-color));
    transform: rotate(15deg);
}

.footer-logo-text {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    text-shadow: var(--glow-intensity) var(--primary-color);
    animation: glow 2s infinite alternate;
}

.footer-description {
    text-align: center;
    line-height: 1.8;
}

.footer-description p {
    margin: 0.5rem 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
}

.footer-description p:first-child {
    font-weight: 600;
    color: var(--text-color);
    font-size: 1.2rem;
}

/* 响应式适配 */
@media (max-width: 768px) {
    .site-footer {
        padding: 2rem 1rem;
    }
    
    .footer-logo {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .footer-logo-text {
        font-size: 1.5rem;
    }
    
    .footer-description p {
        font-size: 1rem;
    }
}

.modal-actions button:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-shadow);
}

/* 表单样式 */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.5rem;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-color);
}

button:not(.test-connection-btn):not(.save-config-btn) {
    background-color: var(--primary-color);
    color: var(--background-color);
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover {
    background-color: var(--secondary-color);
}

/* 卡片样式 - 优化版 */
.card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    border-radius: 20px;
    padding: 1.2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: var(--card-shadow);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 160px;
    opacity: 0;
    transform: translateY(20px);
    animation: cardAppear 0.6s ease forwards;
}

@keyframes cardAppear {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 卡片延迟出现效果 */
.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }
.card:nth-child(4) { animation-delay: 0.4s; }
.card:nth-child(5) { animation-delay: 0.5s; }
.card:nth-child(6) { animation-delay: 0.6s; }
.card:nth-child(7) { animation-delay: 0.7s; }
.card:nth-child(8) { animation-delay: 0.8s; }
.card:nth-child(9) { animation-delay: 0.9s; }
.card:nth-child(10) { animation-delay: 1.0s; }

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 157, 0.1), transparent);
    transition: left 0.5s ease;
}

.card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--hover-shadow);
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.12);
}

.card:hover::before {
    left: 100%;
}

.card-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    gap: 0.8rem;
}

.card-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    color: var(--background-color);
    flex-shrink: 0;
}

.card h3 {
    color: var(--primary-color);
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
    text-shadow: var(--glow-intensity) var(--primary-color);
    flex: 1;
}

.card p {
    color: var(--text-color);
    opacity: 0.9;
    margin: 0 0 1.5rem 0;
    line-height: 1.6;
    font-weight: 300;
    flex: 1;
}

.card-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    min-width: 0;
}

.card-category {
    flex-shrink: 0;
    white-space: nowrap;
}

.card-actions {
    flex-shrink: 0;
    display: flex;
    gap: 0.8rem;
}

.card-category {
    background: rgba(0, 255, 157, 0.1);
    color: var(--primary-color);
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid rgba(0, 255, 157, 0.3);
}

.card-actions {
    display: flex;
    gap: 0.8rem;
}

.card-actions a {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: var(--background-color);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.card-actions a:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 255, 157, 0.4);
}

.card-actions button {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.card-actions button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* 科幻风格铅笔编辑按钮 */
.edit-icon-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    background: transparent !important;
    border: none !important;
}

.edit-icon-btn:hover {
    transform: scale(1.3) rotate(15deg);
}

.edit-icon-btn::before {
    content: '✒️';
    font-size: 1.3rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.edit-icon-btn:hover::before {
    transform: scale(1.3) rotate(15deg);
}

/* 现代描述文字样式 */
.card p {
    color: var(--text-color);
    opacity: 0.85;
    margin: 0 0 1.5rem 0;
    line-height: 1.6;
    font-weight: 400;
    flex: 1;
    font-size: 0.95rem;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.03), 
        rgba(255, 255, 255, 0.08), 
        rgba(255, 255, 255, 0.03)
    );
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(8px);
    text-align: center;
}

.card p::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, 
        transparent 0%, 
        rgba(var(--primary-color-rgb), 0.1) 50%, 
        transparent 100%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover p::before {
    opacity: 1;
}

/* 网站域名显示样式 */
.card-domain {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    background: transparent;
    padding: 0.3rem 0.5rem;
    border-radius: 0;
    border: none;
    transition: all 0.3s ease;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
    text-transform: lowercase;
    opacity: 0.8;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card:hover .card-domain {
    color: rgba(0, 255, 157, 1);
    background: transparent;
    transform: translateY(-1px);
    opacity: 1;
    text-shadow: 0 0 8px rgba(0, 255, 157, 0.4);
}

/* 分类颜色标识 */
.card[data-category="tools"] .card-category {
    background: rgba(0, 180, 255, 0.1);
    color: #00b4ff;
    border-color: rgba(0, 180, 255, 0.3);
}

.card[data-category="entertainment"] .card-category {
    background: rgba(255, 105, 180, 0.1);
    color: #ff69b4;
    border-color: rgba(255, 105, 180, 0.3);
}

.card[data-category="learning"] .card-category {
    background: rgba(76, 175, 80, 0.1);
    color: #4caf50;
    border-color: rgba(76, 175, 80, 0.3);
}

.card[data-category="development"] .card-category {
    background: rgba(156, 39, 176, 0.1);
    color: #9c27b0;
    border-color: rgba(156, 39, 176, 0.3);
}

.card[data-category="design"] .card-category {
    background: rgba(255, 152, 0, 0.1);
    color: #ff9800;
    border-color: rgba(255, 152, 0, 0.3);
}

/* 深色模式样式 */
body.dark-mode {
    --background-color: #0a0a1a;
    --text-color: #ffffff;
    --card-bg: #1a1a2e;
    --modal-bg: rgba(10, 10, 26, 0.95);
    --border-color: #00ff9d;
}



/* 主题风格变量定义 */
body[data-theme="default"] {
    --primary-color: #00ff9d;
    --secondary-color: #00b4ff;
    --gradient-start: #00ff9d;
    --gradient-end: #00b4ff;
}

body[data-theme="cyberpunk"] {
    --primary-color: #ff00ff;
    --primary-color-rgb: 255, 0, 255;
    --secondary-color: #00ffff;
    --gradient-start: #ff00ff;
    --gradient-end: #00ffff;
    --background-color: #0a0a1a;
    --card-bg: #1a1a2e;
}

body[data-theme="futuristic"] {
    --primary-color: #00ffff;
    --primary-color-rgb: 0, 255, 255;
    --secondary-color: #ff6b6b;
    --gradient-start: #00ffff;
    --gradient-end: #ff6b6b;
    --background-color: #0a0a1a;
    --card-bg: #1a1a2e;
}

body[data-theme="pastoral"] {
    --primary-color: #4caf50;
    --primary-color-rgb: 76, 175, 80;
    --secondary-color: #8bc34a;
    --gradient-start: #4caf50;
    --gradient-end: #8bc34a;
    --background-color: #f5f5f5;
    --card-bg: #ffffff;
    --text-color: #333333;
}

body[data-theme="ocean"] {
    --primary-color: #2196f3;
    --primary-color-rgb: 33, 150, 243;
    --secondary-color: #03a9f4;
    --gradient-start: #2196f3;
    --gradient-end: #03a9f4;
    --background-color: #e3f2fd;
    --card-bg: #ffffff;
    --text-color: #333333;
}

/* 深色模式下的模态框样式 */
body.dark-mode .modal-content {
    background: var(--card-bg);
    border-color: var(--border-color);
}

body.dark-mode .settings-group label {
    color: var(--text-color);
}

body.dark-mode .settings-group select {
    background-color: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-color);
}

body.dark-mode .modal-actions button:last-child {
    color: var(--text-color);
    border-color: var(--border-color);
}



/* 海洋主题在深色模式下的特殊处理 */
body.dark-mode[data-theme="ocean"] {
    --text-color: #ffffff;
    --background-color: #0a0a1a;
    --card-bg: #1a1a2e;
}

body.dark-mode[data-theme="ocean"] .modal-content {
    background: #1a1a2e;
    border-color: #2196f3;
}

body.dark-mode[data-theme="ocean"] .settings-group label {
    color: #ffffff;
}

body.dark-mode[data-theme="ocean"] .settings-group select {
    background-color: #1a1a2e;
    border-color: #2196f3;
    color: #ffffff;
}

body.dark-mode[data-theme="ocean"] .modal-actions button:last-child {
    color: #ffffff;
    border-color: #2196f3;
}

/* 田园主题在深色模式下的特殊处理 */
body.dark-mode[data-theme="pastoral"] {
    --text-color: #ffffff;
    --background-color: #0a0a1a;
    --card-bg: #1a1a2e;
}

body.dark-mode[data-theme="pastoral"] .modal-content {
    background: #1a1a2e;
    border-color: #4caf50;
}

body.dark-mode[data-theme="pastoral"] .settings-group label {
    color: #ffffff;
}

body.dark-mode[data-theme="pastoral"] .settings-group select {
    background-color: #1a1a2e;
    border-color: #4caf50;
    color: #ffffff;
}

body.dark-mode[data-theme="pastoral"] .modal-actions button:last-child {
    color: #ffffff;
    border-color: #4caf50;
}





/* 无搜索结果样式 */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-color);
}

.no-results h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.no-results p {
    opacity: 0.8;
    font-size: 1.1rem;
}

/* 大模型页面样式 */
.model-main {
    display: grid;
    grid-template-columns: minmax(300px, 0.25fr) minmax(700px, 1fr); /* 增加配置容器宽度 */
    gap: 2rem;
    padding: 2rem;
    max-width: 1800px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.model-config,
.model-chat {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    backdrop-filter: blur(10px);
}



.section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.section-header h2 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    text-shadow: var(--glow-intensity) var(--primary-color);
}

.section-header p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
}

/* 大模型配置表单样式 */
#model-config-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

#model-config-form .form-group {
    margin-bottom: 1rem;
    display: block;
}

#model-config-form .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-weight: 600;
}

#model-config-form .form-group input,
#model-config-form .form-group select,
#model-config-form .form-group textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0.8rem 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-color);
    font-size: 1rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

#model-config-form .form-group input:focus,
#model-config-form .form-group select:focus,
#model-config-form .form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 255, 157, 0.2);
}

#model-config-form .form-group input::placeholder,
#model-config-form .form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

#temperature {
    margin-right: 1rem;
}

#temperature-value {
    color: var(--primary-color);
    font-weight: 600;
    min-width: 30px;
    display: inline-block;
}

/* 配置提示样式 */
.config-tips {
    background: linear-gradient(135deg, rgba(0, 255, 157, 0.1), rgba(0, 255, 157, 0.05));
    border: 1px solid rgba(0, 255, 157, 0.2);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
    backdrop-filter: blur(8px);
}

.config-tips p {
    margin: 0;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.1rem;
}

/* 表单行布局 */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

/* 字段提示样式 */
.field-tip {
    display: block;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 0.5rem;
    font-style: italic;
}

/* 滑块容器样式 */
.slider-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

#temperature {
    flex: 1;
    margin: 0;
}

#temperature-value {
    min-width: 30px;
    text-align: center;
    font-weight: 600;
    color: var(--primary-color);
}



/* 响应式适配 */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .config-tips {
        padding: 0.8rem 1rem;
    }
    
    .config-tips p {
        font-size: 1rem;
    }
}

/* 大模型对话样式 */
.chat-container {
    height: 450px;
    width: 100%; /* 固定宽度为100% */
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 1rem;
    margin-bottom: 1rem;
    background: rgba(255, 255, 255, 0.05);
    overflow-y: auto;
    overflow-x: hidden; /* 隐藏横向滚动，只保留.welcome-message的横向滚动 */
    backdrop-filter: blur(10px);
    box-sizing: border-box; /* 确保padding和border包含在宽度内 */
}

.chat-message {
    margin-bottom: 1rem;
    padding: 1rem;
    border-radius: 15px;
    max-width: 100%; /* 限制最大宽度 */
    word-wrap: break-word; /* 允许长单词换行 */
    overflow-wrap: break-word; /* 确保内容不会溢出 */
}

.chat-message.user {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: var(--background-color);
    margin-left: auto;
    text-align: right;
    max-width: 90%; /* 用户消息最大宽度 */
}

.chat-message.ai {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    margin-right: auto;
    max-width: 90%; /* AI消息最大宽度 */
    box-sizing: border-box; /* 包含padding和border */
}

/* Markdown渲染样式 */
.chat-message.ai h3 {
    color: var(--primary-color);
    font-size: 1.3rem;
    margin: 1rem 0 0.5rem 0;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.3rem;
}

.chat-message.ai h4 {
    color: var(--primary-color);
    font-size: 1.1rem;
    margin: 0.8rem 0 0.4rem 0;
}

.chat-message.ai strong {
    color: var(--primary-color);
    font-weight: 600;
}

.chat-message.ai em {
    color: rgba(255, 255, 255, 0.8);
    font-style: italic;
}

.chat-message.ai code {
    background: rgba(0, 0, 0, 0.3);
    color: var(--primary-color);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.chat-message.ai pre {
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-color);
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto; /* 允许横向滚动，解决宽代码块被遮挡问题 */
    margin: 0.5rem 0;
    border-left: 3px solid var(--primary-color);
    max-width: 100%;
    box-sizing: border-box;
    width: 100%; /* 确保代码块不会撑开容器 */
}

.chat-message.ai pre code {
    background: transparent;
    color: inherit;
    padding: 0;
    border-radius: 0;
}

.chat-message.ai ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.chat-message.ai li {
    margin-bottom: 0.3rem;
    line-height: 1.4;
}

.chat-message.ai li::marker {
    color: var(--primary-color);
}

.chat-message.ai hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 1rem 0;
}

.chat-message.ai a {
    color: var(--primary-color);
    text-decoration: underline;
}

.chat-message.ai a:hover {
    color: var(--gradient-end);
}

/* 欢迎消息样式 */
.welcome-message {
    text-align: center;
    padding: 2rem;
    color: var(--text-color);
    min-width: 600px; /* 确保内容足够宽以触发滚动 */
    width: 100%;
    box-sizing: border-box;
}

.welcome-message h3 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    text-shadow: var(--glow-intensity) var(--primary-color);
}

.welcome-message p {
    margin-bottom: 1.5rem;
    line-height: 1.6;
    opacity: 0.9;
}

.welcome-message ul {
    text-align: left; /* 列表项左对齐 */
    display: block;
    margin: 0 auto;
    min-width: 400px;
    width: fit-content;
    position: relative;
    left: 20%; /* 向右移动到中间位置 */
}

.welcome-message li {
    margin-bottom: 0.5rem;
    padding-left: 1rem;
    position: relative;
    white-space: nowrap; /* 防止列表项换行 */
    text-align: left;
}

.welcome-message li::before {
    content: "✦";
    color: var(--primary-color);
    position: relative;
    margin-right: 0.5rem;
    font-weight: bold;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .welcome-message {
        min-width: 100%;
        padding: 1rem;
    }
    
    .welcome-message ul {
        min-width: 100%;
    }
    
    .welcome-message li {
        white-space: normal; /* 在小屏幕上允许换行 */
    }
}

/* 只为欢迎消息区域添加横向滚动 */
.welcome-message {
    overflow-x: auto; /* 允许横向滚动 */
    overflow-y: visible; /* 保持垂直滚动正常 */
    width: 100%; /* 确保宽度填满容器 */
    -webkit-overflow-scrolling: touch; /* 在移动设备上提供平滑滚动 */
}

/* 确保欢迎消息内部元素正常换行 */
.welcome-message > * {
    white-space: normal; /* 允许内部元素正常换行 */
}

/* 列表项垂直排列，每个项目单独一行并居中 */
.welcome-message ul {
    display: block;
    white-space: normal;
    width: 100%;
    text-align: center;
}

.welcome-message li {
    display: block;
    white-space: normal;
    margin-right: 0;
    margin-bottom: 0.5rem;
    min-width: auto;
}

/* 表格容器样式 */
.table-container {
    width: 100%;
    overflow-x: auto;
    margin: 0.5rem 0;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.1);
}

.table-container table {
    width: 100%;
    max-width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    background: rgba(0, 0, 0, 0.2);
}

.table-container th,
.table-container td {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.table-container th {
    background: rgba(var(--primary-color-rgb), 0.2);
    color: var(--primary-color);
    font-weight: 600;
}

.table-container td {
    color: var(--text-color);
}

/* 自定义滚动条样式 */
.welcome-message::-webkit-scrollbar {
    height: 8px;
}

.welcome-message::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.welcome-message::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.welcome-message::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

.input-area {
    display: flex;
    gap: 1rem;
}

#user-input {
    flex: 1;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--border-color);
    border-radius: 25px;
    color: var(--text-color);
    font-size: 1rem;
    resize: none;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

#user-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 255, 157, 0.2);
}

#send-btn {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: var(--background-color);
    border: none;
    padding: 1rem 2rem;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    align-self: flex-end;
}

/* 测试连接按钮样式 */
.test-connection-btn {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: var(--background-color);
    border: none;
    padding: 0.8rem 1.5rem !important;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.test-connection-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 255, 157, 0.4);
}

/* 保存配置按钮样式 */
.save-config-btn {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: var(--background-color);
    border: none;
    padding: 0.8rem 1.5rem !important;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.save-config-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 255, 157, 0.4);
}

/* 配置表单按钮容器 */
.form-buttons-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-top: 2rem;
    padding-top: 1rem;
}

.model-chat .section-header {
    text-align: center;
    margin-bottom: 2rem;
}

#send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 255, 157, 0.4);
}

/* 响应式设计 - 保持比例但调整间距 */
@media (max-width: 1200px) {
    .model-main {
        grid-template-columns: minmax(250px, 0.25fr) minmax(550px, 1fr);
        gap: 1.5rem;
        padding: 1.5rem;
    }
}

@media (max-width: 900px) {
    .model-main {
        grid-template-columns: minmax(200px, 0.25fr) minmax(450px, 1fr);
        max-width: 800px;
    }
    
    .chat-message.user,
    .chat-message.ai {
        max-width: 95%; /* 在小屏幕上增加消息宽度 */
    }
}

@media (max-width: 768px) {
    .model-main {
        padding: 1rem;
        gap: 1rem;
    }
    
    .model-config,
    .model-chat {
        padding: 1.5rem;
    }
    
    .section-header h2 {
        font-size: 1.5rem;
    }
    
    .input-area {
        flex-direction: column;
    }
    
    #send-btn {
        align-self: stretch;
    }
}

/* 添加加载状态样式 */
.chat-message.loading {
    color: #aaa;
    font-style: italic;
    position: relative;
}

.chat-message.loading::after {
    content: '...';
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* 错误消息样式 */
.chat-message.ai.error {
    color: #ff6b6b;
    border-left: 3px solid #ff6b6b;
}

/* 改善响应式设计 */
@media (max-width: 768px) {
    .model-main {
        padding: 1rem;
        gap: 1rem;
    }
    
    .model-config,
    .model-chat {
        padding: 1.5rem;
    }
    
    .input-area {
        flex-direction: column;
    }
    
    #send-btn {
        margin-top: 1rem;
        align-self: stretch;
    }
}

/* 通知动画 */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--primary-color);
    color: var(--background-color);
    padding: 1rem 2rem;
    border-radius: 10px;
    z-index: 1000;
    animation: slideIn 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Markdown表格样式 */
.chat-message.ai .table-container {
    width: 100%;
    overflow-x: auto;
    margin: 1rem 0;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.chat-message.ai table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    max-width: 100%; /* 确保表格不会撑开容器 */
}

.chat-message.ai th,
.chat-message.ai td {
    max-width: 300px;
    overflow: visible;
    white-space: normal;
    word-wrap: break-word;
    padding: 0.8rem;
}

/* 表头和单元格优化 */
.chat-message.ai th,
.chat-message.ai td {
    padding: 0.8rem;
}

/* 响应式表格 */
@media (max-width: 768px) {
    .chat-message.ai th,
    .chat-message.ai td {
        max-width: 200px;
        overflow: visible;
        white-space: normal;
        word-wrap: break-word;
        padding: 0.6rem;
    }
}

.chat-message.ai th {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: var(--background-color);
    padding: 0.8rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
}

.chat-message.ai td {
    padding: 0.8rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
}

.chat-message.ai tr:last-child td {
    border-bottom: none
}

/* 复制按钮样式 */
.chat-message {
    position: relative;
}

.chat-message .copy-btn {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    border: none;
    border-radius: 15px;
    padding: 0.4rem 0.8rem;
    color: var(--background-color);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(var(--primary-color-rgb), 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chat-message:hover .copy-btn {
    opacity: 1;
}

.chat-message .copy-btn:hover {
    background: linear-gradient(135deg, var(--gradient-end), var(--gradient-start));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(var(--primary-color-rgb), 0.5);
}

.chat-message.ai tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* 响应式表格 */
@media (max-width: 768px) {
    .chat-message.ai table {
        font-size: 0.9rem;
    }
    
    .chat-message.ai th,
    .chat-message.ai td {
        padding: 0.6rem;
    }
}

/* 微博热搜样式 */
.news-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
    box-sizing: border-box;
}

.weibo-hot {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    backdrop-filter: blur(10px);
}

.section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.section-header h2 {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 0.5rem;
    text-shadow: var(--glow-intensity) var(--primary-color);
}

.section-header p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.update-time {
    color: var(--secondary-color);
    font-size: 0.9rem;
    font-style: italic;
}

.hot-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 1rem;
}

.tab-btn {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-color);
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.tab-btn:hover {
    background: rgba(var(--primary-color-rgb), 0.1);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    border-color: transparent;
    color: var(--background-color);
    box-shadow: 0 4px 15px rgba(var(--primary-color-rgb), 0.3);
}

.hot-content {
    min-height: 400px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: var(--secondary-color);
    font-size: 1.1rem;
    font-style: italic;
}

.hot-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.hot-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.hot-item:hover {
    background: rgba(var(--primary-color-rgb), 0.1);
    border-color: var(--primary-color);
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(var(--primary-color-rgb), 0.2);
}

.hot-rank {
    min-width: 30px;
    text-align: center;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-right: 1rem;
}

.hot-title-link {
    flex: 1;
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    line-height: 1.4;
}

.hot-title-link:hover {
    color: var(--primary-color);
    text-shadow: 0 0 8px rgba(var(--primary-color-rgb), 0.4);
}

.hot-count {
    min-width: 80px;
    text-align: right;
    color: var(--secondary-color);
    font-size: 0.9rem;
    font-weight: 600;
    background: rgba(var(--secondary-color-rgb), 0.1);
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    margin-left: 1rem;
}

/* 热搜排名特殊样式 */
.hot-item:nth-child(1) .hot-rank {
    color: #ff6b6b;
    text-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
}

.hot-item:nth-child(2) .hot-rank {
    color: #ffa726;
    text-shadow: 0 0 8px rgba(255, 167, 38, 0.4);
}

.hot-item:nth-child(3) .hot-rank {
    color: #29b6f6;
    text-shadow: 0 0 8px rgba(41, 182, 246, 0.4);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .news-main {
        padding: 1rem;
    }
    
    .weibo-hot {
        padding: 1.5rem;
        border-radius: 15px;
    }
    
    .section-header h2 {
        font-size: 1.5rem;
    }
    
    .hot-tabs {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .tab-btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    
    .hot-item {
        padding: 0.8rem 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .hot-rank {
        font-size: 1.1rem;
        margin-right: 0;
    }
    
    .hot-title-link {
        font-size: 1rem;
    }
    
    .hot-count {
        margin-left: 0;
        align-self: flex-end;
    }
}

/* API来源标识样式 */
.api-source {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    margin-top: 1.5rem;
    background: rgba(var(--primary-color-rgb), 0.1);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-color);
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
}

.source-icon {
    font-size: 1.1rem;
}

.source-text {
    font-weight: 500;
    opacity: 0.9;
}

.source-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    padding: 0.3rem 0.8rem;
    border-radius: 8px;
    background: rgba(var(--primary-color-rgb), 0.2);
    transition: all 0.3s ease;
}

.source-link:hover {
    background: rgba(var(--primary-color-rgb), 0.3);
    color: var(--primary-color);
    text-shadow: 0 0 8px rgba(var(--primary-color-rgb), 0.4);
}

/* 模拟数据警告样式 */
.mock-warning {
    text-align: center;
    padding: 1rem;
    margin-top: 1.5rem;
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1), rgba(255, 193, 7, 0.05));
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 12px;
    color: #ffc107;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
}

.mock-warning a {
    color: #ffc107;
    text-decoration: underline;
    font-weight: 600;
}

.mock-warning a:hover {
    color: #ffd54f;
}