/* ========================================
   明亮 AI 实验室 - 设计系统
   ======================================== */

/* === 颜色变量 === */
:root {
  /* 中性色 */
  --color-bg: #ffffff;                  /* 主背景：纯白 */
  --color-bg-soft: #fafafa;             /* 次背景：极浅灰 */
  --color-bg-card: #ffffff;             /* 卡片背景 */
  --color-fg: #0a0a0f;                  /* 主文字：近黑 */
  --color-fg-soft: #4a4a55;             /* 次文字：深灰 */
  --color-fg-mute: #8a8a95;             /* 弱文字 */
  --color-border: #e8e8ee;              /* 边框 */
  --color-border-soft: #f0f0f4;         /* 浅边框 */

  /* 渐变（点缀色）— 青蓝 → 紫 */
  --gradient-primary: linear-gradient(135deg, #00d4ff 0%, #5b47e0 100%);
  --gradient-primary-hover: linear-gradient(135deg, #00c4e8 0%, #4a37c8 100%);
  --gradient-accent: linear-gradient(135deg, #ff6bcb 0%, #5b47e0 100%);

  /* 语义色 */
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-error: #ef4444;

  /* 阴影 */
  --shadow-sm: 0 1px 2px rgba(10, 10, 15, 0.04);
  --shadow-md: 0 4px 12px rgba(10, 10, 15, 0.06);
  --shadow-lg: 0 12px 40px rgba(10, 10, 15, 0.08);
  --shadow-xl: 0 24px 60px rgba(10, 10, 15, 0.12);

  /* 字体 */
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
               "Segoe UI", "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", "Monaco", "Cascadia Code", "Courier New", monospace;

  /* 字号 */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.5rem;
  --text-5xl: 3.5rem;

  /* 间距 */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* 圆角 */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* 容器 */
  --container-max: 1200px;
  --container-padding: var(--space-6);

  /* 动画 */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;

  /* z-index */
  --z-base: 1;
  --z-nav: 100;
  --z-modal: 1000;
  --z-toast: 1100;
}

/* === 重置 === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-fg);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, video {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

button {
  font-family: inherit;
  font-size: inherit;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

::selection {
  background: rgba(91, 71, 224, 0.2);
  color: var(--color-fg);
}

/* === 容器 === */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

/* === 顶部导航 === */
.nav {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--color-border-soft);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo {
  font-weight: 700;
  font-size: var(--text-lg);
  letter-spacing: -0.02em;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-links {
  display: flex;
  gap: var(--space-8);
  align-items: center;
}

.nav-link {
  font-size: var(--text-sm);
  color: var(--color-fg-soft);
  transition: color var(--duration-fast) var(--ease-out);
}

.nav-link:hover {
  color: var(--color-fg);
}

.nav-lang-toggle {
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.nav-lang-toggle:hover {
  border-color: var(--color-fg);
  color: var(--color-fg);
}

/* === Hero 区 === */
.hero {
  padding: var(--space-24) 0 var(--space-20);
  text-align: center;
}

.hero-eyebrow {
  display: inline-block;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--color-bg-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-6);
  color: var(--color-fg-soft);
}

.hero-title {
  font-size: var(--text-5xl);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin-bottom: var(--space-6);
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.hero-title .gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: var(--text-lg);
  color: var(--color-fg-soft);
  max-width: 640px;
  margin: 0 auto var(--space-10);
  line-height: 1.6;
}

.hero-cta {
  display: inline-flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-base);
  font-weight: 500;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  background: var(--gradient-primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background: var(--color-bg);
  color: var(--color-fg);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  border-color: var(--color-fg);
  background: var(--color-bg-soft);
}

/* === 作品筛选区 === */
.works {
  padding: var(--space-16) 0;
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-12);
}

.section-title {
  font-size: var(--text-3xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-3);
}

.section-desc {
  color: var(--color-fg-soft);
  max-width: 600px;
  margin: 0 auto;
}

.works-filter {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
  margin-bottom: var(--space-10);
}

.filter-btn {
  padding: var(--space-2) var(--space-5);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-fg-soft);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.filter-btn:hover {
  border-color: var(--color-fg-soft);
  color: var(--color-fg);
}

.filter-btn.active {
  background: var(--color-fg);
  color: var(--color-bg);
  border-color: var(--color-fg);
}

.works-search {
  max-width: 400px;
  margin: 0 auto var(--space-12);
  position: relative;
}

.works-search input {
  width: 100%;
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-base);
  background: var(--color-bg-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  outline: none;
  transition: all var(--duration-fast) var(--ease-out);
}

.works-search input:focus {
  border-color: var(--color-fg);
  background: var(--color-bg);
}

/* === 作品列表 === */
.works-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-10);
}

.work-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
  align-items: center;
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  transition: all var(--duration-normal) var(--ease-out);
  cursor: pointer;
}

.work-card:hover {
  background: var(--color-bg-soft);
}

.work-card:hover .work-thumb img {
  transform: scale(1.04);
}

.work-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--color-bg-soft);
}

.work-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-slow) var(--ease-out);
  /* 懒加载：未加载前占位灰色 */
  background: linear-gradient(90deg, #f0f0f4 0%, #e8e8ee 50%, #f0f0f4 100%);
  background-size: 200% 100%;
}

.work-thumb img[data-loaded="false"] {
  /* shimmer 动效 */
  animation: shimmer 1.5s infinite linear;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.work-thumb::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-out);
  pointer-events: none;
}

.work-thumb::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-40%, -50%);
  width: 0;
  height: 0;
  border-left: 14px solid #0a0a0f;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  z-index: 2;
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-out);
}

.work-card:hover .work-thumb::after,
.work-card:hover .work-thumb::before {
  opacity: 1;
}

.work-content {
  padding: var(--space-2);
}

.work-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.work-tag {
  font-size: var(--text-xs);
  color: var(--color-fg-soft);
  background: var(--color-bg-soft);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
}

.work-title {
  font-size: var(--text-2xl);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-3);
  line-height: 1.3;
}

.work-desc {
  font-size: var(--text-base);
  color: var(--color-fg-soft);
  margin-bottom: var(--space-4);
  line-height: 1.6;
}

.work-meta {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-fg-mute);
}

.work-meta a {
  color: var(--color-fg);
  font-weight: 500;
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
}

/* 作品为空提示 */
.works-empty {
  text-align: center;
  padding: var(--space-20) var(--space-4);
  color: var(--color-fg-mute);
}

/* === 联系区 === */
.contact {
  padding: var(--space-20) 0;
  background: var(--color-bg-soft);
  text-align: center;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-12);
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.contact-card {
  padding: var(--space-6);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  transition: all var(--duration-fast) var(--ease-out);
  cursor: pointer;
}

.contact-card:hover {
  border-color: var(--color-fg);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.contact-card-label {
  font-size: var(--text-xs);
  color: var(--color-fg-mute);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-2);
}

.contact-card-value {
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--color-fg);
  word-break: break-all;
}

/* === 页脚 === */
.footer {
  padding: var(--space-10) 0;
  text-align: center;
  border-top: 1px solid var(--color-border-soft);
  color: var(--color-fg-mute);
  font-size: var(--text-sm);
}

/* === 弹窗（播放器） === */
.modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal.is-open {
  display: flex;
  animation: fadeIn var(--duration-normal) var(--ease-out);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-close {
  position: absolute;
  top: var(--space-6);
  right: var(--space-6);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: white;
  font-size: var(--text-xl);
  z-index: 2;
  transition: all var(--duration-fast) var(--ease-out);
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.05);
}

.modal-content {
  width: 100%;
  max-width: 960px;
  max-height: 90vh;
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: slideUp var(--duration-normal) var(--ease-out);
}

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

.modal-player {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: black;
  position: relative;
}

.modal-player video,
.modal-player iframe {
  width: 100%;
  height: 100%;
  display: block;
}

.modal-info {
  padding: var(--space-8);
}

.modal-title {
  font-size: var(--text-2xl);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-4);
}

.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.modal-desc {
  color: var(--color-fg-soft);
  line-height: 1.7;
  margin-bottom: var(--space-6);
}

.modal-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-sm);
  color: var(--color-fg-mute);
}

.modal-external {
  color: var(--color-fg);
  font-weight: 500;
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
}

/* === 时间线（按事件数量自动 1 / 2 / 3 竖） === */
.timeline {
  padding: var(--space-16) 0;
}

.timeline-list {
  margin: 0 auto;
  max-width: 720px;
  padding: 0 var(--space-4);
}

/* 5 个以上事件 → 自动 2 列 */
.timeline-list.timeline-2cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-10);
  max-width: 880px;
}

/* 10 个以上事件 → 自动 3 列 */
.timeline-list.timeline-3cols {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--space-8);
  max-width: 1200px;
}

/* === 单个时间线 item：左侧时间 · 右侧简短文字 === */
.timeline-item {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: var(--space-5);
  align-items: baseline;
  padding: var(--space-4) 0;
}

/* 当前 item 和下一个 item 之间的连线（左侧细线） */
.timeline-item::before {
  content: '';
  position: absolute;
  left: 78px;       /* 对齐 80px 日期列右边 */
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--color-border);
}

/* 列表底部无需线 */
.timeline-list .timeline-item:last-child::before {
  display: none;
}

.timeline-date {
  text-align: right;
  font-size: var(--text-sm);
  color: var(--color-fg-mute);
  font-weight: 500;
  letter-spacing: 0;
  white-space: nowrap;
  position: relative;
  z-index: 1;
  background: var(--color-bg);  /* 盖住下方的连线，让"日期"看起来是独立的浮动元素 */
  padding-right: var(--space-1);
}

.timeline-content {
  position: relative;
  padding-left: var(--space-6);
}

/* 一个小的渐变小方块，作为"事件节点"标记 */
.timeline-content::before {
  content: '';
  position: absolute;
  left: -3px;
  top: 0.7em;
  width: 6px;
  height: 6px;
  background: var(--gradient-primary);
  border-radius: 2px;
  transform: rotate(45deg);   /* 小菱形 */
  box-shadow: 0 0 0 4px var(--color-bg);   /* 白色描边，隔开与连线 */
}

.timeline-title {
  font-weight: 500;
  font-size: var(--text-base);
  letter-spacing: -0.01em;
  margin-bottom: 0;
  color: var(--color-fg);
  line-height: 1.5;
}

.timeline-text {
  color: var(--color-fg-soft);
  font-size: var(--text-sm);
  line-height: 1.6;
  margin-top: var(--space-1);
}

/* === "日程式"输出一行：标题 + 描述拼成一句 === */
.timeline-line {
  font-size: var(--text-base);
  line-height: 1.5;
  letter-spacing: -0.005em;
  margin: 0;
}

.timeline-line .timeline-event {
  color: var(--color-fg);
  font-weight: 500;
}

.timeline-line .timeline-text-inline {
  color: var(--color-fg-soft);
  font-weight: 400;
}

