:root {
  --bg: #f6f1e8;
  --bg-2: #efe5d5;
  --surface: rgba(255, 252, 247, 0.88);
  --surface-strong: #fffaf3;
  --card: #fffdf9;
  --ink: #1f2d26;
  --ink2: #53645c;
  --ink3: #8a978f;
  --border: rgba(45, 77, 63, 0.12);
  --green: #2f6a4f;
  --green-2: #4b8a6b;
  --blue: #3d7396;
  --orange: #c97f36;
  --red: #b85b4d;
  --purple: #816594;
  --cream-l: #f7efe3;
  --cream-m: #f1e4cf;
  --shadow: 0 20px 55px rgba(54, 47, 35, 0.12);
  --shadow-soft: 0 10px 25px rgba(54, 47, 35, 0.08);
  --r-xl: 28px;
  --r-l: 22px;
  --r-m: 16px;
  --r-s: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font: 15px/1.6 "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255, 220, 183, 0.9), transparent 30%),
    radial-gradient(circle at right 10% top 12%, rgba(166, 209, 190, 0.28), transparent 22%),
    linear-gradient(180deg, #faf7f1 0%, var(--bg) 52%, #f4ecdf 100%);
  min-height: 100vh;
}

a {
  color: var(--blue);
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.hidden {
  display: none !important;
}

.page-layer {
  min-height: 100vh;
  display: none;
  padding: 32px 20px;
}

.page-layer.active {
  display: block;
}

.login-wrap {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(320px, 1fr);
  gap: 24px;
  align-items: stretch;
}

.login-brand,
.login-card,
.section,
.welcome-card,
.profile-top,
.book-detail-card,
.settle-zone,
.drop-area,
.credit-card,
.modal-box,
.chat-drawer {
  backdrop-filter: blur(16px);
}

.login-brand {
  padding: 34px 30px;
  border-radius: var(--r-xl);
  background:
    linear-gradient(140deg, rgba(46, 91, 72, 0.96), rgba(61, 115, 150, 0.88)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.02));
  color: #fff7ec;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.login-brand::after {
  content: "";
  position: absolute;
  inset: auto -6% -38% auto;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: rgba(255, 243, 227, 0.12);
}

.login-logo,
.logo {
  font-family: Georgia, "Songti SC", "STSong", serif;
  letter-spacing: 0.04em;
}

.login-logo {
  font-size: clamp(40px, 6vw, 64px);
  line-height: 1;
  margin-bottom: 12px;
}

.login-sub {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 247, 236, 0.82);
}

.login-brief {
  margin: 26px 0 0;
  max-width: 28em;
  font-size: 15px;
  line-height: 1.9;
  color: rgba(255, 249, 239, 0.9);
}

.login-card {
  align-self: start;
  padding: 30px;
  border-radius: var(--r-xl);
  background: rgba(255, 252, 247, 0.94);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.7);
}

.login-card h2,
.page-hdr h1,
.sec-title,
.book-name,
.prof-name {
  font-family: Georgia, "Songti SC", "STSong", serif;
}

.login-card h2 {
  margin: 0 0 10px;
  font-size: 30px;
}

.login-hint {
  margin: 0 0 24px;
  color: var(--ink2);
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--ink2);
}

.muted {
  color: var(--ink3);
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid rgba(68, 94, 79, 0.18);
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
  border-radius: 14px;
  padding: 13px 15px;
  font: inherit;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(61, 115, 150, 0.45);
  box-shadow: 0 0 0 4px rgba(61, 115, 150, 0.11);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

.review-input {
  background: #fffdfa;
}

.btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  font: inherit;
  padding: 12px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:disabled,
.btn-disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.btn-full {
  width: 100%;
}

.btn-sm {
  padding: 9px 14px;
  font-size: 13px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--green) 0%, var(--blue) 100%);
  color: #fff;
  box-shadow: 0 12px 24px rgba(55, 92, 79, 0.18);
}

.btn-secondary {
  background: linear-gradient(135deg, #f2e5d0 0%, #e7d4bf 100%);
  color: #6a4b2d;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.75);
  color: var(--ink);
  border: 1px solid var(--border);
}

.app-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 26px 20px 120px;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.home-hdr,
.page-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.page-hdr {
  flex-wrap: wrap;
}

.page-hdr h1 {
  font-size: clamp(30px, 5vw, 42px);
  margin: 0;
}

.page-hdr p,
.logo-sub {
  margin: 4px 0 0;
  color: var(--ink2);
}

.logo {
  font-size: clamp(26px, 4vw, 38px);
}

.logo-sub {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.avatar-btn {
  width: 58px;
  height: 58px;
  padding: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
}

.avatar-btn img,
.prof-av img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.welcome-card,
.section,
.profile-top,
.book-detail-card,
.settle-zone {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-soft);
  border-radius: var(--r-l);
}

.welcome-card,
.profile-top,
.section,
.book-detail-card,
.settle-zone {
  padding: 22px;
}

.welcome-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
}

.welcome-txt {
  margin: 0;
  font-size: 16px;
  line-height: 1.85;
  color: var(--ink2);
}

.hl {
  color: var(--green);
}

.pts-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fff1cb 0%, #f6ddb0 100%);
  color: #7f541f;
  font-weight: 600;
}

.pts-val {
  font-size: 24px;
}

.section {
  margin-top: 18px;
}

.sec-title {
  margin: 0 0 16px;
  font-size: 23px;
}

.muted-title {
  color: var(--ink2);
}

.red-title {
  color: var(--red);
}

.scroll-row,
.stats-row,
.card-stack,
.badge-grid,
.tag-cloud {
  display: grid;
  gap: 14px;
}

.scroll-row {
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
}

.qk-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(61, 115, 150, 0.1);
  box-shadow: 0 10px 20px rgba(63, 56, 44, 0.05);
  cursor: pointer;
}

.qk-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 22px;
}

.qk-lbl {
  font-size: 14px;
  font-weight: 600;
}

.stats-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

.stat {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(61, 115, 150, 0.08);
  text-align: center;
}

.stat b {
  display: block;
  font-size: clamp(22px, 4vw, 30px);
  color: var(--green);
}

.stat span {
  color: var(--ink2);
  font-size: 13px;
}

.feed-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.feed-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink2);
}

.feed-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green-2);
}

.feed-time {
  font-size: 12px;
  color: var(--ink3);
}

.card-stack {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.act-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 22px;
  background: var(--card);
  border: 1px solid rgba(54, 89, 72, 0.09);
  box-shadow: var(--shadow-soft);
}

.act-img {
  width: 100%;
  height: 188px;
  object-fit: cover;
  background: linear-gradient(135deg, #e9ddce, #dceadf);
}

.act-body {
  padding: 18px;
}

.act-top,
.act-foot,
.act-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.act-title,
.book-name {
  font-size: 22px;
  line-height: 1.3;
}

.act-pts {
  flex-shrink: 0;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(244, 211, 146, 0.32);
  color: #936024;
  font-size: 13px;
  font-weight: 600;
}

.act-tags,
.sp-amen {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.act-tag,
.am-tag {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(61, 115, 150, 0.1);
  color: var(--blue);
  font-size: 12px;
}

.act-desc {
  margin: 12px 0;
  color: var(--ink2);
}

.act-meta {
  flex-wrap: wrap;
  justify-content: flex-start;
  color: var(--ink3);
  font-size: 13px;
  margin-bottom: 14px;
}

.act-foot {
  margin-top: 16px;
}

.act-spots {
  font-size: 13px;
  color: var(--green);
  font-weight: 600;
}

.act-spots.full {
  color: var(--red);
}

.tab-bar {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px;
  margin-bottom: 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(56, 89, 74, 0.08);
}

.tab {
  white-space: nowrap;
  padding: 11px 16px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  color: var(--ink2);
  background: transparent;
  cursor: pointer;
}

.tab.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 6px 14px rgba(66, 58, 44, 0.08);
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

.sp-cost {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  color: #8b5d2d;
  font-size: 14px;
}

.item-status {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.item-ok {
  background: rgba(67, 160, 100, 0.12);
  color: #2f6a4f;
}

.item-no {
  background: rgba(184, 91, 77, 0.12);
  color: var(--red);
}

.book-card {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 14px;
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(52, 91, 73, 0.08);
  cursor: pointer;
}

.book-cover,
.book-detail-cover {
  border-radius: 16px;
  object-fit: cover;
  background: #efe7db;
  box-shadow: 0 10px 22px rgba(61, 54, 43, 0.12);
}

.book-cover {
  width: 84px;
  height: 116px;
}

.book-detail-card {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 20px;
  margin-bottom: 18px;
}

.book-detail-cover {
  width: 110px;
  height: 154px;
}

.book-author,
.book-meta,
.book-desc,
.book-cabinet {
  color: var(--ink2);
  font-size: 14px;
}

.book-status-tag,
.tl-action {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.book-status-tag.available,
.tl-action.borrow,
.tl-action.verified {
  background: rgba(61, 115, 150, 0.12);
  color: var(--blue);
}

.book-status-tag.borrowed,
.tl-action.review {
  background: rgba(184, 91, 77, 0.12);
  color: var(--red);
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tl-item {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 12px;
}

.tl-dot {
  width: 12px;
  height: 12px;
  margin-top: 15px;
  border-radius: 50%;
  background: var(--green-2);
}

.tl-dot.borrow {
  background: var(--blue);
}

.tl-dot.review {
  background: var(--red);
}

.tl-dot.verified {
  background: var(--orange);
}

.tl-card {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(53, 84, 68, 0.08);
}

.tl-header,
.tl-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tl-header {
  justify-content: space-between;
  flex-wrap: wrap;
}

.tl-avatar {
  font-size: 18px;
}

.tl-name {
  font-weight: 600;
}

.tl-time {
  font-size: 12px;
  color: var(--ink3);
}

.tl-content,
.tl-ai-bubble {
  margin-top: 10px;
  color: var(--ink2);
  line-height: 1.7;
}

.system-msg {
  color: var(--ink2);
}

.book-action-area {
  margin-top: 18px;
}

.profile-top {
  display: grid;
  justify-items: center;
  text-align: center;
}

.prof-av {
  width: 92px;
  height: 92px;
  padding: 4px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 12px 28px rgba(66, 59, 45, 0.12);
}

.prof-name {
  margin-top: 14px;
  font-size: 30px;
}

.prof-room {
  color: var(--ink2);
}

.time-jar {
  width: min(100%, 420px);
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 20px;
  background: linear-gradient(135deg, #fff6de, #f3e3be);
  display: flex;
  align-items: center;
  gap: 14px;
}

.jar-ico {
  font-size: 28px;
}

.jar-info {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}

.jar-lbl,
.jar-unit,
.credit-level-desc,
.cm-label,
.cm-cap,
.credit-hint,
.admin-hint {
  color: var(--ink2);
}

.jar-val {
  font-size: 32px;
  font-weight: 700;
}

.credit-card {
  background: linear-gradient(180deg, rgba(255, 250, 243, 0.98), rgba(247, 239, 227, 0.94));
  border-radius: 24px;
  border: 1px solid rgba(69, 99, 85, 0.09);
  padding: 20px;
}

.credit-header,
.credit-score-row,
.credit-month,
.credit-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.credit-header {
  margin-bottom: 16px;
}

.credit-level-icon {
  font-size: 34px;
}

.credit-level-name {
  font-weight: 700;
}

.credit-score-value {
  font-size: 34px;
  color: var(--green);
  font-weight: 700;
}

.credit-progress-bar {
  width: 100%;
  height: 12px;
  margin: 14px 0;
  border-radius: 999px;
  background: rgba(57, 102, 80, 0.12);
  overflow: hidden;
}

.credit-progress-fill,
.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--orange), var(--green));
}

.credit-next {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
}

.credit-month {
  flex-wrap: wrap;
  align-items: stretch;
}

.credit-month-item {
  flex: 1;
  min-width: 180px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
}

.cm-value.pos,
.pos {
  color: var(--green);
}

.cm-value.neg,
.neg {
  color: var(--red);
}

.credit-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-top: 14px;
}

.credit-log-item,
.h-item {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(45, 77, 63, 0.08);
}

.credit-log-item:last-child,
.h-item:last-child {
  border-bottom: 0;
}

.h-item {
  grid-template-columns: 42px minmax(0, 1fr) auto;
}

.h-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
}

.h-earn {
  background: rgba(67, 160, 100, 0.12);
}

.h-spend {
  background: rgba(184, 91, 77, 0.12);
}

.h-info {
  min-width: 0;
}

.h-desc {
  font-weight: 600;
}

.h-date,
.cl-date {
  color: var(--ink3);
  font-size: 12px;
}

.badge-grid {
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.badge-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.76);
}

.admin-link {
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.75);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}

.arrow {
  color: var(--ink3);
}

.split-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.ai-log {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(53, 84, 68, 0.08);
}

.ai-log.approved {
  border-left: 5px solid var(--green);
}

.ai-log.need_human {
  border-left: 5px solid var(--orange);
}

.log-head,
.log-action,
.chat-input-row,
.drawer-input,
.drawer-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.log-head {
  margin-bottom: 10px;
}

.log-type {
  font-weight: 700;
}

.log-time,
.log-reason {
  color: var(--ink2);
  font-size: 13px;
}

.log-action {
  margin-top: 12px;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.settle-zone {
  min-height: 320px;
}

.drop-area {
  display: grid;
  place-items: center;
  min-height: 220px;
  border-radius: 22px;
  border: 1.5px dashed rgba(61, 115, 150, 0.24);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(246, 239, 228, 0.95));
  text-align: center;
  cursor: pointer;
}

.drop-icon {
  font-size: 48px;
}

.progress-wrap {
  margin-top: 18px;
}

.progress-bar {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(58, 94, 78, 0.12);
}

.progress-text {
  color: var(--ink2);
  font-size: 13px;
}

.settle-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 14px;
  overflow: hidden;
  border-radius: 16px;
}

.settle-table th,
.settle-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid rgba(45, 77, 63, 0.08);
  background: rgba(255, 255, 255, 0.72);
}

.tag-cloud {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.tag-pill {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
}

.tp-ai {
  align-self: flex-start;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(129, 101, 148, 0.14);
  color: var(--purple);
  font-size: 11px;
  font-weight: 700;
}

.tp-name {
  font-weight: 700;
}

.tp-count {
  color: var(--ink2);
  font-size: 13px;
}

.chat-box,
.drawer-body {
  min-height: 280px;
  max-height: 420px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
}

.chat-msg {
  max-width: min(78%, 480px);
  padding: 12px 14px;
  border-radius: 18px;
  line-height: 1.7;
}

.chat-msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(47, 106, 79, 0.92), rgba(61, 115, 150, 0.88));
  color: #fff;
}

.chat-msg.bot {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
}

.cm-src {
  margin-top: 6px;
  font-size: 11px;
  color: var(--ink3);
}

.chat-input-row,
.drawer-input {
  margin-top: 12px;
}

.drawer-input input,
.chat-input-row input {
  flex: 1;
}

.drawer-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.dq-btn {
  border: 0;
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink2);
  border-radius: 999px;
  padding: 9px 12px;
  cursor: pointer;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  width: min(720px, calc(100% - 28px));
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
  border-radius: 24px;
  background: rgba(255, 252, 247, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  z-index: 30;
}

.nav-btn {
  border: 0;
  background: transparent;
  color: var(--ink2);
  padding: 12px 8px;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font: inherit;
  cursor: pointer;
}

.nav-btn svg {
  width: 20px;
  height: 20px;
}

.nav-btn.active {
  background: rgba(61, 115, 150, 0.1);
  color: var(--blue);
}

.modal,
.chat-drawer {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
}

.modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(25, 33, 28, 0.38);
}

.modal-box,
.chat-drawer {
  position: relative;
  background: rgba(255, 252, 247, 0.98);
  border-radius: 26px;
  box-shadow: var(--shadow);
}

.modal {
  align-items: center;
  justify-content: center;
}

.modal-box {
  width: min(620px, calc(100% - 28px));
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 24px;
  margin: auto;
  border: 1px solid rgba(255, 255, 255, 0.84);
}

.chat-drawer {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: min(420px, calc(100% - 24px));
  max-height: calc(100vh - 32px);
  padding: 18px;
  display: none;
  flex-direction: column;
}

.close-btn {
  border: 0;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
  color: var(--ink2);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 108px;
  transform: translateX(-50%);
  z-index: 70;
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(31, 45, 38, 0.9);
  color: #fff;
  box-shadow: 0 14px 30px rgba(20, 23, 20, 0.18);
}

.milestone-box {
  text-align: center;
}

.milestone-icon {
  font-size: 48px;
}

@media (max-width: 920px) {
  .login-wrap,
  .split-cols,
  .welcome-card,
  .book-detail-card {
    grid-template-columns: 1fr;
  }

  .bottom-nav {
    width: calc(100% - 20px);
    bottom: 10px;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 14px;
  }

  .page-layer,
  .app-shell {
    padding-left: 14px;
    padding-right: 14px;
  }

  .login-card,
  .login-brand,
  .section,
  .profile-top,
  .welcome-card,
  .book-detail-card,
  .settle-zone {
    padding: 18px;
  }

  .stats-row {
    grid-template-columns: 1fr;
  }

  .card-stack,
  .tag-cloud,
  .badge-grid {
    grid-template-columns: 1fr;
  }

  .chat-msg {
    max-width: 88%;
  }
}
