/* 学生宿舍分配系统 H5 样式 */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #f3f5f9;
    color: #2b2f38;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.wrap {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background: #fff;
    display: flex;
    flex-direction: column;
}
.topbar {
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: #3b6cf6;
    color: #fff;
    font-size: 17px;
    font-weight: 600;
    flex-shrink: 0;
}
.topbar .back {
    position: absolute;
    left: 12px;
    font-size: 22px;
    font-weight: 400;
    color: #fff;
}
.content {
    flex: 1;
    padding: 20px 18px 32px;
    overflow-y: auto;
}

/* 表单 */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 14px; color: #6b7280; margin-bottom: 6px; }
.field input {
    width: 100%;
    height: 46px;
    border: 1px solid #e3e7ee;
    border-radius: 10px;
    padding: 0 14px;
    font-size: 16px;
    background: #f8fafc;
    outline: none;
    transition: border-color .15s;
}
.field input:focus { border-color: #3b6cf6; background: #fff; }

.btn {
    display: block;
    width: 100%;
    height: 48px;
    border: none;
    border-radius: 24px;
    background: #3b6cf6;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .15s, background .15s;
}
.btn:active { opacity: .85; }
.btn[disabled] { background: #b9c4d8; }
.btn.ghost { background: #eef2ff; color: #3b6cf6; }
.btn.danger { background: #ef4444; }

/* 卡片 */
.card {
    background: #fff;
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 14px;
    box-shadow: 0 2px 10px rgba(31, 45, 77, .06);
}
.card h3 { font-size: 16px; margin-bottom: 12px; }

/* 缴费页 */
.qr-box {
    text-align: center;
    padding: 12px 0 18px;
}
.qr-box img {
    width: 220px;
    height: 220px;
    object-fit: contain;
    margin: 0 auto 12px;
    border: 1px solid #eef0f4;
    border-radius: 10px;
    background: #fff;
}
.qr-tip { color: #6b7280; font-size: 13px; }
.amount { color: #ef4444; font-size: 20px; font-weight: 700; }

.status-bar {
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 16px;
    font-size: 14px;
    text-align: center;
}
.status-bar.pending { background: #fff7e6; color: #d48806; }
.status-bar.approved { background: #e6f9ee; color: #1a9d56; }
.status-bar.rejected { background: #fdeaea; color: #d4380d; }
.status-bar.none { background: #eef2ff; color: #3b6cf6; }

/* 列表项 */
.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 14px;
    border-bottom: 1px solid #f0f2f6;
    cursor: pointer;
}
.list-item:last-child { border-bottom: none; }
.list-item:active { background: #f8fafc; }
.list-item .li-main { flex: 1; }
.list-item .li-title { font-size: 16px; font-weight: 600; }
.list-item .li-sub { font-size: 13px; color: #9099a8; margin-top: 2px; }
.list-item .li-arrow { color: #c2c8d4; font-size: 20px; }
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    background: #eef2ff;
    color: #3b6cf6;
}
.badge.full { background: #f0f2f6; color: #9099a8; }
.badge.empty { background: #fdeaea; color: #d4380d; }

/* 床位网格 */
.bed-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 8px;
}
.bed {
    border: 1px solid #e3e7ee;
    border-radius: 10px;
    padding: 16px 12px;
    text-align: center;
    background: #fff;
}
.bed .bed-no { font-size: 17px; font-weight: 700; }
.bed .bed-state { font-size: 12px; margin-top: 4px; }
.bed.available { border-color: #3b6cf6; color: #3b6cf6; cursor: pointer; }
.bed.occupied { background: #f4f6fa; color: #9099a8; }
.bed.mine { background: #e6f9ee; border-color: #1a9d56; color: #1a9d56; }

/* 结果页 */
.result-card {
    text-align: center;
    padding: 28px 18px;
}
.result-card .check { font-size: 48px; color: #1a9d56; margin-bottom: 10px; }
.result-card .bed-line { font-size: 22px; font-weight: 700; margin: 6px 0; }
.result-card .room-line { color: #6b7280; }

/* 提示文字 */
.muted { color: #9099a8; font-size: 13px; text-align: center; }
.toast {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,.75);
    color: #fff;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 9999;
    max-width: 80%;
    text-align: center;
}
.loader {
    text-align: center;
    padding: 40px 0;
    color: #9099a8;
}

.crumbs { font-size: 13px; color: #6b7280; margin-bottom: 10px; }
.crumbs a { color: #3b6cf6; }
.crumbs .sep { margin: 0 6px; color: #c2c8d4; }

/* 学生信息条 */
.stu-info {
    background: #eef2ff;
    color: #3b6cf6;
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 12px;
    font-size: 13px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}
.stu-info .sep { margin: 0 8px; color: #b9c4d8; }

/* 配额选号 */
.quota-card {
    background: linear-gradient(135deg, #3b6cf6, #5b8def);
    color: #fff;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 8px;
}
.quota-card .quota-title { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.quota-card .quota-stats { font-size: 13px; opacity: .95; }
.quota-card .quota-stats .sep { margin: 0 6px; opacity: .6; }
.quota-card .quota-stats .remain { font-weight: 600; }
.seq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
    gap: 8px;
}
.seq-no {
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 600;
    border: 1px solid #e3e7ef;
    background: #fff;
    color: #2b2f38;
}
.seq-no.free { color: #3b6cf6; background: #eef2ff; cursor: pointer; }
.seq-no.free:active { background: #dbe4ff; }
.seq-no.taken { color: #c2c8d4; background: #f5f6f8; text-decoration: line-through; cursor: not-allowed; }

/* 房间内床位号 */
.seq-no { flex-direction: column; gap: 2px; }
.seq-no .seq-bed-no { font-size: 17px; font-weight: 700; }
.seq-no .seq-bed-state { font-size: 11px; font-weight: 400; opacity: .8; }
.seq-no.free .seq-bed-state { color: #3b6cf6; }
.seq-no.taken .seq-bed-state { color: #c2c8d4; text-decoration: none; }

/* 房间内床位网格：每房间固定 6 列 */
.room-beds {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    margin-top: 4px;
}
.room-beds .seq-no { height: 60px; }

/* 房间列表容器 */
.room-list { margin-top: 4px; }

/* 房间床位示意图（俯视图） */
.room-map {
    border: 2px solid #c2c8d4;
    border-radius: 12px;
    padding: 18px 12px 28px;
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
    position: relative;
    margin-top: 6px;
}
.room-map-label {
    position: absolute;
    top: -9px;
    left: 14px;
    background: #fff;
    padding: 0 8px;
    font-size: 11px;
    color: #9099a8;
}
.room-map-grid {
    display: grid;
    grid-template-columns: 1fr 56px 1fr;
    gap: 10px;
    align-items: stretch;
}
.bed-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
/* 床位卡片 */
.bed-shape {
    border: 1.5px solid #e3e7ef;
    border-radius: 8px;
    padding: 9px 10px;
    background: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: transform .12s, box-shadow .12s;
    color: #2b2f38;
}
.bed-shape.free {
    border-color: #3b6cf6;
    background: #eef2ff;
    color: #3b6cf6;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(59,108,246,.12);
}
.bed-shape.free:active { transform: scale(.97); }
.bed-shape.taken {
    background: #f5f6f8;
    color: #c2c8d4;
    opacity: .7;
}
.bed-shape.mine {
    border-color: #1a9d56;
    background: #e6f9ee;
    color: #1a9d56;
}
/* 床形图标（俯视：床头+被褥纹理） */
.bed-icon {
    width: 30px;
    height: 20px;
    border: 1.5px solid currentColor;
    border-radius: 3px;
    position: relative;
    flex-shrink: 0;
}
.bed-icon::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    height: 5px;
    background: currentColor;
    border-radius: 1px;
    opacity: .35;
}
.bed-icon::after {
    content: '';
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 1.5px;
    background: currentColor;
    opacity: .25;
}
.bed-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}
.bed-num { font-size: 14px; font-weight: 700; }
.bed-st { font-size: 10px; opacity: .75; }
/* 走道 */
.aisle {
    border-left: 1px dashed #c2c8d4;
    border-right: 1px dashed #c2c8d4;
    display: flex;
    align-items: center;
    justify-content: center;
}
.aisle span {
    font-size: 10px;
    color: #9099a8;
    writing-mode: vertical-rl;
    letter-spacing: 3px;
}
/* 房门 */
.room-map-door {
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    padding: 1px 14px;
    border: 2px solid #c2c8d4;
    border-top: none;
    border-radius: 0 0 10px 10px;
    font-size: 10px;
    color: #9099a8;
}
