/* ==========================================================================
   《百年孤独》布恩迪亚家族图谱 - 人物生平档案侧滑抽屉样式 (drawer.css)
   ========================================================================== */

/* 侧滑人物抽屉 (Slide Drawer) */
.character-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 460px;
  background-color: var(--bg-card);
  border-left: 1px solid var(--border-color);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.5);
  z-index: 50;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.character-drawer.drawer-open {
  transform: translateX(0);
}

/* 抽屉头部 */
.drawer-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(90deg, var(--accent-gold-bg), transparent);
  flex-shrink: 0;
}

.drawer-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.drawer-close-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}

.drawer-close-btn:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--accent-gold);
}

/* 抽屉内部滚动区域 */
.drawer-body-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* 人物形象头部卡片 */
.drawer-header-card {
  display: flex;
  gap: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.drawer-portrait-wrap {
  width: 88px;
  height: 88px;
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 2.5px solid var(--accent-gold);
  position: relative;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
  background: #000;
}

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

.drawer-portrait-badge {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.85);
  color: #f59e0b;
  font-size: 8px;
  font-weight: 900;
  text-align: center;
  padding: 1px 0;
  letter-spacing: 0.5px;
}

.drawer-info-block {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.drawer-gen-pill {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--accent-gold);
  text-transform: uppercase;
}

.drawer-char-name {
  font-size: 18px;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1.25;
  margin-top: 2px;
}

.drawer-char-es {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 4px;
}

.drawer-char-role {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.drawer-actor-tag {
  font-size: 11px;
  color: var(--accent-gold);
  margin-top: 4px;
}

/* 抽屉分块标题与内容卡 */
.drawer-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drawer-section-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.drawer-quote-box {
  background: var(--bg-surface);
  border-left: 3px solid var(--accent-gold);
  padding: 12px 14px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 13px;
  font-style: italic;
  color: var(--text-primary);
  line-height: 1.6;
}

.drawer-fate-box {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid var(--accent-gold-border);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 12.5px;
  color: var(--text-primary);
  line-height: 1.6;
  display: flex;
  gap: 8px;
}

.drawer-prose-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.drawer-events-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drawer-event-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-secondary);
}

.drawer-event-index {
  color: var(--accent-gold);
  font-weight: 800;
  font-size: 11px;
  flex-shrink: 0;
  margin-top: 1px;
}

.drawer-event-text {
  flex: 1;
}

.drawer-symbols-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 12.5px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.drawer-rel-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.drawer-rel-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.drawer-rel-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

.drawer-rel-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.drawer-rel-chip {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s;
}

.drawer-rel-chip:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  transform: translateY(-1px);
}

/* 抽屉遮罩层 */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
  z-index: 45;
  transition: opacity 0.3s;
}

.drawer-backdrop.hidden {
  display: none;
}

/* 移动端抽屉全屏适配 */
@media (max-width: 640px) {
  .character-drawer {
    max-width: 100%;
  }
}
