/* 角小探 全局样式 */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
    background: linear-gradient(135deg, #eef2ff 0%, #fdf2f8 100%);
    min-height: 100vh;
    color: #1f2937;
}

.container { max-width: 560px; margin: 0 auto; padding: 24px 16px; }
.container.wide { max-width: 1200px; }
.container.center { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: center; }

h1 { font-size: 24px; margin-bottom: 8px; }
.subtitle { color: #6b7280; margin-bottom: 24px; }
.page-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.page-header h1 { margin-bottom: 0; }
.back {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 7px 14px 7px 10px; border-radius: 20px;
    background: #fff; color: #4b5563; font-size: 14px; text-decoration: none;
    box-shadow: 0 1px 4px rgba(0,0,0,.08); transition: all .15s ease;
}
.back:hover { color: #4d6bfe; box-shadow: 0 2px 8px rgba(77,107,254,.25); transform: translateX(-2px); }
.back svg { width: 14px; height: 14px; }

/* 角色选择 */
.role-cards { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; }
.role-card {
    width: 220px; padding: 32px 20px; border-radius: 16px; text-align: center;
    background: #fff; box-shadow: 0 4px 20px rgba(0,0,0,.08); text-decoration: none;
    color: inherit; transition: transform .2s, box-shadow .2s;
}
.role-card:hover { transform: translateY(-4px); box-shadow: 0 8px 28px rgba(0,0,0,.14); }
.role-card.student { border-top: 4px solid #6366f1; }
.role-card.teacher { border-top: 4px solid #ec4899; }
.role-icon { font-size: 40px; }
.role-title { font-size: 20px; font-weight: 700; margin: 12px 0 6px; }
.role-desc { font-size: 13px; color: #6b7280; }

/* 卡片与表单 */
.card {
    background: #fff; border-radius: 16px; padding: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,.08);
}
.field-label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; color: #374151; }
input[type="text"], input[type="password"] {
    width: 100%; padding: 12px 14px; border: 1px solid #d1d5db; border-radius: 10px;
    font-size: 15px; outline: none;
}
input:focus { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.15); }

/* 拍照上传区 */
.camera-area {
    border: 2px dashed #c7d2fe; border-radius: 12px; min-height: 200px;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    background: #f8faff; overflow: hidden;
}
.camera-area:hover { border-color: #6366f1; }
.camera-tip { text-align: center; color: #6b7280; font-size: 14px; }
.camera-icon { font-size: 36px; margin-bottom: 8px; }
.preview { width: 100%; max-height: 400px; object-fit: contain; }

/* 按钮 */
.btn {
    padding: 12px 20px; border: none; border-radius: 10px; font-size: 15px;
    cursor: pointer; font-weight: 600; transition: opacity .2s;
}
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn.primary { background: #6366f1; color: #fff; }
.btn.ghost { background: #f3f4f6; color: #374151; }
/* 叠角按钮激活态：醒目提示老师当前已通知学生端 */
.btn.diejiao-on { background: #f59e0b; color: #fff; border-color: #d97706; }
/* 学生端叠角提示按钮：吸底大按钮，醒目跳动吸引注意 */
.diejiao-tip {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%);
    z-index: 50;
    width: calc(100% - 40px);
    max-width: 560px;
    font-size: 26px;
    font-weight: 700;
    padding: 46px 16px;
    border-radius: 22px;
    box-shadow: 0 8px 28px rgba(99, 102, 241, 0.5);
    animation: diejiao-bounce 1.2s ease-in-out infinite;
}
@keyframes diejiao-bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-8px); }
}
/* 移动端小屏上字号稍收敛 */
@media (max-width: 480px) {
    .diejiao-tip { font-size: 23px; padding: 42px 12px; }
}
.btn.full { width: 100%; margin-top: 16px; }
/* 查看标注结果按钮：AI 标注生成中置灰，完成后绿色 */
.btn.pending { background: #d1d5db; color: #6b7280; }
.btn.ready { background: #16a34a; color: #fff; }
.grade-slot .btn.full { margin-top: 10px; }

/* 状态提示 */
.status { margin-top: 14px; font-size: 14px; text-align: center; min-height: 20px; }
.status.success { color: #16a34a; }
.status.error { color: #dc2626; }
.status.info { color: #6366f1; }

/* 角的空间 */
.gallery {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px; margin-top: 16px;
}
.work-card {
    background: #fff; border-radius: 14px; overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,.08); padding-bottom: 14px;
}
.work-img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; display: block; background: #f3f4f6; }

/* ---------- 多图对比弹窗 ---------- */
.compare-modal {
    display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 60;
    background: rgba(243, 244, 246, .98);
    padding: 60px 16px 16px; overflow: auto;
}
.compare-modal.open { display: block; }
.compare-close { position: fixed; top: 14px; right: 16px; z-index: 61; }
.compare-grid {
    display: flex; flex-wrap: wrap; gap: 16px;
    justify-content: center; align-items: flex-start;
}
.compare-item {
    width: 460px; max-width: 100%;
    background: #fff; border-radius: 14px; padding: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,.08);
}
.compare-item img {
    width: 100%; max-height: 74vh; object-fit: contain;
    display: block; background: #f3f4f6;
    border-radius: 10px; cursor: zoom-in;
}
.work-info { padding: 12px 14px 4px; }
.work-name { font-weight: 700; font-size: 16px; }
.work-time { font-size: 12px; color: #9ca3af; margin: 4px 0 8px; }
.badge {
    display: inline-block; font-size: 12px; padding: 2px 10px; border-radius: 20px;
}
.badge.graded { background: #dcfce7; color: #16a34a; }
.badge.ungraded { background: #fef3c7; color: #d97706; }
.work-card .btn { margin: 10px 14px 0; width: calc(100% - 28px); }
.grade-show {
    margin: 10px 14px 0; padding: 10px 12px; border-radius: 10px;
    font-size: 14px; line-height: 1.6; text-align: center; font-weight: 500;
    word-break: break-all;
}
.grade-show.ok { background: #dcfce7; color: #166534; }
.grade-show.bad { background: #fee2e2; color: #991b1b; }
/* 批改结果下方操作按钮：改判 + 重新批改 并排小按钮 */
.regrade-btn { font-size: 12px; padding: 7px 6px; }
.grade-actions { display: flex; gap: 8px; margin-top: 10px; padding: 0 14px; }
.grade-actions .btn {
    flex: 1; margin: 0 !important; width: auto !important;
    font-size: 12px; padding: 7px 4px; white-space: nowrap;
}
/* 批改结果：主判定行 + 可折叠详情 */
.grade-wrap { margin: 10px 14px 0; }
.grade-wrap .grade-show {
    margin: 0; display: flex; align-items: center; justify-content: space-between;
    gap: 8px; text-align: left;
}
.grade-wrap .verdict { flex: 1; text-align: center; }
.detail-toggle {
    border: none; background: rgba(0,0,0,.07); color: inherit; cursor: pointer;
    font-size: 12px; padding: 3px 12px; border-radius: 14px; flex-shrink: 0;
}
.grade-detail {
    margin-top: 6px; padding: 8px 12px; border-radius: 10px;
    background: #f1f5f9; color: #334155; font-size: 13px; line-height: 1.7;
    word-break: break-all;
}
/* 对错分组视图 */
.group-view { display: flex; gap: 16px; flex-wrap: wrap; }
.group-box { flex: 1 1 320px; min-width: 300px; }
.group-title {
    font-size: 15px; font-weight: 700; margin: 4px 2px 10px;
    padding: 8px 12px; border-radius: 10px;
}
.group-title.ok-title { background: #dcfce7; color: #166534; }
.group-title.bad-title { background: #fee2e2; color: #991b1b; }
.group-count { font-weight: 500; font-size: 13px; opacity: .8; }
.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.group-note { margin-top: 10px; font-size: 13px; color: #9ca3af; }

.ds-logo { flex-shrink: 0; }
/* 页头按钮统一样式：同尺寸、同字号、同灰色 */
.page-header .btn { padding: 10px 16px; font-size: 14px; line-height: 1.4; }
.lan-ip-box { background: #f1f5f9; border-radius: 8px; padding: 16px; font-size: 14px; line-height: 1.9; text-align: center; }
.phone-url { font-size: 18px; font-weight: bold; color: #4f46e5; user-select: all; }
.empty { grid-column: 1 / -1; text-align: center; color: #9ca3af; padding: 60px 0; font-size: 15px; }

/* 选择模式 + 批量删除 */
.work-card { position: relative; }
.img-wrap { position: relative; }
/* 勾选圈：常驻图片左下角（扇里寻角 .select-checkbox 与叠角比大小 .dj-checkbox 同款） */
.select-checkbox, .dj-checkbox {
    position: absolute; bottom: 12px; left: 12px; z-index: 5;
    width: 24px; height: 24px; cursor: pointer;
    accent-color: #ef4444;
    box-shadow: 0 0 0 2px rgba(255,255,255,.9);
    border-radius: 6px;
}
.work-img.has-marked { cursor: pointer; }  /* 有标注图的卡片点击可切换 */
.delete-bar {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
    background: #fff; padding: 12px 16px; border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,.18); display: none; gap: 10px; align-items: center;
    z-index: 10;
}
.btn.danger { background: #ef4444; color: #fff; }
.btn.danger:disabled { background: #fca5a5; }

/* 设置弹窗 */
.modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 20; display: none; }
.modal-mask { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.4); }
.modal-body {
    position: relative; margin: 40px auto 0; width: 680px; max-width: calc(100% - 32px);
    max-height: calc(100vh - 80px); overflow-y: auto;
    background: #fff; border-radius: 16px; padding: 28px;
    box-shadow: 0 8px 40px rgba(0,0,0,.25);
}
.modal-body h2 { font-size: 20px; margin-bottom: 16px; }
textarea {
    width: 100%; padding: 12px 14px; border: 1px solid #d1d5db; border-radius: 10px;
    font-size: 14px; outline: none; resize: vertical; font-family: inherit; line-height: 1.6;
}
textarea:focus { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.15); }

/* 新作业 Toast 提示 */
.toast {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%) translateY(-80px);
    background: #1f2937; color: #fff; padding: 12px 22px; border-radius: 12px;
    font-size: 14px; box-shadow: 0 4px 20px rgba(0,0,0,.25); z-index: 30;
    transition: transform .3s ease;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* 移动端适配：收紧间距与字号 */
@media (max-width: 640px) {
    h1 { font-size: 20px; }
    .container { padding: 16px 12px; }
    .page-header { gap: 8px; }
    .page-header .btn { padding: 8px 12px; font-size: 13px; }
    .card { padding: 18px; }
    .gallery { gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
    .subtitle { margin-bottom: 16px; }
}
