:root {
  --ink: #173f3d;
  --ink-soft: #587270;
  --muted: #849694;
  --line: #e6efec;
  --surface: #ffffff;
  --surface-soft: #f7fbfa;
  --teal: #0f766e;
  --teal-dark: #0b5f59;
  --mint: #dff4ee;
  --peach: #fff0e5;
  --peach-ink: #a2572c;
  --lavender: #eeebff;
  --shadow: 0 18px 45px rgba(25, 71, 67, 0.10);
  --shadow-soft: 0 8px 25px rgba(25, 71, 67, 0.07);
  --radius-xl: 28px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: #f5f9f8;
  color: var(--ink);
  font-family: "DM Sans", "Noto Sans SC", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; border: 0; }
a { color: inherit; text-decoration: none; }

.app-shell { min-height: 100vh; padding-bottom: 28px; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  height: 74px; background: rgba(255,255,255,.88); backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(230,239,236,.85);
}
.topbar-inner { max-width: var(--max); height: 100%; margin: auto; padding: 0 28px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 800; letter-spacing: -0.02em; }
.brand-mark { width: 35px; height: 35px; display:grid; place-items:center; border-radius: 12px; color: #fff; background: linear-gradient(135deg, #15847a, #0c5d58); box-shadow: 0 7px 16px rgba(15,118,110,.25); font-size: 18px; }
.brand-name { font-size: 17px; }
.brand-sub { color: var(--muted); font-size: 11px; margin-left: 4px; font-weight: 500; }
.desktop-nav { display: flex; align-items:center; gap: 6px; }
.nav-btn { position: relative; background: transparent; padding: 9px 14px; color: var(--ink-soft); border-radius: 10px; font-weight: 600; transition: .2s; }
.nav-btn:hover, .nav-btn.active { color: var(--teal); background: var(--mint); }
.nav-btn .nav-badge { position:absolute; top:3px; right:5px; width:6px; height:6px; background:#ed7555; border-radius:50%; }
.user-actions { display:flex; align-items:center; gap: 10px; }
.user-pill { display:flex; gap:8px; align-items:center; color: var(--ink-soft); font-size: 13px; }
.avatar { width:31px; height:31px; border-radius:50%; display:grid; place-items:center; color:#fff; background: linear-gradient(135deg,#38a697,#196c67); font-size: 13px; font-weight:700; }
.btn { display: inline-flex; align-items:center; justify-content:center; gap: 7px; border-radius: 11px; padding: 11px 16px; font-weight: 700; transition: transform .2s, box-shadow .2s, background .2s; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { color:#fff; background: var(--teal); box-shadow: 0 7px 15px rgba(15,118,110,.18); }
.btn-primary:hover { background: var(--teal-dark); box-shadow: 0 10px 22px rgba(15,118,110,.23); }
.btn-ghost { color: var(--ink-soft); background: #f2f7f6; }
.btn-ghost:hover { background: var(--mint); color: var(--teal); }
.btn-outline { color: var(--teal); background: transparent; border:1px solid #badfd7; }
.btn-outline:hover { background: var(--mint); }
.btn-danger { color:#c55745; background:#fff0ed; }
.btn-sm { padding: 8px 11px; border-radius:9px; font-size:12px; }
.btn-icon { width: 38px; height: 38px; padding:0; border-radius: 10px; background: #f2f7f6; color: var(--ink-soft); }
.btn-icon:hover { color: var(--teal); background: var(--mint); }

.page { max-width: var(--max); margin: 0 auto; padding: 42px 28px 40px; }
.hero { position:relative; overflow:hidden; border-radius: var(--radius-xl); padding: 39px 43px; background: linear-gradient(124deg,#e8f8f3 0%, #f0f8f6 55%, #fff6e8 100%); min-height: 255px; display:flex; justify-content:space-between; align-items:center; }
.hero::after { content:""; position:absolute; width:280px; height:280px; border-radius:50%; right:-80px; top:-95px; background: rgba(255,255,255,.45); }
.hero-copy { position:relative; z-index:1; max-width: 550px; }
.eyebrow { text-transform: uppercase; color: var(--teal); letter-spacing: .12em; font-size: 11px; font-weight: 800; }
.hero h1 { margin: 12px 0 10px; font-size: clamp(28px, 3vw, 43px); letter-spacing:-.04em; line-height: 1.18; }
.hero p { margin:0; color: var(--ink-soft); font-size: 15px; line-height: 1.75; }
.hero-note { margin-top: 20px; display:flex; align-items:center; gap:9px; color:var(--ink-soft); font-size: 12px; }
.hero-note span:first-child { display:grid; place-items:center; width:22px; height:22px; border-radius:50%; background:#fff; color:var(--teal); }
.hero-art { position:relative; z-index:1; width: 210px; height: 172px; display:grid; place-items:center; }
.book-stack { position:relative; width:150px; height:120px; transform: rotate(-8deg); }
.book { position:absolute; height:28px; border-radius: 6px 10px 10px 6px; box-shadow: 0 8px 12px rgba(24,85,80,.13); }
.book.b1 { width:130px; right:6px; bottom:12px; background:#f0a15e; transform:rotate(7deg); }
.book.b2 { width:145px; left:0; bottom:38px; background:#51b9a2; transform:rotate(-4deg); }
.book.b3 { width:128px; right:13px; bottom:67px; background:#6889bd; transform:rotate(4deg); }
.book.b4 { width:105px; left:16px; bottom:92px; background:#e2725b; transform:rotate(-8deg); }
.book::before { content:""; position:absolute; left:12px; top:6px; width:55%; height:4px; border-radius:5px; background:rgba(255,255,255,.58); box-shadow: 0 7px 0 rgba(255,255,255,.28); }
.book-stack::after { content:"✦"; position:absolute; right:-12px; top:-15px; color:#e9a451; font-size:29px; }

.toolbar { margin-top: 28px; display:flex; align-items:center; justify-content:space-between; gap: 15px; }
.search { flex:1; display:flex; align-items:center; gap:10px; min-width: 240px; background:#fff; border:1px solid var(--line); border-radius:13px; padding: 0 15px; box-shadow: var(--shadow-soft); }
.search svg { color: var(--muted); flex:0 0 auto; }
.search input { width:100%; border:0; outline:0; padding: 13px 0; color:var(--ink); background:transparent; }
.search input::placeholder { color:#9aacab; }
.toolbar-meta { display:flex; align-items:center; gap: 9px; color:var(--muted); font-size:13px; white-space:nowrap; }
.count-dot { width: 7px; height:7px; border-radius:50%; background:var(--teal); }
.segmented { margin-top: 22px; background:#edf5f3; padding:4px; border-radius:12px; display:inline-flex; gap:2px; }
.segment { min-width:104px; padding:10px 18px; color:var(--ink-soft); background:transparent; border-radius:9px; font-weight:700; }
.segment.active { color:var(--teal); background:#fff; box-shadow: 0 4px 10px rgba(24,80,75,.08); }
.section-head { display:flex; align-items:center; justify-content:space-between; gap:10px; margin: 29px 0 15px; }
.section-title { font-size:18px; font-weight:800; letter-spacing:-.02em; }
.section-sub { color:var(--muted); font-size:13px; margin-left:6px; font-weight:500; }
.text-btn { color:var(--teal); background:transparent; font-size:13px; font-weight:700; padding:6px; }

.book-grid { display:grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.book-card { background:#fff; border:1px solid var(--line); border-radius: var(--radius-lg); overflow:hidden; box-shadow: 0 4px 15px rgba(32,77,71,.04); transition: .22s; cursor:pointer; }
.book-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.cover-wrap { position:relative; aspect-ratio: 1.55 / 1; overflow:hidden; background:#d8e9e6; }
.cover-wrap img { width:100%; height:100%; object-fit:cover; display:block; }
.cover-fallback { width:100%; height:100%; display:grid; place-items:center; font-size:42px; color:#fff; background: linear-gradient(135deg,#8bc8ba,#3b877d); }
.cover-tag { position:absolute; top:12px; left:12px; padding:5px 8px; border-radius:7px; font-size:10px; font-weight:800; color:#fff; background:rgba(18,66,62,.74); backdrop-filter:blur(5px); }
.favorite { position:absolute; top:10px; right:10px; width:32px; height:32px; border-radius:50%; display:grid; place-items:center; background:rgba(255,255,255,.9); color:#72918e; }
.favorite.active { color:#e07056; }
.card-body { padding: 15px 16px 14px; }
.card-title { font-size:16px; font-weight:800; line-height:1.38; margin:0 0 4px; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.card-meta { font-size:12px; color:var(--muted); line-height:1.6; display:flex; align-items:center; gap:5px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.card-author { color:var(--ink-soft); }
.card-foot { display:flex; align-items:center; justify-content:space-between; border-top:1px solid #edf3f1; margin-top:12px; padding-top:11px; }
.price { color:var(--peach-ink); font-size:16px; font-weight:800; }
.location { color:var(--muted); font-size:11px; }
.seller { display:flex; align-items:center; gap:6px; color:var(--ink-soft); font-size:11px; }
.seller .avatar { width:22px; height:22px; font-size:10px; }
.empty { text-align:center; padding:55px 22px; color:var(--muted); background:#fff; border:1px dashed #cfe2dd; border-radius: var(--radius-lg); }
.empty strong { display:block; color:var(--ink); margin-bottom:6px; font-size:16px; }
.empty .emoji { font-size:33px; margin-bottom:12px; }

.wanted-card { display:flex; flex-direction:column; background:#fff; border:1px solid var(--line); border-radius:15px; padding:17px 18px; box-shadow: 0 4px 15px rgba(32,77,71,.03); cursor:pointer; transition:.2s; }
.wanted-card:hover { transform:translateY(-3px); box-shadow:var(--shadow-soft); }
.wanted-top { display:flex; justify-content:space-between; gap:10px; }
.wanted-title { font-weight:800; font-size:15px; }
.wanted-budget { color:var(--peach-ink); background:var(--peach); border-radius:7px; padding:4px 7px; font-size:11px; font-weight:700; white-space:nowrap; }
.wanted-meta { color:var(--muted); font-size:12px; margin-top:9px; line-height:1.7; }
.wanted-foot { display:flex; justify-content:space-between; align-items:center; border-top:1px solid #eef3f2; margin-top:13px; padding-top:11px; font-size:11px; color:var(--muted); }
.wanted-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:13px; }

.modal-backdrop { position:fixed; z-index:100; inset:0; display:grid; place-items:center; padding:18px; background:rgba(15,43,40,.46); backdrop-filter:blur(5px); }
.modal { width:min(620px, 100%); max-height:92vh; overflow:auto; background:#fff; border-radius:22px; box-shadow: 0 25px 70px rgba(15,49,46,.22); animation: rise .2s ease; }
.modal.wide { width:min(820px,100%); }
@keyframes rise { from { opacity:0; transform:translateY(10px) scale(.98); } to { opacity:1; transform:none; } }
.modal-head { display:flex; align-items:flex-start; justify-content:space-between; gap:14px; padding:22px 24px 15px; border-bottom:1px solid var(--line); }
.modal-title { font-size:20px; font-weight:800; margin:0; }
.modal-kicker { margin:4px 0 0; color:var(--muted); font-size:12px; }
.modal-body { padding:22px 24px 25px; }
.close-btn { width:32px; height:32px; border-radius:9px; background:#f3f7f6; color:var(--muted); font-size:21px; line-height:1; }
.close-btn:hover { color:var(--ink); background:var(--mint); }
.form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.field { display:flex; flex-direction:column; gap:7px; }
.field.full { grid-column:1 / -1; }
.field label { font-size:12px; color:var(--ink-soft); font-weight:700; }
.field input, .field textarea, .field select { width:100%; border:1px solid #dbe9e5; background:#fbfdfc; border-radius:10px; padding:11px 12px; color:var(--ink); outline:none; transition:.2s; }
.field textarea { resize:vertical; min-height:92px; line-height:1.6; }
.field input:focus, .field textarea:focus, .field select:focus { border-color:#70bdb1; box-shadow: 0 0 0 3px rgba(81,185,162,.13); }
.field-hint { color:var(--muted); font-size:11px; line-height:1.5; }
.modal-actions { display:flex; justify-content:flex-end; align-items:center; gap:9px; margin-top:20px; }
.upload-zone { aspect-ratio: 1 / .56; min-height:180px; display:grid; place-items:center; border:1.5px dashed #a9d9cf; border-radius:14px; background:#f5fcfa; color:var(--ink-soft); text-align:center; padding:20px; cursor:pointer; transition:.2s; }
.upload-zone:hover { border-color:var(--teal); background:var(--mint); }
.upload-zone .upload-icon { font-size:29px; color:var(--teal); margin-bottom:8px; }
.upload-zone strong { display:block; color:var(--ink); font-size:14px; }
.upload-zone span { display:block; color:var(--muted); font-size:11px; margin-top:4px; }
.hidden { display:none !important; }
.recognition-note { display:flex; gap:9px; align-items:flex-start; margin-top:12px; padding:11px 12px; border-radius:10px; background:#f5f8ff; color:#596b95; font-size:11px; line-height:1.6; }
.recognition-note b { color:#516896; }
.books-editor { margin-top:17px; display:flex; flex-direction:column; gap:10px; }
.book-edit-row { position:relative; display:grid; grid-template-columns: 51px 1fr 32px; gap:10px; align-items:center; padding:10px; border:1px solid var(--line); border-radius:12px; background:#fcfefd; }
.book-edit-row[data-recognizing="true"] { border-color:#9bd6ca; background:#f1fbf8; }
.book-edit-row[data-recognizing="true"]::after { content:"识别中…"; position:absolute; margin-left:64px; margin-top:-50px; color:var(--teal); font-size:10px; pointer-events:none; }
.mini-cover { width:51px; height:63px; border-radius:7px; display:grid; place-items:center; color:#fff; font-size:20px; background:linear-gradient(135deg,#79baab,#3e837a); overflow:hidden; }
.mini-cover img { width:100%; height:100%; object-fit:cover; }
.book-edit-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; }
.book-edit-fields input { min-width:0; border:1px solid #e0ece9; padding:8px 9px; border-radius:8px; font-size:12px; outline:0; }
.book-edit-fields input:first-child { grid-column:1 / -1; font-weight:700; }
.book-edit-fields input:focus { border-color:#70bdb1; }
.remove-book { width:30px; height:30px; background:#fff0ed; color:#cc634f; border-radius:8px; }
.add-book-btn { align-self:flex-start; margin-top:2px; }

.detail-layout { display:grid; grid-template-columns: .9fr 1.1fr; gap:23px; }
.detail-cover { position:relative; aspect-ratio:1.1 / 1; border-radius:15px; overflow:hidden; background:#d9ece7; }
.detail-cover img { width:100%; height:100%; object-fit:cover; }
.detail-info h2 { margin:0 0 6px; font-size:25px; line-height:1.3; letter-spacing:-.03em; }
.detail-sub { color:var(--muted); font-size:13px; line-height:1.8; }
.detail-price { font-size:24px; font-weight:800; color:var(--peach-ink); margin:18px 0 14px; }
.detail-chips { display:flex; flex-wrap:wrap; gap:7px; }
.chip { padding:6px 9px; border-radius:7px; background:#f0f7f5; color:var(--ink-soft); font-size:11px; }
.detail-note { margin-top:16px; padding:13px; background:#fff9ef; border-radius:10px; color:#836445; font-size:12px; line-height:1.7; }
.detail-actions { display:flex; gap:8px; margin-top:18px; }
.comment-section { border-top:1px solid var(--line); margin-top:22px; padding-top:20px; }
.comment-head { display:flex; align-items:center; justify-content:space-between; }
.comment-list { margin-top:13px; display:flex; flex-direction:column; gap:11px; }
.comment { padding:11px 12px; border-radius:10px; background:#f7faf9; }
.comment-meta { display:flex; justify-content:space-between; color:var(--muted); font-size:11px; }
.comment-text { margin:6px 0 0; color:var(--ink-soft); font-size:12px; line-height:1.6; }
.comment-form { display:flex; gap:8px; margin-top:14px; }
.comment-form input { flex:1; min-width:0; border:1px solid #dbe9e5; border-radius:9px; padding:10px 11px; outline:0; }

.subpage-head { display:flex; align-items:center; gap:11px; margin-bottom:26px; }
.back-btn { width:35px; height:35px; border-radius:10px; background:#fff; color:var(--ink-soft); border:1px solid var(--line); font-size:18px; }
.subpage-head h1 { margin:0; font-size:25px; letter-spacing:-.03em; }
.subpage-head p { margin:5px 0 0; color:var(--muted); font-size:12px; }
.messages-layout { display:grid; grid-template-columns:290px 1fr; min-height: 520px; overflow:hidden; border-radius:18px; background:#fff; border:1px solid var(--line); box-shadow:var(--shadow-soft); }
.thread-list { border-right:1px solid var(--line); background:#fbfdfc; }
.thread-list-head { padding:18px; border-bottom:1px solid var(--line); font-weight:800; }
.thread-item { display:flex; gap:10px; padding:14px 16px; border-bottom:1px solid #eff4f2; cursor:pointer; transition:.2s; }
.thread-item:hover, .thread-item.active { background:var(--mint); }
.thread-main { min-width:0; flex:1; }
.thread-top { display:flex; justify-content:space-between; gap:7px; }
.thread-name { font-size:13px; font-weight:700; }
.thread-time { color:var(--muted); font-size:10px; }
.thread-book { color:var(--teal); font-size:11px; margin-top:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.thread-preview { margin-top:4px; color:var(--muted); font-size:11px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.chat-panel { display:flex; flex-direction:column; min-width:0; }
.chat-head { display:flex; align-items:center; gap:10px; padding:17px 20px; border-bottom:1px solid var(--line); }
.chat-head strong { font-size:14px; }
.chat-head small { display:block; color:var(--muted); font-size:11px; margin-top:3px; }
.chat-messages { flex:1; min-height:330px; padding:20px; display:flex; flex-direction:column; gap:11px; background:linear-gradient(#fff,#fbfdfc); overflow:auto; }
.chat-empty { flex:1; display:grid; place-items:center; text-align:center; color:var(--muted); font-size:13px; }
.bubble { max-width:70%; padding:10px 13px; border-radius:13px; font-size:12px; line-height:1.6; }
.bubble.them { align-self:flex-start; background:#eef5f3; color:var(--ink-soft); border-top-left-radius:4px; }
.bubble.me { align-self:flex-end; background:var(--teal); color:#fff; border-top-right-radius:4px; }
.chat-form { display:flex; gap:8px; padding:14px; border-top:1px solid var(--line); }
.chat-form input { flex:1; border:1px solid #dbe9e5; border-radius:10px; padding:10px 11px; outline:0; }
.mobile-chat-back { display:none; }

.my-grid { display:grid; grid-template-columns: minmax(0, 1fr) 310px; gap:18px; }
.profile-card { padding:23px; border-radius:18px; color:#fff; background:linear-gradient(135deg,#0f766e,#2b9387); box-shadow:var(--shadow); }
.profile-main { display:flex; align-items:center; gap:12px; }
.profile-card .avatar { width:49px; height:49px; font-size:17px; background:rgba(255,255,255,.23); }
.profile-card h2 { margin:0; font-size:19px; }
.profile-card p { margin:4px 0 0; color:rgba(255,255,255,.75); font-size:11px; }
.profile-stats { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; border-top:1px solid rgba(255,255,255,.22); margin-top:19px; padding-top:16px; }
.stat b { display:block; font-size:19px; }
.stat span { color:rgba(255,255,255,.72); font-size:10px; }
.manage-panel { background:#fff; border:1px solid var(--line); border-radius:18px; overflow:hidden; box-shadow:var(--shadow-soft); }
.manage-tabs { display:flex; overflow:auto; border-bottom:1px solid var(--line); }
.manage-tab { flex:1; min-width:112px; padding:14px 12px; background:transparent; color:var(--muted); font-size:12px; font-weight:700; }
.manage-tab.active { color:var(--teal); border-bottom:2px solid var(--teal); }
.manage-list { padding:14px; display:flex; flex-direction:column; gap:10px; }
.manage-item { display:flex; align-items:center; gap:12px; padding:11px; border-radius:11px; background:#fbfdfc; border:1px solid #edf3f1; }
.manage-thumb { position:relative; width:54px; height:54px; border-radius:8px; flex:0 0 auto; overflow:hidden; background:linear-gradient(135deg,#7cbcaf,#43887d); display:grid; place-items:center; color:#fff; }
.manage-thumb img { width:100%; height:100%; object-fit:cover; }
.manage-copy { min-width:0; flex:1; }
.manage-copy strong { display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-size:13px; }
.manage-copy span { display:block; color:var(--muted); font-size:11px; margin-top:3px; }
.manage-actions { display:flex; gap:5px; flex-wrap:wrap; justify-content:flex-end; }
.status { padding:4px 7px; border-radius:6px; font-size:10px; font-weight:700; }
.status.live { color:#0a756b; background:var(--mint); }
.status.sold { color:#8a6b58; background:#f8eee4; }
.feedback-card { padding:19px; border-radius:18px; background:#fff; border:1px solid var(--line); box-shadow:var(--shadow-soft); }
.feedback-card h3 { margin:0 0 6px; font-size:15px; }
.feedback-card p { margin:0 0 13px; color:var(--muted); font-size:11px; line-height:1.6; }
.feedback-card textarea { width:100%; min-height:116px; border:1px solid #dbe9e5; border-radius:10px; padding:10px; resize:vertical; outline:0; }
.feedback-card .btn { width:100%; margin-top:9px; }
.admin-card h3 { display:flex; align-items:center; gap:7px; color:var(--teal); }
.admin-key-list { display:flex; flex-direction:column; gap:12px; margin-top:15px; }
.admin-key-card { padding:14px; border:1px solid var(--line); border-radius:12px; background:#fbfdfc; }
.admin-key-head { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.admin-key-head strong { font-size:14px; }
.admin-key-head .status { margin-left:8px; }
.admin-key-masked { color:var(--muted); font-size:11px; font-family:ui-monospace,SFMono-Regular,Consolas,monospace; }
.admin-key-input { display:flex; flex-wrap:wrap; gap:8px; margin-top:11px; }
.admin-key-input input { flex:1; min-width:0; border:1px solid #dbe9e5; background:#fff; border-radius:8px; padding:9px 10px; font-size:12px; outline:0; }
.admin-key-input input:focus { border-color:#70bdb1; box-shadow:0 0 0 3px rgba(81,185,162,.13); }
.admin-key-stats { display:flex; justify-content:space-between; gap:8px; flex-wrap:wrap; margin-top:9px; color:var(--muted); font-size:10px; }
.admin-model-form { padding:12px; border:1px solid var(--line); border-radius:12px; background:#fbfdfc; }
.admin-model-row { display:flex; gap:8px; align-items:center; margin-top:7px; }
.admin-model-row select { flex:1; min-width:0; border:1px solid #dbe9e5; background:#fff; border-radius:8px; padding:9px 10px; font-size:12px; outline:0; }
.key-error-details { color:#b34a3c; flex:1 1 100%; }
.key-error-details summary { cursor:pointer; font-weight:600; }
.key-error-list { margin-top:7px; display:flex; flex-direction:column; gap:5px; }
.key-error-item { display:flex; justify-content:space-between; gap:10px; padding:7px 8px; border-radius:7px; background:#fff4f1; color:#7d4038; font-size:10px; }
.key-error-item small { white-space:nowrap; color:#a66c63; }
.key-error { color:#b65a4b; line-height:1.5; }
.key-error small { color:var(--muted); margin-left:4px; }
.key-ok { color:#2c887d; }

.bottom-nav { display:none; }
.toast { position:fixed; z-index:200; bottom:28px; left:50%; transform:translateX(-50%); color:#fff; background:#193f3b; padding:11px 16px; border-radius:10px; font-size:12px; box-shadow:0 10px 25px rgba(16,45,42,.2); animation: toast .2s ease; }
@keyframes toast { from { opacity:0; transform:translate(-50%, 8px); } to { opacity:1; transform:translate(-50%,0); } }

@media (max-width: 900px) {
  .book-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .my-grid { grid-template-columns:1fr; }
  .hero-art { width:170px; transform:scale(.84); }
}
@media (max-width: 680px) {
  body { background:#f7faf9; }
  .topbar { height:61px; }
  .topbar-inner { padding:0 17px; }
  .brand-sub, .desktop-nav, .user-pill span, .user-actions .btn { display:none; }
  .user-actions { margin-left:auto; }
  .page { padding:20px 15px 84px; }
  .hero { min-height: 224px; padding:27px 23px; }
  .hero h1 { font-size:28px; }
  .hero p { font-size:13px; }
  .hero-art { position:absolute; right:-21px; bottom:-13px; opacity:.82; transform:scale(.67); }
  .toolbar { align-items:stretch; flex-direction:column; gap:10px; }
  .toolbar-meta { justify-content:space-between; }
  .search { min-width:0; }
  .book-grid { gap:11px; }
  .card-body { padding:12px; }
  .card-title { font-size:14px; }
  .card-foot { margin-top:9px; padding-top:9px; }
  .price { font-size:14px; }
  .seller { font-size:10px; }
  .wanted-grid { grid-template-columns:1fr; }
  .segmented { display:flex; width:100%; }
  .segment { flex:1; }
  .section-head { margin-top:23px; }
  .modal-backdrop { padding:0; place-items:end center; }
  .modal { width:100%; max-height:95vh; border-radius:22px 22px 0 0; }
  .modal-head { padding:19px 18px 13px; }
  .modal-body { padding:18px; }
  .form-grid { grid-template-columns:1fr; }
  .field.full { grid-column:auto; }
  .upload-zone { aspect-ratio: 1 / .73; min-height:165px; }
  .book-edit-row { grid-template-columns:42px 1fr 30px; }
  .mini-cover { width:42px; height:53px; }
  .book-edit-fields { grid-template-columns:1fr; }
  .book-edit-fields input:first-child { grid-column:auto; }
  .detail-layout { grid-template-columns:1fr; gap:16px; }
  .detail-cover { aspect-ratio:1.4 / 1; }
  .detail-info h2 { font-size:22px; }
  .messages-layout { display:block; min-height:0; border-radius:15px; }
  .thread-list { border-right:0; }
  .chat-panel { display:none; min-height: 540px; }
  .messages-layout.chat-open .thread-list { display:none; }
  .messages-layout.chat-open .chat-panel { display:flex; }
  .mobile-chat-back { display:inline-flex; }
  .chat-messages { min-height:390px; }
  .bottom-nav { position:fixed; display:flex; z-index:30; bottom:0; left:0; right:0; height:65px; align-items:stretch; justify-content:space-around; background:rgba(255,255,255,.96); backdrop-filter:blur(14px); border-top:1px solid var(--line); padding-bottom:env(safe-area-inset-bottom); }
  .bottom-nav button { flex:1; background:transparent; color:var(--muted); font-size:10px; font-weight:700; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px; }
  .bottom-nav button.active { color:var(--teal); }
  .bottom-nav .bottom-icon { font-size:20px; line-height:1; }
  .subpage-head h1 { font-size:22px; }
  .profile-card { padding:19px; }
  .manage-actions .btn-sm { padding:6px 7px; font-size:10px; }
  .toast { bottom:82px; }
}
