/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #3498db;
    --secondary: #2c3e50;
    --success: #27ae60;
    --danger: #e74c3c;
    --warning: #f39c12;
    --light: #f8f9fa;
    --dark: #343a40;
    --gray: #6c757d;
    --border: #dee2e6;
}

html, body {
    height: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 头部样式 */
header {
    background: var(--secondary);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

header p {
    opacity: 0.8;
}

/* 导航 */
.admin-nav {
    background: var(--primary);
    padding: 0.5rem 0;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.admin-nav ul {
    display: flex;
    list-style: none;
}

.admin-nav li {
    margin-right: 1rem;
}

.admin-nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background 0.3s;
}

.admin-nav a:hover, .admin-nav a.active {
    background: rgba(255,255,255,0.2);
}

/* 内容区域 */
.main-content {
    flex: 1;
    padding: 2rem 0;
}

h2 {
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
}

/* 表格样式 */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    background: white;
    box-shadow: 0 0 10px rgba(0,0,0,0.05);
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: var(--light);
    font-weight: 600;
}

tr:hover {
    background-color: rgba(0,0,0,0.02);
}

/* 卡片样式 */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 0 10px rgba(0,0,0,0.05);
}

.stat-card h3 {
    font-size: 1rem;
    color: var(--gray);
    margin-bottom: 0.5rem;
}

.stat-card p {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary);
}

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

.form-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -0.75rem;
}

.form-row .form-group {
    flex: 1 0 300px;
    padding: 0 0.75rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

input[type="text"],
input[type="password"],
input[type="datetime-local"],
textarea,
select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 1rem;
    transition: border 0.3s;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="datetime-local"]:focus,
textarea:focus,
select:focus {
    border-color: var(--primary);
    outline: none;
}

textarea {
    min-height: 150px;
    resize: vertical;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    text-decoration: none;
    transition: background 0.3s;
}

.btn:hover {
    background: #2980b9;
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
}

.btn-danger {
    background: var(--danger);
}

.btn-danger:hover {
    background: #c0392b;
}

/* 公告样式 */
.announcement-types {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.announcement-types button {
    padding: 0.5rem 1rem;
    background: var(--light);
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.announcement-types button:hover, .announcement-types button.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.announcement-list {
    display: grid;
    gap: 1.5rem;
}

.announcement {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 0 10px rgba(0,0,0,0.05);
    border-left: 4px solid var(--primary);
}

.top-announcement {
    border-left: 4px solid var(--warning);
    background: #fffaf0;
}

.ann-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--gray);
}

.ann-type {
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    margin-right: 0.5rem;
}

.top-tag {
    background: var(--warning);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    margin-right: 0.5rem;
}

.ann-date {
    margin-left: auto;
}

.announcement h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--secondary);
}

.ann-content {
    margin-bottom: 1rem;
    line-height: 1.8;
}

.ann-footer {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--gray);
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

/* 操作按钮 */
.actions {
    display: flex;
    gap: 0.5rem;
}

/* 消息提示 */
.error {
    background: #f8d7da;
    color: #721c24;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    border-left: 4px solid #f5c6cb;
}

.success {
    background: #d4edda;
    color: #155724;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    border-left: 4px solid #c3e6cb;
}

/* 页脚 - 修复底部空白问题 */
footer {
    background: var(--secondary);
    color: white;
    padding: 1.5rem 0;
    margin-top: auto;
}

footer .container {
    text-align: center;
    padding: 1rem 0;
}

footer p {
    opacity: 0.8;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .admin-nav ul {
        flex-wrap: wrap;
    }
    
    .form-row .form-group {
        flex: 1 0 100%;
    }
    
    .actions {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .actions .btn {
        display: block;
        text-align: center;
    }
    
    .ann-header {
        flex-wrap: wrap;
    }
    
    .ann-date {
        margin-left: 0;
        margin-top: 0.5rem;
        width: 100%;
    }
    
    .ann-footer {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* 移动设备底部安全区域 */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    body {
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    footer {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* 更新提示框 */
.update-alert {
    background: #fff;
    border-radius: 8px;
    border-left: 4px solid #f39c12;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.update-alert:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #f39c12, #e74c3c);
}

.update-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.update-header h3 {
    color: #e74c3c;
    margin: 0;
    font-size: 1.5rem;
}

.version-badge {
    background: #f39c12;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
}

.update-details {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.update-details h4 {
    color: #2c3e50;
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.update-description {
    line-height: 1.7;
    margin-bottom: 15px;
    color: #555;
}

.author-message {
    background: #e3f2fd;
    border-left: 3px solid #2196f3;
    padding: 10px 15px;
    font-style: italic;
    color: #0d47a1;
}

.update-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-update {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    font-weight: bold;
    flex: 1;
    min-width: 150px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(46, 204, 113, 0.3);
    transition: all 0.3s;
}

.btn-update:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(46, 204, 113, 0.4);
}

.btn-ignore {
    background: #95a5a6;
    color: white;
    flex: 0.5;
    min-width: 100px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .update-actions {
        flex-direction: column;
    }
    
    .btn-update, .btn-ignore {
        width: 100%;
    }
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    padding: 2rem 0;
}

/* 后台仪表盘特定高度调整 */
.dashboard-page .main-content {
    min-height: calc(100vh - 300px); /* 根据实际头部/导航高度调整 */
}

/* 移动设备适配 */
@media (max-width: 768px) {
    .dashboard-page .main-content {
        min-height: calc(100vh - 250px);
    }
}

footer {
    flex-shrink: 0;
    margin-top: auto;
}

/* 添加仪表盘卡片间距调整 */
.dashboard-stats {
    margin-bottom: 30px;
}

.recent-announcements {
    margin-bottom: 20px;
}