/* ==========================================================
   Notion / Substack 智性人文刊物风格系统 (Editorial Aesthetic)
   特点：温润米白纸张底色 (#fbfbfa)、优雅衬线体标题、高对比度阅读层级、
   细微石质边框 (#e9e9e7)、克制极简复选勾选、折叠大纲与痛点设问
   ========================================================== */

:root {
  --font-serif: "Songti SC", "Source Han Serif SC", "Noto Serif SC", STSong, "Times New Roman", Georgia, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "PingFang SC", "Hiragino Sans GB", "Segoe UI", sans-serif;
  --bg-page: #fbfbfa;
  --card-bg: #ffffff;
  --border-color: #e9e9e7;
  --border-hover: #d3d1cb;
  --text-main: #2f3437;
  --text-muted: #787774;
  --text-light: #9b9a97;
  --callout-bg: #f7f6f3;
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

[v-cloak] {
  display: none !important;
}

/* 顶部极细深黑高光流动线 (Top Loading Line) */
.top-loading-line {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2.5px;
  z-index: 9999;
  background: #ecebe8;
  overflow: hidden;
  pointer-events: none;
}
.top-loading-line::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 40%;
  background: linear-gradient(90deg, transparent, #2f3437 50%, transparent);
  animation: top-line-slide 1.2s infinite cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes top-line-slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

/* 骨架屏高光扫光流动动画 (Skeleton Shimmer) - 黑色高光与柔光交织流动 */
.skeleton-shimmer {
  position: relative;
  overflow: hidden;
  background-color: #ecebe8;
  border-radius: 6px;
}
.skeleton-shimmer::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.55) 28%,
    rgba(35, 39, 46, 0.14) 50%,
    rgba(255, 255, 255, 0.55) 72%,
    transparent 100%
  );
  animation: shimmer-sweep 1.4s infinite cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes shimmer-sweep {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* 容器防溢出与自然换行规则 (杜绝非预期省略号截断) */
.break-words {
  overflow-wrap: break-word !important;
  word-break: break-word !important;
  white-space: normal !important;
}

.skeleton-pill {
  border-radius: 9999px !important;
}

/* 全局统一 Notion 风格表单选择器重置 (杜绝系统默认灰色方框与粗笨箭头) */
select.appearance-none {
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  background-image: none !important;
}
select.appearance-none::-ms-expand {
  display: none !important;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-main);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 优雅衬线字体辅助类 */
.font-serif {
  font-family: var(--font-serif);
}

/* 隐藏滚动条 */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

/* 被加载出来的社课卡片流光入场动效 (Card Streamer & Shimmer Entrance) */
@keyframes card-streamer-sweep {
  0% {
    transform: translateX(-150%) skewX(-20deg);
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  85% {
    opacity: 1;
  }
  100% {
    transform: translateX(250%) skewX(-20deg);
    opacity: 0;
  }
}

@keyframes card-fade-slide-up {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Notion 风格卡片 */
.notion-card {
  position: relative;
  overflow: hidden;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(15, 15, 15, 0.03), 0 2px 6px rgba(15, 15, 15, 0.02);
  transition: transform 0.22s var(--ease-spring), box-shadow 0.22s var(--ease-spring), border-color 0.22s var(--ease-spring);
  contain: layout style;
  cursor: pointer;
  user-select: none;
  animation: card-fade-slide-up 0.4s var(--ease-spring) backwards;
  animation-delay: calc(var(--card-index, 0) * 0.07s);
}

/* 课程被加载呈现时，表面自然掠过一道深黑与高光交织的优雅流光 */
.notion-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 65%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.5) 40%,
    rgba(47, 52, 55, 0.06) 50%,
    rgba(255, 255, 255, 0.5) 60%,
    transparent 100%
  );
  transform: translateX(-150%) skewX(-20deg);
  pointer-events: none;
  z-index: 20;
  animation: card-streamer-sweep 1.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  animation-delay: calc(var(--card-index, 0) * 0.1s + 0.12s);
}

.notion-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 4px 14px -2px rgba(15, 15, 15, 0.06), 0 1px 3px rgba(15, 15, 15, 0.03);
  transform: translateY(-1px);
}

.notion-card:hover::after {
  animation: card-streamer-sweep 1.1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.notion-card.is-selected {
  border-color: #2f3437;
  background: #ffffff;
  box-shadow: 0 0 0 1px #2f3437, 0 6px 20px -4px rgba(47, 52, 55, 0.12);
}

/* 折叠展开层手风琴动画 */
.amie-accordion-body {
  display: grid;
  grid-template-rows: 0fr;
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  transition: grid-template-rows 0.3s var(--ease-spring), opacity 0.2s ease, visibility 0.3s;
}

.amie-accordion-body.is-open {
  grid-template-rows: 1fr;
  visibility: visible;
  opacity: 1;
}

.amie-accordion-inner {
  min-height: 0;
  overflow: hidden;
}

/* 居中极简浮动岛底栏 (Notion Charcoal Dock) */
.notion-island-dock {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 12px 8px 18px;
  background: rgba(35, 39, 46, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #fbfbfa;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.32), 0 0 0 1px rgba(0, 0, 0, 0.2);
  transition: all 0.3s var(--ease-spring);
  max-width: 92vw;
}

/* 按钮微交互 */
.notion-action-btn {
  border: 1px solid var(--border-color);
  background: #ffffff;
  transition: all 0.15s ease;
}

.notion-action-btn:hover {
  background: #f7f6f3;
  border-color: var(--border-hover);
}

/* 弹窗与移动端抽屉 (Modal & Bottom Sheet) */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 15, 15, 0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  animation: fadeIn 0.18s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  animation: scaleUp 0.2s var(--ease-spring);
}

@keyframes scaleUp {
  from {
    transform: scale(0.97);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.modal-sheet-handle {
  display: none;
  width: 36px;
  height: 4px;
  border-radius: 9999px;
  background: #e9e9e7;
  margin: 0 auto 14px auto;
}

/* ── 投票成功后的社课群邀请卡片 ──
   二维码跟着烟花的节奏弹出来：先放大过冲一下、再回弹落定 */
.group-qr-wrap {
  position: relative;
  width: 10.5rem;
  margin: 0 auto;
  animation: qrPop 0.62s var(--ease-spring) both;
}

.group-qr-img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  border-radius: 14px;
  border: 1px solid #e9e9e7;
  background: #fff;
  box-shadow: 0 8px 26px rgba(47, 52, 55, 0.12);
}

/* 二维码背后缓慢呼吸的彩色光晕，和烟花同色系 */
.group-qr-glow {
  position: absolute;
  inset: -16px;
  border-radius: 26px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.22), rgba(236, 72, 153, 0.15) 46%, transparent 72%);
  animation: qrGlow 2.6s ease-in-out infinite;
}

.group-title {
  animation: qrTextIn 0.5s ease-out both;
  animation-delay: 0.18s;
}

.group-desc {
  animation: qrTextIn 0.5s ease-out both;
  animation-delay: 0.28s;
}

/* 识别不出来时的兜底入口：低调的文字链接，不抢主按钮的注意力 */
.group-save-link {
  display: block;
  margin-top: 12px;
  font-size: 11px;
  color: #9b9a97;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
  animation: qrTextIn 0.5s ease-out both;
  animation-delay: 0.38s;
}

.group-save-link:hover {
  color: #2f3437;
}

/* 进群操作指引 */
.group-hint {
  background: #f7f6f3;
  border: 1px solid #e9e9e7;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 11px;
  line-height: 1.7;
  color: #787774;
  text-align: left;
  margin-bottom: 14px;
  animation: qrTextIn 0.5s ease-out both;
  animation-delay: 0.34s;
}

@keyframes qrPop {
  0%   { transform: scale(0.55) translateY(22px); opacity: 0; }
  62%  { transform: scale(1.05) translateY(-3px); opacity: 1; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

@keyframes qrGlow {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50%      { opacity: 1;    transform: scale(1.07); }
}

@keyframes qrTextIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 移动端专享优化 */
@media (max-width: 640px) {
  input, select, textarea {
    font-size: 16px !important;
  }

  .notion-island-dock {
    bottom: calc(14px + env(safe-area-inset-bottom, 0px)) !important;
    width: calc(100% - 32px) !important;
    max-width: 400px !important;
    justify-content: space-between !important;
    padding: 8px 12px 8px 16px !important;
    gap: 8px !important;
  }

  .modal-overlay {
    align-items: flex-end !important;
    padding: 0 !important;
  }

  .modal-content {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 24px 24px 0 0 !important;
    border-bottom: none !important;
    border-left: none !important;
    border-right: none !important;
    max-height: 88vh !important;
    padding: 1.25rem 1.25rem calc(1.75rem + env(safe-area-inset-bottom, 0px)) !important;
    animation: slideUpSheet 0.28s var(--ease-spring) !important;
    box-shadow: 0 -12px 36px rgba(0, 0, 0, 0.12) !important;
  }

  .modal-sheet-handle {
    display: block;
  }
}

@keyframes slideUpSheet {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

/* Toast 提示 */
.amie-toast {
  animation: toastIn 0.28s var(--ease-spring) both;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translate(-50%, -16px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}
