/* ==========================================================================
   账号与角色相关样式（追加）
   ========================================================================== */

/* ---------- 侧边栏账号区 ---------- */

.sidebar-account {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, .07);
}

.account-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .05);
}

.account-avatar {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #b5643b, #8a4326);
  color: #fff8ec;
  font-family: var(--serif);
  font-size: 15px;
}

.account-info { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 1px; }
.account-name {
  font-size: 13px;
  color: #eef2ee;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-role {
  font-size: 10.5px;
  color: #7d8d85;
  letter-spacing: .08em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-actions { display: flex; gap: 2px; }

.account-btn {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: #9fb0a8;
  transition: background .15s ease, color .15s ease;
}
.account-btn:hover { background: rgba(255, 255, 255, .08); color: #f2eee4; }
.account-btn svg { width: 15px; height: 15px; }

.nav-badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff6ec;
  font-size: 10.5px;
  line-height: 18px;
  text-align: center;
  font-family: var(--mono);
}

/* ---------- 登录页 ---------- */

.auth-mode .sidebar { display: none; }

.auth-mode .main {
  padding: 0;
  display: grid;
  place-items: center;
  min-height: 100vh;
  background:
    radial-gradient(circle at 22% 18%, rgba(31, 77, 67, .10), transparent 42%),
    radial-gradient(circle at 82% 78%, rgba(181, 100, 59, .10), transparent 46%),
    var(--bg);
}

.auth-page {
  width: 100%;
  max-width: 420px;
  padding: 40px 20px;
}

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 26px;
}

.auth-brand .brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: linear-gradient(150deg, var(--brand), var(--brand-deep));
  border: 1px solid rgba(255, 255, 255, .1);
  color: #f2eee4;
}

.auth-brand .brand-mark svg { width: 25px; height: 25px; }

.auth-brand-text { line-height: 1.25; }
.auth-brand-text strong {
  display: block;
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: .16em;
  color: var(--ink);
}
.auth-brand-text span {
  font-size: 10.5px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.auth-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 24px 60px -28px rgba(35, 38, 31, .35);
  padding: 26px 26px 24px;
}

.auth-tabs {
  display: flex;
  gap: 4px;
  padding: 3px;
  border-radius: 10px;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  margin-bottom: 20px;
}

.auth-tab {
  flex: 1;
  height: 34px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--ink-3);
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.auth-tab.is-active {
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(35, 38, 31, .08);
}

.auth-card .form-grid { grid-template-columns: minmax(0, 1fr); gap: 13px; }

.auth-submit {
  width: 100%;
  height: 40px;
  margin-top: 18px;
  border-radius: 10px;
  font-size: 14px;
  letter-spacing: .06em;
}

.auth-note {
  margin-top: 14px;
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.7;
  text-align: center;
}

.auth-alert {
  margin-top: 14px;
  padding: 10px 13px;
  border-radius: 9px;
  font-size: 12.5px;
  line-height: 1.7;
  background: var(--ok-soft);
  border: 1px solid #c8dfcd;
  color: #2f5c42;
}
.auth-alert.is-error { background: var(--danger-soft); border-color: #ecc8c0; color: #7e2b20; }

.auth-hint {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--card-soft);
  border: 1px dashed var(--line);
  font-size: 12px;
  line-height: 1.8;
  color: var(--ink-3);
}
.auth-hint b { color: var(--ink-2); font-weight: 600; }

/* ---------- 读者端 ---------- */

.reader-mode .sidebar { display: none; }

.reader-mode .main { padding: 0; }

.reader-shell { min-height: 100vh; display: flex; flex-direction: column; }

.reader-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 28px;
  background: rgba(255, 253, 248, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.reader-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-size: 17px;
  letter-spacing: .1em;
  white-space: nowrap;
}
.reader-brand .brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: #f2eee4;
}
.reader-brand .brand-mark svg { width: 18px; height: 18px; }
.reader-brand small {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: .16em;
  color: var(--ink-3);
  margin-left: 2px;
}

.reader-nav {
  display: flex;
  gap: 2px;
  margin-left: 8px;
}

.reader-nav button {
  height: 34px;
  padding: 0 15px;
  border-radius: 9px;
  font-size: 13.5px;
  color: var(--ink-3);
  white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}
.reader-nav button:hover { background: rgba(35, 38, 31, .05); color: var(--ink-2); }
.reader-nav button.is-active {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 500;
}

.reader-user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--ink-3);
  white-space: nowrap;
}
.reader-user .account-avatar { width: 28px; height: 28px; flex-basis: 28px; font-size: 13px; }

.reader-main {
  flex: 1;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 30px 28px 64px;
}

.reader-hello {
  margin-bottom: 22px;
}
.reader-hello h1 {
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 600;
  letter-spacing: .06em;
}
.reader-hello p { margin-top: 4px; font-size: 13px; color: var(--ink-3); }

/* 书库卡片 */

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}

.reader-book {
  display: flex;
  gap: 14px;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .18s ease, transform .18s ease;
}
.reader-book:hover { box-shadow: var(--shadow); transform: translateY(-1px); }

.reader-book .book-cover {
  width: 44px;
  height: 60px;
  flex: 0 0 44px;
  font-size: 18px;
}

.reader-book-body { min-width: 0; flex: 1; }
.reader-book-title {
  font-family: var(--serif);
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: .02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reader-book-author {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reader-book-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 9px;
  font-size: 11.5px;
  color: var(--ink-3);
}

.reader-book-desc {
  margin-top: 8px;
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 读者借阅卡片 */

.my-loan {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line-soft);
}
.my-loan:last-child { border-bottom: none; }
.my-loan.is-overdue { background: rgba(178, 58, 44, .035); }

.my-loan-main { flex: 1; min-width: 0; }
.my-loan-title {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.my-loan-sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.my-loan-dates {
  display: flex;
  gap: 18px;
  font-size: 12px;
  color: var(--ink-3);
  white-space: nowrap;
}
.my-loan-dates b { color: var(--ink-2); font-weight: 500; font-family: var(--mono); }

/* 我的资料 */

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.profile-list { display: flex; flex-direction: column; }
.profile-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 2px;
  border-bottom: 1px dashed var(--line-soft);
  font-size: 13.5px;
}
.profile-row:last-child { border-bottom: none; }
.profile-row span:first-child { color: var(--ink-3); }
.profile-row span:last-child { color: var(--ink); font-weight: 500; }

/* ---------- 账号审核页 ---------- */

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

.account-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.account-card .avatar { width: 38px; height: 38px; flex-basis: 38px; font-size: 16px; }

.account-card-body { flex: 1; min-width: 0; }
.account-card-name {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .03em;
}
.account-card-sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.account-card-time { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }

.account-card-actions { display: flex; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }

.status-pill {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 10px;
  font-size: 11px;
  letter-spacing: .03em;
}
.status-pill.pending { background: var(--warn-soft); color: var(--warn); }
.status-pill.active { background: var(--ok-soft); color: var(--ok); }
.status-pill.rejected { background: var(--danger-soft); color: var(--danger); }
.status-pill.disabled { background: #efeadf; color: var(--ink-3); }
.status-pill.admin { background: var(--brand-soft); color: var(--brand); }

.account-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 26px 0 12px;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .08em;
}
.account-section-title .badge { font-family: var(--sans); }

/* ---------- 响应式补充 ---------- */

@media (max-width: 820px) {
  .auth-page { padding: 24px 16px; }
  .auth-card { padding: 22px 18px; }

  .reader-topbar { flex-wrap: wrap; gap: 10px; padding: 10px 16px; }
  .reader-nav { order: 3; width: 100%; margin-left: 0; overflow-x: auto; }
  .reader-user { margin-left: auto; }
  .reader-main { padding: 20px 16px 48px; }

  .profile-grid { grid-template-columns: minmax(0, 1fr); }

  .account-card { flex-wrap: wrap; }
  .account-card-actions { width: 100%; justify-content: flex-start; }

  .my-loan { flex-wrap: wrap; gap: 8px; }
  .my-loan-dates { width: 100%; }
}
