:root {
    /* 护眼模式配色 */
    --primary: #5d8a66;
    --primary-dark: #4a7052;
    --success: #6b9b76;
    --warning: #c9a227;
    --danger: #c25d5d;
    --info: #5a8fa8;

    /* 护眼背景色系 - 米黄/浅绿 */
    --bg-main: #f5f5dc;
    --bg-card: #faf8ef;
    --bg-header: #e8e6d9;
    --bg-hover: #eceadd;
    --bg-input: #fffef7;

    /* 文字颜色 - 柔和深色 */
    --text-primary: #3d3d3d;
    --text-secondary: #5a5a5a;
    --text-muted: #787878;
    --text-light: #969696;

    /* 边框颜色 */
    --border-color: #d4d2c5;
    --border-light: #e5e3d6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 登录页面 */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #a8c0a5 0%, #7d9b7a 100%);
}

.login-box {
    background: var(--bg-card);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--text-primary);
}

/* 头部导航 */
.header {
    background: var(--bg-header);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}

.nav {
    display: flex;
    gap: 8px;
}

.nav a {
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: all 0.2s;
}

.nav a:hover,
.nav a.active {
    background: var(--primary);
    color: white;
}

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

.user-name {
    color: var(--text-secondary);
}

/* 主内容区 */
.main {
    padding: 24px 0;
}

/* 卡片 */
.card {
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-header);
}

.card-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 24px;
}

/* 表格 */
.table-wrapper {
    overflow-x: auto;
}

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

table th,
table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

table th {
    background: var(--bg-header);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 13px;
    text-transform: uppercase;
}

table tr:hover {
    background: var(--bg-hover);
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

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

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

.btn-success {
    background: var(--success);
    color: white;
}

.btn-warning {
    background: var(--warning);
    color: white;
}

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

.btn-info {
    background: var(--info);
    color: white;
}

.btn-secondary {
    background: var(--border-color);
    color: var(--text-secondary);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-group {
    display: flex;
    gap: 8px;
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
    background: var(--bg-input);
    color: var(--text-primary);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(93, 138, 102, 0.15);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

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

.badge-success {
    background: #d4e8d6;
    color: #3d6b42;
}

.badge-warning {
    background: #f5ecc7;
    color: #8b7919;
}

.badge-danger {
    background: #f5d4d4;
    color: #a04444;
}

.badge-info {
    background: #d4e5ed;
    color: #3d6b7a;
}

.badge-secondary {
    background: var(--border-color);
    color: var(--text-secondary);
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border-light);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-header);
}

.modal-header h3 {
    font-size: 18px;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: var(--bg-header);
}

/* 虚拟卡样式 */
.virtual-card {
    background: linear-gradient(135deg, #7d9b7a 0%, #5d8a66 100%);
    border-radius: 16px;
    padding: 24px;
    color: white;
    width: 380px;
    box-shadow: 0 10px 30px rgba(93, 138, 102, 0.3);
}

.virtual-card .card-brand {
    text-align: right;
    font-size: 24px;
    font-weight: 700;
}

.virtual-card .card-number {
    font-size: 22px;
    letter-spacing: 3px;
    margin: 30px 0 20px;
    font-family: monospace;
}

.virtual-card .card-info {
    display: flex;
    justify-content: space-between;
}

.virtual-card .card-info label {
    font-size: 10px;
    opacity: 0.8;
    text-transform: uppercase;
}

.virtual-card .card-info span {
    font-size: 14px;
    font-weight: 500;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid var(--border-light);
}

.stat-card .stat-title {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 8px;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

/* 提示信息 */
.alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d4e8d6;
    color: #3d6b42;
    border: 1px solid #b8d4bb;
}

.alert-error {
    background: #f5d4d4;
    color: #a04444;
    border: 1px solid #e8b8b8;
}

.alert-warning {
    background: #f5ecc7;
    color: #8b7919;
    border: 1px solid #e8dba8;
}

.alert-info {
    background: #d4e5ed;
    color: #3d6b7a;
    border: 1px solid #b8d0dc;
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

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

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state svg {
    width: 80px;
    height: 80px;
    margin-bottom: 16px;
    opacity: 0.5;
}

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

.pagination button {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-secondary);
}

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

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

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

/* 选项卡 */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
    background: var(--bg-header);
    border-radius: 8px 8px 0 0;
}

.tab {
    padding: 12px 24px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-weight: 500;
}

.tab:hover {
    color: var(--text-secondary);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* 工具栏 */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.search-box {
    display: flex;
    gap: 12px;
    flex: 1;
    max-width: 600px;
}

.search-box input,
.search-box select {
    flex: 1;
}

/* 响应式 */
@media (max-width: 768px) {
    .header-inner {
        flex-wrap: wrap;
        height: auto;
        padding: 16px 0;
    }

    .nav {
        width: 100%;
        margin-top: 12px;
        overflow-x: auto;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .virtual-card {
        width: 100%;
    }

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