/* ===== 全局样式 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* ===== 导航栏 ===== */
.navbar {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-logo {
    font-size: 20px;
    font-weight: 600;
    color: #438CE0;
    text-decoration: none;
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 24px;
}

.navbar-menu a {
    color: #666;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.navbar-menu a:hover,
.navbar-menu a.active {
    color: #438CE0;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.navbar-user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.navbar-user-info:hover {
    background: #f5f7fa;
}

.navbar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.navbar-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.navbar-username {
    font-size: 14px;
    color: #333;
    cursor: pointer;
}

.navbar-login-btn {
    padding: 8px 16px;
    background: #438CE0;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.navbar-login-btn:hover {
    background: #357abd;
}

/* ===== 用户下拉菜单 ===== */
.user-dropdown {
    position: absolute;
    top: 60px;
    right: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    min-width: 180px;
    display: none;
    z-index: 101;
}

.user-dropdown.show {
    display: block;
}

.user-dropdown-item {
    padding: 12px 16px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-dropdown-item:hover {
    background: #f5f7fa;
}

.user-dropdown-item:first-child {
    border-radius: 8px 8px 0 0;
}

.user-dropdown-item:last-child {
    border-radius: 0 0 8px 8px;
}

.user-dropdown-divider {
    height: 1px;
    background: #eee;
}

/* ===== 页面容器 ===== */
.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ===== 卡片样式 ===== */
.card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    padding: 24px;
    margin-bottom: 20px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #333;
}

/* ===== 按钮样式 ===== */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-primary {
    background: #438CE0;
    color: #fff;
}

.btn-primary:hover {
    background: #357abd;
}

.btn-secondary {
    background: #f0f0f0;
    color: #666;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-danger {
    background: #ff4d4f;
    color: #fff;
}

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

.btn-success {
    background: #52c41a;
    color: #fff;
}

.btn-success:hover {
    background: #389e0d;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===== 表单样式 ===== */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 14px;
    color: #666;
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: #438CE0;
}

.form-input.error {
    border-color: #ff4d4f;
}

.form-error {
    font-size: 12px;
    color: #ff4d4f;
    margin-top: 4px;
}

.form-hint {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

/* ===== 验证码样式 ===== */
.captcha-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.captcha-input {
    flex: 1;
}

.captcha-image {
    height: 40px;
    border-radius: 6px;
    cursor: pointer;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 4px;
    user-select: none;
}

/* ===== 表格样式 ===== */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.table th {
    font-weight: 600;
    color: #666;
    font-size: 13px;
}

.table td {
    font-size: 14px;
}

.table tr:hover {
    background: #f9f9f9;
}

/* ===== 分页样式 ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.pagination-item {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination-item:hover {
    border-color: #438CE0;
    color: #438CE0;
}

.pagination-item.active {
    background: #438CE0;
    color: #fff;
    border-color: #438CE0;
}

.pagination-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== 标签样式 ===== */
.tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
}

.tag-primary {
    background: #e6f7ff;
    color: #438CE0;
}

.tag-success {
    background: #f6ffed;
    color: #52c41a;
}

.tag-warning {
    background: #fff7e6;
    color: #fa8c16;
}

.tag-danger {
    background: #fff1f0;
    color: #ff4d4f;
}

/* ===== 模态框样式 ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(-20px);
    transition: transform 0.3s;
}

.modal-overlay.show .modal {
    transform: translateY(0);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.modal-close:hover {
    background: #f0f0f0;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ===== Toast 提示 ===== */
.toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: #333;
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 2000;
    opacity: 0;
    transition: all 0.3s;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    background: #52c41a;
}

.toast.error {
    background: #ff4d4f;
}

.toast.warning {
    background: #fa8c16;
}

/* ===== 加载遮罩 ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f0f0f0;
    border-top-color: #438CE0;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    margin-top: 16px;
    font-size: 14px;
    color: #666;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .navbar-menu {
        display: none;
    }
    
    .page-container {
        padding: 12px;
    }
    
    .card {
        padding: 16px;
    }
}
