/* ================= 用户中心 / 管理后台 ================= */

/* ---------- 通用 ---------- */
.hidden { display: none !important; }
.btn-sm { height: 32px; padding: 0 14px; font-size: 13px; border-radius: 4px; }
.btn-line {
    background: #fff; border: 1px solid #D8DFE9; color: #4A5568;
}
.btn-line:hover { border-color: var(--blue); color: var(--blue); }
.btn-danger-line { background: #fff; border: 1px solid #F3C6C6; color: #C62828; }
.btn-danger-line:hover { background: #FEF1F1; }

.tag {
    display: inline-flex; align-items: center; height: 24px; padding: 0 10px;
    border-radius: 12px; font-size: 12px; white-space: nowrap;
}
.tag.pending { background: #FFF7E6; color: #B45309; }
.tag.approved { background: #ECFDF3; color: #15803D; }
.tag.rejected { background: #FEF1F1; color: #C62828; }
.tag.canceled { background: #F1F3F6; color: #6B7688; }
.tag.open { background: #EEF5FE; color: var(--blue); }
.tag.closed { background: #F1F3F6; color: #6B7688; }

.empty {
    padding: 46px 0; text-align: center; color: #A6B0BF; font-size: 13px;
}
.empty svg { width: 52px; height: 52px; fill: #D5DCE6; display: block; margin: 0 auto 12px; }

.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td {
    padding: 12px 14px; text-align: left; border-bottom: 1px solid #EEF1F5; vertical-align: middle;
}
.data-table th { background: #F8FAFD; color: #5A6678; font-weight: 600; white-space: nowrap; }
.data-table tbody tr:hover { background: #FAFCFF; }
.data-table td.actions { white-space: nowrap; }
.data-table .muted { color: #98A2B3; font-size: 12px; }

/* ---------- 用户中心 ---------- */
.uc-section { padding: 40px 0 64px; background: var(--bg); min-height: calc(100vh - 300px); }
.uc-grid { display: grid; grid-template-columns: 320px 1fr; gap: 22px; align-items: start; }

.uc-card {
    background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 24px;
}
.uc-card h3 {
    font-size: 16px; font-weight: 600; color: #1B2536; margin-bottom: 16px;
    display: flex; align-items: center; justify-content: space-between;
}

.uc-profile { text-align: center; }
.uc-avatar {
    width: 76px; height: 76px; margin: 0 auto 14px; border-radius: 50%;
    background: linear-gradient(140deg, #0B67C4, #0035A7); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; font-weight: 600;
}
.uc-profile h4 { font-size: 18px; color: #1B2536; }
.uc-profile .role {
    display: inline-block; margin-top: 6px; padding: 2px 10px; border-radius: 10px;
    background: #EEF5FE; color: var(--blue); font-size: 12px;
}
.uc-info { margin-top: 20px; text-align: left; }
.uc-info li {
    display: flex; justify-content: space-between; gap: 12px;
    padding: 9px 0; border-bottom: 1px dashed #EEF1F5; font-size: 13px;
}
.uc-info li:last-child { border-bottom: 0; }
.uc-info .k { color: #98A2B3; flex-shrink: 0; }
.uc-info .v { color: #2B3444; text-align: right; word-break: break-all; }

.uc-tabs { display: flex; gap: 26px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.uc-tabs button {
    position: relative; border: 0; background: none; cursor: pointer;
    padding: 0 2px 12px; font-size: 15px; color: #7A8699;
}
.uc-tabs button.active { color: var(--blue); font-weight: 600; }
.uc-tabs button.active::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--blue);
}

.enroll-item {
    display: flex; align-items: center; gap: 16px;
    padding: 16px; border: 1px solid #EEF1F5; border-radius: 6px; margin-bottom: 12px;
}
.enroll-item .cover {
    width: 92px; height: 64px; border-radius: 4px; overflow: hidden; flex-shrink: 0; background: #E9EFF7;
}
.enroll-item .cover img { width: 100%; height: 100%; object-fit: cover; }
.enroll-item .info { flex: 1; min-width: 0; }
.enroll-item h4 { font-size: 14px; color: #1B2536; margin-bottom: 4px; }
.enroll-item .meta { font-size: 12px; color: #98A2B3; display: flex; gap: 14px; flex-wrap: wrap; }
.enroll-item .right { text-align: right; flex-shrink: 0; }
.enroll-item .right .price { color: var(--orange); font-weight: 700; margin-bottom: 6px; }

.class-row {
    display: flex; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px dashed #EEF1F5;
}
.class-row:last-child { border-bottom: 0; }
.class-row .cover { width: 84px; height: 58px; border-radius: 4px; overflow: hidden; flex-shrink: 0; }
.class-row .cover img { width: 100%; height: 100%; object-fit: cover; }
.class-row .info { flex: 1; min-width: 0; }
.class-row h4 { font-size: 14px; color: #1B2536; }
.class-row .meta { font-size: 12px; color: #98A2B3; margin-top: 2px; }
.class-row .right { text-align: right; flex-shrink: 0; }

/* ---------- 管理后台 ---------- */
.admin-layout { min-height: 100vh; background: #F4F6FA; }
.admin-side {
    position: fixed; left: 0; top: 0; bottom: 0; width: 224px;
    background: #0B2340; color: #C9D6E5; display: flex; flex-direction: column; z-index: 20;
}
.admin-side .brand {
    display: flex; align-items: center; gap: 10px; padding: 20px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.admin-side .brand img { width: 38px; height: 38px; border-radius: 50%; background: #fff; }
.admin-side .brand strong { color: #fff; font-size: 15px; line-height: 1.3; display: block; }
.admin-side .brand small { color: #7E93AB; font-size: 11px; }
.admin-side nav { padding: 14px 10px; flex: 1; }
.admin-side nav a, .admin-side nav button {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 11px 14px; border-radius: 6px; color: #C9D6E5; font-size: 14px;
    border: 0; background: none; cursor: pointer; text-align: left; margin-bottom: 4px;
}
.admin-side nav a:hover, .admin-side nav button:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.admin-side nav .active { background: #0F4C8A; color: #fff; }
.admin-side nav svg { width: 18px; height: 18px; fill: currentColor; }
.admin-side .side-user {
    padding: 16px 18px; border-top: 1px solid rgba(255, 255, 255, .08); font-size: 12px; color: #8298AE;
}
.admin-side .side-user b { display: block; color: #fff; font-size: 13px; margin-bottom: 2px; }

.admin-main { margin-left: 224px; min-height: 100vh; }
.admin-top {
    height: 62px; background: #fff; border-bottom: 1px solid #E8EDF3;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 26px; position: sticky; top: 0; z-index: 10;
}
.admin-top h1 { font-size: 17px; color: #1B2536; font-weight: 600; }
.admin-top .right { display: flex; align-items: center; gap: 14px; font-size: 13px; color: #7A8699; }
.admin-content { padding: 24px 26px 40px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.stat-card {
    background: #fff; border: 1px solid #E8EDF3; border-radius: 8px; padding: 20px 22px;
}
.stat-card .lbl { font-size: 13px; color: #8A95A6; }
.stat-card .num { font-size: 30px; font-weight: 700; color: #1B2536; line-height: 1.3; }
.stat-card .num small { font-size: 13px; font-weight: 400; color: #98A2B3; margin-left: 6px; }
.stat-card.blue .num { color: var(--blue); }
.stat-card.orange .num { color: var(--orange); }
.stat-card.green .num { color: #15803D; }

.panel-card {
    background: #fff; border: 1px solid #E8EDF3; border-radius: 8px; margin-bottom: 20px;
}
.panel-card .hd {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid #EEF1F5;
}
.panel-card .hd h3 { font-size: 15px; color: #1B2536; font-weight: 600; }
.panel-card .hd .tools { display: flex; align-items: center; gap: 10px; }
.panel-card .bd { padding: 6px 20px 18px; }

.filter-tabs { display: flex; gap: 6px; }
.filter-tabs button {
    border: 1px solid #E2E8F0; background: #fff; color: #5A6678;
    padding: 5px 13px; border-radius: 14px; font-size: 12px; cursor: pointer;
}
.filter-tabs button.active { background: var(--blue); border-color: var(--blue); color: #fff; }

.admin-search {
    height: 34px; padding: 0 12px; border: 1px solid #DCE3ED; border-radius: 4px;
    font-size: 13px; outline: none; width: 190px;
}
.admin-search:focus { border-color: var(--blue); }

/* 弹窗 */
.modal-mask {
    position: fixed; inset: 0; background: rgba(10, 20, 35, .5); z-index: 100;
    display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-mask.on { display: flex; }
.modal-box {
    width: 520px; max-width: 100%; background: #fff; border-radius: 10px; overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 20, 45, .28);
}
.modal-box .m-hd {
    padding: 16px 22px; border-bottom: 1px solid #EEF1F5;
    display: flex; align-items: center; justify-content: space-between;
}
.modal-box .m-hd h3 { font-size: 16px; color: #1B2536; }
.modal-box .m-hd button { border: 0; background: none; font-size: 22px; color: #98A2B3; cursor: pointer; line-height: 1; }
.modal-box .m-bd { padding: 20px 22px; }
.modal-box .m-ft { padding: 14px 22px; border-top: 1px solid #EEF1F5; display: flex; justify-content: flex-end; gap: 10px; }
.modal-box .form-item { margin-bottom: 14px; }
.modal-box .form-grid { gap: 0 14px; }

@media (max-width: 1100px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .uc-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
    .admin-side {
        position: static; width: 100%; flex-direction: column; align-items: stretch;
        overflow: visible;
    }
    .admin-side .brand {
        padding: 10px 14px; border-bottom: 1px solid rgba(255, 255, 255, .08);
    }
    .admin-side .brand img { width: 32px; height: 32px; }
    .admin-side .brand div { display: flex; align-items: baseline; gap: 8px; }
    .admin-side .brand strong { font-size: 14px; line-height: 1.2; }
    .admin-side .brand small { font-size: 11px; }
    .admin-side nav {
        display: flex; gap: 4px; padding: 8px 10px;
        overflow-x: auto; -webkit-overflow-scrolling: touch;
    }
    .admin-side nav button {
        width: auto; flex: 0 0 auto; padding: 8px 12px; font-size: 13px;
        margin-bottom: 0; border-radius: 6px; white-space: nowrap;
    }
    .admin-side nav svg { width: 15px; height: 15px; }
    .admin-side .side-user { display: none; }
    .admin-main { margin-left: 0; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .admin-top { height: 54px; padding: 0 14px; }
    .admin-content { padding: 14px; }
    /* 后台表格改为容器内横向滚动，避免列被压缩成竖排 */
    .data-table { min-width: 640px; }
}

/* 模板卡片 */
.theme-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.theme-card {
    border: 2px solid #E8EDF3; border-radius: 10px; overflow: hidden;
    background: #fff; cursor: pointer; padding: 0; text-align: left; transition: all .2s;
}
.theme-card:hover { border-color: #C9DCF5; }
.theme-card.active { border-color: var(--blue); box-shadow: 0 6px 18px rgba(0, 60, 130, .12); }
.theme-card .thumb {
    height: 92px; display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 13px; letter-spacing: 2px;
}
.theme-card.blue .thumb { background: linear-gradient(120deg, #04254C, #0B67C4); }
.theme-card.red .thumb { background: linear-gradient(120deg, #3F0A0A, #A61B1B); }
.theme-card.green .thumb { background: linear-gradient(120deg, #06302C, #0F766E); }
.theme-card .name {
    padding: 10px 14px; font-size: 14px; color: #1B2536;
    display: flex; align-items: center; justify-content: space-between;
}
.theme-card .tick { color: var(--blue); font-weight: 700; font-size: 12px; }

/* 多行输入 */
.input-wrap.area { height: auto; align-items: flex-start; padding: 8px 14px; }
.input-wrap textarea {
    flex: 1; border: 0; outline: none; background: none;
    font-family: inherit; font-size: 14px; color: var(--text);
    resize: vertical; min-height: 64px; line-height: 1.7;
}

@media (max-width: 860px) {
    .theme-grid { grid-template-columns: 1fr; }
    .admin-side nav { gap: 4px; }
    .admin-top h1 { font-size: 15px; }
    .panel-card .hd { flex-wrap: wrap; gap: 10px; }
    .panel-card .bd { padding: 6px 14px 16px; }
    .data-table th, .data-table td { padding: 10px 10px; }
}

/* 后台客服 */
.chat-admin { display: grid; grid-template-columns: 320px 1fr; gap: 16px; align-items: start; }
.chat-item {
    padding: 10px 12px; border: 1px solid #EEF1F5; border-radius: 6px;
    margin-bottom: 8px; cursor: pointer; transition: all .2s;
}
.chat-item:hover { border-color: #C9DCF5; }
.chat-item.on { border-color: var(--blue); background: #F7FAFF; }
.chat-item h4 { font-size: 13px; color: #1B2536; display: flex; justify-content: space-between; gap: 8px; }
.chat-item p {
    font-size: 12px; color: #98A2B3; margin-top: 4px;
    overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.ch-log {
    height: 420px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px;
    padding: 10px; background: #FAFBFD; border-radius: 6px;
}
.ch-bubble {
    max-width: 78%; padding: 9px 13px; border-radius: 10px;
    font-size: 13px; line-height: 1.7; word-break: break-word;
}
.ch-bubble.admin { background: #F2F5F9; color: #2B3444; align-self: flex-start; }
.ch-bubble.visitor { background: var(--blue); color: #fff; align-self: flex-end; }
.ch-bubble.system { background: #FFF7E6; color: #8A5A12; align-self: center; font-size: 12px; }
.ch-input { display: flex; gap: 8px; margin-top: 10px; }
.ch-input input {
    flex: 1; height: 40px; border: 1px solid #DCE3ED; border-radius: 6px;
    padding: 0 12px; font-size: 13px; outline: none;
}
.ch-input input:focus { border-color: var(--blue); }
.ch-input button {
    width: 80px; border: 0; border-radius: 6px; background: var(--blue);
    color: #fff; cursor: pointer; font-size: 13px;
}
.ch-input button:disabled { opacity: .55; cursor: default; }

@media (max-width: 1100px) {
    .chat-admin { grid-template-columns: 1fr; }
    .ch-log { height: 340px; }
}

/* 课程行内展开的课时管理 */
.data-table tbody tr.lesson-detail:hover { background: transparent; }
.data-table tr.lesson-detail > td { background: #F7F9FC; padding: 0; }
.lesson-box { padding: 12px 16px 14px; }
.lesson-hd { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.lesson-hd span { font-size: 13px; font-weight: 600; color: #1B2536; }
.lesson-table { background: #fff; border: 1px solid #E6EBF2; border-radius: 6px; }
.lesson-table th { background: #F2F6FC; }
