/* 全站通用样式 */
: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;
    --border-radius: 0.375rem;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
}

/* 导航栏样式 */
.navbar {
    box-shadow: var(--box-shadow);
    border-bottom: 1px solid #dee2e6;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

/* 主内容区域 */
.main-content {
    min-height: calc(100vh - 120px);
    padding: 2rem 0;
}

/* 卡片组件 */
.card {
    border: 1px solid #dee2e6;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* 新闻列表样式 */
.news-item {
    border-bottom: 1px solid #eee;
    padding: 1rem 0;
    transition: background-color 0.2s ease;
}

.news-item:hover {
    background-color: #f8f9fa;
}

.news-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    margin-bottom: 0.5rem;
    display: block;
}

.news-title:hover {
    color: var(--primary-color);
    text-decoration: none;
}

.news-meta {
    font-size: 0.875rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.news-summary {
    color: #666;
    margin-bottom: 0.5rem;
}

/* 按钮样式 */
.btn-like, .btn-favorite {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-like {
    background-color: transparent;
    color: var(--danger-color);
}

.btn-like:hover {
    background-color: var(--danger-color);
    color: white;
}

.btn-like.liked {
    background-color: var(--danger-color);
    color: white;
}

.btn-favorite {
    background-color: transparent;
    color: var(--warning-color);
}

.btn-favorite:hover {
    background-color: var(--warning-color);
    color: white;
}

.btn-favorite.favorited {
    background-color: var(--warning-color);
    color: white;
}

/* 筛选区域 */
.filter-section {
    background-color: var(--light-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
}

/* 评论区域 */
.comment-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #dee2e6;
}

.comment-item {
    padding: 1rem;
    border-bottom: 1px solid #eee;
}

.comment-author {
    font-weight: 600;
    color: var(--primary-color);
}

.comment-time {
    font-size: 0.8rem;
    color: var(--secondary-color);
}

/* 表单样式 */
.form-container {
    max-width: 400px;
    margin: 0 auto;
    padding: 2rem;
    background-color: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

/* 图表容器 */
.chart-container {
    position: relative;
    height: 400px;
    margin: 2rem 0;
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--secondary-color);
}

.spinner-border {
    width: 2rem;
    height: 2rem;
}

/* 提示消息 */
.alert {
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: var(--border-radius);
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

/* 页脚样式 */
.footer {
    background-color: var(--dark-color);
    color: #fff;
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer a {
    color: #adb5bd;
    text-decoration: none;
}

.footer a:hover {
    color: #fff;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-content {
        padding: 1rem 0;
    }
    
    .filter-section {
        padding: 1rem;
    }
    
    .form-container {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .news-title {
        font-size: 1rem;
    }
    
    .chart-container {
        height: 300px;
    }
}

/* 工具类 */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.d-none {
    display: none !important;
}

.d-block {
    display: block !important;
}

.text-center {
    text-align: center !important;
}

.text-left {
    text-align: left !important;
}

.text-right {
    text-align: right !important;
}

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 3rem !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mt-5 { margin-top: 3rem !important; } 