/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f8f9fa;
    color: #333;
    line-height: 1.5;
    font-size: 14px;
}

/* 导航栏 */
.navbar {
    background: #003d9f;
    color: #fff;
    padding: 0 0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: stretch;
    min-height: 52px;
}

.nav-title {
    display: flex;
    align-items: center;
    color: #fff;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 0 20px 0 0;
    margin-right: 8px;
    border-right: 1px solid rgba(255,255,255,0.25);
    transition: opacity 0.2s;
}

.nav-title:hover {
    opacity: 0.9;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    padding: 0 14px;
    font-size: 0.9rem;
    line-height: 52px;
    transition: background 0.2s, color 0.2s;
}

.nav-link:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.nav-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-user {
    color: rgba(255,255,255,0.85);
    font-size: 0.85rem;
    padding: 0 4px;
}

.nav-link-out {
    padding: 6px 14px;
    line-height: 1.4;
    border-radius: 4px;
    background: rgba(255,255,255,0.1);
}

.nav-link-out:hover {
    background: rgba(255,255,255,0.2);
}

/* 容器 */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px;
}

/* 页面头部 */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px 20px;
    margin-bottom: 20px;
    padding: 16px 0;
    border-bottom: 1px solid #e0e0e0;
}

.page-header h2 {
    font-size: 1.35rem;
    color: #333;
    font-weight: 600;
    margin: 0;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.page-header .btn {
    flex-shrink: 0;
}

/* 按钮 */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s;
    text-align: center;
    font-weight: 500;
}

.btn-primary {
    background: #0052d9;
    color: #fff;
    border: 1px solid #0052d9;
}

.btn-primary:hover {
    background: #003d9f;
    border-color: #003d9f;
}

.btn-secondary {
    background: transparent;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.btn-secondary:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
    color: #495057;
}

.btn-danger {
    background: transparent;
    color: #e74c3c;
    border: 1px solid #e74c3c;
}

.btn-danger:hover {
    background: #e74c3c;
    color: #fff;
}

.btn-info {
    background: transparent;
    color: #0052d9;
    border: 1px solid #0052d9;
}

.btn-info:hover {
    background: #0052d9;
    color: #fff;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 0.75rem;
}

.btn-block {
    display: block;
    width: 100%;
}

/* 表格 */
.table {
    width: 100%;
    background: #fff;
    border-collapse: collapse;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border-radius: 6px;
    overflow: hidden;
}

.table thead {
    background: #0047c4;
    color: #fff;
}

.table th {
    padding: 10px 12px;
    text-align: left;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table td {
    padding: 10px 12px;
    text-align: left;
    font-size: 0.875rem;
    border-bottom: 1px solid #f0f0f0;
}

.table tbody tr:hover {
    background: #e6f0ff;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table tbody td {
    vertical-align: middle;
}

.text-center {
    text-align: center;
}

code {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    color: #333;
}

/* 徽章 */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

/* 表单 */
.article-form {
    background: #fff;
    padding: 20px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #333;
    font-size: 0.875rem;
}

.form-group .required {
    color: #e74c3c;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #0052d9;
    box-shadow: 0 0 0 2px rgba(0, 82, 217, 0.2);
}

.form-group textarea {
    min-height: 200px;
    resize: vertical;
}

.form-hint {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #7f8c8d;
}

.form-actions {
    margin-top: 20px;
    display: flex;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

/* 提示框 */
.alert {
    padding: 10px 16px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 0.875rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 登录页面 */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0052d9 0%, #003d9f 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: #fff;
    padding: 32px;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.login-title {
    text-align: center;
    margin-bottom: 24px;
    color: #333;
    font-size: 1.5rem;
    font-weight: 600;
}

.login-form {
    margin-bottom: 16px;
}

.login-tip {
    text-align: center;
    padding-top: 16px;
    border-top: 1px solid #eee;
    color: #7f8c8d;
    font-size: 0.8rem;
}

.login-tip p {
    margin: 0;
}

/* 页脚 */
.footer {
    background: #e6f0ff;
    color: #0052d9;
    text-align: center;
    padding: 16px;
    margin-top: 32px;
    font-size: 0.8rem;
    border-top: 1px solid #d0e0ff;
}

.footer p {
    margin: 0;
}

/* 操作按钮组 */
.table td {
    white-space: nowrap;
}

.table td .btn {
    margin-right: 4px;
}

.table td .btn:last-child {
    margin-right: 0;
}

/* 响应式 */
@media (max-width: 768px) {
    .container {
        padding: 12px;
    }
    
    .nav-container {
        flex-wrap: wrap;
        min-height: auto;
        padding: 12px 16px;
        gap: 12px 0;
    }
    
    .nav-title {
        padding-right: 12px;
        margin-right: 12px;
        border-right: 1px solid rgba(255,255,255,0.25);
    }
    
    .nav-links {
        order: 3;
        width: 100%;
        border-top: 1px solid rgba(255,255,255,0.2);
        padding-top: 10px;
        gap: 4px;
    }
    
    .nav-link {
        line-height: 2.2;
        padding: 0 10px;
    }
    
    .nav-right {
        margin-left: auto;
    }
    
    .page-header {
        flex-direction: row;
        align-items: center;
        padding: 12px 0;
        gap: 12px;
        margin-bottom: 16px;
    }
    
    .page-header h2 {
        font-size: 1.2rem;
    }
    
    .table {
        font-size: 0.8rem;
    }
    
    .table th,
    .table td {
        padding: 8px 10px;
    }
    
    .article-form {
        padding: 16px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
}