/* ================= 基础重置 ================= */
* { box-sizing: border-box; }
body { margin: 0; background: #eef2f7; color: #334155; font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; -webkit-font-smoothing: antialiased; }
a { text-decoration: none; color: #4f46e5; }
a:hover { color: #4338ca; }
img { border: 0; max-width: 100%; }

/* ================= 整体框架布局 (带侧边栏) ================= */
.layout-wrapper { display: flex; min-height: 100vh; width: 100%; }
.main-content { flex: 1; min-width: 0; padding: 24px 30px 50px; background: #eef2f7; }

/* 顶部条 */
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; gap: 14px; background: #fff; padding: 15px 20px; border-radius: 12px; box-shadow: 0 2px 10px rgba(15,23,42,.03); }
.topbar-left { display: flex; align-items: center; gap: 15px; }
.topbar h1 { font-size: 20px; font-weight: 700; margin: 0; color: #0f172a; }
.topbar .breadcrumb { font-size: 13px; color: #94a3b8; margin-top: 4px; }
.btn-ghost { border: 1px solid #dbe3ee; background: #fff; color: #475569; font-size: 13px; padding: 8px 15px; border-radius: 8px; cursor: pointer; transition: .2s; display: inline-flex; align-items: center; gap: 6px; }
.btn-ghost:hover { background: #f8fafc; border-color: #c7d2fe; color: #4f46e5; }

/* 侧边栏 */
.sidebar { width: 250px; flex-shrink: 0; background: linear-gradient(180deg, #0f1a2e 0%, #1b283d 100%); padding: 20px 14px; overflow-y: auto; z-index: 1040; transition: transform .28s ease; }
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 4px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 18px; font-size: 17px; font-weight: 700; color: #fff; }
.side-user { display: flex; flex-direction: column; padding: 12px; border-radius: 12px; background: rgba(255,255,255,.055); margin-bottom: 6px; color: #fff; }
.side-user .n { font-size: 14px; font-weight: 600; color: #fff; line-height: 1.3; }
.side-user .g { font-size: 11.5px; color: #94a3b8; margin-top: 2px; }

/* 覆盖原生的侧边栏表格菜单 */
.sidebar table { width: 100%; border-collapse: collapse; border: 0 !important; margin-bottom: 15px; }
.sidebar td { border: 0 !important; background: transparent !important; padding: 0 !important; }
.sidebar .header { background: transparent !important; cursor: pointer; border-radius: 8px; transition: .2s; margin-bottom: 2px; }
.sidebar .header:hover { background: rgba(255,255,255,.07) !important; }
.sidebar .header td { padding: 10px 12px !important; font-size: 14px; font-weight: 600; color: #c3cfdf; }
.sidebar .header img { display: none; }
.sidebar .header td::before { content: '▸'; display: inline-block; margin-right: 8px; font-size: 12px; transition: transform .2s; }
.sidebar tbody td table { padding-left: 12px !important; }
.sidebar tbody td a { display: block; padding: 8px 12px; color: #94a3b8; font-size: 13px; border-radius: 6px; transition: .2s; }
.sidebar tbody td a:hover { background: rgba(255,255,255,.05); color: #fff; }

/* 遮罩层 */
.overlay { display: none; position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 1035; backdrop-filter: blur(2px); }


/* ================= 卡片与数据统计 (控制面板) ================= */
.card { background: #fff; border-radius: 16px; border: 1px solid #e8edf4; box-shadow: 0 2px 10px rgba(15,23,42,.045); padding: 24px; margin-bottom: 20px; }
.card-title { font-size: 15px; font-weight: 700; color: #0f172a; margin: 0 0 16px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { display: flex; align-items: center; justify-content: space-between; padding: 20px; border-radius: 16px; background: #fff; border: 1px solid #e8edf4; box-shadow: 0 2px 10px rgba(15,23,42,.045); }
.stat .info .k { font-size: 12.5px; color: #94a3b8; margin-bottom: 4px; }
.stat .info .num { font-size: 26px; font-weight: 700; line-height: 1.2; }
.stat .info .unit { font-size: 12px; color: #94a3b8; margin-top: 2px; }
.stat .ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 20px; }

/* 快捷入口 */
.quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.quick { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 12px; background: #f8fafc; border: 1px solid #eef2f7; color: #475569; font-size: 13.5px; font-weight: 500; transition: .2s; }
.quick:hover { background: #fff; border-color: #c7d2fe; color: #4f46e5; box-shadow: 0 6px 16px rgba(79,70,229,.1); transform: translateY(-2px); }
.quick .ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 16px; background: #eef2ff; transition: .2s; }
.quick:hover .ico { background: linear-gradient(135deg, #6366f1, #4f46e5); color: #fff; }


/* ================= 通用表单元素 ================= */
.form-control { width: 100%; border: 1px solid #dbe3ee; border-radius: 10px; font-size: 14px; padding: 11px 13px; transition: .2s; background: #fbfcfe; box-sizing: border-box; }
.form-control:focus { border-color: #6366f1; outline: none; box-shadow: 0 0 0 4px rgba(99,102,241,.12); background: #fff; }
.btn-primary { background: linear-gradient(135deg, #6366f1, #4f46e5); border: 0; color: #fff; border-radius: 10px; padding: 12px 24px; font-size: 14.5px; font-weight: 600; cursor: pointer; transition: .2s; box-shadow: 0 6px 16px rgba(79,70,229,.25); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 20px rgba(79,70,229,.35); }
.btn-outline { border: 1px solid #dbe3ee; background: #fff; color: #475569; border-radius: 10px; padding: 11px 24px; font-size: 14.5px; cursor: pointer; transition: .2s; }
.btn-outline:hover { background: #f8fafc; border-color: #c7d2fe; color: #4f46e5; }
.req { color: #ef4444; margin-left: 2px; }


/* ================= 登录页专属样式 (独立全屏居中) ================= */
.auth-wrapper { display: flex; justify-content: center; align-items: center; min-height: 100vh; padding: 20px; background: radial-gradient(1100px 520px at 8% 0%, #e0e7ff 0%, #f1f5f9 48%, #eef2f7 100%); box-sizing: border-box; }
.auth-card { background: #fff; border-radius: 20px; box-shadow: 0 20px 50px rgba(15,23,42,.1); display: flex; width: 100%; max-width: 960px; overflow: hidden; }

/* 左侧欢迎区 */
.auth-brand { background: linear-gradient(155deg, #4f46e5 0%, #6366f1 48%, #0ea5e9 100%); color: #fff; padding: 48px 40px; flex: 1; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-brand::after { content: ""; position: absolute; width: 280px; height: 280px; border-radius: 50%; background: rgba(255,255,255,.08); right: -90px; bottom: -90px; }
.auth-brand::before { content: ""; position: absolute; width: 180px; height: 180px; border-radius: 50%; background: rgba(255,255,255,.07); left: -60px; top: -60px; }
.auth-brand h2 { font-size: 28px; font-weight: 700; line-height: 1.4; margin: 0 0 15px; position: relative; z-index: 1; }
.auth-brand p { font-size: 14px; color: rgba(255,255,255,.85); line-height: 1.8; margin: 0; position: relative; z-index: 1; }
.auth-brand ul { list-style: none; padding: 0; margin: 30px 0 0; position: relative; z-index: 1; }
.auth-brand ul li { font-size: 13.5px; color: rgba(255,255,255,.95); margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.auth-brand ul li i { width: 20px; height: 20px; border-radius: 50%; background: rgba(255,255,255,.2); display: grid; place-items: center; font-size: 11px; font-style: normal; }

/* 右侧表单区 */
.auth-form-box { padding: 48px 50px; flex: 1; display: flex; flex-direction: column; justify-content: center; box-sizing: border-box; }
.auth-form-box h3 { font-size: 24px; font-weight: 700; color: #0f172a; margin: 0 0 8px; }
.auth-form-box .sub { font-size: 13.5px; color: #94a3b8; margin-bottom: 30px; }
.auth-form-group { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.auth-form-group label { font-size: 13.5px; color: #64748b; font-weight: 500; }
.auth-form-group .radio-group { display: flex; flex-wrap: wrap; gap: 15px; font-size: 13.5px; color: #334155; }
.auth-form-group .radio-group label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-weight: normal; }
.auth-actions { display: flex; gap: 12px; margin-top: 10px; }
.auth-actions .btn-primary, .auth-actions .btn-outline { flex: 1; display: flex; justify-content: center; }


/* ================= 注册页专属：清理后台自定义字段的丑陋表格 ================= */
.reg-wrapper { display: flex; justify-content: center; padding: 30px 20px; box-sizing: border-box; }
.reg-card { background: #fff; border-radius: 16px; box-shadow: 0 10px 30px rgba(15,23,42,0.05); width: 100%; max-width: 650px; padding: 40px; border: 1px solid #e2e8f0; box-sizing: border-box; }
.reg-header { text-align: center; margin-bottom: 30px; }
.reg-header h1 { font-size: 24px; margin: 0 0 10px; color: #0f172a; font-weight: 700; }
.reg-header p { font-size: 14px; color: #94a3b8; margin: 0; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 13.5px; color: #64748b; margin-bottom: 8px; font-weight: 500; }
.reg-row { display: flex; gap: 15px; }
.reg-row > * { flex: 1; }
.btn-submit { width: 100%; background: #4f46e5; color: #fff; border: 0; border-radius: 8px; padding: 14px; font-size: 16px; cursor: pointer; margin-top: 10px; font-weight: 600; transition: 0.2s; }
.btn-submit:hover { background: #4338ca; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(79,70,229,0.3); }

/* 炸平表格核心代码 */
.custom-fields-wrapper, 
.custom-fields-wrapper table, 
.custom-fields-wrapper tbody, 
.custom-fields-wrapper tr, 
.custom-fields-wrapper td, 
.custom-fields-wrapper div { 
    display: block !important; 
    width: 100% !important; 
    background: transparent !important; 
    border: none !important; 
    padding: 0 !important; 
    margin: 0 !important;
}
.custom-fields-wrapper tr { margin-bottom: 20px !important; }
.custom-fields-wrapper td:first-child { 
    font-size: 13.5px !important; 
    color: #64748b !important; 
    margin-bottom: 8px !important; 
    font-weight: 500 !important; 
}
.custom-fields-wrapper td:first-child font,
.custom-fields-wrapper td:first-child b { font-weight: 500 !important; color: #ef4444 !important; font-size: 13.5px !important; }
.custom-fields-wrapper input[type="text"], 
.custom-fields-wrapper input[type="password"], 
.custom-fields-wrapper select, 
.custom-fields-wrapper textarea { 
    width: 100% !important; 
    border: 1px solid #dbe3ee !important; 
    border-radius: 8px !important; 
    padding: 12px 14px !important; 
    font-size: 14px !important; 
    background: #fbfcfe !important; 
    outline: none !important;
    box-sizing: border-box !important;
    font-family: inherit !important;
    color: #334155 !important;
    display: block !important;
    margin-top: 5px !important;
}
.custom-fields-wrapper input:focus, 
.custom-fields-wrapper textarea:focus { 
    border-color: #4f46e5 !important; 
    box-shadow: 0 0 0 3px rgba(79,70,229,0.1) !important; 
    background: #fff !important; 
}
.custom-fields-wrapper textarea { min-height: 100px !important; resize: vertical !important; }
.custom-fields-wrapper span, 
.custom-fields-wrapper font { color: #ef4444 !important; }


/* ================= 响应式媒体查询 ================= */
/* 手机端隐藏左侧欢迎区，让表单占满屏幕 */
@media (max-width: 768px) {
    .auth-brand { display: none; }
    .auth-card { max-width: 100% !important; }
    .auth-form-box { padding: 30px 20px; }
}

/* 响应式核心：手机端侧边栏弹出与样式重置 */
@media (max-width: 991.98px) {
    .sidebar { position: fixed; top: 0; left: 0; height: 100vh; transform: translateX(-100%); }
    .sidebar.on { transform: translateX(0); }
    .overlay.on { display: block; }
    .main-content { padding: 16px !important; }
}

/* 手机端注册页强制单列 */
@media (max-width: 600px) { 
    .reg-row { flex-direction: column; gap: 0; } 
    .reg-card { padding: 25px 20px; }
    .reg-wrapper { padding: 15px 10px; }
}