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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #f0f4f8;
    color: #1e293b;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: #2c7da0;
}

a:hover {
    color: #1e5a74;
}

/* ==================== 登录页面 ==================== */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1e5a74 0%, #2c7da0 100%);
    margin: 0;
}

.login-card {
    background: white;
    padding: 40px 48px;
    border-radius: 24px;
    box-shadow: 0 20px 35px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
}

.login-card h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #1e5a74;
    font-size: 24px;
}

.login-card input {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 16px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    font-size: 16px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.login-card input:focus {
    border-color: #2c7da0;
    outline: none;
}

.login-card button {
    width: 100%;
    padding: 12px;
    background: #2c7da0;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s;
}

.login-card button:hover {
    background: #1e5a74;
}

.login-card .error {
    color: #e53e3e;
    margin-top: 12px;
    text-align: center;
    font-size: 14px;
}

/* ==================== 通用按钮 ==================== */
.btn {
    display: inline-block;
    padding: 8px 20px;
    background: #2c7da0;
    color: white;
    border: none;
    border-radius: 40px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
}

.btn:hover {
    background: #1e5a74;
    color: white;
}

.btn-outline {
    background: transparent;
    color: #2c7da0;
    border: 1px solid #2c7da0;
}

.btn-outline:hover {
    background: #2c7da0;
    color: white;
}

.btn-danger {
    background: #e53e3e;
}

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

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

/* ==================== 布局容器 ==================== */
.page-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

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

.search-area {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.search-area input {
    padding: 8px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    width: 260px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.search-area input:focus {
    border-color: #2c7da0;
    outline: none;
}

.search-area button {
    padding: 8px 20px;
    background: #2c7da0;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.search-area button:hover {
    background: #1e5a74;
}

.clear-btn {
    background: #6c757d !important;
}

.clear-btn:hover {
    background: #5a6268 !important;
}

.stats {
    font-size: 14px;
    color: #475569;
    background: #f1f5f9;
    padding: 6px 16px;
    border-radius: 20px;
}

.hint {
    font-size: 12px;
    color: #64748b;
}

/* ==================== 表格 ==================== */
.table-wrapper {
    overflow-x: auto;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    background: white;
    max-height: calc(100vh - 180px);
    overflow-y: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 800px;
}

.data-table thead tr {
    position: sticky;
    top: 0;
    background: #f8fafc;
    z-index: 10;
}

.data-table th {
    background: #f8fafc;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #1e293b;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}

.data-table td {
    padding: 10px 16px;
    border-bottom: 1px solid #e2e8f0;
    color: #334155;
    white-space: nowrap;
}

.data-table tr:hover {
    background: #f8fafc;
}

.data-table .actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.data-table .actions a {
    color: #2c7da0;
    font-size: 13px;
}

.data-table .actions a:hover {
    color: #1e5a74;
}

/* ==================== 加载状态 ==================== */
.loading {
    text-align: center;
    padding: 40px;
    color: #64748b;
}

.no-data {
    text-align: center;
    padding: 40px;
    color: #94a3b8;
}

/* ==================== 闪存动画 ==================== */
@keyframes flash-green {
    0% { background: #bbf7d0; }
    100% { background: transparent; }
}

.flash {
    animation: flash-green 0.6s ease;
}

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

    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-area {
        flex-wrap: wrap;
    }

    .search-area input {
        width: 100%;
    }

    .data-table {
        font-size: 13px;
        min-width: 600px;
    }

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

    .login-card {
        padding: 24px;
        margin: 16px;
    }
}