/* EA远程授权管理系统 - 深色科技大屏风格 */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #030813;
    --panel: rgba(10, 22, 45, 0.78);
    --panel-border: rgba(0, 247, 255, 0.22);
    --cyan: #00f7ff;
    --cyan-dim: rgba(0, 247, 255, 0.15);
    --gold: #ffd166;
    --gold-dim: rgba(255, 209, 102, 0.18);
    --red: #ff4d6d;
    --green: #39ff9f;
    --orange: #ffb347;
    --text: #cbe3ff;
    --text-dim: #7794b8;
    --font-num: 'Inter', 'Segoe UI', 'Microsoft YaHei', 'PingFang SC', sans-serif;
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Segoe UI', sans-serif;
    background:
        radial-gradient(circle at 20% 30%, rgba(0, 247, 255, 0.08) 0%, transparent 35%),
        radial-gradient(circle at 80% 70%, rgba(0, 120, 255, 0.08) 0%, transparent 35%),
        var(--bg);
    color: var(--text);
    font-size: 14px;
    min-height: 100vh;
    overflow-x: hidden;
}

/* 网格背景 */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 247, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 247, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

/* ---------- 左侧边栏 ---------- */
.sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: 68px;
    background: rgba(6, 16, 34, 0.92);
    border-right: 1px solid rgba(0, 247, 255, 0.12);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 18px 0;
    z-index: 50;
    backdrop-filter: blur(8px);
}
.sidebar-logo {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--cyan), #0066ff);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 28px;
    box-shadow: 0 0 18px rgba(0, 247, 255, 0.35);
}
.sidebar-logo svg { width: 22px; height: 22px; fill: #fff; }

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 18px;
    flex: 1;
}
.sidebar-nav a, .sidebar-nav button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-dim);
    cursor: pointer;
    transition: .2s;
    text-decoration: none;
}
.sidebar-nav a:hover, .sidebar-nav button:hover,
.sidebar-nav a.active {
    color: var(--cyan);
    border-color: rgba(0, 247, 255, 0.35);
    background: var(--cyan-dim);
    box-shadow: 0 0 14px rgba(0, 247, 255, 0.15);
}
.sidebar-nav svg { width: 22px; height: 22px; fill: currentColor; }

/* ---------- 顶部标题栏 ---------- */
.topbar {
    position: fixed;
    left: 68px; right: 0; top: 0;
    height: 64px;
    background: rgba(4, 12, 26, 0.85);
    border-bottom: 1px solid rgba(0, 247, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    z-index: 40;
    backdrop-filter: blur(10px);
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 2px;
    color: #fff;
    text-shadow: 0 0 12px rgba(0, 247, 255, 0.55);
}
.brand::before {
    content: '';
    width: 4px; height: 22px;
    background: linear-gradient(180deg, var(--cyan), transparent);
    border-radius: 2px;
}
.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}
.user {
    color: var(--text-dim);
    font-size: 13px;
}
.user strong { color: var(--cyan); }

/* ---------- 主内容区 ---------- */
.main-wrap {
    margin-left: 68px;
    padding: 88px 24px 32px;
    position: relative;
    z-index: 1;
}
.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* ---------- 统计卡片 ---------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 20px;
}
.stat-card {
    position: relative;
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 20px 18px;
    backdrop-filter: blur(6px);
    overflow: hidden;
    transition: .25s;
}
.stat-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(0,247,255,0.35), transparent 50%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(0, 247, 255, 0.12);
}
.stat-card.stat-warn { border-color: rgba(255, 179, 71, 0.35); }
.stat-card.stat-warn::before { background: linear-gradient(135deg, rgba(255,179,71,0.45), transparent 50%); }
.stat-card.stat-danger { border-color: rgba(255, 77, 109, 0.35); }
.stat-card.stat-danger::before { background: linear-gradient(135deg, rgba(255,77,109,0.45), transparent 50%); }
.stat-card.stat-gold { border-color: rgba(255, 209, 102, 0.35); }
.stat-card.stat-gold::before { background: linear-gradient(135deg, rgba(255,209,102,0.45), transparent 50%); }
.stat-card.stat-money { border-color: rgba(57, 255, 159, 0.35); }
.stat-card.stat-money::before { background: linear-gradient(135deg, rgba(57,255,159,0.4), transparent 50%); }
.stat-card.stat-money:nth-of-type(2) { border-color: rgba(0, 247, 255, 0.35); }
.stat-card.stat-money:nth-of-type(2)::before { background: linear-gradient(135deg, rgba(0,247,255,0.4), transparent 50%); }

.stat-icon {
    position: absolute;
    top: 14px; right: 14px;
    width: 34px; height: 34px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0, 247, 255, 0.12);
    color: var(--cyan);
}
.stat-card.stat-warn .stat-icon { background: rgba(255, 179, 71, 0.12); color: var(--orange); }
.stat-card.stat-danger .stat-icon { background: rgba(255, 77, 109, 0.12); color: var(--red); }
.stat-card.stat-gold .stat-icon { background: rgba(255, 209, 102, 0.12); color: var(--gold); }
.stat-card.stat-money .stat-icon { background: rgba(57, 255, 159, 0.12); color: #39ff9f; }
.stat-card.stat-money:nth-of-type(2) .stat-icon { background: rgba(0, 247, 255, 0.12); color: var(--cyan); }
.stat-icon svg { width: 20px; height: 20px; fill: currentColor; }

.stat-label {
    color: var(--text-dim);
    font-size: 13px;
    margin-bottom: 6px;
    letter-spacing: 1px;
}
.stat-value {
    font-family: var(--font-num);
    font-size: 34px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
}
.stat-card.stat-warn .stat-value { color: var(--orange); text-shadow: 0 0 14px rgba(255, 179, 71, 0.4); }
.stat-card.stat-danger .stat-value { color: var(--red); text-shadow: 0 0 14px rgba(255, 77, 109, 0.4); }
.stat-card.stat-gold .stat-value { color: var(--gold); text-shadow: 0 0 14px rgba(255, 209, 102, 0.4); }
.stat-card.stat-money .stat-value { color: #39ff9f; text-shadow: 0 0 14px rgba(57, 255, 159, 0.4); font-size: 26px; }
.stat-card.stat-money:nth-of-type(2) .stat-value { color: var(--cyan); text-shadow: 0 0 14px rgba(0, 247, 255, 0.4); }

/* ---------- 资金单元格样式 ---------- */
.money-cell { font-family: var(--font-num); color: #39ff9f; font-weight: 600; letter-spacing: -0.01em; }
.money-up { color: var(--red); font-family: var(--font-num); font-weight: 600; letter-spacing: -0.01em; }
.money-down { color: #39ff9f; font-family: var(--font-num); font-weight: 600; letter-spacing: -0.01em; }
.money-flat { color: var(--text-dim); font-family: var(--font-num); }

/* ---------- 内容面板（图表 + 表格） ---------- */
.content-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 18px;
    margin-bottom: 20px;
}
.panel {
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 18px;
    backdrop-filter: blur(6px);
    position: relative;
    overflow: hidden;
}
.panel::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(0,247,255,0.25), transparent 55%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}
.panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 12px;
    padding-left: 10px;
    border-left: 3px solid var(--cyan);
}
.panel-title.gold { border-left-color: var(--gold); }
.chart-wrap { position: relative; height: 230px; }

/* ---------- 工具栏 ---------- */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.search-box {
    display: flex;
    gap: 10px;
}
.search-box input {
    width: 260px;
    padding: 9px 14px;
    background: rgba(0, 247, 255, 0.06);
    border: 1px solid rgba(0, 247, 255, 0.22);
    border-radius: 8px;
    color: #fff;
    outline: none;
    font-size: 13px;
}
.search-box input::placeholder { color: var(--text-dim); }
.search-box input:focus { border-color: var(--cyan); box-shadow: 0 0 10px rgba(0, 247, 255, 0.15); }

/* ---------- 按钮 ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    border: 1px solid rgba(0, 247, 255, 0.35);
    border-radius: 8px;
    background: rgba(0, 247, 255, 0.08);
    color: var(--cyan);
    cursor: pointer;
    font-size: 13px;
    text-decoration: none;
    transition: .2s;
    line-height: 1.4;
}
.btn:hover {
    background: rgba(0, 247, 255, 0.18);
    box-shadow: 0 0 14px rgba(0, 247, 255, 0.2);
}
.btn svg { width: 14px; height: 14px; fill: currentColor; }
.btn-primary {
    background: linear-gradient(90deg, rgba(0, 247, 255, 0.22), rgba(0, 120, 255, 0.22));
    color: #fff;
    border-color: rgba(0, 247, 255, 0.55);
}
.btn-primary:hover { background: linear-gradient(90deg, rgba(0, 247, 255, 0.35), rgba(0, 120, 255, 0.35)); }
.btn-danger {
    color: var(--red);
    border-color: rgba(255, 77, 109, 0.35);
    background: rgba(255, 77, 109, 0.08);
}
.btn-danger:hover { background: rgba(255, 77, 109, 0.18); box-shadow: 0 0 12px rgba(255, 77, 109, 0.2); }
.btn-sm { padding: 5px 12px; font-size: 12px; }
/* 金色高亮按钮：用于「新EA加授权模块」等主推入口 */
.btn-gold {
    color: var(--gold);
    border-color: rgba(255, 209, 102, 0.45);
    background: var(--gold-dim);
}
.btn-gold:hover {
    background: rgba(255, 209, 102, 0.28);
    box-shadow: 0 0 14px rgba(255, 209, 102, 0.25);
}
.btn-block { width: 100%; }

/* ---------- 表格 ---------- */
.table-wrap {
    position: relative;
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    overflow: auto;
    backdrop-filter: blur(6px);
}
.table-wrap::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(0,247,255,0.25), transparent 55%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}
.data-table { width: 100%; min-width: 1180px; border-collapse: collapse; }
.data-table th, .data-table td {
    padding: 13px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(0, 247, 255, 0.08);
    white-space: nowrap;
}
.data-table td:last-child {
    min-width: 150px;
    white-space: normal;
}
.data-table td:last-child .btn {
    margin-right: 8px;
    margin-bottom: 4px;
}
.data-table td:last-child .btn:last-child { margin-right: 0; }
.data-table th {
    background: rgba(0, 247, 255, 0.08);
    color: var(--cyan);
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 1px;
}
.data-table tr:hover td { background: rgba(0, 247, 255, 0.05); }
.data-table .empty { text-align: center; color: var(--text-dim); padding: 46px 0; }

.tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    border: 1px solid transparent;
}
.tag-mt4 { background: rgba(0, 120, 255, 0.12); color: #4db8ff; border-color: rgba(0, 120, 255, 0.3); }
.tag-mt5 { background: rgba(57, 255, 159, 0.12); color: var(--green); border-color: rgba(57, 255, 159, 0.3); }
.tag-ok { background: rgba(57, 255, 159, 0.12); color: var(--green); border-color: rgba(57, 255, 159, 0.3); }
.tag-warn { background: rgba(255, 179, 71, 0.12); color: var(--orange); border-color: rgba(255, 179, 71, 0.3); }
.tag-expired { background: rgba(255, 77, 109, 0.12); color: var(--red); border-color: rgba(255, 77, 109, 0.3); }
.tag-ea { background: rgba(196, 128, 255, 0.14); color: #c480ff; border-color: rgba(196, 128, 255, 0.35); }

.muted { color: var(--text-dim); }

/* ---------- 弹窗 ---------- */
.modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}
.modal-mask[hidden] { display: none !important; }
.modal {
    background: rgba(8, 22, 48, 0.96);
    border: 1px solid rgba(0, 247, 255, 0.35);
    border-radius: 14px;
    width: 440px;
    max-width: calc(100vw - 32px);
    padding: 24px;
    box-shadow: 0 0 40px rgba(0, 247, 255, 0.18);
    position: relative;
}
.modal::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 14px;
    padding: 1px;
    background: linear-gradient(135deg, var(--cyan), transparent 60%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}
.modal h2 {
    font-size: 17px;
    margin-bottom: 20px;
    color: #fff;
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(0, 247, 255, 0.35);
}
.modal-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 22px; }
.modal-tip { color: var(--text-dim); font-size: 12px; margin-top: 6px; }

/* ---------- 表单 ---------- */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    margin-bottom: 7px;
    color: var(--cyan);
    font-weight: 500;
    font-size: 13px;
}
.form-group input, .form-group select {
    width: 100%;
    padding: 10px 13px;
    background: rgba(0, 247, 255, 0.06);
    border: 1px solid rgba(0, 247, 255, 0.25);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    outline: none;
}
.form-group input:focus, .form-group select:focus { border-color: var(--cyan); box-shadow: 0 0 12px rgba(0, 247, 255, 0.15); }
.form-group option { background: #061326; color: #fff; }

/* ---------- 提示 ---------- */
.alert {
    padding: 11px 16px;
    border-radius: 8px;
    margin-bottom: 14px;
    font-size: 14px;
    border: 1px solid transparent;
}
.alert-error { background: rgba(255, 77, 109, 0.12); color: var(--red); border-color: rgba(255, 77, 109, 0.35); }
.alert-success { background: rgba(57, 255, 159, 0.12); color: var(--green); border-color: rgba(57, 255, 159, 0.35); }
#toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    display: none;
}

/* ---------- 登录页 ---------- */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background:
        radial-gradient(circle at 30% 30%, rgba(0, 247, 255, 0.12) 0%, transparent 40%),
        var(--bg);
}
.login-box {
    background: rgba(8, 22, 48, 0.95);
    border: 1px solid rgba(0, 247, 255, 0.35);
    border-radius: 14px;
    padding: 36px 32px;
    width: 380px;
    max-width: calc(100vw - 32px);
    box-shadow: 0 0 50px rgba(0, 247, 255, 0.18);
    text-align: center;
}
.login-box h1 { font-size: 22px; color: #fff; margin-bottom: 6px; text-shadow: 0 0 14px rgba(0, 247, 255, 0.4); }
.login-sub { color: var(--text-dim); margin-bottom: 26px; }
.login-box .form-group { text-align: left; }

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .content-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
    .sidebar { width: 56px; }
    .main-wrap, .topbar { margin-left: 56px; }
    .stats-grid { grid-template-columns: 1fr; }
    .toolbar { flex-direction: column; align-items: stretch; }
    .search-box input { width: 100%; }
}
