@layer utilities {
    .text-shadow {
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    }
    .gold-border {
        border-image: linear-gradient(45deg, #f8c365, #ffffff, #f8c365) 1;
    }
    .shine-effect {
        position: relative;
        overflow: hidden;
    }
    .shine-effect::before {
        content: '';
        position: absolute;
        top: -50%;
        left: -50%;
        width: 200%;
        height: 200%;
        background: linear-gradient(
                to right,
                rgba(255, 255, 255, 0) 0%,
                rgba(255, 255, 255, 0.3) 50%,
                rgba(255, 255, 255, 0) 100%
        );
        transform: rotate(30deg);
        animation: shine 6s infinite;
    }
    @keyframes shine {
        0% { transform: rotate(30deg) translate(-100%, -100%); }
        100% { transform: rotate(30deg) translate(100%, 100%); }
    }
    .box-decoration {
        position: relative;
    }
    .box-decoration::before,
    .box-decoration::after {
        content: '';
        position: absolute;
        width: 20px;
        height: 20px;
        border-color: #f8c365;
        border-style: solid;
    }
    .box-decoration::before {
        top: -2px;
        left: -2px;
        border-width: 2px 0 0 2px;
    }
    .box-decoration::after {
        bottom: -2px;
        right: -2px;
        border-width: 0 2px 2px 0;
    }
    /* 过渡动画 */
    .fade-transition {
        transition: opacity 0.8s ease, transform 0.8s ease;
    }
    /* 弹窗样式 */
    .modal-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.7);
        backdrop-filter: blur(4px);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 100;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }
    .modal-overlay.show {
        opacity: 1;
        pointer-events: all;
    }
    .modal-content {
        background: white;
        border: 3px solid #f8c365;
        border-radius: 12px;
        padding: 2rem;
        width: 90%;
        max-width: 400px;
        box-shadow: 0 10px 50px rgba(0,0,0,0.5);
        transform: translateY(-20px);
        transition: transform 0.3s ease;
    }
    .modal-overlay.show .modal-content {
        transform: translateY(0);
    }
    /* 退出登录按钮样式 */
    .logout-btn {
        position: fixed;
        top: 20px;
        right: 20px;
        padding: 0.6rem 1.2rem;
        background-color: rgba(255, 255, 255, 0.2);
        color: white;
        border: 1px solid #f8c365;
        border-radius: 4px;
        cursor: pointer;
        font-size: 0.9rem;
        z-index: 50;
        transition: all 0.3s ease;
        backdrop-filter: blur(8px);
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    .logout-btn:hover {
        background-color: rgba(255, 255, 255, 0.3);
        box-shadow: 0 0 8px rgba(248, 195, 101, 0.5);
    }
    /* 初始页面隐藏退出按钮 */
    .initial-content + .logout-btn {
        display: none;
    }
    /* 用户编号显示区域 */
    .user-info {
        position: fixed;
        top: 20px;
        left: 20px;
        padding: 0.6rem 1.2rem;
        background-color: rgba(255, 255, 255, 0.2);
        color: white;
        border: 1px solid #f8c365;
        border-radius: 4px;
        font-size: 0.9rem;
        z-index: 50;
        backdrop-filter: blur(8px);
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
}

 * {
     margin: 0;
     padding: 0;
     box-sizing: border-box;
 }
body {
    overflow: hidden; /* 隐藏滚动条 */
    height: 100vh; /* 确保body占满视口高度 */
}
/* 全屏视频背景（通用样式） */
.video-bg {
    position: fixed;
    top: 0;
    left: 0;
    min-width: 100%;
    min-height: 100%;
    z-index: -1; /* 放在内容下层 */
    object-fit: cover; /* 保持视频比例并覆盖全屏 */
    transition: opacity 0.8s ease; /* 添加过渡效果 */
}
/* 初始视频隐藏类 */
.video-bg.hidden {
    opacity: 0;
    pointer-events: none;
}
/* 宣誓区域专用视频背景（层级调整） */
.oath-video-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; /* 低于宣誓内容 */
    object-fit: cover;
}
/* 初始内容区域（居中） */
.initial-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    opacity: 1;
    z-index: 10;
}
/* 选项框内容区域 - 强制居中+横向排列 */
.options-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center; /* 垂直居中 */
    justify-content: center; /* 水平居中 */
    opacity: 0;
    pointer-events: none;
    z-index: 5;
    padding: 20px; /* 防止贴边 */
}
/* 选项框容器 - 强制横向一排，严格居中 */
.options-container {
    display: flex;
    flex-direction: row; /* 强制横向排列，不随屏幕变化 */
    align-items: center;
    justify-content: center;
    gap: 4rem; /* 横向间距，可根据需求调整 */
    width: 100%;
    max-width: 900px; /* 限制最大宽度，避免过宽 */
    flex-wrap: nowrap; /* 禁止换行，确保始终一排 */
}
/* 注意事项内容区域 - 居中显示 */
.notice-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 700px;
    opacity: 0;
    pointer-events: none;
    z-index: 8;
    text-align: center;
    padding: 2rem;
    background-color: rgba(168, 7, 39, 0.7); /* 深红色半透明背景 */
    border: 2px solid #f8c365; /* 金色边框 */
    border-radius: 12px;
    backdrop-filter: blur(8px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}
/* 宣誓内容区域 - 全屏显示（添加相对定位，用于承载内部视频背景） */
.oath-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    z-index: 15; /* 层级高于其他区域 */
    position: relative;
}
/* 宣誓内容容器 - 恢复左右两栏布局 */
.oath-container {
    width: 95%;
    height: 95vh;
    position: relative;
    padding: 2rem;
    overflow: hidden;
    display: flex; /* 恢复flex左右布局 */
    align-items: center; /* 整体垂直居中 */
    gap: 25%; /* 左右栏间距 */
}
/* 左侧摄像头显示框 - 稍微靠下，带金色边框 */
.camera-container {
    width: 520px; /* 摄像头框宽度 */
    height: 440px; /* 摄像头框高度 */
    border: 3px solid #f8c365; /* 金色边框 */
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    background-color: rgba(0, 0, 0, 0.5); /* 半透明黑色背景 */
    box-shadow: 0 0 20px rgba(248, 195, 101, 0.3);
    transform: translateY(60px); /* 向下偏移，实现稍微靠下的效果 */
}
/* 摄像头视频元素样式 */
#cameraVideo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
/* 摄像头未开启时的提示文字 */
.camera-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f8c365;
    font-size: 1.2rem;
    text-align: center;
    padding: 20px;
}
/* 右侧宣誓文字区域 - 保持原有样式，放在右边 */
.oath-inner {
    position: relative;
    z-index: 1;
    color: #fff;
    width: 100%;
    max-width: 49%; /* 限制最大宽度 */
    margin: 1rem 0;
}
/* 出监宣誓标题 - 右下角署名样式 */
.oath-title {
    position: absolute;
    bottom: 4rem;
    right: 0;
    font-size: 2.8rem;
    font-weight: bold;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.oath-lead {
    font-size: 2.5rem; /* 增大引导文字 */
    font-weight: 500;
    margin-bottom: 2rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
/* 宣誓词样式 */
.oath-text {
    font-size: 3rem;
    line-height: 2;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    padding-bottom: 10rem; /* 为右下角署名和按钮预留空间 */
}
/* 宣誓人署名 - 右下角样式 */
.oath-sign {
    position: absolute;
    bottom: 0;
    right: 0;
    font-size: 1.8rem;
    text-align: right;
}
.oath-input {
    padding: 0.8rem 1.2rem;
    margin-left: 1rem;
    width: 220px;
    border: 2px solid #f8c365;
    background-color: rgba(255,255,255,0.2);
    color: #fff;
    font-size: 1.4rem;
    border-radius: 4px;
}
/* 底部按钮组 */
.oath-buttons {
    position: absolute;
    bottom: 2rem; /* 紧贴底部 */
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 3rem;
    z-index: 2;
}
.oath-btn {
    padding: 0.8rem 2.5rem;
    font-size: 1.4rem;
    background-color: #f8c365;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}
.oath-btn:hover {
    background-color: #e6c200;
    box-shadow: 0 6px 12px rgba(248,195,101,0.5);
    transform: translateY(-2px);
}
/* 录制中状态样式 */
.recording {
    background-color: #ff3b30 !important;
    color: white !important;
    animation: pulse 1.5s infinite;
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(255, 59, 48, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0); }
}
/* 五角星装饰 */
.star {
    position: absolute;
    color: #ffd700;
    text-shadow: 0 0 15px rgba(255,215,0,0.8);
}
.star1 {
    top: 10%;
    left: 10%;
    font-size: 4rem;
}
.star2 {
    top: 20%;
    left: 22%;
    font-size: 2.5rem;
}
.star3 {
    top: 15%;
    left: 18%;
    font-size: 1.8rem;
}
/* 状态类 - 显示/隐藏对应区域 */
.show-options .initial-content {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
    pointer-events: none;
}
.show-options .options-content {
    opacity: 1;
    pointer-events: all;
    z-index: 20;
}
.show-notice .initial-content,
.show-notice .options-content,
.show-notice .message-content {
    opacity: 0;
    pointer-events: none;
}
.show-notice .notice-content {
    opacity: 1;
    pointer-events: all;
    transform: translate(-50%, -50%) scale(1);
    z-index: 20;
}
.show-oath .initial-content,
.show-oath .options-content,
.show-oath .notice-content,
.show-oath .message-content {
    opacity: 0;
    pointer-events: none;
}
.show-oath .oath-content {
    opacity: 1;
    pointer-events: all;
    z-index: 20;
}
/* 留言区域显示状态 - 重点修复：提高层级，确保显示 */
.show-message .initial-content,
.show-message .options-content,
.show-message .notice-content,
.show-message .oath-content {
    opacity: 0 !important;
    pointer-events: none !important;
    z-index: 0 !important;
}
.show-message .message-content {
    opacity: 1 !important;
    pointer-events: all !important;
    z-index: 30 !important; /* 最高层级，确保不被遮挡 */
}
/* 标题样式 */
.initial-content h1 {
    font-size: 5rem;
    color: #ffffff;
    margin-bottom: 5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.notice-content h2 {
    color: #f8c365; /* 金色标题 */
    font-size: 2rem;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border-bottom: 2px solid rgba(248, 195, 101, 0.5);
    padding-bottom: 0.8rem;
}
/* 注意事项文字样式 */
.notice-text {
    color: #ffffff;
    font-size: 1.1rem;
    line-height: 1.8;
    text-align: left;
    margin-bottom: 2rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
.notice-text p {
    margin-bottom: 1rem;
}
.notice-text p:last-child {
    margin-bottom: 0;
}
/* 按钮样式 */
.enter-btn, .back-btn {
    padding: 1rem 2.5rem;
    font-size: 1.2rem;
    background-color: #ffd700; /* 黄色 */
    color: #000;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    font-weight: bold;
}
.enter-btn:hover, .back-btn:hover {
    background-color: #e6c200; /* hover加深黄色 */
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
}
.enter-btn:active, .back-btn:active {
    transform: scale(0.95);
}
.back-btn {
    padding: 0.8rem 2rem;
    font-size: 1.1rem;
}
/* 选项框样式 - 统一尺寸，确保横向排列整齐 */
.option-box {
    width: 160px; /* 固定宽度，确保三个框大小一致 */
    height: 120px; /* 统一高度 */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 15px;
    flex-shrink: 0; /* 禁止缩小，确保尺寸不变 */
}
/* 核心修复：留言区域样式 - 简化结构，确保显示 */
.message-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    z-index: 15;
    padding: 20px;
    background: rgba(0,0,0,0.3); /* 半透明背景，确保内容可见 */
}
.message-container {
    width: 100%;
    max-width: 1000px;
    background-color: #fff; /* 纯白背景，清晰可见 */
    border: 3px solid #f8c365;
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.message-title {
    font-size: 2.2rem;
    font-weight: bold;
    color: #000 !important; /* 强制黑色文字 */
    text-align: center;
    margin: 0;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}
/* 新增：用户编号输入框样式 */
.user-id-input-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 0;
}
.user-id-label {
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
    white-space: nowrap;
}
.user-id-input {
    flex: 1;
    padding: 0.8rem 1.2rem;
    font-size: 1.1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    outline: none;
}
.user-id-input:focus {
    border-color: #f8c365;
    box-shadow: 0 0 0 3px rgba(248, 195, 101, 0.2);
}
.required-mark {
    color: #c41e3a;
    font-size: 1.4rem;
}
/* 留言输入框样式 */
.message-textarea {
    width: 100%;
    min-height: 350px; /* 更大的输入框 */
    padding: 1.5rem;
    font-size: 1.2rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    resize: vertical;
    font-family: 'SimHei', 'Microsoft YaHei', sans-serif;
    line-height: 1.8;
    color: #333;
    background-color: #f9f9f9;
    outline: none;
}
.message-textarea:focus {
    border-color: #f8c365;
    box-shadow: 0 0 0 3px rgba(248, 195, 101, 0.2);
}
.message-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}
.message-count {
    color: #666;
    font-size: 1rem;
}
.message-buttons {
    display: flex;
    gap: 1.5rem;
}
.submit-btn {
    padding: 0.8rem 2.5rem;
    font-size: 1.2rem;
    background-color: #c41e3a;
    color: white;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}
.submit-btn:hover {
    background-color: #a80727;
    transform: translateY(-2px);
}

/* 打印样式 - 只打印oath-inner内容 */
@media print {
    /* 隐藏所有非打印内容 */
    body * {
        visibility: hidden;
        background: white !important;
        color: black !important;
    }

    /* 只显示宣誓内容区域 */
    .oath-inner, .oath-inner * {
        visibility: visible;
    }

    /* 定位打印内容到页面顶部 */
    .oath-inner {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        max-width: 100%;
        width: 80%;
        text-align: center;
    }

    /* 打印时去除阴影和透明效果，确保文字清晰 */
    .oath-lead, .oath-text, .oath-title, .oath-sign {
        text-shadow: none !important;
        color: black !important;
    }

    .oath-input {
        border: 1px solid #333 !important;
        color: black !important;
        background: white !important;
    }

    /* 隐藏打印不需要的元素 */
    .camera-container, .oath-buttons, .oath-video-bg, .video-bg, .logout-btn, .user-info {
        display: none !important;
    }
}

/* 响应式调整 */
@media (max-width: 1024px) {
    .oath-container {
        flex-direction: column;
        gap: 2rem;
    }
    .camera-container {
        transform: translateY(0);
        margin-top: 2rem;
    }
    .oath-inner {
        max-width: 90%;
        text-align: center;
    }
    .oath-title, .oath-sign {
        position: relative;
        bottom: 0;
        right: 0;
        margin-top: 1rem;
    }
    .oath-text {
        padding-bottom: 2rem;
    }
    .message-container {
        padding: 2rem;
    }
    .message-title {
        font-size: 1.8rem;
    }
    .message-textarea {
        min-height: 300px;
        font-size: 1.1rem;
    }
    .user-id-input-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}
@media (max-width: 768px) {
    .options-container {
        gap: 2rem;
    }
    .option-box {
        width: 120px;
        height: 100px;
    }
    .option-box span {
        font-size: 1.2rem !important;
    }
    .initial-content h1 {
        font-size: 2.2rem;
    }
    .notice-content h2 {
        font-size: 1.6rem;
    }
    .notice-text {
        font-size: 1rem;
        line-height: 1.6;
    }
    .back-btn {
        padding: 0.7rem 1.5rem;
        font-size: 1rem;
    }
    .camera-container {
        width: 280px;
        height: 200px;
    }
    .oath-container {
        padding: 1.5rem;
        height: auto;
        min-height: 100vh;
    }
    .oath-lead {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }
    .oath-text {
        font-size: 1.6rem;
        line-height: 2.2;
    }
    .oath-title {
        font-size: 2rem;
    }
    .oath-sign {
        font-size: 1.4rem;
    }
    .oath-input {
        width: 160px;
        font-size: 1.2rem;
        padding: 0.6rem 1rem;
        margin-left: 0.5rem;
    }
    .oath-buttons {
        gap: 1.5rem;
        bottom: 1.5rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    .oath-btn {
        padding: 0.6rem 1.5rem;
        font-size: 1.1rem;
    }
    .message-container {
        padding: 1.5rem;
        width: 95%;
    }
    .message-title {
        font-size: 1.6rem;
    }
    .message-textarea {
        min-height: 250px;
        font-size: 1rem;
        padding: 1rem;
    }
    .message-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    .message-buttons {
        width: 100%;
        justify-content: space-between;
    }
    .submit-btn, .back-btn {
        flex: 1;
        text-align: center;
        padding: 0.7rem;
        font-size: 1rem;
    }
    .logout-btn, .user-info {
        top: 10px;
        right: 10px;
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
    .user-info {
        left: 10px;
        right: auto;
    }
}
@media (max-width: 480px) {
    .options-container {
        gap: 1.5rem;
    }
    .option-box {
        width: 100px;
        height: 90px;
    }
    .option-box span {
        font-size: 1rem !important;
    }
    .notice-content {
        padding: 1.5rem 1rem;
    }
    .notice-content h2 {
        font-size: 1.4rem;
        margin-bottom: 1rem;
    }
    .camera-container {
        width: 240px;
        height: 180px;
    }
    .oath-lead {
        font-size: 1.8rem;
    }
    .oath-text {
        font-size: 1.4rem;
        line-height: 2;
    }
    .oath-title {
        font-size: 1.8rem;
    }
    .oath-sign {
        font-size: 1.2rem;
    }
    .oath-input {
        width: 140px;
    }
    .oath-buttons {
        gap: 1rem;
    }
    .message-textarea {
        min-height: 200px;
    }
    .message-buttons {
        flex-direction: column;
        gap: 0.8rem;
    }
    .submit-btn, .back-btn {
        width: 100%;
    }
}
