/* ==========================================================================
   时作晓浅 · 广播剧编剧作品集 (Split Gallery Portfolio)
   基于西泠印社设计系统规范 (Editorial Minimalist - Light Mode Only)
   左右两栏画廊格局：左作者档案 / 右剧作画廊
   ========================================================================== */

:root {
  /* Brand Voltage */
  --primary: #e94709;           /* 西泠朱砂红 */
  --primary-active: #c83b06;
  --primary-subtle: rgba(233, 71, 9, 0.06);
  --on-primary: #ffffff;

  /* Editorial Light Canvas */
  --canvas: #f7f7f4;            /* 暖色奶油底/宣纸白 */
  --canvas-soft: #fafaf7;
  --surface-card: #ffffff;
  --surface-card-hover: #fcfcfb;
  --surface-raised: #f2f1ec;
  --ink: #26251e;               /* 深色墨水字 */
  --body: #5a5852;              /* 正文灰 */
  --body-strong: #26251e;
  --muted: #807d72;
  --muted-soft: #a09c92;
  --hairline: #e6e5e0;
  --hairline-soft: #efeee8;
  --hairline-strong: #cfcdc4;

  /* Shadows */
  --shadow-subtle: 0 2px 10px -1px rgba(38, 37, 30, 0.04);
  --shadow-hover: 0 8px 24px -2px rgba(38, 37, 30, 0.06);

  /* Typography */
  --font-serif: "Noto Serif SC", "Songti SC", "Source Han Serif SC", STSong, serif;
  --font-sans: "PingFang SC", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", monospace;

  /* Radii */
  --radius-xs: 3px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-pill: 9999px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--canvas);
  color: var(--body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ==========================================================================
   左右两栏主布局 (Split Portfolio Layout)
   ========================================================================== */
.portfolio-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* ==========================================================================
   左栏：作者档案与特质 (Sidebar Dossier)
   ========================================================================== */
.sidebar-dossier {
  width: 400px;
  min-width: 360px;
  max-width: 440px;
  position: sticky;
  top: 0;
  background-color: var(--canvas);
  border-right: 1px solid var(--hairline);
  overflow: visible;
  flex-shrink: 0;
}

.dossier-inner {
  padding: 44px 36px 36px 36px;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.dossier-header {
  position: relative;
  z-index: 1;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--hairline);
}

.brand-seal-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.seal-icon {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.dossier-tag {
  font-family: var(--font-serif);
  font-size: 13px;
  color: var(--primary);
  letter-spacing: 0.5px;
}

.author-name {
  font-family: var(--font-serif);
  font-size: 34px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.15;
  letter-spacing: -0.3px;
  margin-bottom: 4px;
}

.author-alias {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 18px;
}

.author-quote {
  font-family: var(--font-serif);
  font-size: 15px;
  color: var(--body-strong);
  line-height: 1.6;
  padding-left: 14px;
  border-left: 2.5px solid var(--primary);
  font-style: italic;
}

/* 左栏内容段落 */
.dossier-section {
  position: relative;
  z-index: 1;
  margin-bottom: 30px;
}

.section-title-dossier {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 14px;
}

.seal-mini {
  width: 14px;
  height: 14px;
  object-fit: contain;
}

/* 紧凑资历数据网格 */
.stats-compact-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.stat-pill {
  background-color: var(--surface-card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
}

.stat-num {
  font-family: var(--font-mono);
  font-size: 19px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
}

.stat-text {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.35;
  margin-top: 2px;
}

/* 创作特质清单 */
.dossier-pillars-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pillar-item {
  background-color: var(--surface-card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.pillar-strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 13.5px;
  color: var(--ink);
  margin-bottom: 4px;
}

.pillar-desc {
  font-size: 12px;
  color: var(--body);
  line-height: 1.55;
}

/* 左栏底部联系方式 */
.dossier-footer {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding-top: 24px;
  border-top: 1px solid var(--hairline);
}

.contact-card-simple {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background-color: var(--surface-card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 14px;
}

.contact-item {
  display: flex;
  align-items: center;
  font-size: 12.5px;
  gap: 8px;
  cursor: pointer;
}

.contact-key {
  color: var(--muted);
  width: 32px;
  font-size: 11.5px;
}

.contact-val {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink);
  font-weight: 600;
  background-color: var(--canvas-soft);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--hairline-strong);
}

.contact-tip {
  font-size: 11px;
  color: var(--primary);
  margin-left: auto;
}

.contact-link {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink);
  text-decoration: none;
}

.contact-link:hover {
  color: var(--primary);
}

.dossier-colophon {
  font-size: 11px;
  color: var(--muted-soft);
  line-height: 1.4;
}

/* ==========================================================================
   右栏：剧作画廊 (Gallery Main)
   ========================================================================== */
.gallery-main {
  flex: 1;
  min-width: 0;
  background-color: var(--canvas-soft);
  padding: 44px 52px;
}

.gallery-container {
  max-width: 980px;
  margin: 0 auto;
}

/* 顶部画廊分类栏 */
.gallery-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--hairline);
  flex-wrap: wrap;
  gap: 16px;
}

.gallery-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--primary);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.gallery-heading {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.2;
}

.gallery-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.gallery-tab {
  background-color: var(--surface-card);
  color: var(--body);
  border: 1px solid var(--hairline-strong);
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.gallery-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.gallery-tab.active {
  background-color: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}

/* 画廊卡片堆叠流 */
.gallery-cards-stack {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.gallery-item-card {
  background-color: var(--surface-card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-subtle);
  display: grid;
  grid-template-columns: 240px 1fr;
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.gallery-item-card:hover {
  border-color: var(--hairline-strong);
  box-shadow: var(--shadow-hover);
}

/* 海报侧 */
.gallery-poster-col {
  background-color: var(--canvas-soft);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.poster-box {
  width: 100%;
  height: 320px;
  position: relative;
  overflow: hidden;
}

.poster-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.gallery-item-card:hover .poster-img {
  transform: scale(1.02);
}

.poster-gradient {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 100%);
  pointer-events: none;
}

.poster-platform-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background-color: rgba(20, 20, 24, 0.85);
  backdrop-filter: blur(4px);
  color: #ffffff;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.poster-cast-info {
  position: absolute;
  bottom: 10px;
  left: 12px;
  right: 12px;
  color: #ffffff;
}

.cast-lbl {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 2px;
}

.cast-val {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
}

/* 详情侧 */
.gallery-detail-col {
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.detail-top-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 6px;
}

.detail-category-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
}

.detail-role-pill {
  font-size: 12px;
  color: var(--primary);
  background-color: var(--primary-subtle);
  border: 1px solid rgba(233, 71, 9, 0.3);
  padding: 2px 8px;
  border-radius: var(--radius-xs);
}

.detail-work-title {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.25;
  margin-bottom: 8px;
}

.detail-spec-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--hairline-soft);
}

.detail-spec-line strong {
  color: var(--ink);
  font-weight: 600;
}

/* 结构化分季布局（睡前小甜饼等多季单元剧） */
.detail-spec-seasons {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.spec-author-line {
  margin-bottom: 2px;
}

.spec-seasons-grid {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.spec-season-row {
  display: grid;
  grid-template-columns: 82px 1fr;
  align-items: baseline;
  font-size: 12px;
  line-height: 1.55;
}

.spec-season-label {
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

.spec-season-val {
  color: var(--ink);
  font-weight: 500;
}

/* 解题手记三段论 */
.dossier-note-box {
  background-color: var(--canvas-soft);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 16px;
}

.note-row {
  display: grid;
  grid-template-columns: 74px 1fr;
  font-size: 12.5px;
  line-height: 1.55;
  margin-bottom: 6px;
}

.note-row:last-child {
  margin-bottom: 0;
}

.note-key {
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 5px;
}

.note-key::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background-color: var(--primary);
}

.note-val {
  color: var(--body);
}

/* 标签行 */
.detail-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.gallery-tag-pill {
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background-color: var(--canvas);
  border: 1px solid var(--hairline-strong);
  color: var(--muted);
}

/* 分割线中嵌文字折叠触控栏 (桌面端隐藏，900px以下移动端显示) */
.dossier-divider-toggle {
  display: none;
  align-items: center;
  width: 100%;
  margin: 16px 0 0 0;
  cursor: pointer;
  user-select: none;
  background: transparent;
  border: none;
  padding: 6px 0;
}

.divider-line {
  flex: 1;
  height: 1px;
  background-color: var(--hairline-strong);
  transition: background-color var(--transition-fast);
}

.divider-text {
  padding: 0 14px;
  font-size: 12px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  letter-spacing: 0.3px;
  white-space: nowrap;
  transition: color var(--transition-fast);
}

.dossier-divider-toggle:hover .divider-text,
.dossier-divider-toggle.active .divider-text {
  color: var(--primary);
}

.dossier-divider-toggle:hover .divider-line,
.dossier-divider-toggle.active .divider-line {
  background-color: rgba(233, 71, 9, 0.4);
}

.toggle-btn-icon {
  font-size: 10px;
  transition: transform 0.25s ease;
}

.dossier-divider-toggle.active .toggle-btn-icon {
  transform: rotate(180deg);
}

/* 桌面端默认展开状态 */
.dossier-collapsible {
  display: block;
}

/* Toast */
.toast-notice {
  position: fixed;
  bottom: 24px;
  right: 28px;
  background-color: var(--ink);
  color: var(--canvas);
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition-normal);
}

.toast-notice.show {
  opacity: 1;
}

/* ==========================================================================
   全局唯一定制断点: 900px
   > 900px: 经典左右分栏画廊，左栏全展，右栏流式，绝无局部滚动条
   ≤ 900px: 单栏流式，左栏默认折叠为顶部名片条，点击分割线展开
   ========================================================================== */
@media (max-width: 900px) {
  .portfolio-layout {
    flex-direction: column;
  }

  .sidebar-dossier {
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    height: auto !important;
    position: relative;
    border-right: none;
    border-bottom: 1px solid var(--hairline);
    overflow: visible !important;
  }

  .dossier-inner {
    padding: 22px 20px 16px 20px;
  }

  .dossier-header {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
  }

  .author-name {
    font-size: 28px;
  }

  .author-alias {
    font-size: 12px;
    margin-bottom: 8px;
  }

  .author-quote {
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 12px;
    padding-left: 10px;
  }

  /* 移动端展示分割线折叠栏 */
  .dossier-divider-toggle {
    display: flex;
  }

  /* 移动端默认收拢折叠，无内部滚动条，随页面流式自然流动 */
  .dossier-collapsible {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.25s ease, margin-top 0.25s ease;
    margin-top: 0;
  }

  .dossier-collapsible.expanded {
    max-height: 2400px;
    opacity: 1;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed var(--hairline-strong);
  }

  .gallery-main {
    padding: 24px 16px;
  }

  .gallery-toolbar {
    margin-bottom: 20px;
    padding-bottom: 14px;
  }

  .gallery-heading {
    font-size: 22px;
  }

  .gallery-item-card {
    grid-template-columns: 1fr;
  }

  .poster-box {
    height: 280px;
  }

  .gallery-detail-col {
    padding: 20px 18px;
  }
}
