/* 视频课堂 1.0.0  基础样式 */

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.65;
    color: #22262b;
    background: #f5f6f8;
}

a { color: #1a6fd4; text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

input, select, textarea, button {
    font-family: inherit;
    font-size: 15px;
}
input[type="text"], input[type="password"], input[type="number"],
input[type="date"], input[type="file"], select, textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d3d8de;
    border-radius: 6px;
    background: #fff;
    color: #22262b;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #1a6fd4;
    box-shadow: 0 0 0 3px rgba(26, 111, 212, .12);
}
textarea { resize: vertical; }

/* ---------- 按钮 ---------- */
.btn-primary,
.btn-ghost,
.btn-danger {
    display: inline-block;
    padding: 9px 20px;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    text-align: center;
    text-decoration: none;
}
.btn-primary { background: #1a6fd4; color: #fff; }
.btn-primary:hover { background: #155cb5; text-decoration: none; }
.btn-ghost { background: #eef1f5; color: #3b4249; }
.btn-ghost:hover { background: #e3e8ef; text-decoration: none; }
.btn-danger { background: #d64545; color: #fff; }
.btn-danger:hover { background: #bd3535; }
.btn-block { width: 100%; margin-top: 16px; padding: 11px 20px; }

.btn-mini {
    display: inline-block;
    padding: 4px 11px;
    border: 1px solid #d3d8de;
    border-radius: 5px;
    background: #fff;
    color: #3b4249;
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
}
.btn-mini:hover { background: #f2f4f7; text-decoration: none; }
.btn-mini-danger { color: #c0392b; border-color: #edc9c4; }
.btn-mini-danger:hover { background: #fdf1ef; }

/* ---------- 顶栏 ---------- */
.topbar {
    background: #fff;
    border-bottom: 1px solid #e4e8ee;
    position: sticky;
    top: 0;
    z-index: 10;
}
.bar-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 58px;
    flex-wrap: wrap;
}
.brand {
    font-size: 17px;
    font-weight: 700;
    color: #22262b;
    text-decoration: none;
}
.brand:hover { text-decoration: none; color: #1a6fd4; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nav a {
    padding: 5px 11px;
    border-radius: 5px;
    color: #4a525b;
    font-size: 14px;
}
.nav a:hover { background: #f2f4f7; text-decoration: none; }
.nav a.on { background: #eaf1fb; color: #1a6fd4; font-weight: 600; }
.nav .who { color: #8b929b; font-size: 13px; margin-left: 6px; }
.nav .out { color: #8b929b; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 18px; width: 100%; }
.main { padding-top: 24px; padding-bottom: 40px; }

.footer {
    border-top: 1px solid #e4e8ee;
    padding: 18px 0;
    color: #989fa8;
    font-size: 13px;
    text-align: center;
    background: #fff;
}

/* ---------- 提示块 ---------- */
.flash, .notice {
    padding: 11px 15px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
    border: 1px solid transparent;
}
.flash-error, .notice-error { background: #fdeceb; border-color: #f3c7c3; color: #a4291c; }
.flash-success, .notice-success { background: #eaf7ee; border-color: #bde3c9; color: #1e7a41; }
.flash-info, .notice-info { background: #eef4fc; border-color: #cfe0f5; color: #1a5ba8; }
.notice-warn { background: #fdf6e5; border-color: #ecd9a2; color: #855b12; }

/* ---------- 卡片 / 面板 ---------- */
.card, .panel {
    background: #fff;
    border: 1px solid #e4e8ee;
    border-radius: 10px;
    padding: 20px 22px;
    margin-bottom: 18px;
}
.card-ok { border-color: #bde3c9; background: #f7fdf9; }
.card-h {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eef1f5;
}
.sub-h { font-size: 16px; font-weight: 700; margin: 26px 0 12px; }

.row { margin-bottom: 14px; }
.row label { display: block; margin-bottom: 5px; font-size: 14px; color: #4a525b; }
.row-tip { font-size: 12px; color: #989fa8; margin-top: 5px; }
.chk-inline {
    display: inline-flex !important;
    align-items: center;
    gap: 7px;
    margin: 0 18px 0 0;
    font-size: 14px;
    color: #4a525b;
}
.chk-inline input { width: auto; }

.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 22px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 22px; }

.panel-row {
    display: flex;
    gap: 14px;
    padding: 9px 0;
    border-bottom: 1px dashed #eef1f5;
    font-size: 14px;
}
.panel-row:last-child { border-bottom: 0; }
.panel-label { min-width: 92px; color: #8b929b; }

.hint { font-size: 13px; color: #8b929b; margin: 0 0 12px; }
.muted { color: #8b929b; }
.ok-text { color: #1e7a41; }
.no-text { color: #c0392b; }
.danger-text { color: #a4291c; }
.big { font-size: 17px; margin: 4px 0 10px; }

.steps { margin: 0; padding-left: 20px; }
.steps li { margin-bottom: 8px; }

.tag {
    display: inline-block;
    padding: 1px 7px;
    margin-left: 6px;
    border-radius: 4px;
    background: #eef4fc;
    color: #1a5ba8;
    font-size: 12px;
    vertical-align: 1px;
}
.tag-red { background: #fdeceb; color: #a4291c; }

/* ---------- 课程网格 ---------- */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}
.vcard {
    background: #fff;
    border: 1px solid #e4e8ee;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.vcover {
    display: block;
    aspect-ratio: 16 / 9;
    background: #2b3038;
    text-decoration: none;
    overflow: hidden;
}
.vcover:hover { text-decoration: none; }
.vcover img { width: 100%; height: 100%; object-fit: cover; }
.vcover-ph {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #8f98a3;
    font-size: 34px;
}
.vbody { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.vtitle { font-weight: 600; color: #22262b; font-size: 15px; }
.vtitle:hover { color: #1a6fd4; text-decoration: none; }
.vintro { font-size: 13px; color: #8b929b; }

.badge {
    align-self: flex-start;
    margin-top: auto;
    padding: 2px 9px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}
.badge-gray { background: #f0f2f5; color: #7d858e; }
.badge-ok { background: #eaf7ee; color: #1e7a41; }
.badge-warn { background: #fdf6e5; color: #855b12; }
.badge-lock { background: #fdeceb; color: #a4291c; }

/* ---------- 登录 / 注册 ---------- */
.auth-box {
    background: #fff;
    border: 1px solid #e4e8ee;
    border-radius: 10px;
    padding: 26px 26px 22px;
    max-width: 400px;
    margin: 20px auto;
}
.auth-box h1 { font-size: 20px; margin: 0 0 18px; }
.auth-alt { text-align: center; color: #8b929b; font-size: 13px; margin: 16px 0 0; }

/* ---------- 播放页 ---------- */
.player-page { max-width: 920px; margin: 0 auto; width: 100%; }
.page-title { font-size: 20px; margin: 0 0 14px; }
.player-box {
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 14px;
}
.player-box > div { width: 100%; min-height: 200px; }
.player-msg {
    margin: 0;
    padding: 40px 24px;
    text-align: center;
    color: #fff;
}
.player-msg strong { display: block; font-size: 16px; margin-bottom: 10px; }
.player-msg span {
    display: block;
    font-size: 13px;
    color: #ffb4a8;
    word-break: break-all;
    font-family: Consolas, Menlo, monospace;
    line-height: 1.6;
}
.player-msg em { display: block; font-size: 13px; color: #9aa3ad; font-style: normal; margin-top: 10px; }
.raw-box {
    background: #fff;
    border: 1px solid #e4e8ee;
    border-radius: 10px;
    padding: 14px 16px;
    margin-top: 14px;
}
.raw-h { font-size: 13px; color: #8b929b; margin: 0 0 8px; }
.raw-box pre {
    margin: 0;
    font-size: 12px;
    line-height: 1.6;
    color: #4a525b;
    white-space: pre-wrap;
    word-break: break-all;
    font-family: Consolas, Menlo, monospace;
}
.build-tag { color: #b4bcc6; font-size: 12px; }
.dbg {
    font-size: 12px;
    color: #8b929b;
    background: #fff;
    border: 1px dashed #d9dee6;
    border-radius: 8px;
    padding: 8px 12px;
    margin: -6px 0 14px;
    word-break: break-all;
}
.meta-row { font-size: 14px; color: #1e7a41; margin-bottom: 8px; }
.intro-box {
    background: #fff;
    border: 1px solid #e4e8ee;
    border-radius: 10px;
    padding: 16px 18px;
    margin-top: 16px;
    font-size: 14px;
    color: #4a525b;
    white-space: normal;
}
.back-link { margin-top: 20px; font-size: 14px; }

.locked-box {
    background: #fff;
    border: 1px solid #e4e8ee;
    border-radius: 10px;
    padding: 44px 24px;
    text-align: center;
}
.locked-icon { font-size: 34px; margin-bottom: 12px; }
.locked-text { font-size: 16px; margin: 0 0 8px; }
.locked-sub { font-size: 13px; color: #8b929b; margin: 0; }

.tech-info {
    margin-top: 14px;
    padding: 10px 14px;
    background: #fdf6e5;
    border: 1px solid #ecd9a2;
    border-radius: 6px;
    font-size: 12px;
    color: #855b12;
    word-break: break-all;
}

/* ---------- 表格 ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td {
    padding: 9px 10px;
    border-bottom: 1px solid #eef1f5;
    text-align: left;
    vertical-align: middle;
}
.tbl th { color: #8b929b; font-weight: 600; font-size: 13px; background: #fafbfc; }
.tbl small { color: #989fa8; }
.ops { display: flex; align-items: center; gap: 6px; }
.ops form { margin: 0; }
.ops-wrap { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.inline-form { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.inline-form input[type="text"], .inline-form input[type="date"] { width: auto; min-width: 140px; padding: 4px 8px; font-size: 13px; }

.form-inline-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 16px; align-items: end; }

.pager { margin-top: 14px; display: flex; gap: 6px; flex-wrap: wrap; font-size: 14px; }
.pager a, .pager .cur {
    padding: 3px 10px;
    border: 1px solid #d3d8de;
    border-radius: 5px;
    background: #fff;
}
.pager .cur { background: #1a6fd4; color: #fff; border-color: #1a6fd4; }

/* ---------- 后台 ---------- */
.admin-nav {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    border-bottom: 1px solid #e4e8ee;
    padding-bottom: 10px;
}
.admin-nav a {
    padding: 6px 14px;
    border-radius: 6px;
    color: #4a525b;
    font-size: 14px;
}
.admin-nav a:hover { background: #f2f4f7; text-decoration: none; }
.admin-nav a.on { background: #1a6fd4; color: #fff; }

.stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}
.stat {
    background: #fff;
    border: 1px solid #e4e8ee;
    border-radius: 10px;
    padding: 16px 18px;
}
.stat-num { font-size: 24px; font-weight: 700; line-height: 1.2; }
.stat-label { font-size: 13px; color: #8b929b; margin-top: 2px; }

/* ---------- 安装向导 ---------- */
.inst-body { background: #eff1f4; }
.inst-wrap { max-width: 780px; margin: 0 auto; padding: 34px 18px 60px; width: 100%; }
.inst-h1 { font-size: 22px; margin: 0 0 6px; }
.inst-sub { color: #8b929b; font-size: 14px; margin: 0 0 22px; }
.chk {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 6px 0;
    font-size: 14px;
    border-bottom: 1px dashed #f0f2f5;
}
.chk:last-child { border-bottom: 0; }
.chk .ok { color: #1e7a41; font-weight: 700; }
.chk .no { color: #c0392b; font-weight: 700; }
.errs {
    background: #fdeceb;
    border: 1px solid #f3c7c3;
    border-radius: 8px;
    padding: 12px 16px 12px 34px;
    margin-bottom: 18px;
    color: #a4291c;
    font-size: 14px;
}
.errs ul { margin: 0; }

/* ---------- 窄屏 ---------- */
@media (max-width: 640px) {
    body { font-size: 14px; }
    .bar-inner { gap: 10px; }
    .nav { margin-left: 0; width: 100%; padding-bottom: 6px; }
    .main { padding-top: 16px; }
    .video-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .card, .panel { padding: 16px; }
    .tbl th:nth-child(1), .tbl td:nth-child(1) { display: none; }
    .inst-wrap { padding: 20px 14px 40px; }
}
