/**
 * 系统样式表 - 现代大气风格
 * System Stylesheet - Modern & Atmospheric
 */

/* ========== 字体引入 ========== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&family=Khmer+OS+Siemreap&display=swap');

/* ========== 全局变量 ========== */
:root {
    --primary-color: #4e73df;
    --primary-gradient: linear-gradient(135deg, #4e73df 0%, #224abe 100%);
    --secondary-color: #858796;
    --success-color: #1cc88a;
    --info-color: #36b9cc;
    --warning-color: #f6c23e;
    --danger-color: #e74a3b;
    --light-color: #f8f9fc;
    --dark-color: #5a5c69;

    --bg-color: #f3f4f7;
    --card-bg: #ffffff;
    --text-main: #2e384d;
    --text-muted: #8798ad;
    --border-color: #e2e8f0;

    --shadow-sm: 0 2px 4px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
}

/* ========== 全局重置 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', 'Noto Sans SC', 'Khmer OS Siemreap', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-main);
    background-color: var(--bg-color);
    background-image:
        radial-gradient(at 0% 0%, rgba(78, 115, 223, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(28, 200, 138, 0.05) 0px, transparent 50%);
    background-attachment: fixed;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    color: #224abe;
    text-decoration: none;
}

.wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 30px;
    width: 100%;
    flex: 1;
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== 导航栏 ========== */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 0 40px;
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.navbar-brand h2 {
    font-size: 20px;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.navbar-menu {
    display: flex;
    gap: 10px;
}

.nav-link {
    color: var(--text-main);
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 50px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover {
    color: var(--primary-color);
    background: rgba(78, 115, 223, 0.1);
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 25px;
}

/* ========== 用户信息 & 下拉 ========== */
.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-name {
    font-weight: 600;
    color: var(--text-main);
    font-size: 14px;
}

.user-role {
    font-size: 11px;
    padding: 2px 8px;
    background: rgba(78, 115, 223, 0.1);
    color: var(--primary-color);
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ========== 语言切换 ========== */
.language-switcher {
    display: flex;
    align-items: center;
    background: #f1f3f9;
    padding: 4px;
    border-radius: 50px;
}

.language-switcher span {
    color: #d1d3e2;
    font-size: 12px;
}

.language-switcher a {
    color: var(--text-muted);
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
}

.language-switcher a:hover {
    color: var(--primary-color);
}

.language-switcher a.active {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

/* ========== 按钮 ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
    gap: 8px;
}

.btn:active {
    transform: translateY(1px);
    box-shadow: none;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 10px rgba(78, 115, 223, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 15px rgba(78, 115, 223, 0.4);
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, #1cc88a 0%, #13855c 100%);
    color: white;
    box-shadow: 0 4px 10px rgba(28, 200, 138, 0.3);
}

.btn-success:hover {
    box-shadow: 0 6px 15px rgba(28, 200, 138, 0.4);
    transform: translateY(-1px);
}

.btn-danger {
    background: linear-gradient(135deg, #e74a3b 0%, #be2617 100%);
    color: white;
    box-shadow: 0 4px 10px rgba(231, 74, 59, 0.3);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    box-shadow: none;
}

.btn-outline:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: white;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-sm {
    padding: 6px 16px;
    font-size: 12px;
}

/* ========== 表单元素 ========== */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-main);
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e3e6f0;
    border-radius: var(--radius-md);
    background-color: #fcfcfd;
    font-size: 14px;
    color: var(--text-main);
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    background-color: white;
    border-color: #bac8f3;
    box-shadow: 0 0 0 4px rgba(78, 115, 223, 0.1);
}

/* ========== 提示框 ========== */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    border: none;
    display: flex;
    align-items: center;
    font-size: 14px;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
}

.alert-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

/* ========== 卡片 (Glassmorphism) ========== */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(0, 0, 0, 0.02);
    margin-bottom: 30px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.card-header {
    padding: 24px 30px;
    background: white;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

.card-body {
    padding: 30px;
}

/* ========== 统计卡片 ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    padding: 30px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 24px;
    border: 1px solid rgba(0, 0, 0, 0.02);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.stat-icon {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.stat-icon.primary {
    background: linear-gradient(135deg, #4e73df 0%, #224abe 100%);
    color: white;
}

.stat-icon.success {
    background: linear-gradient(135deg, #1cc88a 0%, #13855c 100%);
    color: white;
}

.stat-icon.warning {
    background: linear-gradient(135deg, #f6c23e 0%, #dfa009 100%);
    color: white;
}

.stat-icon.danger {
    background: linear-gradient(135deg, #e74a3b 0%, #be2617 100%);
    color: white;
}

.stat-content h3 {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 4px;
    color: var(--text-main);
}

.stat-content p {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ========== 表格 ========== */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-md);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

table thead th {
    text-align: left;
    background: #f8f9fc;
    padding: 16px 20px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}

table tbody td {
    padding: 20px;
    border-bottom: 1px solid #f1f3f9;
    color: var(--text-main);
    vertical-align: middle;
}

table tbody tr:last-child td {
    border-bottom: none;
}

table tbody tr {
    transition: background-color 0.2s;
}

table tbody tr:hover {
    background-color: #fafbfc;
}

/* ========== 徽章 Pills ========== */
.badge {
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: rgba(28, 200, 138, 0.15);
    color: #17a673;
}

.badge-primary {
    background: rgba(78, 115, 223, 0.15);
    color: #2e59d9;
}

.badge-warning {
    background: rgba(246, 194, 62, 0.15);
    color: #dda20a;
}

.badge-danger {
    background: rgba(231, 74, 59, 0.15);
    color: #e74a3b;
}

.badge-secondary {
    background: #eaecf4;
    color: #858796;
}

/* ========== 登录页 ========== */
.login-page {
    background: radial-gradient(circle at top left, #4e73df 0%, transparent 25%),
        radial-gradient(circle at bottom right, #1cc88a 0%, transparent 25%),
        #f8f9fc;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-box {
    width: 100%;
    max-width: 440px;
    padding: 50px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: var(--shadow-2xl);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-header h1 {
    font-size: 28px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

.login-header p {
    color: var(--text-muted);
    margin-top: 10px;
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    .navbar {
        padding: 0 20px;
        height: auto;
        flex-direction: column;
        gap: 15px;
        padding-bottom: 15px;
    }

    .nav-link {
        font-size: 13px;
    }

    .stat-card {
        padding: 20px;
    }

    .login-box {
        padding: 30px;
        margin: 20px;
    }
}