/* ===== CSS VARIABLES & RESET ===== */
:root {
  --bg: #08090c;
  --bg-card: #111318;
  --bg-card-hover: #1a1d25;
  --bg-surface: #0d0f13;
  --gold: #c8a44e;
  --gold-light: #e8cc6e;
  --gold-dim: #8a7235;
  --accent: #f0b90b;
  --text: #e8e6e1;
  --text-dim: #8a8a8a;
  --text-muted: #555;
  --border: #1e2028;
  --border-light: #2a2d38;
  --red: #e74c3c;
  --green: #27ae60;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --font-serif: 'Noto Serif TC', serif;
  --font-sans: 'Inter', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-gold: 0 0 40px rgba(200,164,78,0.15);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scrollbar-width: thin; scrollbar-color: var(--gold-dim) var(--bg); }
body { font-family: var(--font-sans); background: var(--bg); color: var(--text); line-height: 1.6; overflow-x: hidden; }
a { color: var(--gold); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--gold-light); }
img { max-width: 100%; display: block; }
.font-mono { font-family: var(--font-mono); }
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

/* ===== NAVIGATION ===== */
#navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(8,9,12,0.85); backdrop-filter: blur(20px); border-bottom: 1px solid transparent;
  transition: var(--transition);
}
#navbar.scrolled { border-bottom-color: var(--border); background: rgba(8,9,12,0.95); }
.nav-inner {
  max-width: 1280px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between; height: 64px;
}
.nav-logo { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 700; }
.logo-icon { color: var(--gold); font-size: 1.4rem; }
.logo-text { font-family: var(--font-serif); font-size: 1rem; }
.logo-text small { font-size: 0.65em; color: var(--gold); vertical-align: super; letter-spacing: 2px; }
.nav-links { display: flex; gap: 28px; }
.nav-links a { color: var(--text-dim); font-size: 0.85rem; font-weight: 500; letter-spacing: 0.5px; }
.nav-links a:hover, .nav-links a.nav-active { color: var(--gold); }
.nav-links a.nav-active { position: relative; }
.nav-links a.nav-active::after { content: ''; position: absolute; bottom: -4px; left: 0; right: 0; height: 2px; background: var(--gold); border-radius: 1px; }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.btn-wallet {
  display: flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dim)); color: #000;
  border: none; padding: 8px 18px; border-radius: 999px; font-weight: 600; font-size: 0.82rem;
  cursor: pointer; transition: var(--transition);
}
.btn-wallet:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(200,164,78,0.3); }
.btn-wallet.connected { background: var(--bg-card); color: var(--gold); border: 1px solid var(--gold-dim); }
.nav-hamburger { display: none; background: none; border: none; cursor: pointer; padding: 4px; flex-direction: column; gap: 5px; }
.nav-hamburger span { display: block; width: 22px; height: 2px; background: var(--text); transition: var(--transition); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 28px; border-radius: 999px; font-weight: 600; font-size: 0.9rem;
  border: none; cursor: pointer; transition: var(--transition); text-align: center;
}
.btn-primary {
  background: linear-gradient(135deg, var(--gold), #d4a843); color: #000;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-gold); color: #000; }
.btn-outline {
  background: transparent; border: 1px solid var(--border-light); color: var(--text);
}
.btn-outline:hover { border-color: var(--gold); color: var(--gold); }
.btn-lg { padding: 16px 36px; font-size: 1rem; }
.btn-sm { padding: 8px 16px; font-size: 0.8rem; }

/* ===== HERO ===== */
#hero {
  min-height: 100vh; display: flex; align-items: center; position: relative;
  background: radial-gradient(ellipse at 70% 50%, rgba(200,164,78,0.06) 0%, transparent 60%),
              radial-gradient(ellipse at 30% 80%, rgba(200,164,78,0.03) 0%, transparent 50%),
              var(--bg);
  overflow: hidden; padding: 100px 24px 60px;
}
.hero-bg-particles { position: absolute; inset: 0; pointer-events: none; }
.hero-content { max-width: 1280px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; width: 100%; }
.hero-badge {
  display: inline-block; padding: 6px 16px; border-radius: 999px;
  background: rgba(200,164,78,0.1); border: 1px solid rgba(200,164,78,0.2);
  color: var(--gold); font-size: 0.78rem; font-weight: 600; letter-spacing: 1.5px; margin-bottom: 20px;
}
.hero-title { margin-bottom: 20px; }
.title-zh {
  display: block; font-family: var(--font-serif); font-size: clamp(3rem, 6vw, 5rem);
  font-weight: 900; line-height: 1.1;
  background: linear-gradient(135deg, var(--gold-light), var(--gold), var(--gold-dim));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.title-sub { display: block; font-size: clamp(1rem, 2vw, 1.3rem); color: var(--text-dim); margin-top: 8px; font-weight: 400; }
.hero-desc { color: var(--text-dim); font-size: 1rem; line-height: 1.8; margin-bottom: 32px; max-width: 520px; }
.hero-stats { display: flex; gap: 32px; margin-bottom: 36px; }
.stat { display: flex; flex-direction: column; }
.stat-num { font-size: 1.6rem; font-weight: 700; color: var(--gold); font-family: var(--font-mono); }
.stat-label { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-top: 2px; }
.hero-actions { display: flex; gap: 16px; }
.hero-visual { display: flex; justify-content: center; align-items: center; }

/* 3D Book */
.book-3d { perspective: 1200px; position: relative; }
.book-cover {
  width: 320px; border-radius: 4px; overflow: hidden;
  transform: rotateY(-12deg) rotateX(2deg);
  box-shadow: 20px 20px 60px rgba(0,0,0,0.6), -2px 0 10px rgba(200,164,78,0.1);
  transition: transform 0.6s ease;
  border: 1px solid rgba(200,164,78,0.15);
}
.book-cover:hover { transform: rotateY(-5deg) rotateX(1deg); }
.book-cover img { width: 100%; }
.book-glow {
  position: absolute; top: 50%; left: 50%; width: 400px; height: 400px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(200,164,78,0.08) 0%, transparent 70%);
  pointer-events: none; animation: pulse-glow 4s ease-in-out infinite;
}
@keyframes pulse-glow { 0%,100% { opacity: 0.5; } 50% { opacity: 1; } }

.hero-scroll-hint {
  position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.hero-scroll-hint span { font-size: 0.65rem; letter-spacing: 3px; color: var(--text-muted); }
.scroll-line { width: 1px; height: 40px; background: linear-gradient(to bottom, var(--gold-dim), transparent); animation: scroll-hint 2s ease-in-out infinite; }
@keyframes scroll-hint { 0% { opacity: 0; transform: scaleY(0); transform-origin: top; } 50% { opacity: 1; transform: scaleY(1); } 100% { opacity: 0; transform: scaleY(0); transform-origin: bottom; } }

/* ===== PAGE HERO (sub-pages) ===== */
.page-hero {
  padding: 120px 0 60px;
  background: radial-gradient(ellipse at 50% 0%, rgba(200,164,78,0.06) 0%, transparent 60%), var(--bg);
  border-bottom: 1px solid var(--border);
}
.page-hero-inner { text-align: center; max-width: 700px; margin: 0 auto; }
.page-hero-title {
  font-family: var(--font-serif); font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900; margin: 12px 0 16px;
  background: linear-gradient(135deg, var(--gold-light), var(--gold), var(--gold-dim));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.page-hero-desc { color: var(--text-dim); font-size: 1rem; line-height: 1.8; }
.collection-stats-bar {
  display: flex; justify-content: center; gap: 40px; margin-top: 32px;
  padding: 20px 0; border-top: 1px solid var(--border);
}
.cs-item { display: flex; flex-direction: column; align-items: center; }
.cs-val { font-family: var(--font-mono); font-size: 1.4rem; font-weight: 700; color: var(--gold); }
.cs-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-top: 4px; }

.page-section { padding: 60px 0 100px; }

/* ===== SECTIONS ===== */
section { padding: 100px 0; position: relative; }
section:nth-child(even) { background: var(--bg-surface); }
.section-header { text-align: center; margin-bottom: 56px; }
.section-tag {
  display: inline-block; font-size: 0.7rem; letter-spacing: 3px; color: var(--gold);
  font-weight: 600; margin-bottom: 12px; text-transform: uppercase;
}
.section-header h2 { font-family: var(--font-serif); font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 700; }
.section-subtitle { color: var(--text-dim); margin-top: 12px; max-width: 600px; margin-left: auto; margin-right: auto; }

/* ===== ABOUT BOOK ===== */
.about-book-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: start; }
.book-meta-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; margin-bottom: 28px;
}
.meta-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); }
.meta-row:last-child { border-bottom: none; }
.meta-label { color: var(--text-muted); font-size: 0.85rem; }
.meta-value { font-weight: 600; font-size: 0.85rem; text-align: right; }
.book-desc-text { color: var(--text-dim); line-height: 1.9; margin-bottom: 28px; }
.endorsement { margin-bottom: 20px; padding: 20px; background: var(--bg-card); border-left: 3px solid var(--gold-dim); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.endorsement blockquote { font-style: italic; color: var(--text); font-size: 0.92rem; line-height: 1.7; }
.endorsement cite { display: block; margin-top: 8px; color: var(--gold-dim); font-size: 0.8rem; }

.book-preview-stack { position: relative; height: 480px; }
.preview-card {
  position: absolute; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); border: 1px solid var(--border);
  transition: transform 0.5s ease;
}
.preview-card img { width: 240px; }
.pc1 { top: 0; left: 20px; transform: rotate(-4deg); z-index: 3; }
.pc2 { top: 40px; left: 120px; transform: rotate(2deg); z-index: 2; }
.pc3 { top: 80px; left: 60px; transform: rotate(-1deg); z-index: 1; }
.preview-card:hover { transform: rotate(0deg) translateY(-8px) scale(1.03); z-index: 10; }

/* ===== AUTHOR ===== */
.author-grid { display: grid; grid-template-columns: 350px 1fr; gap: 60px; align-items: start; }
.portrait-frame {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  border: 2px solid var(--border-light);
}
.portrait-frame img { width: 100%; filter: grayscale(30%); }
.portrait-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(8,9,12,0.7) 0%, transparent 50%);
}
.author-bio h3 { font-family: var(--font-serif); font-size: 2rem; margin-bottom: 28px; }
.author-bio .alias { color: var(--gold); font-size: 0.8em; font-weight: 400; }
.author-timeline { position: relative; padding-left: 32px; margin-bottom: 28px; }
.author-timeline::before { content: ''; position: absolute; left: 8px; top: 0; bottom: 0; width: 1px; background: var(--border-light); }
.tl-item { position: relative; margin-bottom: 20px; }
.tl-item::before {
  content: ''; position: absolute; left: -28px; top: 6px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--gold-dim);
}
.tl-year { font-family: var(--font-mono); color: var(--gold); font-size: 0.82rem; font-weight: 600; }
.tl-item p { color: var(--text-dim); font-size: 0.88rem; margin-top: 2px; }
.author-quote {
  font-family: var(--font-serif); font-size: 1.1rem; color: var(--gold);
  padding: 20px; background: rgba(200,164,78,0.05); border-radius: var(--radius);
  border: 1px solid rgba(200,164,78,0.1);
}

/* ===== CHAPTERS ===== */
.chapters-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.chapter-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; transition: var(--transition); cursor: default;
}
.chapter-card:hover { border-color: var(--gold-dim); transform: translateY(-4px); box-shadow: var(--shadow-gold); }
.ch-num { font-family: var(--font-mono); font-size: 0.75rem; color: var(--gold-dim); letter-spacing: 1px; }
.chapter-card h4 { font-family: var(--font-serif); font-size: 1.1rem; margin: 8px 0; }
.chapter-card p { font-size: 0.85rem; color: var(--text-dim); line-height: 1.6; }
.ch-pages { display: inline-block; margin-top: 12px; font-size: 0.72rem; color: var(--text-muted); font-family: var(--font-mono); letter-spacing: 0.5px; }

/* ===== NFT COLLECTION ===== */
.collection-filters { display: flex; justify-content: center; gap: 12px; margin-bottom: 36px; flex-wrap: wrap; }
.filter-btn {
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text-dim);
  padding: 8px 20px; border-radius: 999px; font-size: 0.82rem; cursor: pointer;
  transition: var(--transition); font-weight: 500;
}
.filter-btn:hover, .filter-btn.active { background: var(--gold); color: #000; border-color: var(--gold); }

.nft-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.nft-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; transition: var(--transition);
}
.nft-card:hover { transform: translateY(-6px); border-color: var(--gold-dim); box-shadow: var(--shadow-gold); }
.nft-card-img { position: relative; aspect-ratio: 3/4; overflow: hidden; background: var(--bg-surface); }
.nft-card-img img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.25s ease, transform 0.5s ease; }
.nft-card-img img.is-loaded { opacity: 1; }
.nft-card:hover .nft-card-img img { transform: scale(1.05); }
.nft-card-info { padding: 14px 16px; }
.nft-card-info h5 { font-size: 0.88rem; margin-bottom: 4px; }
.nft-card-info .nft-chapter { font-size: 0.72rem; color: var(--text-muted); }
.nft-card-footer { display: flex; justify-content: space-between; align-items: center; padding: 0 16px 14px; }
.nft-price { font-family: var(--font-mono); font-size: 0.85rem; color: var(--gold); font-weight: 600; }
.nft-status { font-size: 0.7rem; padding: 3px 8px; border-radius: 999px; }
.status-available { background: rgba(39,174,96,0.15); color: var(--green); }
.status-minted { background: rgba(200,164,78,0.15); color: var(--gold); }

.load-more-wrap { text-align: center; margin-top: 40px; }

/* ===== MINT ===== */
.mint-panel { display: grid; grid-template-columns: 1fr; gap: 48px; align-items: start; max-width: 560px; margin: 0 auto; }
.mint-panel.has-preview { grid-template-columns: 1fr 1fr; max-width: none; }
.mint-preview-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; aspect-ratio: 3/4; display: flex; align-items: center; justify-content: center;
}
.mint-card-inner { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.mint-card-inner img { width: 100%; height: 100%; object-fit: cover; }
.minted-preview-content {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 20px;
  text-align: center;
}
.minted-preview-content img {
  width: 100%;
  height: calc(100% - 72px);
  object-fit: cover;
  border-radius: var(--radius-sm);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.minted-preview-content img.is-loaded { opacity: 1; }
.minted-preview-content .img-skeleton,
.minted-preview-content .nft-img-state {
  bottom: 72px;
}
.mint-placeholder { display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--text-muted); }
.mint-placeholder svg { opacity: 0.3; }
.mint-progress { margin-top: 20px; }
.progress-bar { height: 6px; background: var(--bg-card); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--gold-dim), var(--gold)); border-radius: 999px; transition: width 0.5s ease; }
.progress-text { font-size: 0.78rem; color: var(--text-muted); margin-top: 8px; text-align: center; }

.mint-controls { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 36px; }
.mint-phase { margin-bottom: 28px; }
.phase-indicator {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: var(--radius-sm); background: rgba(39,174,96,0.08); border: 1px solid rgba(39,174,96,0.2);
}
.phase-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); animation: phase-pulse 2s infinite; }
@keyframes phase-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(39,174,96,0.4); } 50% { box-shadow: 0 0 0 8px rgba(39,174,96,0); } }
.phase-indicator strong { font-size: 0.9rem; }
.phase-indicator small { color: var(--green); font-size: 0.75rem; }

.mint-field { margin-bottom: 20px; }
.mint-field label { display: block; font-size: 0.82rem; color: var(--text-dim); margin-bottom: 8px; font-weight: 500; }
.page-selector, .qty-selector {
  display: flex; align-items: center; gap: 0;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden;
}
.page-selector input, .qty-selector span {
  flex: 1; text-align: center; background: transparent; border: none; color: var(--text);
  font-size: 1.1rem; font-weight: 600; padding: 12px; font-family: var(--font-mono);
}
.page-selector input:focus { outline: none; }
.page-nav, .qty-selector button {
  background: var(--bg-card); border: none; color: var(--text); padding: 12px 18px;
  cursor: pointer; font-size: 1.1rem; transition: var(--transition);
}
.page-nav:hover, .qty-selector button:hover { background: var(--gold-dim); color: #000; }

.mint-pricing { margin: 24px 0; padding: 20px; background: var(--bg); border-radius: var(--radius-sm); }
.price-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 0.85rem; color: var(--text-dim); }
.price-row.total { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 8px; color: var(--text); font-weight: 700; font-size: 1rem; }

.btn-mint { width: 100%; justify-content: center; }
.mint-note { font-size: 0.72rem; color: var(--text-muted); margin-top: 16px; text-align: center; }

/* ===== MARKETPLACE ===== */
.market-toolbar { display: flex; gap: 16px; margin-bottom: 32px; flex-wrap: wrap; }
.market-search {
  flex: 1; min-width: 250px; display: flex; align-items: center; gap: 10px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 16px;
}
.market-search input { flex: 1; background: transparent; border: none; color: var(--text); padding: 12px 0; font-size: 0.9rem; }
.market-search input:focus { outline: none; }
.market-search svg { color: var(--text-muted); }
.market-sort select {
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text); padding: 12px 16px;
  border-radius: var(--radius-sm); font-size: 0.85rem; cursor: pointer;
}
.market-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.market-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: var(--transition); cursor: pointer;
}
.market-card:hover { border-color: var(--gold-dim); transform: translateY(-4px); }
.market-card-top { display: flex; gap: 14px; padding: 16px; }
.market-card-thumb { width: 80px; height: 100px; border-radius: var(--radius-sm); overflow: hidden; flex-shrink: 0; }
.market-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.market-card-info { flex: 1; }
.market-card-info h5 { font-size: 0.9rem; margin-bottom: 4px; }
.market-card-info .mc-chapter { font-size: 0.72rem; color: var(--text-muted); margin-bottom: 6px; }
.market-card-info .mc-seller { font-size: 0.72rem; color: var(--text-dim); font-family: var(--font-mono); }
.market-card-bottom {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; border-top: 1px solid var(--border);
}
.mc-price { font-family: var(--font-mono); font-weight: 700; color: var(--gold); }
.mc-buy { padding: 6px 16px; }

/* ===== MY NFTS ===== */
.connect-prompt {
  text-align: center; padding: 60px 20px;
  background: var(--bg-card); border: 2px dashed var(--border); border-radius: var(--radius-lg);
}
.connect-prompt svg { color: var(--text-muted); margin-bottom: 16px; }
.connect-prompt h3 { margin-bottom: 8px; }
.connect-prompt p { color: var(--text-dim); margin-bottom: 24px; }
.my-nft-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.my-nft-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden;
}
.my-nft-card-img { aspect-ratio: 3/4; overflow: hidden; }
.my-nft-card-img img { width: 100%; height: 100%; object-fit: cover; }
.my-nft-card-body { padding: 14px 16px; }
.my-nft-card-body h5 { font-size: 0.88rem; margin-bottom: 8px; }
.my-nft-actions { display: flex; gap: 8px; }
.my-nft-actions .btn { flex: 1; justify-content: center; font-size: 0.78rem; padding: 8px 12px; }

/* ===== FOOTER ===== */
#footer { padding: 60px 0 30px; background: var(--bg-surface); border-top: 1px solid var(--border); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer-brand { }
.footer-brand .logo-icon { font-size: 1.2rem; }
.footer-brand .logo-text { font-family: var(--font-serif); font-size: 1.1rem; font-weight: 700; }
.footer-brand p { color: var(--text-muted); font-size: 0.85rem; margin-top: 12px; line-height: 1.7; }
.footer-links h5 { font-size: 0.8rem; letter-spacing: 1px; text-transform: uppercase; color: var(--text-dim); margin-bottom: 16px; }
.footer-links a { display: block; color: var(--text-muted); font-size: 0.85rem; padding: 4px 0; }
.footer-links a:hover { color: var(--gold); }
.footer-bottom { text-align: center; padding-top: 28px; border-top: 1px solid var(--border); }
.footer-bottom p { font-size: 0.78rem; color: var(--text-muted); }
.footer-note { margin-top: 4px; }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.8); backdrop-filter: blur(10px);
  z-index: 2000; display: none; align-items: center; justify-content: center; padding: 20px;
  overflow-y: auto;
}
.modal-overlay.open { display: flex; }
.modal-content {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  max-width: 900px; width: 100%; max-height: 90vh; overflow-y: auto; position: relative;
}
.modal-close {
  position: sticky; top: 16px; float: right; margin-right: 16px;
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  width: 36px; height: 36px; border-radius: 50%; font-size: 1.2rem;
  cursor: pointer; z-index: 10; display: flex; align-items: center; justify-content: center;
}
.modal-body { display: grid; grid-template-columns: 1fr 1fr; }
.modal-image { padding: 24px; display: flex; align-items: center; justify-content: center; }
.modal-image img { max-height: 70vh; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.modal-info { padding: 32px 28px; }
.modal-tag { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 0.7rem; font-weight: 700; letter-spacing: 1px; margin-bottom: 12px; }
.modal-info h3 { font-family: var(--font-serif); font-size: 1.5rem; margin-bottom: 4px; }
.modal-chapter { color: var(--text-dim); font-size: 0.85rem; margin-bottom: 12px; }
.modal-desc { color: var(--text-dim); font-size: 0.85rem; line-height: 1.7; margin-bottom: 20px; }
.modal-meta { background: var(--bg); border-radius: var(--radius-sm); padding: 16px; margin-bottom: 20px; }
.mm-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 0.82rem; }
.mm-row span:first-child { color: var(--text-muted); }
.modal-actions { display: flex; gap: 12px; margin-bottom: 24px; }
.modal-actions .btn { flex: 1; justify-content: center; }
.modal-history h4 { font-size: 0.85rem; margin-bottom: 12px; color: var(--text-dim); }
.history-item { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 0.78rem; }
.hi-event { color: var(--gold); font-weight: 600; }
.hi-addr { color: var(--text-muted); }
.hi-time { color: var(--text-muted); }

/* ===== WALLET MODAL ===== */
.wallet-modal-content {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  max-width: 440px; width: 100%; padding: 36px; position: relative;
}
.wallet-modal-content h3 { font-family: var(--font-serif); font-size: 1.3rem; margin-bottom: 8px; }
.wallet-modal-content > p { color: var(--text-dim); font-size: 0.85rem; margin-bottom: 24px; }
.wallet-options { display: flex; flex-direction: column; gap: 12px; }
.wallet-option {
  display: flex; align-items: center; gap: 16px; width: 100%;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 20px; cursor: pointer; transition: var(--transition);
  color: var(--text); font-size: 0.95rem; font-weight: 500;
}
.wallet-option:hover { border-color: var(--gold-dim); background: var(--bg-card-hover); }

/* ===== LISTING FORM ===== */
.list-form { margin-top: 20px; }
.list-input {
  width: 100%; background: var(--bg); border: 1px solid var(--border); color: var(--text);
  padding: 12px 16px; border-radius: var(--radius-sm); font-size: 0.95rem;
}
.list-input:focus { outline: none; border-color: var(--gold-dim); }

/* ===== REWARDS DASHBOARD ===== */
.rewards-dashboard { margin-bottom: 40px; }
.rewards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.reward-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; display: flex; flex-direction: column;
}
.reward-label { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 8px; }
.reward-value { font-family: var(--font-mono); font-size: 1.4rem; font-weight: 700; color: var(--gold); }

/* ===== MINT ELIGIBILITY ===== */
.mint-eligibility { margin-bottom: 20px; }
.eligibility-status {
  padding: 16px; background: var(--bg); border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.eligibility-ok { border-color: rgba(39,174,96,0.3); background: rgba(39,174,96,0.05); }
.eligibility-fail { border-color: rgba(231,76,60,0.3); background: rgba(231,76,60,0.05); }
.eligibility-status .check-icon { color: var(--green); font-weight: 700; }
.eligibility-status .fail-icon { color: var(--red); font-weight: 700; }

/* ===== TOAST ===== */
.toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(100px);
  background: var(--bg-card); border: 1px solid var(--gold-dim); color: var(--text);
  padding: 14px 28px; border-radius: var(--radius); font-size: 0.88rem;
  box-shadow: var(--shadow-gold); z-index: 3000;
  opacity: 0; transition: all 0.4s ease; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .hero-content { grid-template-columns: 1fr; text-align: center; }
  .hero-desc { margin: 0 auto 32px; }
  .hero-stats { justify-content: center; }
  .hero-actions { justify-content: center; }
  .hero-visual { margin-top: 40px; }
  .about-book-grid { grid-template-columns: 1fr; }
  .book-preview-stack { height: 360px; display: flex; gap: 12px; }
  .preview-card { position: relative; top: auto !important; left: auto !important; transform: none !important; }
  .preview-card img { width: 160px; }
  .author-grid { grid-template-columns: 1fr; }
  .author-portrait { max-width: 300px; margin: 0 auto; }
  .mint-panel, .mint-panel.has-preview { grid-template-columns: 1fr; max-width: 560px; }
  .modal-body { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .nav-links { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--border); flex-direction: column; padding: 20px 24px; gap: 16px; }
  .nav-links.open { display: flex; }
  .nav-links a.nav-active::after { display: none; }
  .nav-hamburger { display: flex; }
  .hero-stats { flex-wrap: wrap; gap: 20px; }
  .hero-actions { flex-direction: column; align-items: center; }
  .nft-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .market-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .book-preview-stack { flex-wrap: wrap; height: auto; }
  .chapters-grid { grid-template-columns: 1fr; }
  .collection-stats-bar { gap: 20px; flex-wrap: wrap; }
  .page-hero { padding: 100px 0 40px; }
}

/* ===== LOADING SKELETON ===== */
.img-skeleton {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(110deg, var(--bg-card) 30%, var(--bg-card-hover) 50%, var(--bg-card) 70%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

.nft-img-state {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.78rem;
  background: rgba(13, 15, 19, 0.72);
}

.nft-img-state.is-loading span:last-child {
  color: var(--text);
}

.nft-img-state.is-error {
  color: var(--gold);
  background: rgba(13, 15, 19, 0.88);
}

.loading-spinner-sm {
  width: 24px;
  height: 24px;
  border-width: 2px;
}

.modal-image {
  position: relative;
  min-height: min(70vh, 560px);
}

.modal-image .modal-img-state {
  position: absolute;
  inset: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.modal-image img {
  opacity: 0;
  transition: opacity 0.25s ease;
}

.modal-image img.is-loaded {
  opacity: 1;
}
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.loading-spinner {
  width: 40px; height: 40px; margin: 0 auto;
  border: 3px solid var(--border-light);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spinner-rotate 0.8s linear infinite;
}
@keyframes spinner-rotate {
  to { transform: rotate(360deg); }
}

/* ===== ENHANCED MINT PROGRESS ===== */
.mint-progress-lg { margin-top: 16px; }
.progress-stats {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px;
}
.progress-label {
  font-size: 0.85rem; font-weight: 600; color: var(--text); letter-spacing: 0.5px;
}
.progress-pct {
  font-family: var(--font-mono); font-size: 1rem; font-weight: 700; color: var(--gold);
}
.progress-bar-lg {
  height: 12px !important; border-radius: 6px !important;
  background: var(--bg-surface) !important; border: 1px solid var(--border) !important;
}
.progress-bar-lg .progress-fill {
  height: 100%; border-radius: 5px;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold), var(--gold-light)) !important;
  transition: width 0.6s ease;
  box-shadow: 0 0 8px rgba(200,164,78,0.4);
}

/* relative positioning for skeleton in image containers */
.nft-card-img, .market-card-thumb, .my-nft-card-img {
  position: relative; overflow: hidden;
}
