/* 全局样式 */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --primary-gradient: linear-gradient(135deg, #007bff, #0056b3);
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --card-shadow-hover: 0 10px 20px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(100, 116, 139, 0.05) 0%, transparent 20%),
        radial-gradient(circle at 80% 70%, rgba(100, 116, 139, 0.05) 0%, transparent 30%);
}

/* 导航栏样式 */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

.navbar:hover {
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: var(--transition);
}

.navbar-brand:hover {
    transform: scale(1.05);
}

.nav-link {
    position: relative;
    font-weight: 500;
    transition: var(--transition);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-gradient);
    transition: var(--transition);
}

.nav-link:hover::after {
    width: 100%;
}

/* 卡片样式 */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
}

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

.card-header {
    background: var(--primary-gradient);
    color: white;
    font-weight: 600;
}

/* 按钮样式 */
.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--primary-gradient);
    border: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.4);
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline-primary:hover {
    background: var(--primary-gradient);
    border-color: var(--primary-color);
}

/* 表单样式 */
.form-control {
    border-radius: 8px;
    border: 1px solid #e9ecef;
    transition: var(--transition);
    padding: 0.75rem 1rem;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
    outline: none;
}

/* 页脚样式 */
footer {
    background: var(--dark-color);
    color: white;
    padding: 3rem 0;
    margin-top: 3rem;
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-gradient);
}

footer a {
    color: rgba(255, 255, 255, 0.7);
    transition: var(--transition);
}

footer a:hover {
    color: white;
    text-decoration: none;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .navbar {
        background: white;
    }
}

/* 工具页面样式 */
.tool-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.tool-card {
    border-radius: 12px;
    overflow: hidden;
    transition: var(--transition);
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--card-shadow-hover);
}

/* 博客页面样式 */
.post-item {
    transition: var(--transition);
    border-radius: 12px;
    overflow: hidden;
}

.post-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--card-shadow-hover);
}

.post-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    transition: var(--transition);
}

.post-title:hover {
    color: var(--primary-color);
}

/* 论坛页面样式 */
.topic-list table {
    font-size: 0.9rem;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.topic-list th {
    background: var(--primary-gradient);
    color: white;
    font-weight: 600;
}

.topic-list tr {
    transition: var(--transition);
}

.topic-list tr:hover {
    background: rgba(0, 123, 255, 0.05);
}

/* 消息提示样式 */
.alert {
    margin-bottom: 20px;
    border-radius: 8px;
    border: none;
    box-shadow: var(--card-shadow);
}

/* 主容器样式 */
main {
    min-height: 80vh;
    padding-top: 30px;
}

/* 确保页面内容不被导航栏遮挡 */
body {
    padding-top: 70px; /* 为固定导航栏预留空间 */
}

/* 导航栏固定在顶部 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease forwards;
}

/* 加载动画 */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 工具卡片图标样式 */
.tool-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--primary-gradient);
    color: white;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    transition: var(--transition);
}

.tool-card:hover .tool-icon {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.4);
}

/* 文本颜色类 */
.text-gray-400 {
    color: rgba(255, 255, 255, 0.7);
}

.text-white {
    color: white;
}

/* 边框颜色类 */
.border-gray-700 {
    border-color: rgba(255, 255, 255, 0.1);
}

/* 过渡效果类 */
.transition-all {
    transition: var(--transition);
}

/* 悬停效果类 */
.hover\:text-white:hover {
    color: white;
}

/* 输入框组样式 */
.input-group {
    border-radius: 8px;
    overflow: hidden;
}

.input-group .form-control {
    border-radius: 0;
    border-right: none;
}

.input-group .btn {
    border-radius: 0;
    border-left: none;
}
