/* ==========================================================
   CPR+AED 课程报名 · 用户端 H5 样式（对齐参考截图）
   主色：红十字红 #e60012
   地点标签：横向滑动，无下拉
   ========================================================== */

:root {
    --red: #e60012;
    --red-dark: #c3000f;
    --ink: #1a1a1a;
    --gray-1: #4a4a4a;
    --gray-2: #8f8f8f;
    --gray-3: #c8c8c8;
    --card: #f5f5f5;
    --line: #e6e6e6;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { background: #fff; }

body.h5 {
    max-width: 640px;
    margin: 0 auto;
    background: #fff;
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
                 "Microsoft YaHei", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    padding-bottom: 84px;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: 0; background: none; }
input { font-family: inherit; outline: none; }

/* ---------------- 顶部标题 ---------------- */
.topbar {
    height: 56px;
    line-height: 56px;
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: .5px;
    color: #111;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 30;
    border-bottom: 1px solid #f0f0f0;
}

/* ---------------- 地点标签【横向滑动，无下拉】 ---------------- */
.place-bar {
    display: flex;
    align-items: center;
    padding: 10px 10px 8px;
    background: #fff;
}
.place-scroll-wrap {
    flex: 1;
    overflow: hidden;
}
.place-scroll-inner {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
}
.place-scroll-inner::-webkit-scrollbar {
    display: none;
}
.place-chip {
    display: inline-block;
    flex: 0 0 auto;
    padding: 5px 9px;
    border-radius: 4px;
    background: #8f8f8f;
    color: #fff;
    font-size: 14px;
    transition: background .15s;
    white-space: nowrap;
}
.place-chip.on { background: var(--red); }

/* ---------------- 日期 Tab【8等分Grid，不再横向滚动】 ---------------- */
.date-bar {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    padding: 2px 6px 0;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
}
.date-cap,
.date-item {
    position: relative;
    padding: 6px 2px 12px;
    text-align: center;
    color: #333;
}
.date-cap b {
    font-size: 14.5px;
    font-weight: 700;
    line-height: 1.45;
}
.date-item b {
    display: block;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
}
.date-cap,
.date-item span {
    display: block;
    font-size: 12.5px;
    color: var(--gray-1);
    line-height: 1.4;
}
.date-cap.on,
.date-item.on { color: var(--red); }
.date-item.on span { color: var(--red); }

.date-cap::after,
.date-item::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 2px;
    transform: translateX(-50%);
    width: 46px;
    height: 2px;
    border-radius: 2px;
    background: transparent;
}
.date-cap.on::after,
.date-item.on::after { background: var(--red); }

/* ---------------- 课程列表 ---------------- */
.course-list { padding: 12px; }

.card {
    background: var(--card);
    border-radius: 10px;
    padding: 14px 14px 12px;
    margin-bottom: 12px;
}

.card-head { display: flex; align-items: flex-start; padding-bottom: 10px; }
.cross {
    position: relative;
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    margin: 3px 8px 0 0;
}
.cross::before,
.cross::after {
    content: "";
    position: absolute;
    background: var(--red);
    border-radius: 3px;
}
.cross::before { left: 0; top: 6px; width: 18px; height: 6px; }
.cross::after { top: 0; left: 6px; width: 6px; height: 18px; }

.card-title h2 {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.5;
    color: #111;
    word-break: break-all;
}
.card-title p {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.5;
    color: #111;
    word-break: break-all;
}

.breadline { height: 1px; background: #dadada; margin: 0 0 10px; }

.meta-line { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 7px; }
.ico {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    margin-top: 3px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 16px 16px;
}
.ico-clock {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='1.8'><circle cx='12' cy='12' r='9'/><path d='M12 7.6v5l3.2 2.1'/></svg>");
}
.ico-pin {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='1.8'><path d='M12 21c4.2-4.4 7-7.6 7-11a7 7 0 1 0-14 0c0 3.4 2.8 6.6 7 11z'/><circle cx='12' cy='10' r='2.6'/></svg>");
}
.meta-text { font-size: 15px; color: #333; line-height: 1.6; word-break: break-all; }

.notice {
    background: #fff;
    border-radius: 8px;
    padding: 12px 14px;
    margin: 10px 0 4px;
    font-size: 14px;
    color: #666;
    line-height: 1.9;
    /* 核心：默认只显示2行，超出省略 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.notice.expand {
    /* 展开后取消行数限制，全部显示 */
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
}

.detail-wrap { text-align: center; }
.btn-detail {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 4px 16px;
    font-size: 15px;
    color: #333;
    margin: 8px 0 6px;
}
.btn-detail i { font-style: normal; font-size: 12px; color: #777; }
.detail-body {
    text-align: left;
    background: #fff;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13.5px;
    color: #666;
    margin-bottom: 6px;
}
.detail-row { display: flex; gap: 10px; line-height: 1.9; }
.detail-row label { flex: 0 0 64px; color: #999; }

.card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
}
.num { font-size: 15px; color: #333; }
.num em { font-style: normal; color: #333; font-weight: 600; }

.btn-sign {
    flex: 0 0 auto;
    background: var(--red);
    color: #fff;
    border-radius: 22px;
    padding: 9px 30px;
    font-size: 17px;
    letter-spacing: 3px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(230, 0, 18, .18);
}
.btn-sign:active { background: var(--red-dark); }
.btn-sign.off {
    background: #b5b5b5;
    box-shadow: none;
    letter-spacing: 1px;
    cursor: default;
}

.empty { text-align: center; padding: 48px 0; color: #999; }
.empty-icon { font-size: 34px; margin-bottom: 8px; }
.empty p { font-size: 15px; color: #666; }
.empty small { font-size: 12.5px; }

/* ---------------- 底部固定查询 ---------------- */
.foot-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    padding: 8px 12px calc(10px + env(safe-area-inset-bottom));
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #fff 38%);
}
.foot-bar-inner, .btn-query { max-width: 616px; margin: 0 auto; }
.btn-query {
    display: block;
    width: 100%;
    height: 48px;
    border-radius: 24px;
    background: var(--red);
    color: #fff;
    font-size: 19px;
    letter-spacing: 2px;
    font-weight: 500;
    box-shadow: 0 3px 12px rgba(230, 0, 18, .22);
}
.btn-query:active { background: var(--red-dark); }

/* ---------------- 弹窗 ---------------- */
.mask[hidden] { display: none; }

.mask {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .45);
    padding: 16px;
}
.pop {
    width: 100%;
    max-width: 420px;
    max-height: 86vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 10px;
    position: relative;
}
.pop-head {
    position: relative;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    text-align: center;
}
.pop-head h3 { font-size: 19px; font-weight: 600; color: #111; }
.pop-x {
    position: absolute;
    right: 10px;
    top: 6px;
    font-size: 26px;
    line-height: 1;
    color: #666;
    padding: 4px 8px;
}
.pop-sec { padding: 14px 18px; border-bottom: 1px solid var(--line); }
.pop-sec:last-child { border-bottom: 0; padding-bottom: 18px; }

.pop-label { display: block; font-size: 16px; color: #111; margin-bottom: 2px; }
.pop-value {
    font-size: 16px;
    color: var(--red);
    line-height: 1.75;
    white-space: pre-line;
    word-break: break-all;
}

.field-row { display: flex; align-items: center; gap: 6px; margin-bottom: 14px; }
.field-row label { flex: 0 0 52px; font-size: 16px; color: #111; }
.field-row input {
    flex: 1;
    min-width: 0;
    border: 1px solid #ccc;
    border-radius: 20px;
    padding: 9px 16px;
    font-size: 15px;
    color: #111;
    background: #fff;
}
.field-row input::placeholder { color: #b3b3b3; }
.field-row input:focus { border-color: var(--red); }

.pop-tip {
    min-height: 18px;
    font-size: 13px;
    color: var(--red);
    margin: -4px 0 8px 58px;
}

.btn-pop {
    display: block;
    width: 100%;
    height: 46px;
    border-radius: 10px;
    background: var(--red);
    color: #fff;
    font-size: 18px;
    letter-spacing: 1px;
    font-weight: 500;
    margin-top: 4px;
}
.btn-pop:disabled { opacity: .65; }

/* 查询结果 */
.result-user { font-size: 17px; color: #111; line-height: 2; }
.result-user span { color: #111; }

.result-title-bar {
    text-align: center;
    font-size: 18px;
    color: #111;
    padding: 2px 0 12px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 12px;
}

.result-item { padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid #eaeaea; }
.result-item:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }

.result-field { margin-bottom: 6px; }
.result-label { font-size: 16px; color: #111; line-height: 1.75; }
.result-value { font-size: 16px; line-height: 1.75; color: #111; word-break: break-all; }
.result-value.red { color: var(--red); }

.result-time { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
.result-time .result-label { flex: 0 0 auto; font-size: 14.5px; white-space: nowrap; }
.result-time .time-text {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 14.5px;
    color: var(--red);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.btn-cancel {
    flex: 0 0 auto;
    background: var(--red);
    color: #fff;
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 13.5px;
    line-height: 1.4;
}
.btn-cancel.off { background: #a8a8a8; }

/* toast */
.toast {
    position: fixed;
    left: 50%;
    top: 40%;
    transform: translate(-50%, -50%) scale(.96);
    background: rgba(0, 0, 0, .82);
    color: #fff;
    font-size: 14px;
    padding: 10px 18px;
    border-radius: 8px;
    opacity: 0;
    pointer-events: none;
    transition: .2s;
    z-index: 80;
    max-width: 80vw;
    text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }

@media (max-width: 360px) {
    .date-cap b { font-size:13px; }
    .date-item b { font-size:14px; }
    .date-item span { font-size:11px; }
    .place-chip { font-size: 13px; padding: 5px 7px; }
    .btn-sign { padding: 8px 22px; font-size: 15px; }
}
