/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
}

/* 登录页面 */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header i {
    font-size: 3.5rem;
    color: #667eea;
    margin-bottom: 1rem;
    display: block;
}

.login-header h1 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 1.6rem;
}

.login-header p {
    color: #7f8c8d;
    font-size: 0.95rem;
}

.login-form .form-group {
    margin-bottom: 1.5rem;
}

.login-form label {
    display: block;
    margin-bottom: 0.6rem;
    color: #34495e;
    font-weight: 600;
    font-size: 0.95rem;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #95a5a6;
    font-size: 1.15rem;
    z-index: 10;
    pointer-events: none;
    width: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.input-with-icon input {
    width: 100%;
    padding: 14px 16px 14px 44px;
    border: 2px solid #e8e8e8;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #fafafa;
}

.input-with-icon input:focus {
    outline: none;
    border-color: #667eea;
    background-color: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.login-btn:active {
    transform: translateY(0);
}

.error-message {
    color: #e74c3c;
    text-align: center;
    margin-top: 1rem;
    display: none;
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* 管理页面布局 */
.admin-page {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
    width: 250px;
    background-color: #2c3e50;
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: bold;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header i {
    font-size: 1.5rem;
    color: #2ecc71;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 1.5rem;
    color: #bdc3c7;
    text-decoration: none;
    transition: all 0.3s;
}

.nav-item:hover, .nav-item.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-item.active {
    border-left: 3px solid #2ecc71;
}

.nav-item i {
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px;
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    color: #bdc3c7;
    cursor: pointer;
    transition: all 0.3s;
}

.logout-btn:hover {
    background-color: rgba(231, 76, 60, 0.2);
    border-color: #e74c3c;
    color: #e74c3c;
}

/* 主内容区 */
.main-content {
    flex: 1;
    margin-left: 250px;
    padding: 0;
}

/* 顶部栏 */
.top-bar {
    background: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.page-title h1 {
    color: #2c3e50;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #7f8c8d;
}

.user-info i {
    font-size: 1.5rem;
    color: #3498db;
}

/* 页面内容 */
.page-content {
    padding: 2rem;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.stat-info h3 {
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.stat-info p {
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* 最近公告 */
.recent-section {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.recent-section h2 {
    color: #2c3e50;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f0f0f0;
}

.recent-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.recent-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.recent-item:hover {
    background-color: #e9ecef;
}

.recent-item-title {
    font-weight: 500;
    color: #2c3e50;
}

.recent-item-meta {
    display: flex;
    gap: 1rem;
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* 页面操作栏 */
.page-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.filter-options {
    display: flex;
    gap: 10px;
}

.filter-options select {
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
    color: #333;
}

.search-box {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
}

.search-box input {
    border: none;
    padding: 8px 15px;
    outline: none;
}

.search-box button {
    background: #3498db;
    color: white;
    border: none;
    padding: 8px 15px;
    cursor: pointer;
}

/* 表格 */
.announcements-table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow-x: auto;
}

.announcements-table {
    width: 100%;
    border-collapse: collapse;
}

.announcements-table th {
    background-color: #f8f9fa;
    padding: 12px 15px;
    text-align: left;
    color: #2c3e50;
    font-weight: 600;
    border-bottom: 2px solid #eee;
}

.announcements-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
}

.announcements-table tr:hover {
    background-color: #f8f9fa;
}

.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 0.85rem;
}

.status-badge.published {
    background-color: #d4edda;
    color: #155724;
}

.status-badge.draft {
    background-color: #fff3cd;
    color: #856404;
}

.top-badge {
    background-color: #f8d7da;
    color: #721c24;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 0.85rem;
}

.actions {
    display: flex;
    gap: 5px;
}

.btn-action {
    padding: 5px 10px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.btn-edit {
    background-color: #3498db;
    color: white;
}

.btn-edit:hover {
    background-color: #2980b9;
}

.btn-delete {
    background-color: #e74c3c;
    color: white;
}

.btn-delete:hover {
    background-color: #c0392b;
}

.btn-top {
    background-color: #f39c12;
    color: white;
}

.btn-top:hover {
    background-color: #e67e22;
}

/* 表单 */
.announcement-form, .settings-form {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    max-width: 800px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #2c3e50;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
}

.form-group textarea {
    resize: vertical;
    min-height: 200px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.checkbox-group {
    display: flex;
    align-items: center;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
}

.image-preview {
    margin-top: 1rem;
}

.image-preview img {
    max-width: 300px;
    max-height: 200px;
    border-radius: 5px;
    border: 1px solid #ddd;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 2rem;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

/* 设置页面 */
.settings-section {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
    max-width: 600px;
}

.settings-section h2 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f0f0f0;
}

.system-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.info-item label {
    color: #7f8c8d;
    font-weight: 500;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 2rem;
}

.page-btn {
    padding: 8px 15px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.page-btn:hover:not(:disabled) {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

.page-btn.active {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Toast提示 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 5px;
    color: white;
    font-weight: 500;
    z-index: 9999;
    display: none;
    animation: slideIn 0.3s ease;
}

.toast.success {
    background-color: #2ecc71;
}

.toast.error {
    background-color: #e74c3c;
}

.toast.info {
    background-color: #3498db;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .admin-page {
        flex-direction: column;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .page-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-options {
        flex-direction: column;
    }
}

/* PDF预览样式 */
.pdf-preview {
    margin-top: 1rem;
}

.pdf-file-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-top: 0.5rem;
}

.pdf-file-info i {
    color: #e74c3c;
    font-size: 1.5rem;
}

.pdf-file-info span {
    flex: 1;
    color: #2c3e50;
    font-size: 0.9rem;
    word-break: break-all;
}

.remove-pdf {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s;
}

.remove-pdf:hover {
    color: #c0392b;
}

.form-hint {
    display: block;
    margin-top: 0.5rem;
    color: #7f8c8d;
    font-size: 0.85rem;
}
