/* ==========================================================================
   《百年孤独》布恩迪亚家族图谱与导读系统 - 核心主样式表 (main.css)
   支持明暗双主题、响应式跨端适配与典雅拉美魔幻现实主义美学
   ========================================================================== */

:root {
  /* 官方素材包调色体系 (Source of Truth Palette) */
  --bg-deep: #0B1F1A;
  --bg-deep-2: #102E26;
  --panel-green: #1F3D36;
  --paper: #D4C29A;
  --paper-light: #E7D8B3;
  --gold: #C9A961;
  --gold-light: #D8C89F;
  --earth: #8B6F47;
  --text-dark: #3B2F21;
  --text-light: #EDE6D6;
  --muted: #AAA69B;

  --bg-primary: #0B1F1A;
  --bg-canvas: #061411;
  --bg-surface: #102E26;
  --bg-card: #E7D8B3;
  --border-color: rgba(201, 169, 97, 0.35);
  --border-gold: #C9A961;
  --border-hover: #D8C89F;
  --text-primary: #EDE6D6;
  --text-secondary: #AAA69B;
  --text-muted: #857A68;
  --accent-gold: #C9A961;
  --accent-gold-hover: #D8C89F;
  --accent-gold-bg: rgba(201, 169, 97, 0.15);
  --accent-gold-border: rgba(201, 169, 97, 0.4);

  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 14px 34px rgba(0, 0, 0, 0.7);
  --shadow-gold: 0 0 24px rgba(201, 169, 97, 0.45);
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --radius-full: 9999px;
  --font-serif: "Cormorant Garamond", "Cinzel", "Noto Serif SC", Georgia, serif;
  --font-body: "Cormorant Garamond", "Noto Serif SC", -apple-system, BlinkMacSystemFont, serif;
  --font-family: var(--font-body);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-deep);
  color: var(--text-light);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  user-select: none;
  -webkit-user-select: none;
}

/* 顶部导航栏 - 透明暗绿 + 细致哑光金排印 (64-76px 高度) */
.app-header {
  height: 70px;
  background: rgba(6, 20, 17, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(201, 169, 97, 0.28);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: rgba(16, 46, 38, 0.6);
  border: 1px solid rgba(201, 169, 97, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--gold);
}

.brand-title-wrap h1 {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 700;
  color: var(--text-light);
  letter-spacing: 0.8px;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.15;
}

.brand-title-wrap p {
  font-family: var(--font-body);
  font-size: 10.5px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0.85;
  margin-top: 2px;
}

.badge-sub {
  font-family: var(--font-serif);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  background-color: rgba(201, 169, 97, 0.15);
  color: var(--gold);
  border: 1px solid rgba(201, 169, 97, 0.35);
}

/* Tab 切换组 - 文学典雅风格 (纯文字 + 细金下划线) */
.nav-tabs-group {
  display: flex;
  align-items: center;
  gap: 18px;
}

.nav-tab-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 8px 12px;
  font-family: var(--font-serif);
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
  transition: all 0.25s ease;
}

.nav-tab-btn:hover {
  color: var(--text-light);
}

.nav-tab-btn.active {
  color: var(--gold);
  font-weight: 700;
}

.nav-tab-btn.active::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 12px;
  right: 12px;
  height: 2px;
  background: var(--gold);
  box-shadow: 0 0 8px rgba(201, 169, 97, 0.5);
}

/* 顶部操作区 (暗绿半透搜索框 + 三点菜单) */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.header-search-icon {
  position: absolute;
  left: 10px;
  font-size: 13px;
  color: var(--gold);
  opacity: 0.7;
  pointer-events: none;
}

.header-search-input {
  width: 170px;
  height: 34px;
  padding: 0 12px 0 32px;
  background: rgba(16, 46, 38, 0.55);
  border: 1px solid rgba(201, 169, 97, 0.4);
  border-radius: var(--radius-sm);
  color: var(--text-light);
  font-family: var(--font-serif);
  font-size: 12.5px;
  outline: none;
  transition: all 0.25s ease;
}

.header-search-input::placeholder {
  color: rgba(201, 169, 97, 0.55);
  font-style: italic;
}

.header-search-input:focus {
  width: 220px;
  background: rgba(16, 46, 38, 0.85);
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(201, 169, 97, 0.3);
}

.global-search-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  width: 280px;
  background: rgba(11, 31, 26, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(201, 169, 97, 0.45);
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.75), 0 0 16px rgba(201, 169, 97, 0.2);
  z-index: 100;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.global-search-dropdown.hidden {
  display: none !important;
}

.search-drop-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid rgba(201, 169, 97, 0.15);
  transition: background 0.2s ease;
}

.search-drop-item:last-child {
  border-bottom: none;
}

.search-drop-item:hover {
  background: rgba(31, 61, 54, 0.65);
}

.search-drop-avatar {
  width: 34px;
  height: 34px;
  border-radius: 2px;
  object-fit: cover;
  border: 1px solid rgba(201, 169, 97, 0.4);
  flex-shrink: 0;
}

.search-drop-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.search-drop-name {
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-drop-es {
  font-size: 10.5px;
  color: var(--gold);
  font-style: italic;
  font-weight: normal;
  margin-left: 4px;
}

.search-drop-role {
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.btn-three-dots {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: rgba(16, 46, 38, 0.55);
  border: 1px solid rgba(201, 169, 97, 0.4);
  color: var(--gold);
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-three-dots:hover {
  background: rgba(31, 61, 54, 0.85);
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(201, 169, 97, 0.3);
}

/* 魔幻现实主义氛围装饰层 (黄蝴蝶缓慢轻舞 + 黄花细雨) */
.macondo-magic-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 2;
}

.magic-butterfly {
  position: absolute;
  width: 18px;
  height: 18px;
  background: url('../assets/cien-anos/decorative_assets.png') no-repeat;
  background-size: 240px 180px;
  background-position: -8px -8px; /* 映射素材图中的黄蝴蝶 */
  filter: drop-shadow(0 2px 6px rgba(201, 169, 97, 0.6));
  opacity: 0.85;
}

.magic-butterfly.b1 {
  top: 18%;
  left: 12%;
  animation: butterflyFly1 22s infinite ease-in-out;
}

.magic-butterfly.b2 {
  top: 55%;
  right: 15%;
  transform: scale(0.85);
  animation: butterflyFly2 26s infinite ease-in-out 3s;
}

.magic-butterfly.b3 {
  top: 75%;
  left: 28%;
  transform: scale(0.7);
  animation: butterflyFly3 28s infinite ease-in-out 7s;
}

@keyframes butterflyFly1 {
  0% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(60px, -40px) rotate(12deg); }
  50% { transform: translate(120px, 10px) rotate(-8deg); }
  75% { transform: translate(40px, 30px) rotate(10deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

@keyframes butterflyFly2 {
  0% { transform: translate(0, 0) rotate(0deg) scale(0.85); }
  30% { transform: translate(-80px, 30px) rotate(-15deg) scale(0.85); }
  60% { transform: translate(-140px, -20px) rotate(10deg) scale(0.85); }
  100% { transform: translate(0, 0) rotate(0deg) scale(0.85); }
}

@keyframes butterflyFly3 {
  0% { transform: translate(0, 0) rotate(0deg) scale(0.7); }
  40% { transform: translate(90px, -50px) rotate(18deg) scale(0.7); }
  80% { transform: translate(30px, 20px) rotate(-12deg) scale(0.7); }
  100% { transform: translate(0, 0) rotate(0deg) scale(0.7); }
}

.magic-petal {
  position: absolute;
  width: 9px;
  height: 9px;
  background: #f1b834;
  border-radius: 50% 0 50% 0;
  opacity: 0.65;
  filter: blur(0.5px);
  animation: petalFall 18s linear infinite;
}

.magic-petal.p1 { left: 22%; top: -20px; animation-duration: 16s; animation-delay: 0s; }
.magic-petal.p2 { left: 45%; top: -20px; animation-duration: 20s; animation-delay: 4s; }
.magic-petal.p3 { left: 68%; top: -20px; animation-duration: 24s; animation-delay: 2s; }
.magic-petal.p4 { left: 82%; top: -20px; animation-duration: 18s; animation-delay: 8s; }
.magic-petal.p5 { left: 35%; top: -20px; animation-duration: 22s; animation-delay: 6s; }

@keyframes petalFall {
  0% { transform: translateY(0) rotate(0deg) translateX(0); opacity: 0; }
  15% { opacity: 0.75; }
  85% { opacity: 0.75; }
  100% { transform: translateY(110vh) rotate(360deg) translateX(80px); opacity: 0; }
}

.btn-three-dots:hover {
  background: rgba(31, 61, 54, 0.85);
  border-color: var(--gold);
  color: var(--gold);
  transform: translateY(-1px);
}

.header-more-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 190px;
  background: rgba(11, 31, 26, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(201, 169, 97, 0.4);
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.75), 0 0 14px rgba(201, 169, 97, 0.2);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  z-index: 1000;
  animation: dropdownIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.more-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-light);
  font-size: 13px;
  font-family: var(--font-serif);
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
  width: 100%;
}

.more-menu-item:hover {
  background: rgba(31, 61, 54, 0.65);
  color: var(--gold);
}

.menu-item-icon {
  font-size: 14px;
}

/* 反馈弹窗体系 */
.feedback-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 16px calc(16px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.feedback-modal.hidden {
  display: none !important;
}

.feedback-dialog {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  box-shadow: var(--shadow-lg), 0 0 30px rgba(0, 0, 0, 0.3);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  animation: modalPopIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPopIn {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.feedback-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
}

.feedback-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.feedback-header-title h3 {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
}

.feedback-dialog-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.feedback-dialog-close:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.feedback-form {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.feedback-tip {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

.form-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.required-star {
  color: #ef4444;
}

.feedback-type-pills {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.type-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.type-pill input {
  display: none;
}

.type-pill.active {
  border-color: var(--accent-gold);
  background: var(--accent-gold-bg);
  color: var(--accent-gold);
}

.feedback-textarea,
.feedback-input {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text-primary);
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.feedback-textarea:focus,
.feedback-input:focus {
  outline: none;
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

.feedback-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

.btn-feedback-cancel {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-feedback-cancel:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.btn-feedback-submit {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border: none;
  color: #ffffff;
  padding: 8px 20px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
  transition: all 0.2s;
}

.btn-feedback-submit:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.feedback-admin-bar {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-color);
  text-align: center;
}

.feedback-admin-trigger {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 11.5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.feedback-admin-trigger:hover {
  color: var(--accent-gold);
  background: var(--accent-gold-bg);
}

/* 反馈后台弹窗 */
.feedback-admin-dialog {
  max-width: 600px;
  max-height: 85vh;
}

.admin-count-badge {
  font-size: 11px;
  font-weight: 700;
  background: var(--accent-gold-bg);
  color: var(--accent-gold);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.feedback-admin-body {
  padding: 14px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
  flex: 1;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

.admin-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.admin-filter-pill {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s;
}

.admin-filter-pill.active {
  background: var(--accent-gold);
  border-color: var(--accent-gold);
  color: #fff;
}

.admin-actions {
  display: flex;
  gap: 6px;
}

.btn-admin-sm {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-admin-sm:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

.btn-admin-danger:hover {
  border-color: #ef4444;
  color: #ef4444;
}

.feedback-admin-list {
  overflow-y: auto;
  max-height: 55vh;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 4px;
}

.admin-feedback-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s;
}

.admin-feedback-card:hover {
  border-color: var(--accent-gold);
  box-shadow: var(--shadow-sm);
}

.admin-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}

.admin-card-tags {
  display: flex;
  align-items: center;
  gap: 6px;
}

.admin-type-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  background: var(--accent-gold-bg);
  color: var(--accent-gold);
}

.admin-platform-tag {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.admin-card-time {
  color: var(--text-muted);
  font-size: 11px;
}

.admin-card-contact {
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--bg-card);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border-left: 2px solid var(--accent-gold);
}

.admin-card-content {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.admin-empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 13px;
}

/* 主内容视图容器 */
.main-content {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.view-panel {
  display: none;
  flex: 1;
  flex-direction: column;
  overflow-y: auto;
}

.view-panel.active {
  display: flex;
}

/* 导读面板与名录通用布局 */
.content-container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 16px 60px;
}

/* 导读面板头部书籍卡片 */
.guide-book-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  md-flex-direction: row;
  gap: 24px;
  box-shadow: var(--shadow-md);
  margin-bottom: 32px;
}

@media (min-width: 768px) {
  .guide-book-card {
    flex-direction: row;
    align-items: flex-start;
  }
}

.guide-cover-wrap {
  width: 100%;
  max-width: 240px;
  aspect-ratio: 3/4;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  flex-shrink: 0;
  margin: 0 auto;
}

.guide-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.guide-cover-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  color: #f59e0b;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.guide-meta-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.guide-title {
  font-size: 26px;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1.2;
}

.guide-original-title {
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 2px;
}

.guide-author-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
}

.guide-author-bio {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
  line-height: 1.4;
}

.guide-themes-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.theme-tag {
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--accent-gold-bg);
  color: var(--accent-gold);
  border: 1px solid var(--accent-gold-border);
}

.guide-summary-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.guide-bg-box {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background-color: var(--bg-subtle);
  border-left: 3px solid var(--accent-gold);
}

.guide-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.guide-tag {
  font-size: 11px;
  color: var(--text-muted);
}

/* 七代兴衰时间轴 */
.section-heading-box {
  margin-bottom: 20px;
}

.section-title {
  font-size: 20px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
}

.section-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.timeline-wrap {
  display: flex;
  flex-direction: column;
  position: relative;
  margin-bottom: 40px;
}

.timeline-item {
  display: flex;
  gap: 16px;
  position: relative;
}

.timeline-dot-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 36px;
  flex-shrink: 0;
}

.timeline-dot {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 2px solid var(--accent-gold);
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.25);
  z-index: 2;
}

.timeline-line {
  flex: 1;
  width: 2px;
  background-color: var(--border-color);
  margin: 4px 0;
}

.timeline-item:last-child .timeline-line {
  display: none;
}

.timeline-card {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.timeline-header {
  margin-bottom: 8px;
}

.timeline-stage-pill {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--accent-gold);
  text-transform: uppercase;
}

.timeline-stage-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 2px;
}

.timeline-summary {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 10px;
}

.timeline-elements {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.timeline-chip {
  font-size: 11px;
  padding: 2px 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--text-muted);
}

/* 经典语录流 */
.quotes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.quote-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, border-color 0.2s;
}

.quote-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
}

.quote-symbol {
  font-size: 36px;
  color: var(--accent-gold);
  line-height: 1;
  font-family: Georgia, serif;
  margin-bottom: 4px;
}

.quote-text {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text-primary);
  font-style: italic;
  margin-bottom: 14px;
}

.quote-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-color);
  padding-top: 10px;
}

.quote-tag {
  font-size: 11px;
  color: var(--text-muted);
}

.quote-author-btn {
  background: transparent;
  border: none;
  color: var(--accent-gold);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.quote-author-btn:hover {
  text-decoration: underline;
}

/* 人物名录与检索 */
#panel-roster {
  background-color: var(--bg-deep);
  background-image: 
    linear-gradient(180deg, rgba(6, 20, 17, 0.85) 0%, rgba(6, 20, 17, 0.95) 100%),
    url('../assets/cien-anos/bg_macondo.png');
  background-size: cover;
  background-position: center center;
  background-attachment: fixed;
  padding-bottom: 60px;
}

.roster-toolbar {
  background: rgba(16, 46, 38, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(201, 169, 97, 0.35);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.search-input-wrap {
  position: relative;
  width: 100%;
}

.search-input-wrap span {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gold);
  font-size: 14px;
  opacity: 0.8;
}

.search-input {
  width: 100%;
  padding: 11px 14px 11px 40px;
  background-color: rgba(11, 31, 26, 0.85);
  border: 1px solid rgba(201, 169, 97, 0.4);
  border-radius: var(--radius-sm);
  color: var(--text-light);
  font-family: var(--font-serif);
  font-size: 13.5px;
  outline: none;
  transition: all 0.25s ease;
}

.search-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(201, 169, 97, 0.35);
  background-color: rgba(16, 46, 38, 0.95);
}

.gen-filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.gen-filter-btn {
  background-color: #1f1913;
  border: 1px solid #4a3c2c;
  color: #c2b299;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s;
}

.gen-filter-btn:hover {
  color: #ede3d2;
  border-color: #e5c17b;
}

.gen-filter-btn.active {
  background-color: var(--accent-gold);
  color: #1b130a;
  border-color: var(--accent-gold);
  font-weight: 700;
}

.roster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
}

.roster-card {
  background-color: var(--paper-light);
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.6) 0%, transparent 60%),
    url('../assets/cien-anos/parchment_texture.png'),
    linear-gradient(180deg, #eae0cd 0%, #d8c6a0 100%);
  background-size: cover, cover, auto;
  border: 1px solid rgba(139, 111, 71, 0.45);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  position: relative;
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.55),
    0 2px 6px rgba(0, 0, 0, 0.35),
    inset 0 0 16px rgba(181, 147, 90, 0.22);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s, border-color 0.22s;
}

.roster-card:hover {
  transform: translateY(-5px);
  box-shadow: 
    0 16px 36px rgba(0, 0, 0, 0.7),
    0 0 20px rgba(201, 169, 97, 0.45);
  border-color: var(--gold);
}

.roster-card-photo-wrap {
  width: 100%;
  height: 290px;
  position: relative;
  flex-shrink: 0;
  background: #18130e;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid #d4c2a3;
}

.roster-card-photo {
  width: 100%;
  height: 100%;
  object-fit: contain; /* 完整显示，绝不切割裁剪 */
  display: block;
  transition: transform 0.25s ease;
}

.roster-card:hover .roster-card-photo {
  transform: scale(1.025);
}

.roster-card-content {
  padding: 16px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.roster-gen-pill-below {
  display: inline-block;
  align-self: flex-start;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: #ece0ce;
  color: #785022;
  border: 1px solid #c4ad8b;
  margin-bottom: 2px;
}

.roster-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.roster-card-name {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  color: #2b1d0e;
  line-height: 1.25;
}

.roster-card-es {
  font-family: var(--font-body);
  font-size: 12px;
  color: #8c7356;
  font-style: italic;
}

.roster-card-role {
  font-size: 12.5px;
  color: #925c27;
  font-weight: 600;
}

.roster-card-desc {
  font-size: 12.5px;
  color: #4a3b2c;
  line-height: 1.55;
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==========================================================================
   马孔多历史变迁画廊卡片 (Macondo Era Gallery Cards)
   ========================================================================== */
.macondo-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.macondo-era-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s, border-color 0.22s;
}

.macondo-era-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.45);
  border-color: var(--accent-gold);
}

.macondo-era-photo-wrap {
  width: 100%;
  height: 230px;
  background: #0f0d0b;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border-color);
}

.macondo-era-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.macondo-era-card:hover .macondo-era-photo {
  transform: scale(1.05);
}

.macondo-era-body {
  padding: 18px 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.macondo-era-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: var(--radius-full);
  background: rgba(245, 158, 11, 0.14);
  color: var(--accent-gold);
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.macondo-era-title {
  font-size: 16.5px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.3;
}

.macondo-era-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Toast 提示 */
.sync-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-card);
  border: 1px solid var(--accent-gold);
  color: var(--text-primary);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  z-index: 99;
  animation: toastIn 0.3s ease;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.toast-fadeout {
  opacity: 0;
  transform: translateY(12px);
  transition: all 0.3s ease;
}

/* 通用隐藏类 */
.hidden {
  display: none !important;
}

/* 响应式优化 */
@media (max-width: 768px) {
  .app-header {
    flex-wrap: wrap;
    padding-top: calc(8px + env(safe-area-inset-top, 24px));
    padding-left: calc(12px + env(safe-area-inset-left, 0px));
    padding-right: calc(12px + env(safe-area-inset-right, 0px));
    padding-bottom: 8px;
  }
  .nav-tabs-group {
    order: 3;
    width: 100%;
    justify-content: space-between;
    overflow-x: auto;
  }
  .nav-tab-btn {
    padding: 5px 8px;
    font-size: 12px;
    flex: 1;
    justify-content: center;
  }
  .brand-title-wrap h1 {
    font-size: 14.5px;
  }
  .status-pill {
    padding: 3px 6px;
    font-size: 10px;
  }
}
