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

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --bg: #f1f5f9;
    --card-bg: rgba(255, 255, 255, 0.95);
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* 登录页背景 */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* 登录卡片 */
.login-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
}

.login-card h1 {
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 8px;
}

.login-card .subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 32px;
    font-size: 14px;
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    font-size: 14px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.remember-me input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-primary:active {
    transform: scale(0.98);
}

/* 错误提示 */
.error-message {
    background: #fef2f2;
    color: #dc2626;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
    display: none;
}

.error-message.show {
    display: block;
}

/* 主页布局 */
.main-layout {
    min-height: 100vh;
}

/* 顶部导航 */
.navbar {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-brand {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary);
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-name {
    color: var(--text-muted);
    font-size: 14px;
}

.btn-logout {
    background: transparent;
    color: var(--text-muted);
    font-size: 14px;
    padding: 6px 12px;
}

.btn-logout:hover {
    color: #dc2626;
}

/* 主页内容 */
.home-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px;
}

.welcome-section {
    margin-bottom: 40px;
}

.welcome-section h2 {
    font-size: 28px;
    margin-bottom: 8px;
}

.welcome-section p {
    color: var(--text-muted);
}

/* 网格卡片 */
.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.module-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: var(--text);
}

.module-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.module-icon {
    width: 48px;
    height: 48px;
    background: rgba(37, 99, 235, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 16px;
}

.module-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
}

.module-card p {
    font-size: 14px;
    color: var(--text-muted);
}

/* 页面头部 */
.page-header {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 24px;
}

.page-header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-header h2 {
    font-size: 20px;
    font-weight: 600;
}

/* 搜索栏 */
.search-bar {
    display: flex;
    gap: 12px;
}

.search-bar input {
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    min-width: 240px;
}

.btn-secondary {
    background: white;
    color: var(--text);
    border: 1px solid var(--border);
    padding: 10px 20px;
    font-size: 14px;
}

.btn-secondary:hover {
    background: var(--bg);
}

/* 表格容器 */
.table-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

/* 数据表格 */
.data-table {
    width: 100%;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.data-table table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 16px;
    text-align: left;
    font-size: 14px;
}

.data-table th {
    background: var(--bg);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.data-table tbody tr {
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s;
}

.data-table tbody tr:hover {
    background: rgba(37, 99, 235, 0.03);
}

.data-table tbody tr:nth-child(even) {
    background: #fafafa;
}

.data-table tbody tr:nth-child(even):hover {
    background: rgba(37, 99, 235, 0.03);
}

.data-table tbody tr:last-child {
    border-bottom: none;
}

/* 状态标签 */
.tag {
    display: inline-flex;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.tag-success {
    background: #dcfce7;
    color: #16a34a;
}

.tag-warning {
    background: #fef3c7;
    color: #d97706;
}

.tag-danger {
    background: #fee2e2;
    color: #dc2626;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
}

.pagination button {
    padding: 8px 12px;
    border: 1px solid var(--border);
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    min-width: 36px;
}

.pagination button:hover:not(:disabled) {
    background: var(--bg);
}

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

.pagination button.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 详情页 */
.detail-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 24px;
}

.back-link:hover {
    color: var(--primary);
}

.detail-card {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 32px;
}

.detail-card h3 {
    font-size: 20px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.detail-row {
    display: flex;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    width: 140px;
    color: var(--text-muted);
    font-size: 14px;
}

.detail-value {
    flex: 1;
    font-weight: 500;
}

/* 响应式 */
@media (max-width: 768px) {
    .login-card {
        padding: 32px 24px;
    }

    .navbar {
        padding: 0 16px;
    }

    .home-container,
    .table-container,
    .detail-container {
        padding: 20px 16px;
    }

    .module-grid {
        grid-template-columns: 1fr;
    }

    .page-header-content {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }

    .search-bar {
        width: 100%;
    }

    .search-bar input {
        flex: 1;
        min-width: 0;
    }

    .data-table th,
    .data-table td {
        padding: 12px;
    }

    .detail-row {
        flex-direction: column;
        gap: 8px;
    }

    .detail-label {
        width: auto;
    }
}
