/* 学习机管理后台通用样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif; color: #333; }

/* ========== 登录页 ========== */
.login-body {
    min-height: 100vh;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 55%, #3a7bd5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-wrap { width: 400px; max-width: 92vw; }
.login-box {
    background: #fff;
    border-radius: 12px;
    padding: 40px 38px 28px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .28);
}
.login-head { text-align: center; margin-bottom: 30px; }
.login-logo {
    width: 62px; height: 62px; margin: 0 auto 16px;
    border-radius: 16px; display: block;
    box-shadow: 0 6px 16px rgba(255, 140, 0, .35);
}
.login-head h1 { font-size: 22px; color: #1e3c72; font-weight: 600; letter-spacing: 1px; }
.login-head p { font-size: 11px; color: #9aa5b1; margin-top: 6px; letter-spacing: 2px; }
.form-item { margin-bottom: 18px; }
.form-item label { display: block; font-size: 13px; color: #555; margin-bottom: 8px; }
.input-wrap { position: relative; }
.input-icon {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    font-size: 16px; color: #aab2bd; pointer-events: none;
}
.input-wrap input {
    width: 100%; height: 44px; padding: 0 12px 0 40px;
    border: 1px solid #d9e0e8; border-radius: 6px;
    font-size: 14px; outline: none; transition: border-color .2s, box-shadow .2s;
}
.input-wrap input:focus { border-color: #ff8c00; box-shadow: 0 0 0 3px rgba(255, 140, 0, .12); }
.err-tip {
    display: none; background: #fff2f0; border: 1px solid #ffccc7;
    color: #cf1322; font-size: 13px; padding: 9px 12px;
    border-radius: 5px; margin-bottom: 12px;
}
.btn-login {
    width: 100%; height: 46px; border: none; border-radius: 6px;
    background: linear-gradient(135deg, #ff8c00, #ff6a00);
    color: #fff; font-size: 16px; font-weight: 600; letter-spacing: 4px;
    cursor: pointer; transition: opacity .2s, transform .1s;
}
.btn-login:hover { opacity: .9; }
.btn-login:active { transform: translateY(1px); }
.btn-login:disabled { opacity: .6; cursor: not-allowed; }
.login-foot { text-align: center; font-size: 12px; color: #b0b7bf; margin-top: 20px; }

/* ========== 主框架 ========== */
.main-body { overflow: hidden; height: 100vh; }
.layout { display: flex; height: 100vh; }

/* 左侧菜单 */
.sidebar {
    width: 220px; flex-shrink: 0;
    background: #1e293b; color: #cbd5e1;
    display: flex; flex-direction: column;
    transition: width .2s;
}
.sidebar.collapsed { width: 60px; }
.sidebar-head {
    height: 60px; flex-shrink: 0;
    display: flex; align-items: center; gap: 10px;
    padding: 0 16px; border-bottom: 1px solid rgba(255,255,255,.08);
    font-size: 16px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden;
}
.sidebar-head .logo {
    width: 32px; height: 32px; flex-shrink: 0;
    border-radius: 8px; display: block;
}
.menu { flex: 1; overflow-y: auto; padding: 8px 0; }
.menu-group > .group-title {
    display: flex; align-items: center; gap: 10px;
    height: 44px; padding: 0 18px; cursor: pointer;
    font-size: 14px; color: #cbd5e1; white-space: nowrap;
    border-left: 3px solid transparent;
}
.menu-group > .group-title:hover { background: rgba(255,255,255,.05); }
.menu-group.open > .group-title { color: #fff; background: rgba(255,255,255,.04); }
.menu-group > .group-title .ico { width: 20px; flex-shrink: 0; text-align: center; font-size: 15px; }
.menu-group > .group-title .arrow { margin-left: auto; font-size: 10px; transition: transform .2s; }
.menu-group.open > .group-title .arrow { transform: rotate(90deg); }
.submenu { display: none; background: #0f172a; }
.menu-group.open .submenu { display: block; }
.submenu a {
    display: block; padding: 10px 18px 10px 48px;
    font-size: 13px; color: #94a3b8; text-decoration: none; white-space: nowrap;
    border-left: 3px solid transparent;
}
.submenu a:hover { color: #fff; background: rgba(255,255,255,.05); }
.submenu a.active { color: #fff; background: rgba(255,140,0,.16); border-left-color: #ff8c00; }
.sidebar.collapsed .menu-group > .group-title span:not(.ico),
.sidebar.collapsed .menu-group > .group-title .arrow,
.sidebar.collapsed .submenu { display: none; }

/* 右侧区域 */
.content { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
    height: 60px; flex-shrink: 0; background: #fff;
    border-bottom: 1px solid #e8edf3;
    display: flex; align-items: center; padding: 0 22px; gap: 16px;
}
.toggle-btn {
    width: 34px; height: 34px; border: none; background: transparent;
    font-size: 18px; color: #64748b; cursor: pointer; border-radius: 5px;
}
.toggle-btn:hover { background: #f1f5f9; }
.crumb { font-size: 14px; color: #64748b; }
.crumb b { color: #1e293b; font-weight: 600; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.user-badge {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; color: #475569;
}
.user-badge .avatar {
    width: 30px; height: 30px; border-radius: 50%;
    background: #ff8c00; color: #fff; text-align: center; line-height: 30px; font-size: 13px;
}
.logout-btn {
    border: 1px solid #e2e8f0; background: #fff; color: #64748b;
    padding: 6px 14px; border-radius: 5px; font-size: 13px; cursor: pointer;
}
.logout-btn:hover { color: #cf1322; border-color: #ffccc7; background: #fff2f0; }
.workspace { flex: 1; border: none; width: 100%; background: #f5f7fa; }

/* 占位页 */
.placeholder {
    height: 100vh; display: flex; align-items: center; justify-content: center;
    background: #f5f7fa;
}
.placeholder-card {
    text-align: center; background: #fff; padding: 50px 60px;
    border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,.06);
}
.placeholder-card .big-ico { font-size: 54px; margin-bottom: 16px; }
.placeholder-card h2 { font-size: 20px; color: #1e293b; margin-bottom: 8px; }
.placeholder-card p { font-size: 13px; color: #94a3b8; }

/* ===== 业务页面通用样式（列表/搜索/表格/分页/弹窗） ===== */
.page-wrap { padding: 18px 22px 30px; min-height: 100vh; box-sizing: border-box; }
.page-title { font-size: 17px; font-weight: 600; color: #1e293b; margin: 0 0 16px; }
.page-title small { font-size: 12px; font-weight: 400; color: #94a3b8; margin-left: 8px; }

.search-bar {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    background: #fff; padding: 14px 16px; border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,.04); margin-bottom: 14px;
}
.search-bar label { font-size: 13px; color: #475569; }
.search-bar input, .search-bar select {
    border: 1px solid #d9dee7; border-radius: 5px; padding: 7px 10px;
    font-size: 13px; color: #1e293b; outline: none; background: #fff;
}
.search-bar input:focus, .search-bar select:focus { border-color: #ff8c00; }
.search-bar input[type=text] { width: 200px; }

.btn {
    border: none; border-radius: 5px; padding: 8px 16px; font-size: 13px;
    cursor: pointer; transition: opacity .2s;
}
.btn:hover { opacity: .85; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: #ff8c00; color: #fff; }
.btn-default { background: #fff; color: #475569; border: 1px solid #d9dee7; }
.btn-danger { background: #fff1f0; color: #d4380d; border: 1px solid #ffccc7; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

.table-box {
    background: #fff; border-radius: 8px; overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
table.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
    background: #f8fafc; color: #475569; font-weight: 600; text-align: left;
    padding: 11px 12px; border-bottom: 1px solid #e8edf3; white-space: nowrap;
}
.data-table td {
    padding: 10px 12px; border-bottom: 1px solid #f1f5f9; color: #334155;
    vertical-align: middle; word-break: break-all;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #fffbf5; }
.data-table .empty { text-align: center; color: #94a3b8; padding: 40px 0; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; }
.tag-green { background: #f6ffed; color: #389e0d; }
.tag-gray { background: #f5f5f5; color: #8c8c8c; }
.tag-orange { background: #fff7e6; color: #d46b08; }
.tag-red { background: #fff1f0; color: #cf1322; }

.pager {
    display: flex; align-items: center; justify-content: flex-end; gap: 8px;
    padding: 12px 16px; background: #fff; margin-top: 0;
}
.pager-info { font-size: 12px; color: #94a3b8; margin-right: auto; }
.pager-btn {
    border: 1px solid #d9dee7; background: #fff; color: #475569;
    padding: 5px 11px; border-radius: 4px; font-size: 12px; cursor: pointer;
}
.pager-btn:hover:not(:disabled) { border-color: #ff8c00; color: #d46b08; }
.pager-btn:disabled { opacity: .45; cursor: not-allowed; }
.pager-cur { font-size: 12px; color: #334155; }

/* 弹窗 */
.modal-mask {
    position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 1000;
    display: flex; align-items: center; justify-content: center;
}
.modal-box {
    background: #fff; border-radius: 10px; width: 480px; max-width: 92vw;
    max-height: 86vh; overflow: auto; box-shadow: 0 12px 40px rgba(0,0,0,.18);
}
.modal-head {
    padding: 16px 20px; border-bottom: 1px solid #f1f5f9;
    font-size: 15px; font-weight: 600; color: #1e293b;
}
.modal-body { padding: 18px 20px; font-size: 13px; color: #334155; }
.modal-foot {
    padding: 12px 20px; border-top: 1px solid #f1f5f9;
    display: flex; justify-content: flex-end; gap: 10px;
}
.modal-field { margin-bottom: 14px; }
.modal-field label { display: block; font-size: 12px; color: #64748b; margin-bottom: 6px; }
.modal-field input, .modal-field select, .modal-field textarea {
    width: 100%; box-sizing: border-box; border: 1px solid #d9dee7;
    border-radius: 5px; padding: 8px 10px; font-size: 13px; outline: none;
}
.modal-field input:focus, .modal-field select:focus, .modal-field textarea:focus { border-color: #ff8c00; }
.modal-field textarea { min-height: 80px; resize: vertical; }
