/* ==========================================================================
 * FRP 前台 - EasyAdmin / Layui 风格覆盖
 * 保留原 app.css 类名，通过覆盖实现 Layui / EA 视觉统一。
 * ========================================================================== */

:root {
    --ea-primary: #1E9FFF;
    --ea-primary-dark: #1786e0;
    --ea-success: #19be6b;
    --ea-warning: #e6a23c;
    --ea-danger: #f56c6c;
    --ea-info: #1E9FFF;
    --ea-text: #333;
    --ea-text-sub: #666;
    --ea-text-muted: #999;
    --ea-border: #e6e6e6;
    --ea-bg: #f0f2f5;
    --ea-card-bg: #fff;
    --ea-side-bg: #28333e;
    --ea-side-bg2: #1f2933;
    --ea-side-color: #c2c9d6;
    --ea-header-h: 60px;
    --ea-side-w: 210px;
}

/* -------------------- 整体 -------------------- */
body {
    background: var(--ea-bg);
    color: var(--ea-text);
}

/* -------------------- 顶部导航（保持浅色，但更简洁） -------------------- */
.topbar {
    background: #fff;
    border-bottom: 1px solid var(--ea-border);
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.topbar-inner { height: 60px; }
.nav a { color: var(--ea-text-sub); border-radius: 4px; }
.nav a:hover, .nav a.active { color: var(--ea-primary); background: #f0f8ff; }

/* -------------------- 按钮： Layui 风格 -------------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 5px;
    padding: 0 16px; height: 34px; border: 1px solid #dcdfe6; border-radius: 4px;
    background: #fff; color: #606266; font-size: 13px; cursor: pointer; white-space: nowrap;
    transition: all .12s; box-sizing: border-box; line-height: 1;
}
.btn:hover { color: var(--ea-primary); border-color: #aed8ff; background: #f0f8ff; }
.btn-primary, .btn-normal {
    background: var(--ea-primary); border-color: var(--ea-primary); color: #fff;
}
.btn-primary:hover, .btn-normal:hover { background: var(--ea-primary-dark); border-color: var(--ea-primary-dark); color: #fff; }
.btn-danger { background: var(--ea-danger); border-color: var(--ea-danger); color: #fff; }
.btn-danger:hover { background: #e04141; border-color: #e04141; color: #fff; }
.btn-success { background: var(--ea-success); border-color: var(--ea-success); color: #fff; }
.btn-success:hover { background: #16a45a; border-color: #16a45a; color: #fff; }
.btn-warning { background: var(--ea-warning); border-color: var(--ea-warning); color: #fff; }
.btn-warning:hover { background: #d48b25; border-color: #d48b25; color: #fff; }
.btn-light { background: #fff; border-color: #fff; color: var(--ea-primary); }
.btn-ghost { background: transparent; border-color: rgba(255,255,255,.7); color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,.12); color: #fff; }
.btn-sm { height: 30px; padding: 0 12px; font-size: 12px; }
.btn-lg { height: 42px; padding: 0 22px; font-size: 15px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* -------------------- 表单： Layui 风格 -------------------- */
.form-control, .layui-input {
    height: 38px; line-height: 38px; padding: 0 12px;
    border: 1px solid #e6e6e6; border-radius: 4px;
    background: #fff; color: #333; font-size: 14px;
    transition: border-color .15s, box-shadow .15s; width: 100%;
    box-sizing: border-box;
}
.form-control:focus, .layui-input:focus {
    border-color: var(--ea-primary);
    box-shadow: 0 0 0 2px rgba(30,159,255,.15);
    outline: none;
}
select.form-control, .layui-select {
    appearance: none; -webkit-appearance: none;
    background: #fff url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23999' fill='none' stroke-width='1.2'/%3E%3C/svg%3E") no-repeat right 10px center;
    padding-right: 28px;
}
textarea.form-control, .layui-textarea {
    height: auto; min-height: 100px; line-height: 1.6;
    padding: 10px 12px; resize: vertical;
}
.form-label {
    display: block; margin-bottom: 6px;
    font-size: 13px; color: #555; font-weight: 500;
}
.form-group { margin-bottom: 18px; }
.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 200px; }
.form-hint {
    font-size: 12px; color: #999; margin-top: 5px;
}
.req { color: var(--ea-danger); margin-left: 2px; }

/* -------------------- 卡片： EA 风格 -------------------- */
.card {
    background: var(--ea-card-bg); border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    border: 0; overflow: hidden;
}
.card-head {
    padding: 13px 18px; border-bottom: 1px solid #f0f0f0;
    font-weight: 600; font-size: 15px; color: #222;
    display: flex; justify-content: space-between; align-items: center;
}
.card-title { font-weight: 600; }
.card-body { padding: 18px; }
.card.mb-16 { margin-bottom: 16px; }

/* -------------------- 表格： Layui / EA 风格 -------------------- */
.table-wrap { padding: 0; }
table.data, .layui-table {
    width: 100%; border-collapse: collapse; font-size: 14px;
    background: #fff; color: #333;
}
table.data thead th, .layui-table thead th {
    background: #f8f8f8; color: #333; font-weight: 600;
    padding: 12px 15px; border-bottom: 1px solid #f0f0f0;
    text-align: left;
}
table.data tbody td, .layui-table tbody td {
    padding: 12px 15px; border-bottom: 1px solid #f0f0f0;
}
table.data tbody tr:hover, .layui-table tbody tr:hover { background: #f8fbff; }
table.data tbody tr:last-child td, .layui-table tbody tr:last-child td { border-bottom: 0; }
.table-loading, .text-center { text-align: center; }

/* -------------------- 控制台布局：深色侧边栏 + 白色主内容 -------------------- */
.console-layout {
    display: flex; gap: 0; margin-top: 16px; margin-bottom: 24px;
    align-items: stretch; /* 覆盖 app.css 的 align-items:start，让深色侧边栏撑满整卡高度 */
    background: var(--ea-card-bg); border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06); overflow: hidden;
    min-height: calc(100vh - 120px);
    padding: 0; /* 覆盖 app.css 的 padding:24px 0 60px，避免顶部空白 */
}
.console-layout .side-menu {
    width: var(--ea-side-w); flex: 0 0 var(--ea-side-w);
    background: var(--ea-side-bg); color: var(--ea-side-color);
    padding: 10px 0;
    /* 覆盖 app.css 的 .side-menu { position:sticky; top:86px; border:1px solid; border-radius:10px }
       —— 否则侧边栏会被 sticky 的 top:86px 往下推 86px，在卡片顶部留出一大片空白，
          且自带圆角边框，与外层卡片脱节（实测 gap 恒为 86px）。 */
    position: static; top: auto;
    border: 0; border-radius: 0;
}
.console-layout .side-menu .menu-group {
    padding: 12px 18px 6px; color: #6b7886; font-size: 12px; letter-spacing: .5px;
}
.console-layout .side-menu a {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 18px; color: var(--ea-side-color);
    text-decoration: none; font-size: 14px;
    border-left: 3px solid transparent; transition: all .15s;
}
.console-layout .side-menu a:hover { background: rgba(255,255,255,.06); color: #fff; }
.console-layout .side-menu a.active {
    background: var(--ea-primary); color: #fff; border-left-color: #fff;
}
.console-layout main {
    flex: 1; padding: 18px; min-width: 0; background: var(--ea-bg);
}
.console-layout .page-head {
    display: flex; justify-content: space-between; align-items: flex-start;
    margin-bottom: 16px; gap: 12px; flex-wrap: wrap;
}
.console-layout .page-head h1 { font-size: 18px; margin: 0 0 4px; color: #222; }
.console-layout .page-head .sub { font-size: 12px; color: #999; }

@media (max-width: 900px) {
    .console-layout { flex-direction: column; }
    .console-layout .side-menu { width: 100%; flex: none; }
}

/* -------------------- 统计卡 -------------------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat-card {
    background: var(--ea-card-bg); border-radius: 6px; padding: 16px 18px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.stat-label { color: var(--ea-text-muted); font-size: 12px; margin-bottom: 6px; }
.stat-value { font-size: 22px; font-weight: 700; color: #222; }
.stat-value small { font-size: 13px; color: #999; font-weight: 400; }
@media (max-width: 900px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .stat-grid { grid-template-columns: 1fr; } }

/* -------------------- 状态标签 -------------------- */
.badge {
    display: inline-block; padding: 2px 8px; border-radius: 3px;
    font-size: 12px; line-height: 1.6; white-space: nowrap;
}
.badge-success { background: #e8f7ef; color: #19be6b; }
.badge-danger  { background: #fdeaea; color: #f56c6c; }
.badge-warning { background: #fdf6ec; color: #e6a23c; }
.badge-primary { background: #ecf5ff; color: #1E9FFF; }
.badge-info    { background: #f4f4f5; color: #909399; }

/* -------------------- 提示条 -------------------- */
.alert {
    padding: 10px 14px; border-radius: 4px; margin-bottom: 16px;
    font-size: 13px; line-height: 1.6;
}
.alert-info    { background: #f0f8ff; border: 1px solid #d2ecff; color: #1E9FFF; }
.alert-warning { background: #fffaf0; border: 1px solid #ffe9c2; color: #e6a23c; }
.alert-danger  { background: #fff5f5; border: 1px solid #ffe0e0; color: #f56c6c; }
.alert-success { background: #f0fff4; border: 1px solid #c7f0d8; color: #19be6b; }

/* -------------------- 空状态 / 加载 -------------------- */
.empty {
    text-align: center; color: var(--ea-text-muted); padding: 32px 0;
}

/* -------------------- 首页特性卡片：固定 3 列，6 条排两行 -------------------- */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}
@media (max-width: 900px) { .feature-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .feature-grid { grid-template-columns: 1fr; } }

/* -------------------- 页面标题（落地页） -------------------- */
.page-head { margin-bottom: 16px; }
.page-head h1 { font-size: 18px; margin: 0 0 4px; color: #222; }
.page-head .sub { font-size: 12px; color: #999; }

/* -------------------- 认证页（登录/注册） -------------------- */
.auth-wrap {
    min-height: calc(100vh - 62px - 60px);
    display: flex; align-items: center; justify-content: center;
    padding: 40px 20px;
}
.auth-card {
    width: 420px; max-width: 100%; background: #fff; border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,.08); padding: 32px;
}
.auth-card h1 { font-size: 22px; text-align: center; color: #222; margin: 0 0 4px; }
.auth-sub { text-align: center; color: #999; font-size: 13px; margin-bottom: 24px; }
.auth-foot { text-align: center; font-size: 13px; color: #999; margin-top: 18px; }
.captcha-img { height: 38px; border-radius: 4px; cursor: pointer; border: 1px solid #e6e6e6; }

/* -------------------- 工具栏 -------------------- */
.toolbar {
    display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
    margin-bottom: 14px; padding: 0;
}
.toolbar .spacer { flex: 1; }

/* -------------------- 分页条 -------------------- */
.page-bar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 0 0; font-size: 13px;
}
.page-bar .pages { display: flex; gap: 6px; }
.page-bar .pages a, .page-bar .pages span {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 30px; height: 30px; padding: 0 10px;
    border: 1px solid #e6e6e6; border-radius: 4px; color: #666;
    cursor: pointer; user-select: none; background: #fff;
}
.page-bar .pages a:hover, .page-bar .pages span.current {
    border-color: var(--ea-primary); color: var(--ea-primary);
}
.page-bar .pages span.current { background: #f0f8ff; }
.page-bar .total { color: #999; }

/* -------------------- 响应式 -------------------- */
@media (max-width: 780px) {
    .auth-wrap { padding: 20px; }
    .form-row { flex-direction: column; gap: 0; }
}
