/* ================================================================
   style.css — Crean Lutheran Book Relay (Navy & Gold)
   ================================================================ */

/* ——— CSS Variables ——— */
:root {
  --navy-dark: #0B1F3A;
  --navy: #13294B;
  --navy-light: #1a3a6b;
  --gold: #C69214;
  --gold-bright: #E5A820;
  --gold-light: #F5D060;
  --red: #c0392b;
  --bg: #f5f6f8;
  --white: #ffffff;
  --text: #1a1a1a;
  --text-secondary: #666666;
  --text-muted: #999999;
  --border: #e8e8e8;
  --shadow: 0 2px 12px rgba(11, 31, 58, 0.08);
  --radius: 12px;
  --max-width: 768px;
}

/* ——— Reset & Base ——— */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 0.875rem;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  padding-bottom: 70px;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button { cursor: pointer; border: none; font-family: inherit; }
input, textarea { font-family: inherit; font-size: inherit; outline: none; }

/* ——— Desktop Navbar ——— */
.navbar-desktop {
  display: none;
  background: var(--navy-dark);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 56px;
}

.navbar-brand {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold-bright);
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.navbar-brand-icon {
  font-size: 1.25rem;
}

.navbar-links { display: flex; gap: 4px; }

.navbar-links a {
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.75);
  transition: all 0.2s;
}

.navbar-links a:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.navbar-links a.active {
  color: var(--gold-bright);
  font-weight: 600;
  background: rgba(198, 146, 20, 0.12);
}

/* ——— Mobile Header ——— */
.mobile-header {
  display: flex;
  align-items: center;
  background: var(--navy-dark);
  padding: 0 16px;
  height: 48px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.back-btn {
  font-size: 1rem;
  color: var(--gold-bright);
  margin-right: 12px;
  padding: 4px 0;
}

.mobile-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  flex: 1;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 768px) {
  .mobile-header { display: none; }
}

/* ——— Bottom Tab Bar ——— */
.bottom-tabs {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--navy-dark);
  border-top: 1px solid rgba(255,255,255,0.08);
  z-index: 100;
  height: 56px;
  padding-bottom: env(safe-area-inset-bottom);
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.55);
  font-size: 0.625rem;
  transition: color 0.2s;
}

.tab-item.active {
  color: var(--gold-bright);
}

.tab-icon { font-size: 1.25rem; margin-bottom: 2px; }
.tab-label { line-height: 1; font-weight: 500; }

@media (min-width: 768px) {
  .bottom-tabs { display: none; }
  body { padding-bottom: 0; }
}

@media (min-width: 768px) {
  .navbar-desktop { display: block; }
}

/* ——— Main Container ——— */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px;
}

.main-content {
  max-width: var(--max-width);
  margin: 0 auto;
}

/* ——— School Brand Header ——— */
.school-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 4px 12px;
}

.brand-logo {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.brand-mascot {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid var(--gold);
}

.brand-text { min-width: 0; }

.brand-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--navy-dark);
  line-height: 1.2;
}

.brand-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
  letter-spacing: 0.3px;
}

/* ——— Hero Slogan ——— */
.hero-slogan {
  background: linear-gradient(135deg, var(--navy-dark), var(--navy));
  border-radius: var(--radius);
  padding: 28px 22px;
  margin-bottom: 16px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-slogan::before {
  content: '';
  position: absolute;
  top: -20px; right: -20px;
  width: 100px; height: 100px;
  background: var(--gold);
  opacity: 0.08;
  border-radius: 50%;
}

.hero-slogan::after {
  content: '';
  position: absolute;
  bottom: -30px; left: -30px;
  width: 120px; height: 120px;
  background: var(--gold-light);
  opacity: 0.06;
  border-radius: 50%;
}

.hero-line1 {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.04em;
  line-height: 1.3;
  text-transform: uppercase;
}

.hero-line2 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--gold-bright);
  letter-spacing: 0.08em;
  margin-top: 6px;
  text-transform: uppercase;
}

.hero-line3 {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.7);
  margin-top: 12px;
  letter-spacing: 0.03em;
  font-style: italic;
}

.hero-accent {
  display: inline-block;
  width: 40px;
  height: 3px;
  background: var(--gold);
  margin: 10px auto 0;
  border-radius: 2px;
}

/* ——— Page Taglines ——— */
.page-tagline {
  text-align: center;
  padding: 10px 20px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: 0.05em;
  font-style: italic;
  position: relative;
}

.page-tagline::after {
  content: '';
  display: block;
  width: 50px;
  height: 2px;
  background: var(--gold);
  margin: 8px auto 0;
  border-radius: 1px;
}

/* ——— Floating slogan on detail page ——— */
.detail-slogan {
  background: linear-gradient(135deg, #fdfaf2, #fef9e7);
  border: 1px solid var(--gold-light);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 0 20px 20px;
  text-align: center;
}

.detail-slogan-text {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--navy-dark);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.detail-slogan-sub {
  font-size: 0.75rem;
  color: var(--gold);
  margin-top: 4px;
  letter-spacing: 0.04em;
}

/* ——— Feedback Section ——— */
.feedback-section {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px 20px;
  margin-top: 24px;
  border: 1px solid var(--border);
}

.feedback-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy-dark);
  margin-bottom: 6px;
}

.feedback-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.feedback-textarea {
  width: 100%;
  min-height: 100px;
  background: #f8f8f8;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 0.875rem;
  border: 2px solid transparent;
  resize: vertical;
  font-family: inherit;
  transition: border-color 0.2s, background 0.2s;
}

.feedback-textarea:focus {
  border-color: var(--navy);
  background: var(--white);
  outline: none;
}

.feedback-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 44px;
  background: var(--navy);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  margin-top: 12px;
  letter-spacing: 0.4px;
}

.feedback-submit:hover { background: var(--navy-light); }
.feedback-submit:active { opacity: 0.9; }

.feedback-list {
  margin-top: 20px;
}

.feedback-item {
  background: #f9fafb;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
  border-left: 3px solid var(--gold);
}

.feedback-item-text {
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.5;
}

.feedback-item-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ——— Search Entry ——— */
.search-entry {
  display: flex;
  align-items: center;
  background: var(--white);
  border-radius: 40px;
  padding: 10px 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 6px rgba(11, 31, 58, 0.05);
  border: 1px solid var(--border);
}

.search-entry-icon {
  margin-right: 8px;
  display: flex;
  align-items: center;
}

.search-entry-svg {
  width: 18px;
  height: 18px;
  opacity: 0.5;
}

.search-entry-placeholder { font-size: 0.875rem; color: var(--text-muted); }

/* ——— Compact Book Grid ——— */
.book-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding-bottom: 16px;
}

.book-card-compact {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: transform 0.12s;
  display: flex;
  flex-direction: column;
}

.book-card-compact:active { transform: scale(0.975); }

.cover-compact {
  width: 100%;
  aspect-ratio: 3 / 4;
  background: #f0f0f0;
  position: relative;
  overflow: hidden;
}

.cover-compact img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.price-badge {
  position: absolute;
  bottom: 6px;
  left: 6px;
  background: rgba(11, 31, 58, 0.88);
  color: #fff;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.2;
}

.cond-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(255,255,255,0.92);
  color: var(--navy-dark);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  line-height: 1.3;
}

.cond-badge.like-new { color: #27ae60; }
.cond-badge.very-good { color: #2e86c1; }
.cond-badge.good { color: var(--navy); }
.cond-badge.fair { color: var(--text-secondary); }

.info-compact {
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.title-compact {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--navy-dark);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 3px;
}

.meta-compact {
  font-size: 0.65rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meta-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

.meta-time { font-size: 0.6rem; color: var(--text-muted); }

.seller-stat {
  font-size: 0.6rem;
  color: var(--navy);
  opacity: 0.7;
  font-weight: 500;
}

/* ——— Filter Chips ——— */
.filter-chips {
  display: flex;
  gap: 6px;
  padding: 4px 0 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  flex-wrap: nowrap;
}

.filter-chip {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  background: var(--white);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  transition: all 0.15s;
}

.filter-chip:hover { border-color: var(--navy); color: var(--navy); }

.filter-chip.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
  font-weight: 600;
}

/* ——— Seller Badge (detail page) ——— */
.seller-badge {
  font-size: 0.8rem;
  color: var(--navy);
  font-weight: 500;
}

/* ——— Book List (for mine page, vertical cards) ——— */
.book-list { padding-bottom: 16px; }

.book-card {
  display: flex;
  background: var(--white);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: transform 0.15s, box-shadow 0.15s;
}

.book-card:active { transform: scale(0.985); }

.book-card .cover {
  width: 100px;
  height: 135px;
  border-radius: 8px;
  background: #f0f0f0;
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.book-card .cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-card .info {
  flex: 1;
  margin-left: 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  min-width: 0;
}

.book-card .info .title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--navy-dark);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 6px;
}

.book-card .info .author {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.book-card .info .time {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ——— Gravatar Avatar ——— */
.nav-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  flex-shrink: 0;
}

.avatar-img-full {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

/* ——— Email Contact Button ——— */
.btn-email {
  flex: 1;
  height: 42px;
  text-align: center;
  border-radius: 8px;
  font-size: 0.875rem;
  color: var(--navy-dark);
  background: #f0f4f8;
  font-weight: 600;
  line-height: 42px;
  border: 1px solid #d0d8e0;
  transition: background 0.2s;
}

.btn-email:hover { background: #e0e8f0; }

/* ——— Unpublish / Republish Buttons ——— */
.mine-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
  margin-left: 10px;
}

.action-form { margin: 0; }

.unpublish-btn {
  padding: 8px 14px;
  background: #f0ad4e;
  color: #fff;
  font-size: 0.7rem;
  border-radius: 6px;
  font-weight: 600;
  white-space: nowrap;
  border: none;
  cursor: pointer;
  width: 100%;
}

.unpublish-btn:active { opacity: 0.85; }

.republish-btn {
  padding: 8px 14px;
  background: var(--navy);
  color: #fff;
  font-size: 0.7rem;
  border-radius: 6px;
  font-weight: 600;
  white-space: nowrap;
  border: none;
  cursor: pointer;
  width: 100%;
}

.republish-btn:active { opacity: 0.85; }

.unpublished { opacity: 0.55; border-left: 3px solid #f0ad4e; }

.status-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  margin-bottom: 4px;
  width: fit-content;
}

.status-badge.sold { background: #fef3e4; color: #b8860b; }

/* ——— Cover Price Tag (for mine page) ——— */
.cover-price-tag {
  position: absolute;
  bottom: 4px;
  left: 4px;
  background: rgba(11, 31, 58, 0.85);
  color: #fff;
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 0.65rem;
  font-weight: 700;
}

/* ——— Pagination ——— */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 16px 0 24px;
}

.page-btn {
  padding: 8px 18px;
  background: var(--white);
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--navy);
  border: 1px solid var(--navy);
  transition: all 0.2s;
}

.page-btn:hover {
  background: var(--navy);
  color: #fff;
}

.page-btn.disabled {
  color: var(--text-muted);
  border-color: #ddd;
  pointer-events: none;
}

.page-info {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ——— Empty State ——— */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 40px;
  text-align: center;
}

.empty-state .icon { font-size: 3.5rem; margin-bottom: 16px; opacity: 0.6; }
.empty-state .text { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state .text.sub { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 20px; }

.empty-state .link {
  font-size: 0.9rem;
  color: var(--gold);
  font-weight: 600;
  text-decoration: underline;
}

/* ——— Form ——— */
.publish-form { padding-bottom: 30px; }

.form-group { margin-bottom: 20px; }

.form-label {
  font-size: 0.875rem;
  color: var(--text);
  margin-bottom: 8px;
  display: block;
  font-weight: 500;
}

.required { color: var(--red); margin-left: 4px; }

.form-input {
  width: 100%;
  height: 44px;
  background: #f8f8f8;
  border-radius: 10px;
  padding: 0 14px;
  font-size: 0.875rem;
  border: 2px solid transparent;
  transition: border-color 0.2s, background 0.2s;
}

.form-input:focus {
  border-color: var(--navy);
  background: var(--white);
}

.form-textarea {
  width: 100%;
  min-height: 100px;
  background: #f8f8f8;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 0.875rem;
  border: 2px solid transparent;
  resize: vertical;
  transition: border-color 0.2s, background 0.2s;
}

.form-textarea:focus {
  border-color: var(--navy);
  background: var(--white);
}

.field-error {
  color: var(--red);
  font-size: 0.75rem;
  margin-top: 4px;
}

.privacy-notice {
  margin-top: 8px;
  font-size: 0.7rem;
  color: var(--gold);
  line-height: 1.5;
}

/* ——— Image Upload ——— */
.image-upload-area {
  display: block;
  width: 100%;
  height: 220px;
  border: 3px dashed #d0d0d0;
  border-radius: var(--radius);
  overflow: hidden;
  background: #fafafa;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.upload-icon { font-size: 2.5rem; margin-bottom: 8px; }
.upload-hint { font-size: 0.875rem; color: var(--text-secondary); margin-bottom: 4px; }
.upload-sub-hint { font-size: 0.75rem; color: var(--text-muted); }

.upload-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rechoose-hint {
  text-align: center;
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--navy);
  cursor: pointer;
}

/* ——— Price Recommendation ——— */
.price-recommendation {
  margin-top: 8px;
  padding: 10px 14px;
  background: #fdfaf2;
  border: 1px solid var(--gold-light);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.rec-badge {
  font-size: 0.8rem;
  color: var(--navy-dark);
}

.rec-badge strong {
  color: var(--navy-dark);
  font-size: 0.9rem;
}

.rec-note {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ——— Form Row (side-by-side) ——— */
.form-row {
  display: flex;
  gap: 14px;
}

.form-half {
  flex: 1;
  min-width: 0;
}

/* ——— Form Select ——— */
.form-select {
  width: 100%;
  height: 44px;
  background: #f8f8f8;
  border-radius: 10px;
  padding: 0 14px;
  font-size: 0.875rem;
  border: 2px solid transparent;
  font-family: inherit;
  color: var(--text);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  transition: border-color 0.2s, background 0.2s;
  cursor: pointer;
}

.form-select:focus {
  border-color: var(--navy);
  background-color: var(--white);
}

/* ——— Price Input ——— */
.price-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.price-symbol {
  position: absolute;
  left: 14px;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.9rem;
  z-index: 1;
  pointer-events: none;
}

.price-input {
  padding-left: 32px !important;
}

/* ——— Card Price ——— */
.card-price {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--navy-dark);
  margin-bottom: 2px;
}

/* ——— Detail Price ——— */
.price-row .info-value {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.price-original {
  color: var(--text-muted);
  text-decoration: line-through;
  font-size: 0.85rem;
}

.price-arrow {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.price-selling {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--navy-dark);
}

.price-save {
  display: inline-block;
  background: #fdf0e8;
  color: #c0392b;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: 0.3px;
}

/* ——— Condition Badge ——— */
.cond-like-new { color: #27ae60; font-weight: 600; }
.cond-very-good { color: #2e86c1; font-weight: 600; }
.cond-good { color: var(--navy); font-weight: 500; }
.cond-fair { color: var(--text-secondary); }

/* ——— Primary Button (Navy + Gold accent) ——— */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 46px;
  background: var(--navy);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  margin-top: 12px;
  letter-spacing: 0.3px;
  transition: background 0.2s;
}

.btn-primary:hover { background: var(--navy-light); }
.btn-primary:active { opacity: 0.9; }
.btn-primary:disabled { background: #aab; cursor: not-allowed; }

/* ——— Detail Page ——— */
.cover-wrap {
  width: 100%;
  height: 0;
  padding-bottom: 133%;
  background: #f0f0f0;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  margin-bottom: 16px;
  cursor: pointer;
}

.cover-image {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-tap-hint {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(11, 31, 58, 0.75);
  color: #fff;
  padding: 4px 10px;
  border-radius: 10px;
  font-size: 0.7rem;
}

.info-section {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
}

.info-row {
  display: flex;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.info-row:last-child { border-bottom: none; }

.info-label {
  width: 90px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  flex-shrink: 0;
  font-weight: 500;
}

.info-value {
  flex: 1;
  font-size: 0.875rem;
  color: var(--text);
  word-break: break-all;
}

.title-value { font-size: 1rem; font-weight: 600; color: var(--navy-dark); }

/* ——— Contact Section ——— */
.contact-section {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  border: 2px solid var(--gold-light);
}

.contact-header { margin-bottom: 14px; display: flex; align-items: baseline; gap: 8px; }

.contact-label { font-size: 0.95rem; font-weight: 600; color: var(--navy-dark); }
.contact-tip { font-size: 0.75rem; color: var(--text-muted); }

.contact-masked {
  padding: 20px 0;
  text-align: center;
  background: #fafafa;
  border-radius: 8px;
}

.mask-text { font-size: 0.875rem; color: #ccc; }

.contact-revealed {
  padding: 16px;
  background: #fdfaf2;
  border: 2px solid var(--gold);
  border-radius: 10px;
  margin-bottom: 14px;
  text-align: center;
}

.contact-value {
  font-size: 1rem;
  color: var(--navy-dark);
  font-weight: 500;
  word-break: break-all;
}

.btn-group { display: flex; gap: 12px; }

.btn-copy, .btn-wechat {
  flex: 1;
  height: 42px;
  text-align: center;
  border-radius: 8px;
  font-size: 0.875rem;
  color: #fff;
  font-weight: 600;
  line-height: 42px;
  transition: opacity 0.2s;
}

.btn-copy {
  background: var(--navy);
}

.btn-wechat {
  background: #2e7d32;
}

.btn-copy:active, .btn-wechat:active { opacity: 0.85; }

/* ——— Search Page ——— */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  margin-bottom: 16px;
  position: sticky;
  top: 48px;
  background: var(--bg);
  z-index: 50;
}

.search-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--white);
  border-radius: 22px;
  padding: 0 14px;
  height: 42px;
  border: 1px solid var(--border);
}

.search-input-wrap .search-icon { font-size: 1rem; margin-right: 8px; }

.search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 0.875rem;
  height: 42px;
}

.clear-btn {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #ccc;
  font-size: 0.75rem;
  color: #fff;
  cursor: pointer;
}

.cancel-btn {
  font-size: 0.875rem;
  color: var(--navy);
  white-space: nowrap;
  font-weight: 500;
}

.result-count {
  font-size: 0.75rem;
  color: var(--text-secondary);
  padding: 0 4px 12px;
}

.results-container .empty-state { padding: 100px 40px; }

/* ——— Mine Page ——— */
.user-card {
  display: flex;
  align-items: center;
  background: var(--white);
  padding: 20px;
  border-radius: var(--radius);
  box-shadow: 0 1px 6px rgba(11, 31, 58, 0.05);
  border: 1px solid var(--border);
  margin-bottom: 20px;
}

.avatar-wrap {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 2rem;
  color: var(--gold-bright);
}

.user-info { margin-left: 16px; flex: 1; }

.nickname { font-size: 1rem; font-weight: 600; color: var(--navy-dark); margin-bottom: 4px; }
.listing-count { font-size: 0.8rem; color: var(--text-secondary); }

.section-header { padding: 8px 4px 12px; }
.section-title { font-size: 0.95rem; font-weight: 600; color: var(--navy-dark); }

/* Mine card */
.mine-card {
  display: flex;
  align-items: center;
}

.card-main {
  display: flex;
  flex: 1;
  align-items: center;
  overflow: hidden;
  min-width: 0;
}

.card-main .cover {
  width: 80px;
  height: 110px;
  border-radius: 8px;
  background: #f0f0f0;
  flex-shrink: 0;
  overflow: hidden;
}

.card-main .cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-main .info {
  flex: 1;
  margin-left: 12px;
}

.card-main .info .title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--navy-dark);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 4px;
}

.card-main .info .author {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.card-main .info .time {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.delete-form { flex-shrink: 0; margin-left: 10px; }

.delete-btn {
  padding: 8px 18px;
  background: var(--red);
  color: #fff;
  font-size: 0.75rem;
  border-radius: 6px;
  font-weight: 500;
}

.delete-btn:active { opacity: 0.85; }

/* ——— Lightbox ——— */
.lightbox-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(11, 31, 58, 0.95);
  z-index: 999;
  align-items: center;
  justify-content: center;
}

.lightbox-overlay.show { display: flex; }

.lightbox-overlay img {
  max-width: 95vw;
  max-height: 95vh;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  color: var(--gold-bright);
  font-size: 1.75rem;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ——— Toast ——— */
.toast {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(11, 31, 58, 0.92);
  color: #fff;
  padding: 14px 28px;
  border-radius: 8px;
  font-size: 0.875rem;
  z-index: 1000;
  pointer-events: none;
}

.toast.show {
  display: block;
  animation: toastFade 2s ease forwards;
}

@keyframes toastFade {
  0% { opacity: 0; }
  10% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; }
}

/* ——— Responsive ——— */
@media (min-width: 600px) {
  .book-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }
  .book-card { margin-bottom: 0; flex-direction: column; }
  .book-card .cover { width: 100%; height: 0; padding-bottom: 130%; }
  .book-card .info { margin-left: 0; margin-top: 10px; }
  .mine-card { flex-direction: row; }
  .mine-card .cover { width: 80px; height: 110px; padding-bottom: 0; }
}

/* ——— Navbar Logo & User ——— */
.nav-logo {
  width: 32px;
  height: 32px;
  margin-right: 8px;
  vertical-align: middle;
}

.navbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.user-email {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.7);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.login-link, .logout-link {
  font-size: 0.8rem;
  color: var(--gold-bright);
  padding: 6px 14px;
  border: 1px solid var(--gold);
  border-radius: 16px;
  font-weight: 500;
  transition: all 0.2s;
}

.login-link:hover, .logout-link:hover {
  background: var(--gold);
  color: var(--navy-dark);
}

.logout-link {
  padding: 4px 8px;
  font-size: 0.9rem;
  border: none;
}

/* ——— Mobile Header Logo ——— */
.mobile-logo {
  width: 24px;
  height: 24px;
  margin-right: 6px;
  flex-shrink: 0;
}

.mobile-user-icon {
  font-size: 1.1rem;
  padding: 4px 8px;
}

.mobile-login-btn {
  font-size: 0.7rem;
  color: var(--gold-bright);
  padding: 4px 10px;
  border: 1px solid var(--gold);
  border-radius: 12px;
  white-space: nowrap;
}

/* ——— Tab Icons (inline SVG, currentColor) ——— */
.tab-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
}

/* ——— Login Page ——— */
.login-page {
  max-width: 380px;
  margin: 40px auto;
  padding: 30px 20px;
  text-align: center;
}

.login-logos {
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.logo-img {
  width: 100px;
  height: 100px;
}

.login-mascot {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3px solid var(--gold);
}

.login-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--navy-dark);
  margin-bottom: 8px;
  line-height: 1.3;
}

.login-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 30px;
}

.login-error {
  background: #fdf0ef;
  border: 1px solid #f5c6cb;
  color: var(--red);
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 0.8rem;
  margin-bottom: 16px;
  text-align: left;
}

.login-form {
  text-align: left;
}

.login-input {
  text-align: left;
}

.login-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.login-btn {
  margin-top: 24px;
}

.login-footer {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-footer-text {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ——— User Card (Mine page) ——— */
.avatar-logo {
  width: 40px;
  height: 40px;
}

.user-email-display {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.logout-btn {
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 6px 12px;
  border: 1px solid #ddd;
  border-radius: 14px;
  background: transparent;
  transition: all 0.2s;
  flex-shrink: 0;
}

.logout-btn:hover {
  border-color: var(--red);
  color: var(--red);
}

@media (min-width: 768px) {
  .container { padding: 20px 24px; }
  body { padding-bottom: 0; }
  .navbar-user { margin-left: 20px; }
}
