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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: linear-gradient(180deg, #f0f7ff 0%, #f5f7fa 30%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 1rem 2rem;
}

/* Top bar */
.top-bar {
    width: 100%;
    max-width: 800px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    margin-bottom: 0.5rem;
}

.top-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #333;
    font-weight: 600;
    font-size: 0.95rem;
}

.top-logo-img { height: 26px; width: auto; }

.top-back {
    font-size: 0.85rem;
    color: #2F80ED;
    text-decoration: none;
    padding: 6px 14px;
    border: 1px solid #2F80ED;
    border-radius: 20px;
    transition: all 0.2s;
}

.top-back:hover {
    background: #2F80ED;
    color: #fff;
}

#app {
    width: 100%;
    max-width: 800px;
}

.view {
    display: none;
}

.view.active {
    display: block;
}

/* Welcome banner */
.welcome-banner {
    text-align: center;
    padding: 2rem 1.5rem;
    margin-bottom: 1.5rem;
}

.welcome-icon {
    margin-bottom: 1rem;
}

.welcome-banner h1 {
    font-size: 1.6rem;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
    text-align: center;
}

.welcome-desc {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.welcome-tips {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.tip-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: #666;
}

.tip-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #2F80ED;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card {
    background: #fff;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 24px rgba(47, 128, 237, 0.06);
    border: 1px solid #e8eef6;
}

.card-title {
    font-size: 1.25rem;
    color: #1a1a1a;
    text-align: center;
    margin-bottom: 0.25rem;
}

h1 {
    font-size: 1.5rem;
    color: #1a1a1a;
    text-align: center;
    margin-bottom: 0.25rem;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    color: #333;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

/* select 默认继承不到 body 字体，校名会掉成系统衬线体，和上下输入框不齐。
   同时把系统外观关掉，让圆角和边框与 input 一致。 */
.form-group select {
    font-family: inherit;
    background: #fff;
    color: #333;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23888' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    background-size: 12px 8px;
    padding-right: 2.2rem;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #2F80ED;
    box-shadow: 0 0 0 3px rgba(47, 128, 237, 0.1);
}

.field-note {
    margin-top: 0.35rem;
    font-size: 0.75rem;
    color: #5b6470;
    line-height: 1.5;
}

/* 等待院校核实页。琥珀色而非红色：这不是学生做错了什么，只是需要等院校确认。 */
.pending-box {
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 12px;
    padding: 1.5rem 1.25rem;
    text-align: center;
    margin-bottom: 1rem;
}
.pending-box.rejected {
    background: #fdecec;
    border-color: #f5b5b5;
}
.pending-icon { font-size: 2.5rem; line-height: 1; margin-bottom: 0.75rem; }
.pending-msg {
    font-size: 0.95rem;
    color: #5d4a00;
    line-height: 1.7;
    margin-bottom: 1.25rem;
}
.pending-box.rejected .pending-msg { color: #a62828; }
.pending-detail {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 0.4rem 0.75rem;
    text-align: left;
    font-size: 0.85rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}
.pending-detail dt { color: #8a7500; }
.pending-detail dd { color: #333; word-break: break-all; }
.pending-box.rejected .pending-detail dt { color: #a05252; }
.pending-hint {
    font-size: 0.8rem;
    color: #5b6470;
    line-height: 1.7;
    margin-bottom: 1rem;
}

.btn {
    width: 100%;
    padding: 0.85rem;
    background: #2F80ED;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 0.5rem;
}

.btn:hover:not(:disabled) {
    background: #1a6dd4;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(47, 128, 237, 0.3);
}

.btn:disabled {
    background: #a0c4f0;
    cursor: not-allowed;
}

.btn-secondary {
    background: #6c757d;
    margin-top: 0.5rem;
}

.btn-secondary:hover:not(:disabled) {
    background: #5a6268;
}

.btn-warning {
    background: #ff9800;
    margin-top: 0.5rem;
}

.btn-warning:hover:not(:disabled) {
    background: #f57c00;
}

.preview-grid {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.preview-img {
    max-width: 300px;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
}

.error-msg {
    color: #d32f2f;
    background: #ffebee;
    padding: 0.6rem;
    border-radius: 6px;
    font-size: 0.875rem;
    margin-top: 1rem;
    display: none;
}

.error-msg.visible {
    display: block;
}

/* Neutral info variant (e.g. submitted for manual review) */
.error-msg.info {
    color: #1565c0;
    background: #e8f2fc;
}

/* 合规审核的多条整改建议，逐条列出比一行铺开好读 */
.reason-list {
    margin: 0.5rem 0 0;
    padding-left: 1.2rem;
    text-align: left;
}

.reason-list li {
    margin-bottom: 0.35rem;
    line-height: 1.5;
}

.reason-list li:last-child {
    margin-bottom: 0;
}

.camera-wrap {
    position: relative;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 3 / 4;
    max-width: 400px;
    margin: 0 auto 1rem;
}

#video, #snapshot {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hidden {
    display: none !important;
}

/* 拍照引导框：按学信网头肩构图规范定位(头顶留白~10%、头部占比~65%、双眼线~40%、露双耳) */
.face-guide {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
}

/* 取景框用 SVG 绘制，viewBox 与 3:4 画面等比，几何不受容器尺寸影响 */
.guide-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

/* 底部提示文字 */
.guide-tip {
    position: absolute;
    bottom: 4%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.3rem 0.9rem;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 0.8rem;
    border-radius: 999px;
    white-space: nowrap;
}

.step-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}

.step-item {
    display: flex;
    flex-direction: column;
    padding: 0.75rem;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
}

.step-main {
    display: flex;
    align-items: center;
}

.step-error {
    margin-top: 0.4rem;
    margin-left: 2.25rem;
    font-size: 0.8rem;
    color: #f44336;
    line-height: 1.3;
}

.step-item:last-child {
    border-bottom: none;
}

.step-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.step-item.running .step-icon {
    background: #ffc107;
    color: #fff;
    animation: pulse 1.5s infinite;
}

.step-item.done .step-icon {
    background: #4caf50;
    color: #fff;
}

.step-item.failed .step-icon {
    background: #f44336;
    color: #fff;
}

.step-pct {
    margin-left: auto;
    font-size: 0.8rem;
    color: #5b6470;
}

.step-item.running .step-pct {
    color: #ffc107;
    font-weight: 500;
}

.step-item.done .step-pct {
    color: #4caf50;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.progress-wrap {
    background: #e0e0e0;
    border-radius: 6px;
    height: 8px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #2F80ED, #56A5F8);
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    color: #666;
    font-size: 0.875rem;
}

.spec-grid {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 1.5rem 0;
}

.spec-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    max-width: 300px;
}

.spec-card img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: 4px;
    background: #e0e0e0;
    margin-bottom: 0.5rem;
}

.spec-thumb {
    width: 100%;
    aspect-ratio: 3 / 4;
    border-radius: 4px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.spec-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.spec-loading {
    font-size: 0.75rem;
    color: #5b6470;
}

.spec-card .spec-name {
    font-size: 0.8rem;
    color: #333;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.spec-card .spec-size {
    font-size: 0.7rem;
    color: #5b6470;
    margin-bottom: 0.5rem;
}

.spec-card .btn-download {
    display: inline-block;
    width: 100%;
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
    background: #2F80ED;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}

.spec-card .btn-download:hover {
    background: #1a6dd4;
}

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

/* Side-by-side comparison */
.compare-side-by-side {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin: 0 auto 1.5rem;
    max-width: 500px;
}

.compare-col {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #e5e8ed;
    aspect-ratio: 3 / 4;
}

.compare-col img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.compare-tag {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 3px 10px;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 0.75rem;
    border-radius: 4px;
}

.compare-tag.tag-after {
    background: rgba(47,128,237,0.85);
}

/* Background switch buttons */
.bg-options {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.bg-btn {
    padding: 0.4rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    background: #fff;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.bg-btn:hover {
    border-color: #2F80ED;
}

.bg-btn.active {
    border-color: #2F80ED;
    background: #eef4fd;
    color: #2F80ED;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 480px) {
    .welcome-tips {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    .welcome-banner {
        padding: 1.5rem 1rem;
    }
    .welcome-banner h1 {
        font-size: 1.3rem;
    }
    .card {
        padding: 1.5rem;
    }
    .clothing-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Options page */
.option-group {
    margin-bottom: 1.5rem;
}

.option-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.75rem;
}

.clothing-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
}

.clothing-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 0.75rem 0.25rem;
    border: 2px solid #e5e8ed;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.75rem;
    color: #666;
    text-align: center;
}

.clothing-item:hover {
    border-color: #2F80ED;
}

.clothing-item.active {
    border-color: #2F80ED;
    background: #eef4fd;
    color: #2F80ED;
    font-weight: 500;
}

.clothing-icon {
    font-size: 1.5rem;
}

.option-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}

.option-hint {
    font-size: 0.78rem;
    color: #8a94a6;
    margin: -0.4rem 0 0.6rem;
}

.retouch-actions {
    display: flex;
    gap: 0.75rem;
}

.link-btn {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.78rem;
    color: #2F80ED;
    cursor: pointer;
}

.link-btn:hover {
    text-decoration: underline;
}

.retouch-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.retouch-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.6rem 0.7rem;
    border: 2px solid #e5e8ed;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.retouch-item:hover {
    border-color: #2F80ED;
}

.retouch-item:has(input:checked) {
    border-color: #2F80ED;
    background: #eef4fd;
}

.retouch-item input {
    margin-top: 0.15rem;
    accent-color: #2F80ED;
    flex-shrink: 0;
}

.retouch-body {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.retouch-name {
    font-size: 0.82rem;
    font-weight: 500;
    color: #333;
}

.retouch-desc {
    font-size: 0.72rem;
    color: #8a94a6;
    line-height: 1.3;
}

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

.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: #f8f9fb;
    border-radius: 8px;
}

.toggle-desc {
    font-size: 0.85rem;
    color: #666;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #ccc;
    border-radius: 24px;
    transition: 0.2s;
}

.toggle-slider::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.2s;
}

.toggle-switch input:checked + .toggle-slider {
    background: #2F80ED;
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

/* 成品页的交付环节：报送学信网、冲印下单各占一块，与下载区分隔开。 */
.deliver-box {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin: 1rem 0;
    text-align: left;
}

.deliver-title {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.25rem;
}

.deliver-hint {
    font-size: 0.8125rem;
    color: #6b7280;
    margin: 0 0 0.75rem;
    line-height: 1.5;
}

.album-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.25rem 0;
}

.album-item {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    text-align: left;
}

.album-meta {
    font-size: 0.875rem;
    color: #374151;
    margin-bottom: 0.5rem;
}

/* 相册里一次采集可能有多个规格，横排会溢出小屏，改为换行。 */
.album-item .spec-grid {
    flex-wrap: wrap;
    margin: 0.5rem 0 0;
}

/* 报送回执列表复用 .step-item 的排版，但没有步骤图标，故用独立的着色类。 */
.chsi-item {
    color: #374151;
}

.chsi-ok {
    color: #059669;
    font-weight: 500;
}

.chsi-bad {
    color: #dc2626;
}

/* ---- 无障碍：键盘焦点可见 ---- */
/* 学生端主要在手机上用，但院校机房的公用电脑是键盘操作，Tab 到"开始拍摄"时
   必须看得出焦点在哪。用 focus-visible，鼠标点击不留焦点环。 */
.btn:focus-visible,
.bg-btn:focus-visible,
.link-btn:focus-visible,
.spec-card a:focus-visible,
.spec-card button:focus-visible,
.clothing-item:focus-visible {
    outline: 2px solid #2F80ED;
    outline-offset: 3px;
}
.form-group input:focus-visible,
.form-group select:focus-visible {
    outline: 2px solid #2F80ED;
    outline-offset: 1px;
}

/* ---- 触摸目标：手指点击区不小于 44px ---- */
/* link-btn 原来 padding:0，纯文字高度约 18px，手机上很难点准。
   撑到 44px 并居中，视觉上只是行高变宽，不改字号也不改颜色。 */
.link-btn { min-height: 44px; display: inline-flex; align-items: center; }
.bg-btn { min-height: 44px; }
.clothing-item { min-height: 44px; }

/* ---- 动效降级 ---- */
/* 处理进度页有持续动画，前庭功能敏感的用户会不适；系统开了"减弱动态效果"就停掉。 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }
}

/* 院校老师的留言。挂在失败提示（.error-msg 红底）里面，用白底把它从 AI 的
   模板化建议里分出来——这是一句人写给学生的话，不该混在报错文本里。 */
.school-notice {
    margin-top: 0.6rem;
    padding: 0.5rem 0.65rem;
    background: #fff;
    border-radius: 6px;
    color: #333;
    font-size: 0.85rem;
    line-height: 1.55;
    text-align: left;
    word-break: break-word;
}
