/* ===== 配色主题（非纯黑白，深色文字 + 蓝色主色 + 语义色） ===== */
:root {
    --bg: #f4f6f9;
    --panel: #ffffff;
    --ink: #1f2937;
    --muted: #6b7280;
    --line: #e5e7eb;
    --soft: #f1f3f7;
    --accent: #2563eb;
    /* 主色：蓝 */
    --accent-dark: #1d4ed8;
    --success: #16a34a;
    /* 打卡成功：绿 */
    --danger: #dc2626;
    /* 未注册：红 */
    --stage-bg: #0b0f14;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--ink);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 顶栏 */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 32px;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
}

.brand {
    font-weight: 800;
    letter-spacing: 3px;
    font-size: 18px;
    color: var(--ink);
}

.brand .dot {
    color: var(--accent);
}

.nav a {
    text-decoration: none;
    color: var(--muted);
    margin-left: 28px;
    padding: 6px 4px;
    border-bottom: 2px solid transparent;
    font-weight: 600;
    transition: color .15s ease;
}

.nav a.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.nav a:hover {
    color: var(--ink);
}

/* 主体 */
.container {
    flex: 1;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 36px 24px;
}

.page-title {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 1px;
    margin-bottom: 4px;
    color: var(--ink);
}

.page-sub {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 28px;
}

/* 布局：左视频 右信息 */
.layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 28px;
    align-items: start;
}

@media (max-width: 860px) {
    .layout {
        grid-template-columns: 1fr;
    }
}

/* 视频卡（彩色，无灰度滤镜） */
.stage {
    position: relative;
    background: var(--stage-bg);
    border: 1px solid var(--line);
    border-radius: 12px;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .08);
}

.stage video,
.stage canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.stage .placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 15px;
    letter-spacing: 1px;
}

/* 控制条 */
.controls {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    align-items: center;
}

.btn {
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--ink);
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    border-radius: 8px;
    cursor: pointer;
    transition: all .15s ease;
}

.btn:hover {
    background: var(--soft);
    border-color: var(--accent);
    color: var(--accent);
}

.btn:disabled {
    opacity: .4;
    cursor: not-allowed;
}

.btn.primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.btn.primary:hover {
    background: var(--accent-dark);
    color: #fff;
}

.status {
    font-size: 13px;
    color: var(--muted);
    margin-left: 8px;
}

/* 右侧面板 */
.panel {
    border: 1px solid var(--line);
    background: var(--panel);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .06);
}

.panel h3 {
    font-size: 13px;
    letter-spacing: 2px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    background: var(--ink);
    color: #fff;
    font-weight: 700;
}

.panel .body {
    padding: 8px 0;
    max-height: 420px;
    overflow-y: auto;
}

.record {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid var(--soft);
    font-size: 14px;
}

.record:last-child {
    border-bottom: none;
}

.record .who {
    font-weight: 700;
    color: var(--ink);
}

.record .when {
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    font-size: 13px;
}

.empty {
    padding: 24px 16px;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}

/* 表单 */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 18px;
}

.field label {
    display: block;
    font-size: 12px;
    letter-spacing: 1px;
    color: var(--muted);
    margin-bottom: 6px;
    text-transform: uppercase;
}

.field input {
    width: 100%;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--ink);
    padding: 11px 12px;
    font-size: 15px;
    font-family: inherit;
    border-radius: 8px;
    transition: border-color .15s ease;
}

.field input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

/* 进度 */
.progress {
    margin-top: 18px;
    border: 1px solid var(--line);
    height: 14px;
    position: relative;
    background: var(--soft);
    border-radius: 8px;
    overflow: hidden;
}

.progress .bar {
    position: absolute;
    inset: 0;
    width: 0;
    background: var(--accent);
    transition: width .2s ease;
}

.progress-text {
    margin-top: 8px;
    font-size: 13px;
    color: var(--muted);
}

/* 打卡成功浮层（绿色语义色） */
.toast {
    position: fixed;
    top: 84px;
    left: 50%;
    transform: translateX(-50%) translateY(-12px);
    background: var(--success);
    color: #fff;
    padding: 14px 28px;
    font-weight: 700;
    letter-spacing: 2px;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(22, 163, 74, .35);
    opacity: 0;
    pointer-events: none;
    transition: all .25s ease;
    z-index: 50;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* 底栏 */
.footer {
    border-top: 1px solid var(--line);
    text-align: center;
    padding: 14px;
    font-size: 12px;
    color: var(--muted);
    letter-spacing: 1px;
}

/* ===== 移动端适配（≤768px） ===== */
@media (max-width: 768px) {

    /* 顶栏：缩小内边距，导航换行 */
    .topbar {
        flex-wrap: wrap;
        gap: 10px 16px;
        padding: 12px 16px;
    }

    .brand {
        font-size: 15px;
        letter-spacing: 2px;
    }

    .nav {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
    }

    .nav a {
        margin-left: 0;
        margin-right: 22px;
        font-size: 13px;
    }

    /* 容器缩小内边距 */
    .container {
        padding: 20px 14px;
    }

    .page-title {
        font-size: 22px;
    }

    .page-sub {
        font-size: 13px;
        margin-bottom: 18px;
    }

    /* 视频卡与面板间距收紧 */
    .layout {
        gap: 16px;
    }

    /* 按钮在小屏更易点按 */
    .btn {
        padding: 11px 18px;
        font-size: 14px;
    }

    .controls {
        flex-wrap: wrap;
    }

    /* 面板列表高度自适应，不再固定 420px */
    .panel .body {
        max-height: 320px;
    }
}

/* ===== 窄屏手机（≤480px） ===== */
@media (max-width: 480px) {
    .page-title {
        font-size: 20px;
    }

    .btn {
        padding: 10px 14px;
        font-size: 13px;
    }

    /* 按钮组在极窄屏铺满更友好 */
    .controls .btn {
        flex: 1;
    }

    .status {
        width: 100%;
        margin-left: 0;
        font-size: 12px;
    }
}