/* v3 前端样式 —— 手写，够用就行 */

/* ---------- 配色变量（收敛主调，改主题只动这里） ---------- */
:root {
    --brand: #1a4fd6;        /* 品牌蓝：logo / 主按钮 / 链接 */
    --brand-hover: #1541b0;
    --danger: #d13438;       /* 价格红 / 危险按钮 —— 注意中国股市惯例红涨绿跌，价格用红 */
    --danger-hover: #b02a2e;
    --bg: #f5f6f8;           /* 页面背景 */
    --text: #24292f;         /* 主文字 */
    --surface: #fff;         /* 卡片 / 面板底色 */
    --border: #e4e6eb;
    --img-bg: #f0f1f3;       /* 图片占位底 */
    --img-text: #a0a6ad;     /* 占位文字 */
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

.hidden { display: none !important; }

/* ---------- 顶栏 ---------- */
.topbar {
    background: #fff;
    border-bottom: 1px solid #e4e6eb;
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
}

.brand { font-size: 17px; font-weight: 600; color: var(--brand); }
.brand .tag {
    font-size: 12px;
    font-weight: 400;
    color: #6b7280;
    background: #eef2ff;
    border-radius: 10px;
    padding: 2px 8px;
    margin-left: 8px;
}

.user-area { display: flex; align-items: center; gap: 12px; }
.user-area .who { font-size: 13px; color: #57606a; }

/* ---------- 通用控件 ---------- */
button {
    font-size: 14px;
    font-family: inherit;
    border-radius: 6px;
    border: 1px solid transparent;
    padding: 8px 16px;
    cursor: pointer;
    transition: all .15s;
}

button.primary { background: var(--brand); color: #fff; }
button.primary:hover { background: var(--brand-hover); }
button.ghost { background: #fff; color: var(--text); border-color: #d0d7de; }
button.ghost:hover { background: #f3f4f6; }
button.danger { background: var(--danger); color: #fff; }
button.danger:hover { background: var(--danger-hover); }
button.small { padding: 5px 12px; font-size: 13px; }

input, select {
    font-family: inherit;
    font-size: 14px;
    padding: 9px 12px;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    width: 100%;
    background: #fff;
}
/*
  复选框不能跟着上面的 width:100% 走。

  踩过的真 bug：书单导入确认页那一行是 flex，checkbox 继承 width:100%
  后直接占满整行，把右边的书名/ISBN 输入框挤成几十像素 —— 表现是
  "看不见书名、文字竖着排、底部还有横向滚动条"，用户根本没法核对草稿。
  checkbox 天生就该是固有尺寸，这里统一兜底，别指望每个局部样式都记得写。
*/
input[type=checkbox] { width: auto; padding: 0; flex: none; accent-color: var(--brand); }
input:focus, select:focus { outline: none; border-color: var(--brand); }

label { display: block; font-size: 13px; color: #57606a; margin-bottom: 12px; }
label input, label select { margin-top: 4px; }

/* ---------- 登录/注册：覆盖层（先逛后登，11-18） ---------- */
.auth {
    position: fixed;
    inset: 0;
    z-index: 500;              /* 高于 .modal(300) 和 #askModal(400) */
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 48px 16px;
    overflow-y: auto;
    background: rgba(20, 26, 38, .48);
    backdrop-filter: blur(2px);
}
.auth-card {
    position: relative;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,.22);
    padding: 28px;
    width: 100%;
    max-width: 380px;
    margin: auto 0;            /* 内容不超屏时垂直居中 */
}
.auth-x {
    position: absolute;
    top: 8px; right: 10px;
    background: transparent;
    border: none;
    color: #8b949e;
    font-size: 20px;
    line-height: 1;
    padding: 4px 9px;
}
.auth-x:hover { color: var(--text); background: #f3f4f6; }
.auth-lead {
    font-size: 12.5px;
    color: #6b7280;
    line-height: 1.6;
    margin: 0 0 14px;
    padding-right: 18px;
}
body.auth-open { overflow: hidden; }
.auth-tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.auth-tabs button {
    flex: 1;
    background: #f3f4f6;
    color: #57606a;
}
.auth-tabs button.active { background: var(--brand); color: #fff; }
.auth-card form button[type=submit] { width: 100%; margin-top: 6px; }
/* 「忘了密码？」这类次要入口：不抢眼，但要点得到 */
.auth-link { text-align: center; margin-top: 10px; font-size: 13px; }
.auth-link a { color: var(--brand); text-decoration: none; }
.auth-link a:hover { text-decoration: underline; }
.hint { font-size: 12px; color: #8b949e; margin-top: 10px; }
/* 输入框下面那行小字说明（学号格式、算出的大几）：紧贴输入框，别和 label 一样粗 */
.field-hint { display: block; font-size: 12px; color: #8b949e; margin-top: 4px; line-height: 1.5; }
.field-hint.ok { color: #1a7f37; }
.field-hint.warn { color: #cf222e; }
.register-grade { font-size: 13px; color: #57606a; }

/* ---------- Tab ---------- */
.tabs {
    display: flex;
    gap: 6px;
    padding: 16px 24px 0;
    max-width: 1000px;
    margin: 0 auto;
}
.tab { background: transparent; color: #57606a; border-radius: 6px 6px 0 0; }
.tab.active { background: #fff; color: var(--brand); font-weight: 600; }

/* ---------- 首次进入引导条 ---------- */
.guidebar {
    width: calc(100% - 48px);
    max-width: 952px;
    margin: 12px auto 0;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #eef2ff;
    border: 1px solid #dbe4ff;
    border-radius: 8px;
    font-size: 13px;
    color: #3b4252;
    box-sizing: border-box;
}
.guide-dot {
    flex: none;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    font-size: 11px;
    display: flex; align-items: center; justify-content: center;
}
.guide-text { flex: 1; line-height: 1.65; }
/* B3：短文案只在手机上显示（规则在末尾 B3 段），桌面仍用上面那句长的 */
.guide-short { display: none; }
.guide-link {
    background: none;
    border: none;
    padding: 0 2px;
    color: var(--brand);
    font-size: 13px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.guide-link:hover { color: var(--brand-hover); background: none; }
.guide-close {
    flex: none;
    background: transparent;
    border: 1px solid #c7d2fe;
    color: #4338ca;
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 6px;
}
.guide-close:hover { background: #e0e7ff; }

/* ---------- 游客预览提示条 ----------
   所有 tab 都能进，但纯个人数据页不能留白壳 —— 给一句说明 + 登录入口。
   用暖黄和引导条的浅蓝区分：一个是"教你怎么用"，一个是"这里要登录"。 */
.guest-hint {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff8e6;
    border: 1px solid #f3dfae;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #6b5418;
    line-height: 1.6;
}
.gh-dot {
    flex: none;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: #d9a441;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.gh-text { flex: 1; }
.gh-text b { font-weight: 600; }
.guest-hint button { flex: none; }
.guest-empty { color: #8b949e; }

/* 桌面端：tab 行 + 搜索筛选行吸顶。
   手机上不做 —— 屏幕本来就窄，吸顶会吃掉一大块可视区，书就没地方看了。 */
@media (min-width: 900px) {
    .tabs {
        position: sticky;
        top: 56px;
        z-index: 9;
        height: 55px;
        background: var(--bg);
    }
    .list-toolbar {
        position: sticky;
        top: 111px;
        z-index: 8;
        background: var(--bg);
        padding-top: 10px;
        margin-top: -10px;
    }
}

/* 订单 tab 上的待办角标：有人下单 / 等我收货时冒出来 */
.tab-badge {
    display: inline-block;
    min-width: 18px;
    margin-left: 6px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--danger);
    color: #fff;
    font-size: 12px;
    line-height: 18px;
    text-align: center;
    font-weight: 400;
}

.panel { max-width: 1000px; margin: 0 auto; padding: 20px 24px 60px; }
.panel h2 { font-size: 17px; margin-bottom: 16px; }

/* ---------- 搜索 ---------- */
.searchbar { display: flex; gap: 10px; margin-bottom: 18px; }
.searchbar input { flex: 1; }

/* ---------- 书籍卡片 ---------- */
/* 「我的挂售」用这个：紧凑横排，一屏看到更多本 + 管理按钮 */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
/* 书单页用这个：大图卡片流（买二手书第一眼要看实物，图必须够大） */
.cards.grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }

.gcard {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
    transition: transform .15s, box-shadow .15s;
}
.gcard:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(0,0,0,.09); }

.gimg { position: relative; aspect-ratio: 4 / 3; background: var(--img-bg); overflow: hidden; }
.gimg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gimg .no-img.big {
    width: 100%; height: 100%; border-radius: 0;
    display: flex; align-items: center; justify-content: center;
    color: var(--img-text); font-size: 13px;
}
.gcount {
    position: absolute; right: 8px; bottom: 8px;
    background: rgba(0,0,0,.55); color: #fff;
    font-size: 12px; border-radius: 10px; padding: 1px 8px;
}

.gbody { padding: 10px 12px 12px; }
.gbody h3 {
    font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.35;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; min-height: 38px;
}
.gsub {
    font-size: 12.5px; color: #6b7280; margin-top: 2px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* ISBN 单独一行：教材版本靠它区分，别塞进会被省略号截掉的副行里 */
.gisbn {
    margin-top: 2px; font-size: 11.5px; color: #57606a;
    font-family: ui-monospace, Menlo, Consolas, monospace;
    letter-spacing: .2px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gisbn.nope { color: #b6bec9; font-family: inherit; letter-spacing: 0; }
.grow { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.gprice { color: var(--danger); font-weight: 700; font-size: 18px; }

/* ---------- 图片加载失败占位（替代破图） ---------- */
.img-fail {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background: var(--img-bg); color: var(--img-text);
    font-size: 12px;
}
/* 不同容器里 img 被替换成 .img-fail 后的尺寸兜底（.gimg 靠 aspect-ratio 自动撑满，不用列） */
.thumb .img-fail { width: 84px; height: 112px; border-radius: 6px; }
.dmain .img-fail { width: 100%; height: 220px; }
.dthumbs .img-fail { width: 56px; height: 56px; border-radius: 6px; flex: none; }
.oitem .img-fail { width: 40px; height: 52px; border-radius: 4px; flex: none; }

/* ---------- 空状态（结构化，带行动入口） ----------
   老的 <p class="empty"> 仍兜底；新空状态用 .empty-state 给图标+标题+说明+按钮 */
.empty { color: #6b7280; text-align: center; padding: 40px 20px; font-size: 14px; grid-column: 1 / -1; }
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 44px 20px 48px;
}
.empty-state .es-icon {
    width: 56px; height: 56px; margin: 0 auto 12px;
    color: var(--img-text);
    display: block;
}
.empty-state h4 { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.empty-state p {
    font-size: 13.5px; color: #6b7280; margin: 0 auto 18px; max-width: 320px;
}
.empty-state .es-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.card {
    background: #fff;
    border-radius: 10px;
    padding: 12px;
    display: flex;
    gap: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}

/* 「我的挂售」卡片整张可点进详情 */
.card.clickable { cursor: pointer; transition: box-shadow .15s, transform .15s; }
.card.clickable:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,.09); }

.thumb { flex: 0 0 84px; }
.thumb img { width: 84px; height: 112px; object-fit: cover; border-radius: 6px; display: block; }
.no-img {
    width: 84px; height: 112px; border-radius: 6px;
    background: var(--img-bg); color: var(--img-text);
    display: flex; align-items: center; justify-content: center; font-size: 12px;
}

.meta { flex: 1; min-width: 0; }
.meta h3 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.meta h3 .edition { font-size: 12px; color: #6b7280; font-weight: 400; margin-left: 4px; }
.meta .sub { font-size: 12.5px; color: #6b7280; }
.price { color: var(--danger); font-weight: 700; font-size: 16px; margin: 4px 0; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }

/* ---------- 状态徽标 ---------- */
.badge {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
    background: #eef2ff;
    color: var(--brand);
}
.badge.s1, .badge.o1 { background: #fff4e5; color: #b45309; }
.badge.s2, .badge.o2 { background: #e8f0fe; color: var(--brand); }
.badge.s3, .badge.o3 { background: #e6f4ea; color: #1e7b34; }
.badge.s4, .badge.o4 { background: #f1f3f5; color: #6b7280; }

/* ---------- 订单 ---------- */
.order {
    background: #fff;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.order-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.order-head .oid { font-weight: 600; font-size: 13px; color: #57606a; }
.order-head .price { margin-left: auto; }
.order .title { font-size: 15px; font-weight: 600; }
.order .contact {
    margin-top: 6px;
    font-size: 13px;
    color: #1e7b34;
    background: #e6f4ea;
    border-radius: 6px;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
/* 号码本身：等宽 + 加大，一眼能抄下来 */
.order .contact-num {
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .3px;
    user-select: all;
}
button.tiny { padding: 3px 9px; font-size: 12px; }

/* 打包折叠卡：同一个对手的多笔订单合成一张 */
.order.group { border-left: 3px solid var(--brand); }
.order.group .lines {
    list-style: none;
    margin: 8px 0;
    padding-top: 6px;
    border-top: 1px dashed #e4e6eb;
}
.order.group .lines li {
    display: flex;
    gap: 8px;
    align-items: baseline;
    flex-wrap: wrap;
    font-size: 13px;
    padding: 4px 0;
}
.order.group .lines .price { font-size: 13px; margin: 0; }

.empty {
    text-align: center;
    color: #8b949e;
    background: #fff;
    border-radius: 10px;
    padding: 40px;
}

/* ---------- 打包勾选 ---------- */
.pick {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: 0;
    font-size: 12.5px;
    color: #57606a;
    cursor: pointer;
    user-select: none;
}
.pick input { width: 15px; height: 15px; margin: 0; }

.pickbar {
    position: fixed;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border: 1px solid #d0d7de;
    border-radius: 10px;
    box-shadow: 0 6px 24px rgba(0,0,0,.14);
    padding: 10px 16px;
    font-size: 13px;
    z-index: 50;
    max-width: calc(100% - 32px);
}

/* ---------- 发布表单 ---------- */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
#publishForm { background: #fff; border-radius: 10px; padding: 20px; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
#publishForm button[type=submit] { margin-top: 8px; }

/* ---------- 发布页：适用专业多选 ---------- */
.field { margin-bottom: 14px; }
.field-label { margin: 0 0 6px; font-size: 13px; color: #5b6570; }
/*
  这一行以前是裸的 <p class="sub">：没有任何样式，于是按浏览器默认正文字号渲染，
  一整段黑字杵在表单中间，比输入框本身还抢眼。表单里的说明永远是"配角"，
  必须比正文小、比正文淡，否则用户会以为它是必读告示。
*/
.field .sub { margin: 6px 0 0; font-size: 12.5px; line-height: 1.5; color: #9aa4b2; }

.major-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; min-height: 26px; align-items: center; }
.chip {
    display: inline-flex; align-items: center; gap: 4px;
    background: #eef4ff; color: #1a56c4; border: 1px solid #cddcfb;
    border-radius: 999px; padding: 2px 6px 2px 10px; font-size: 13px;
}
.chip-x {
    border: 0; background: none; color: #5b7fc4; cursor: pointer;
    font-size: 15px; line-height: 1; padding: 0 2px;
}
.chip-x:hover { color: var(--danger); }

/* 选择面板：按学院分组，手机上单列、宽屏两列 */
.major-picker {
    margin-top: 10px; padding: 12px; max-height: 340px; overflow-y: auto;
    border: 1px solid #e3e6ea; border-radius: 8px; background: #fafbfc;
}
.major-group + .major-group { margin-top: 12px; }
.major-group-name { margin: 0 0 6px; font-size: 13px; font-weight: 600; color: #3b4550; }
.major-items { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; }
.major-item {
    display: flex; align-items: center; gap: 6px;
    font-size: 14px; padding: 4px 2px; cursor: pointer; margin: 0;
}
.major-item input { width: auto; margin: 0; }

@media (max-width: 640px) {
    .major-items { grid-template-columns: 1fr; }
}

/* ---------- 提示条 ----------
   ⚠️ 层级必须高于所有覆盖层，否则就是"提示被盖住、用户以为没反应"：
        .topbar 10 / .tabs 9(手机在底部 60) / .detail-bar 60
        .lightbox 200 / .modal 300 / #askModal 400 / .auth 500
        .toast 900 / 上传进度条 9999
   2026-11-24 修：原来是 z-index:100，而登录覆盖层 .auth 是 500 ——
   手机上点登录、密码错，那句「学号或密码不对」整条被压在登录卡片下面，
   用户看到的就是"点了一点反应都没有"。同一个坑还影响：
   联系方式弹层、书单导入弹窗、确认弹窗里触发的所有提示。
   记住一条：**凡是需要压在覆盖层之上显示的浮层，z-index 必须 > 500。** */
.toast {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    max-width: min(92vw, 520px);   /* 长句要能换行，不能撑出屏幕 */
    background: #1e7b34;
    color: #fff;
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
    word-break: break-word;
    box-shadow: 0 4px 16px rgba(0,0,0,.15);
    z-index: 900;
    pointer-events: none;          /* 提示条只是看的，不该拦住底下的点击 */
}
.toast.error { background: var(--danger); }

/* ---------- 表单内联错误（登录 / 注册 / 找回密码）----------
   为什么不只靠 .toast：
     · toast 5 秒后自己消失，用户正要回头改输入框时提示已经没了；
     · 手机上键盘一弹起，顶部那条经常落在视野边缘，等于没提示；
     · 登录失败是最需要"看着改"的场景，错误必须留在原地。
   所以两处一起用：表单里留一条（下面这个），顶部再闪一下。 */
.form-err {
    margin: 12px 0 0;
    padding: 9px 12px;
    border: 1px solid #f3c2be;
    border-radius: 8px;
    background: #fff5f4;
    color: #b42318;
    font-size: 13px;
    line-height: 1.55;
    text-align: left;
    word-break: break-word;
}

/* ---------- 书籍详情页 ---------- */
.detail { max-width: 760px; margin: 0 auto; padding: 0 16px 96px; }
.detail-top {
    /* topbar 是 sticky top:0 且高 56px，这里要让开它，否则返回按钮会被顶栏盖住 */
    position: sticky; top: 56px; z-index: 8;
    display: flex; align-items: center; gap: 12px;
    background: var(--bg); padding: 12px 0 10px;
}
.detail-title {
    font-size: 14px; color: #57606a; min-width: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.dgal { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.dmain { position: relative; background: var(--img-bg); cursor: zoom-in; }
.dmain img { width: 100%; display: block; max-height: 62vh; object-fit: contain; }
.dmain .no-img.xl {
    width: 100%; height: 220px; border-radius: 0;
    display: flex; align-items: center; justify-content: center; color: var(--img-text);
}
.dcount {
    position: absolute; right: 10px; bottom: 10px;
    background: rgba(0,0,0,.55); color: #fff; font-size: 12px;
    border-radius: 10px; padding: 1px 9px;
}
.dthumbs { display: flex; gap: 8px; padding: 10px; overflow-x: auto; }
.dthumbs img {
    width: 56px; height: 56px; object-fit: cover; border-radius: 6px;
    flex: none; cursor: pointer; opacity: .55; border: 2px solid transparent;
}
.dthumbs img.on { opacity: 1; border-color: var(--brand); }

.dcard {
    background: #fff; border-radius: 12px; padding: 16px;
    margin-top: 12px; box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.dprice {
    display: flex; align-items: center; gap: 8px;
    color: var(--danger); font-weight: 700; font-size: 26px; line-height: 1.2;
}
.dcard h2 { font-size: 18px; font-weight: 600; line-height: 1.4; margin-top: 2px; }
.dcard h2 .edition { font-size: 13px; color: #6b7280; font-weight: 400; margin-left: 6px; }
.dcard h3 { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.dmeta { display: grid; grid-template-columns: 72px 1fr; gap: 7px 12px; margin-top: 14px; font-size: 13.5px; }
.dmeta dt { color: #8b949e; }
.dmeta dd { color: var(--text); word-break: break-all; }
.mono { font-family: ui-monospace, Consolas, monospace; letter-spacing: .4px; }

/* 举报入口：刻意低调，不抢底部「下单」的视觉重心；按钮与说明同一行，窄屏自动换行 */
.report-box { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.report-box .hint { margin-top: 0; }

/* 详情页：同一个卖家的其他在售书 —— 打包真正的入口 */
.others { margin: 8px 0 10px; display: flex; flex-direction: column; }
.oitem {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 2px; margin: 0; font-size: 13px; color: var(--text);
    border-bottom: 1px solid var(--img-bg); cursor: pointer;
}
.oitem:last-child { border-bottom: none; }
.oitem img, .oitem .no-img.sm {
    width: 40px; height: 52px; border-radius: 4px; object-fit: cover; flex: none;
}
.oitem .no-img.sm {
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; color: var(--img-text); background: var(--img-bg);
}
.otitle { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oprice { color: var(--danger); font-weight: 600; }
.oitem input { width: 17px; height: 17px; flex: none; margin: 0; }

/* 详情页底部固定拍板条 */
.detail-bar {
    position: fixed; left: 50%; transform: translateX(-50%); bottom: 0;
    width: 100%; max-width: 760px; z-index: 60;
    display: flex; align-items: center; gap: 12px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: #fff; border-top: 1px solid #e4e6eb;
}
.pick.big { font-size: 13.5px; color: var(--text); margin: 0; flex: none; }
.pick.big input { width: 19px; height: 19px; }
.detail-bar button.primary { flex: 1; padding: 11px; font-size: 15px; }
.center-block { display: block; text-align: center; width: 100%; }

/* ---------- 求书 ---------- */
#wantForm {
    background: #fff; border-radius: 10px; padding: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,.05); margin-bottom: 22px;
}
#wantForm button[type=submit] { margin-top: 8px; }
.sec-title { font-size: 15px; font-weight: 600; margin: 0 0 10px; }
.want {
    display: flex; align-items: center; gap: 12px;
    background: #fff; border-radius: 10px; padding: 12px 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,.05); margin-bottom: 10px;
}
.want-main { flex: 1; min-width: 0; }
.want-main h3 { font-size: 15px; font-weight: 600; margin-bottom: 5px; }
.want-main h3 .edition { font-size: 12px; color: #6b7280; font-weight: 400; margin-left: 4px; }
.want-sub { font-size: 12.5px; color: #6b7280; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.want-remark { font-size: 12px; color: #8b949e; margin-top: 4px; }
.want-act { flex: none; display: flex; align-items: center; gap: 10px; }
.want-num { font-size: 12.5px; color: #6b7280; white-space: nowrap; }
.want-num b { color: var(--danger); font-size: 17px; }

/* ---------- 我的求书：点书名看详情 ---------- */
.want-item { margin-bottom: 10px; }
.want-item .want { margin-bottom: 0; }
.want-main h3 { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.want-title {
    background: none; border: 0; padding: 0; text-align: left;
    font-size: 15px; font-weight: 600; color: var(--brand); cursor: pointer;
}
.want-title:hover { text-decoration: underline; text-underline-offset: 3px; }
.want-detail-tog {
    background: none; border: 0; padding: 1px 5px;
    font-size: 11.5px; font-weight: 400; color: #8b949e; cursor: pointer;
}
.want-detail-tog:hover { color: var(--brand); background: #eef2ff; }
.want-detail {
    background: #f8fafc; border: 1px solid #e4e9f0; border-top: 0;
    border-radius: 0 0 10px 10px; padding: 12px 14px;
}
.wd-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 9px 14px;
}
.wd-item span { display: block; font-size: 11px; color: #8b949e; }
.wd-item b {
    display: block; font-size: 13px; font-weight: 500; color: var(--text);
    word-break: break-all; line-height: 1.5;
}
.wd-item b.mono { font-family: ui-monospace, Menlo, Consolas, monospace; }
.wd-remark { margin-top: 10px; font-size: 12px; color: #57606a; }
.wd-act { margin-top: 11px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wd-tip { font-size: 11.5px; color: #9aa4b2; }

/* 就地修改：跟详情共用一块地方切着显示，不另开弹窗、不用取消重登 */
.wd-form {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 9px 14px;
}
.wd-form label { display: block; min-width: 0; font-size: 11px; color: #8b949e; }
.wd-form input { margin-top: 3px; font-size: 13px; color: var(--text); }
.wd-form .we-isbn { font-family: ui-monospace, Menlo, Consolas, monospace; }
.wd-edit-tip {
    margin: 10px 0 0; padding: 7px 10px;
    font-size: 11.5px; line-height: 1.6; color: #b45309;
    background: #fffbf2; border: 1px solid #f0d59a; border-radius: 7px;
}

/* ---------- 求书热榜：卡片流 ---------- */
.want-stream-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin: 26px 0 12px;
}
.want-stream-head .sec-title { margin: 0; }
/* flex-wrap：4 个筛选片在小屏上要能换行，别把标题挤出屏幕 */
.chipbar { display: flex; gap: 6px; flex-wrap: wrap; }
/* 必须带 .chipbar 前缀：发布页的专业标签也叫 .chip（蓝色胶囊），不加前缀会把它盖成白框 */
.chipbar .chip {
    border: 1px solid #e5e7eb; background: #fff; color: #6b7280;
    font-family: inherit; font-size: 12.5px; line-height: 1;
    padding: 6px 12px; border-radius: 14px; cursor: pointer;
}
.chipbar .chip:hover { border-color: #c7cdd6; }
.chipbar .chip.active { background: #1f6feb; border-color: #1f6feb; color: #fff; }
.chipbar .chip span { margin-left: 4px; opacity: .75; }
/* 热榜说明：把"冷门书去哪看"写明白，别让人以为只有最热门那几本 */
.want-stream-hint {
    margin: -2px 0 12px; font-size: 12px; color: #8b949e; line-height: 1.6;
}
.want-stream-hint:empty { display: none; }
/* 卡片两列并排：一眼扫到的书越多，卖家越可能发现自己手里正好有一本 */
.want-cards {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(236px, 1fr));
    gap: 12px;
}
.wcard {
    display: flex; flex-direction: column; gap: 5px;
    background: #fff; border-radius: 12px; padding: 13px 15px 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
    border-left: 3px solid #e5e7eb;
}
/* 缺货的用左侧红条标出来 —— 这是卖家真正要看的那些 */
.wcard.is-gap { border-left-color: var(--danger); }
.wcard-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wcard-num { font-size: 12px; color: #6b7280; white-space: nowrap; }
.wcard-num b { color: var(--danger); font-size: 19px; margin-right: 2px; vertical-align: -1px; }
.wcard-title { font-size: 15px; font-weight: 600; line-height: 1.35; margin: 2px 0 0; }
.wcard-title .edition { font-size: 12px; color: #6b7280; font-weight: 400; margin-left: 4px; }
.wcard-isbn {
    margin: 0; font-size: 11.5px; color: #a2abb8; letter-spacing: .2px;
    font-family: ui-monospace, Menlo, Consolas, monospace;
}
/* 1~2 人在求的书单独标一下：混在热门卡片里也能被一眼认出来 */
.wcard-few { color: #1f6feb; font-family: inherit; letter-spacing: 0; }
.wcard-foot {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; margin-top: auto; padding-top: 9px;
}
.wcard-ago { font-size: 11.5px; color: #b6bec9; white-space: nowrap; }
.wcard-act { display: flex; gap: 6px; }
.wtag.gap { background: #fde8e8; color: #c0392b; }

.wtag { font-size: 12px; padding: 1px 7px; border-radius: 9px; }
.wtag.ok { background: #e6f4ea; color: #1e7b34; }
.wtag.wait { background: #f1f3f5; color: #6b7280; }

/* 发布页：填书名时冒出来的"有几个人在求" */
.wanthint {
    background: #fff8e6; color: #b45309; font-size: 13px;
    border: 1px solid #ffe2a8; border-radius: 8px;
    padding: 9px 12px; margin: 4px 0 10px;
}

/* 求书里「N 本在售 · 去看」是个按钮，要长得像标签但不能真的像标签 */
.wtag.link {
    border: 0; cursor: pointer; font-family: inherit;
    text-decoration: underline; text-underline-offset: 2px;
}
.wtag.link:hover { background: #d7ecdf; }

/* 价格输入框下面那行"别人卖多少"。放在 label 里，不能撑开输入框 */
.price-hint {
    display: block; margin-top: 5px;
    font-size: 12.5px; line-height: 1.5; color: #1e7b34;
}
.price-hint:empty { display: none; }
.price-hint.warn { color: #b45309; }

/* ---------- 课程书单 ---------- */
.course-summary {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 10px;
    background: #f6f8fa; border-radius: 10px; padding: 10px 12px;
    font-size: 13px; line-height: 1.6; color: #4b5563; margin: 10px 0 14px;
}
.course-summary.ok { background: #e9f7ef; color: #1e7b34; }
/* 两行：第一行说事实（几本、几本有人卖），第二行说"按下去会发生什么" */
.cs-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1 1 320px; }
.cs-line { font-size: 13px; }
.cs-sub { font-size: 12px; color: #8b949e; }
.course-summary.ok .cs-sub { color: #4a8f63; }
.course {
    display: flex; gap: 12px; align-items: center; justify-content: space-between;
    background: #fff; border-radius: 10px; padding: 12px 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,.05); margin-bottom: 9px;
}
.course-main { min-width: 0; }
.course-name { margin: 0 0 3px; font-size: 12.5px; color: #6b7280; }
.course-main h3 { margin: 0 0 5px; font-size: 14.5px; line-height: 1.4; }
.course-main h3 .edition { font-size: 12px; color: #6b7280; font-weight: normal; }
/* ISBN 那一行：等宽字体，跟正文区分开 —— 这串数字是要拿去别处比的，不能看错 */
.course-meta { margin: 0; font-size: 12px; color: #6b7280; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cisbn {
    font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11.5px;
    color: #8b949e; background: #f6f8fa; border: 1px solid #eceff3;
    border-radius: 5px; padding: 1px 6px; cursor: pointer; letter-spacing: .2px;
    font-weight: normal;
}
.cisbn:hover { color: #1f6feb; border-color: #cfe0ff; background: #f2f7ff; }
.cisbn.add { border-style: dashed; color: #b0b8c4; }
.cisbn.add:hover { color: #1f6feb; }
.wsub { font-size: 12px; color: #8b949e; font-weight: normal; }
.course-act { flex: 0 0 auto; }
.wtag.hot { background: #fde8e8; color: #c0392b; }

/* 众包补一条：默认收起，不抢"看清单"这个主要动作 */
.course-add { margin-top: 16px; }
.course-add form {
    background: #fff; border-radius: 10px; padding: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,.05); margin-top: 10px;
}
.course-add form button[type=submit] { margin-top: 6px; }

/* ---------- 消息中心 ---------- */
.notice-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.notice-head h2 { margin: 0; }
.notice {
    display: flex; gap: 10px; align-items: flex-start;
    background: #fff; border-radius: 10px; padding: 13px 15px;
    box-shadow: 0 1px 4px rgba(0,0,0,.05); margin-bottom: 10px; cursor: pointer;
}
.notice:hover { box-shadow: 0 3px 10px rgba(0,0,0,.09); }
.notice.unread { background: #f7f9ff; }
.notice-dot {
    flex: none; width: 8px; height: 8px; border-radius: 50%;
    background: var(--danger); margin-top: 7px;
}
.notice-dot.off { background: transparent; }
.notice-main { flex: 1; min-width: 0; }
.notice-main h3 { font-size: 14.5px; font-weight: 600; margin-bottom: 3px; }
.notice-main p { font-size: 13px; color: #57606a; line-height: 1.5; }
.notice-time { font-size: 12px; color: #8b949e; }
/* 单条删除：故意做得比「点开消息」弱一档，避免误触。事件委托会先命中最内层
   的 data-act，所以点它不会顺带触发外层 .notice 的 openNotice。 */
.notice-del {
    flex: none; align-self: center; cursor: pointer; line-height: 1.4;
    border: 1px solid #d0d7de; background: #fff; color: #57606a;
    font-size: 12px; padding: 4px 9px; border-radius: 6px;
}
.notice-del:hover { background: #f6f8fa; color: var(--danger); border-color: var(--danger); }

/* ---------- 图片灯箱 ---------- */
.lightbox {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(0,0,0,.92);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    cursor: zoom-out;
}
.lightbox img { max-width: 96vw; max-height: 86vh; object-fit: contain; }
.lightbox-hint { color: rgba(255,255,255,.65); font-size: 12px; margin-top: 14px; }

/* ---------- 联系方式弹层 ---------- */
/* 卖家点「同意」后直接怼上来的一层：他要的就是"怎么联系这个人"，别的都是噪音 */
.modal {
    position: fixed; inset: 0; z-index: 300;
    background: rgba(15, 23, 42, .48);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    overflow-y: auto;
}
/* 2026-11-11：确认弹层必须压在其它弹层之上。
   askDialog 常被书单导入弹窗盖住 —— 两个都是 .modal(z-index:300)，
   而 #importModal 在 DOM 里排在 #askModal 后面，同层级时后者被完全遮住，
   焦点却已落在看不见的「就这样登记」上，用户以为「登记勾选的」点了没反应。
   2026-11-24：再提到 600。确认框在任何情况下都该在最上 —— 之前是 400，
   而登录覆盖层是 500，一旦在登录层里触发确认框，确认框就被压在下面。 */
#askModal { z-index: 600; }
.modal-card {
    background: #fff;
    border-radius: 14px;
    padding: 22px 22px 16px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 18px 48px rgba(0,0,0,.22);
    text-align: center;
    max-height: 92vh;
    overflow-y: auto;
}
.modal-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.modal-sub { font-size: 13px; color: #57606a; margin-bottom: 12px; line-height: 1.5; }

/* 类型标签：手机号 / 微信号 / QQ —— 一眼看出该去哪个 App 搜 */
.contact-kind {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: #185FA5;
    background: #E6F1FB;
    border-radius: 20px;
    padding: 2px 10px;
    margin-bottom: 8px;
}
.contact-kind-sm {
    font-size: 11px;
    color: #185FA5;
    background: #E6F1FB;
    border-radius: 4px;
    padding: 1px 6px;
    vertical-align: 1px;
}
.contact-big {
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 23px;
    font-weight: 700;
    letter-spacing: .6px;
    color: var(--brand);
    background: #f1f5ff;
    border-radius: 10px;
    padding: 13px 10px;
    word-break: break-all;
    user-select: all;          /* 手机上长按能整段选中 */
}
.contact-big.muted { font-size: 15px; color: #8b949e; background: #f6f7f9; }

/* 「接下来这么做」—— 光有号码没用，得告诉人下一步干啥 */
.contact-steps {
    text-align: left;
    margin: 14px 0 0;
    padding: 12px 14px 12px 30px;
    background: #FAFAF8;
    border-radius: 10px;
    font-size: 12.5px;
    color: #444441;
    line-height: 1.75;
}
.contact-steps li { margin-bottom: 6px; }
.contact-steps li:last-child { margin-bottom: 0; }

.modal-actions { display: flex; gap: 8px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.modal-actions button { min-width: 108px; }
.modal-close { margin-top: 12px; color: #8b949e; }

/* ---------- 顶部请求进度条 ---------- */
/* 只占 2px，不挡任何东西；有请求在飞时从左往右长一段，请求结束淡出 */
.loadbar {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    width: 0;
    background: var(--brand);
    box-shadow: 0 0 6px rgba(26,79,214,.6);
    opacity: 0;
    z-index: 9999;
    transition: opacity .25s;
    pointer-events: none;
}
.loadbar.on { opacity: 1; animation: loadbar-grow 1.1s ease-out forwards; }
@keyframes loadbar-grow {
    from { width: 8%; }
    to   { width: 82%; }
}

/* ---------- 筛选行 ---------- */
.filters { display: flex; gap: 8px; margin: 0 0 10px; flex-wrap: wrap; }
.filters select { flex: 1 1 130px; min-width: 0; }
.resultline { font-size: 13px; color: #57606a; margin: 0 0 10px; }
.resultline.empty-line { color: #a4262c; }

/* ---------- 买 / 卖分栏 ---------- */
.segbar { display: flex; gap: 8px; margin-bottom: 14px; }
.seg {
    background: #eef1f5;
    color: #57606a;
    border-radius: 18px;
    padding: 7px 16px;
    font-size: 13px;
}
.seg.active { background: var(--brand); color: #fff; font-weight: 600; }
.seg-num:not(:empty) { margin-left: 5px; opacity: .85; }

/* 订单卡片右上角的相对时间 */
.order-head .when { margin-left: auto; font-size: 12px; color: #8b949e; }

/* ---------- 发布页图片预览 ---------- */
.pb-preview { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 4px; }
.pb-preview img {
    width: 74px;
    height: 74px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #f6f8fa;
}

@media (max-width: 640px) {
    /* 手机上把 tab 挪到底部：大图卡片流 + 顶部标签，单手够不着上面的按钮 */
    .tabs {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 60;
        max-width: none;
        margin: 0;
        padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
        gap: 2px;
        background: #fff;
        box-shadow: 0 -2px 12px rgba(0, 0, 0, .08);
        overflow-x: auto;
    }
    .tab {
        flex: 1 0 auto;
        min-width: 50px;
        font-size: 12px;
        padding: 9px 4px;
        border-radius: 8px;
        white-space: nowrap;
    }
    .panel { padding-bottom: 92px; }
    /* 提示条：手机上必须让开刘海/状态栏，否则「学号或密码不对」会被
       系统状态栏压掉半行；宽度收进视口，长句自动换行。
       放顶部而不是底部，是因为键盘弹起时底部那块最先被吃掉。
       56px = 顶栏高度，落在顶栏下沿，别压住品牌名。 */
    .toast {
        top: calc(env(safe-area-inset-top, 0px) + 64px);
        max-width: calc(100vw - 32px);
        padding: 10px 16px;
        font-size: 13.5px;
    }
    /* 打包浮条要让开底部导航，否则被压在 tab 底下点不到 */
    .pickbar { bottom: 74px; }

    .grid2 { grid-template-columns: 1fr; }
    .cards { grid-template-columns: 1fr; }
    .cards.grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .gbody { padding: 8px 9px 10px; }
    .gbody h3 { font-size: 13px; min-height: 35px; }
    .gsub { font-size: 12px; }
    .gprice { font-size: 16px; }
    .detail { padding: 0 12px 92px; }
    .dcard { padding: 14px; }
    .dprice { font-size: 23px; }
    .dcard h2 { font-size: 16px; }
    .dmeta { grid-template-columns: 66px 1fr; font-size: 13px; }
}

/* 课程书单：手机上一行放不下「书名 + 版次 + 作者 + 按钮」，按钮单独占一行 */
@media (max-width: 640px) {
    .course { flex-direction: column; align-items: stretch; }
    .course-act { display: flex; justify-content: flex-end; }
    /* 求书卡片：手机上单列，否则 236px 两列会把书名挤成两行 */
    .want-cards { grid-template-columns: 1fr; }
    .want-stream-head { align-items: flex-start; flex-direction: column; gap: 8px; }
    /* 导入弹层在手机上要占满，横着排的「版次 + ISBN」会挤成一团 */
    .modal-card.wide { max-width: none; }
    .imp-line { flex-wrap: wrap; }
    .imp-edition, .imp-isbn { flex: 1 1 100%; }
}

/* ---------- 书单导入 ---------- */
/* 面板标题右边放主操作（导入/补一条），标题和按钮一条线 */
.panel-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin-bottom: 8px;
}
.panel-head h2 { margin: 0; }
/* 导入弹层是"表格草稿"，左对齐比居中好读；按钮仍单独居中 */
.modal-card.wide { max-width: 660px; text-align: left; }

/* textarea 没有全局样式（input/select 有），这里单独给 */
#importText {
    width: 100%; box-sizing: border-box;
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 12.5px; line-height: 1.65;
    padding: 10px 11px; border: 1px solid #d0d7de; border-radius: 8px;
    resize: vertical; color: var(--text);
}
#importText:focus { outline: none; border-color: var(--brand); }
.import-file { margin-top: 8px; }
.import-file label { margin: 0; font-size: 12.5px; color: var(--brand); cursor: pointer; }

.imp-list { max-height: 46vh; overflow-y: auto; overflow-x: hidden; margin-top: 6px; }
/*
  用 grid 而不是 flex：草稿行里输入框、课程名、原文都可能很长，
  grid 的 minmax(0, 1fr) 能保证右列**绝不被长内容撑破**，
  哪怕 OCR 认出一段没有空格的怪字符串也不会把整页顶出横向滚动条。
*/
.imp-row {
    display: grid; grid-template-columns: 18px minmax(0, 1fr);
    gap: 8px; align-items: start;
    padding: 9px 0; border-bottom: 1px solid #f0f2f5;
}
.imp-row:last-child { border-bottom: 0; }
.imp-row > .imp-pick { width: 15px; height: 15px; margin-top: 11px; }
.imp-main { min-width: 0; }
.imp-title { width: 100%; min-width: 0; box-sizing: border-box; }
.imp-line { display: flex; gap: 6px; margin-top: 4px; }
.imp-edition { flex: 0 0 42%; min-width: 0; box-sizing: border-box; font-size: 13px; }
.imp-isbn {
    flex: 1; min-width: 0; box-sizing: border-box; font-size: 13px;
    font-family: ui-monospace, Menlo, Consolas, monospace;
}
.imp-meta {
    margin: 5px 0 0; font-size: 11.5px; color: #8b949e;
    display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
    overflow-wrap: anywhere; word-break: break-word;
}
.imp-note { color: #b45309; }
/*
  原文：OCR 认错字时，光看"认出来的书名"根本不知道该改回什么。
  把那一行原文放出来（单行省略、鼠标悬停看全），用户对照着改一下就行。
*/
.imp-raw {
    margin: 3px 0 0; font-size: 11px; color: #9aa4b2;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* 疑似被截断的书名：给个黄框，但不替用户改 —— 错书名进求书池比少登记一本贵得多 */
.imp-row.suspect .imp-title { border-color: #e2a63a; background: #fffbf2; }

/* OCR 只认出文字、没对上一本书时的说明块。
   用暖黄底而不是红色：这不是报错，是"这图得换个方式处理" */
.imp-fail {
    margin-top: 12px; padding: 11px 13px;
    background: #fffbf2; border: 1px solid #f0d59a; border-radius: 9px;
    font-size: 12.5px; line-height: 1.65; color: #6b5220;
}
.imp-fail b { color: #b45309; }
.imp-fail p { margin: 6px 0 0; }
.imp-fail .modal-actions { margin-top: 10px; justify-content: flex-start; }
.imp-ocr-preview {
    margin-top: 9px; max-height: 150px; overflow: auto;
    background: #fff; border: 1px solid #eee2c4; border-radius: 6px; padding: 6px 8px;
}
.ocr-line { display: flex; gap: 8px; font-size: 11.5px; line-height: 1.7; }
.ocr-line > span { flex: none; width: 20px; text-align: right; color: #b6a887; }
.ocr-line code {
    white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word;
    font-family: ui-monospace, Menlo, Consolas, monospace; color: #57606a;
}
.imp-fail .sub { font-size: 11.5px; color: #9a8b6b; }

/* ---------- 用平台已有图 ---------- */

/*
   复用图和自拍图在预览里要能看出来是两拨：
   复用图压一层灰边 + 左上角小字，避免卖家自己也忘了"这几张不是我拍的"。
*/
.reuse-bar { margin: 6px 0 2px; display: flex; align-items: center; gap: 8px; }
.reuse-bar .sub { font-size: 12.5px; color: #9aa4b2; }

#pbPreview img.reused {
    border: 2px dashed #c7d2fe;
    background: #f8faff;
}

/* 复用图：每一张都能单独删。别逼卖家为了换一张图把整张表单清了重填 */
.reused-wrap { position: relative; display: inline-block; line-height: 0; }
.reused-del {
    position: absolute; top: -6px; right: -6px;
    width: 20px; height: 20px; padding: 0;
    border: 1px solid #d0d7de; border-radius: 50%;
    background: #fff; color: #57606a;
    font-size: 14px; line-height: 17px; text-align: center;
    cursor: pointer; box-shadow: 0 1px 3px rgba(0, 0, 0, .12);
}
.reused-del:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.reused-wrap.broken img { display: none; }
.reused-wrap.broken::after {
    content: '图已失效';
    display: flex; align-items: center; justify-content: center;
    width: 74px; height: 74px; box-sizing: border-box;
    border: 2px dashed #e5e7eb; border-radius: 8px;
    font-size: 11px; line-height: 1.4; color: #9aa4b2; background: #f6f8fa;
}

.lib-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 8px; max-height: 46vh; overflow-y: auto; margin-top: 8px;
}
.lib-item {
    position: relative;
    padding: 0; border: 2px solid transparent; border-radius: 10px;
    background: #f3f5f9; overflow: hidden; cursor: pointer;
    aspect-ratio: 3 / 4; display: block;
}
.lib-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lib-item.on { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(26, 79, 214, .15); }
.lib-item.broken { opacity: .65; cursor: not-allowed; }
.lib-item.broken::after {
    content: '图已失效'; position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; color: #9aa4b2;
}

/* ===========================================================================
   手机端细节（2026-11-06 上线当天补，大王反馈"手机上看着不如电脑精致"）

   背景：整站是 .panel { max-width: 1000px; padding: 20px 24px 60px } 的居中
   单栏布局 —— 电脑上 1000px 宽很好，手机上 24px 的内边距就吃掉了半个字的
   宽度，顶栏的昵称+学号还会把「我的信息 / 退出」挤成两行。

   原则：**只调手机**，一律写在 max-width: 640px 里，电脑端一个像素都不动。
   =========================================================================== */
@media (max-width: 640px) {
    /* 顶栏：昵称+学号自动折成两行时，按钮不许被压扁换行 */
    .topbar { height: auto; min-height: 56px; padding: 8px 12px; gap: 10px; }
    .user-area { gap: 8px; min-width: 0; flex: 0 0 auto; }
    /* 「范兆博 (2531261312)」太长就截断 —— 学号自己记得住，页面上不用全露 */
    .user-area .who {
        max-width: 92px;
        white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
        line-height: 1.35;
    }
    .user-area button { white-space: nowrap; flex: none; }

    /* 主容器：24px → 12px，把宽度还给内容 */
    .panel { padding: 14px 12px 92px; }
    .tabs { padding-left: 12px; padding-right: 12px; }

    /* 搜索行：输入框一行，两个按钮换行到第二行平分 —— 原来三个挤一行时
       输入框只剩半句话的位置，用户打「高等数学」都要盲打 */
    .searchbar { flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
    .searchbar input { flex: 1 1 100%; }
    .searchbar button { flex: 1 1 0; }

    /* 筛选：三个下拉 2+1 排布，别让「全部专业」被压到只剩俩字 */
    .filters { gap: 8px; margin-bottom: 10px; }
    .filters select { flex: 1 1 calc(50% - 4px); font-size: 13px; padding: 8px 10px; }

    /* 卡片：图片定成 3/4 竖版。二手教材封面/实拍本来就是一本书的竖长条，
       原来 4/3 横着放，真人拍的图（竖着拍的）会被 cover 裁掉上下两头 */
    .gimg { aspect-ratio: 3 / 4; }
    /* 卡片内文字整体缩小一档，两列并排放得下完整书名 */
    .gbody h3 { font-size: 12.5px; line-height: 1.4; min-height: 35px; }
    .gsub { font-size: 11.5px; }
    .gisbn { font-size: 10.5px; letter-spacing: 0; }

    /* 「打包」勾选框：手机上太小点不中（原来 13px，是 Web 端尺寸） */
    .grow input[type=checkbox], .gcard input[type=checkbox] {
        width: 20px; height: 20px;
    }

    /* 结果统计那行 + 说明段落：字号别比卡片还大 */
    .resultline { font-size: 12.5px; }
}

/* ===========================================================================
   页脚备案信息（2026-11-24）

   ICP 备案号是管局核发、必须挂在首页底部的，所以不能只写在某张卡片里，
   要跟着每一屏走 —— 放在 main 末尾、所有 panel 之后。

   宽度和 .panel 对齐（1000px 居中），字号压到 12px：这是"能查到就行"的信息，
   不该抢正文的注意力。手机上见下面 @media 里的补白说明。
   =========================================================================== */
.sitefoot {
    max-width: 1000px;
    margin: 0 auto;
    padding: 16px 24px 32px;
    border-top: 1px solid #eef1f6;
    text-align: center;
    color: #9aa4b2;
    font-size: 12px;
    line-height: 1.9;
}
.sitefoot p { margin: 0; }
.sitefoot a { color: #8b95a5; text-decoration: none; }
.sitefoot a:hover { color: var(--brand); text-decoration: underline; }
.foot-rec { margin-top: 2px; }
/* 两个备案号之间留一口空气，免得粘成一句话 */
.foot-rec a + a { margin-left: 12px; }

/* ===========================================================================
   手机端 B1~B6（2026-11-18，按大王「b1 到 b6 全部实现」）

   和上面 11-06 那批的区别：那批解决的是「电脑上看着好、手机上挤」，
   这批解决的是「手机上能顺手用」—— 横滑、触控面积、键盘弹起、底部遮挡、
   以及首屏引导条在 390px 宽下占掉三行的问题。

   一律写在 max-width: 640px 里，桌面端一个像素都不动。
   每段前面的 B 编号对应一个独立 commit，方便单独回退。
   =========================================================================== */
@media (max-width: 640px) {
    /* ---- B1 底部 tab：一行横滑，当前项一定在视野里 ----
       原来 7 个 tab 靠 flex:1 0 auto 硬挤，窄屏上每个只剩 50px 且高亮是
       「白底对白底」看不出来。这里改成可横滑、隐藏滚动条、给足触控高度，
       并用 inset 下边线让当前项一眼可见；JS 负责把它滚到中间。 */
    .tabs {
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
        scroll-padding-inline: 8px;
    }
    .tabs::-webkit-scrollbar { display: none; }
    .tab {
        min-width: 58px;
        min-height: 44px;
        padding: 9px 6px;
        scroll-snap-align: center;
    }
    .tab.active {
        background: #eef2ff;
        box-shadow: inset 0 -3px 0 var(--brand);
    }

    /* ---- B2 搜索 / 筛选：明确两行，控件给足触控高度 ----
       11-06 那批是「2+1」排布，结果第三个下拉只有半行宽，
       「价格从高到低」被裁成「价格从…」。这里让排序独占整行：
       第一行专业 + 年级，第二行排序，两行谁都不挤。 */
    .searchbar input, .searchbar button { min-height: 44px; }
    .searchbar input, .filters select { font-size: 16px; }
    .filters select { min-height: 44px; }
    .filters select:last-child { flex-basis: 100%; }
    .resultline { margin-bottom: 6px; }

    /* ---- B3 首屏引导条：短文案 + 关闭按钮给足触控 ----
       原句在 390px 宽下占三到四行，书单被推到首屏之外；而「知道了」
       只有 3px 10px 内边距，手机上几乎点不中。 */
    .guidebar {
        width: calc(100% - 24px);
        padding: 8px 10px;
        gap: 8px;
        font-size: 12.5px;
        align-items: flex-start;
    }
    .guide-full { display: none; }
    .guide-short { display: block; }
    .guide-dot { margin-top: 2px; }
    .guide-close { min-height: 44px; min-width: 44px; padding: 6px 10px; }
    .guide-link { padding: 6px 2px; }

    /* ---- B4 登录 / 注册覆盖层：小屏可滚，键盘弹起不把表单顶出屏幕 ----
       .auth 本来就有 overflow-y:auto，但 align-items + margin:auto 0 让卡片
       在内容超屏时仍试图垂直居中，上半截（标题 + 前两个输入框）会被裁掉。
       手机端取消居中、收紧 padding、用 100dvh 跟住键盘变化的可视高度。 */
    .auth {
        padding: 12px 10px calc(12px + env(safe-area-inset-bottom, 0px));
        max-height: 100dvh;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }
    .auth-card {
        padding: 20px 16px;
        margin: 0;
        border-radius: 10px;
    }
    .auth-card input, .auth-card select, .auth-card textarea {
        font-size: 16px;        /* iOS 对 <16px 输入框会自动放大整页 */
        min-height: 44px;
    }
    .auth-tabs button, .auth-card form button[type=submit] { min-height: 44px; }
    .auth-x {
        width: 44px; height: 44px;
        display: flex; align-items: center; justify-content: center;
    }
    .auth-lead { font-size: 12px; margin-bottom: 10px; }

    /* ---- B5 详情页底部拍板条：两行排布，绝不被遮 ----
       原来「加入打包」勾选和「下单」按钮挤在同一行，390px 宽 + 长书名总价
       时按钮会被压到只剩几个字；而 .detail 的 padding-bottom 只有 92px，
       iPhone 底部安全区一加，最后一段内容正好压在条底下翻不出来。 */
    .detail {
        padding-bottom: calc(150px + env(safe-area-inset-bottom, 0px));
    }
    .detail-bar {
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    }
    .detail-bar .pick.big { flex: 1 1 100%; min-height: 40px; }
    .detail-bar button.primary { flex: 1 1 100%; min-height: 46px; }
    .detail-bar .center-block { flex: 1 1 100%; }
    /* 打包浮条也要让开底部 tab + 安全区 */
    .pickbar { bottom: calc(82px + env(safe-area-inset-bottom, 0px)); }

    /* ---- B6 全局触控尺寸、间距与弹层安全区 ----
       iOS 的可点目标建议 ≥44×44、相邻 ≥8px。原来 .small / .tiny / 弹层里的
       确认按钮普遍只有 28~32px 高，手机上很容易点错相邻那个。 */
    html { -webkit-text-size-adjust: 100%; }   /* 横屏别自动放大字号 */
    button { min-height: 44px; }
    button.small, button.tiny { min-height: 40px; }
    .chip, .seg, .modal-close { min-height: 40px; }
    .guide-link { min-height: 0; }             /* 行内文字链接，别撑高一行 */
    input, select, textarea { font-size: 16px; }
    input[type=checkbox] { width: 20px; height: 20px; }
    .modal {
        padding: 12px 10px calc(12px + env(safe-area-inset-bottom, 0px));
        -webkit-overflow-scrolling: touch;
    }
    .modal-card {
        max-height: 100dvh;
        overscroll-behavior: contain;
    }
    .modal-actions { gap: 10px; }
    .modal-actions button { flex: 1 1 130px; min-height: 44px; }
    .auth-link a { display: inline-block; padding: 8px 4px; }

    /* 页脚：手机端 tab 是 fixed 在底部的（约 56px + 安全区），
       .panel 自己留了 92px 下边距，但页脚在 panel 外面 —— 不自己补白的话
       备案号正好被 tab 条压住，翻到底也看不见。 */
    .sitefoot {
        padding: 12px 12px calc(84px + env(safe-area-inset-bottom, 0px));
        font-size: 11.5px;
    }
}
