/* 通用组件：导航/容器/hero/区块标题/卡片/视频卡片/搜索栏/页面标题区 */
/* 顶部导航：吸顶固定，滚动时始终可见 */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-primary);
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: center;
}

/* 导航栏 - 胶囊形 黑边框 右下阴影 左中右三栏 */
.nav-container {
  width: 100%;
  max-width: 900px;
  margin: 1rem auto;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--bg-card);
  border: var(--border-black);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-offset);
}

/* 左侧品牌区：圆形头像 + PORTFOLIO 标识 */
.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.nav-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  object-fit: cover;
}

.nav-brand-text {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.nav-links {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.25rem;
}

.nav-link {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
}

.nav-link:hover {
  background: rgba(0,0,0,0.05);
}

.nav-link.active {
  background: #000;
  color: white !important;
}

/* 右侧简历按钮：空心圆角胶囊 + 斜向上箭头，背景色取头像四叶草绿 */
.nav-resume {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 1rem;
  border: none;
  background: #d4f8dfb8;
  border-radius: var(--radius-lg);
  font-size: 0.9rem;
  font-weight: 500;
  flex-shrink: 0;
  transition: all 0.2s;
}

.nav-resume:hover {
  background: #000;
  color: white;
}

/* 汉堡按钮：仅移动端显示，桌面端隐藏 */
.nav-toggle {
  display: none;
}
/* 主容器 */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* 单页布局：主内容区各 section 之间的垂直间距（hero 为首页首屏，不含在内） */
main > section.container {
  padding-top: 2.5rem;
  padding-bottom: 5rem;
}
/* Hero 区域 */
.hero {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1.5rem 5rem;
}

.hero-content {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 4rem;
  align-items: center;
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
}

/* Hero 问候标签 - 极简文字行 + 短横线前缀 */
.hero-greet {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: #888;
}

.hero-greet::before {
  content: "";
  width: 32px;
  height: 2px;
  background: #000;
}

.hero-greet .greet-zh { color: #555; letter-spacing: 0.2em; }

.hero-title {
  font-size: clamp(3rem, 7vw, 5.2rem);
  font-weight: 700;
  line-height: 1.08;
  margin-bottom: 0.4rem;
  letter-spacing: -0.01em;
}

.hero-title.hero-name {
  margin-bottom: 1rem;
}

.hero-role {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  margin-bottom: 1.2rem;
}

.hero-role .greet-zh { color: #555; letter-spacing: 0.1em; }

/* Hero 区域高亮 - 深色填充 + 黑色边框，无阴影，参考 Journal 设计 */
.hero-title .hero-highlight {
  padding: 0.08em 0.28em;
  border-radius: 0;
  display: inline-block;
  border: 3px solid #000;
  color: #000;
}

.hero-title .hero-highlight-pink {
  background: #e91e8c;
  color: white;
}

.hero-title .hero-highlight-blue {
  background: #2196f3;
  color: white;
}

/* 倾斜效果 - 用于 about 页欢迎区 */
.hero-title .hero-highlight-tilt {
  transform: rotate(-3deg);
  display: inline-block;
}

/* 右上倾斜 - 清柠一婷 */
.hero-title .hero-highlight-tilt-up {
  transform: rotate(2deg);
}

/* 右下倾斜 - 两年半 */
.hero-title .hero-highlight-tilt-down {
  transform: rotate(-2deg);
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 560px;
  margin-bottom: 2rem;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.1rem;
  background: #000;
  color: white !important;
  border: var(--border-black);
  border-radius: var(--radius-md);
  font-weight: 600;
  box-shadow: 3px 3px 0 0 rgba(0, 0, 0, 0.2);
  transition: all 0.2s;
}

.btn-primary:hover {
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 0 #000;
}

.hero-visual {
  display: flex;
  justify-content: flex-end;
}

/* Hero 肖像 - 拍立得横版：相纸白框 + 胶带 + 手写标注 + 轻微倾斜 */
.polaroid {
  position: relative;
  width: 440px;
  max-width: 100%;
  background: #fff;
  border: var(--border-black);
  border-radius: 6px;
  padding: 18px 18px 60px;
  box-shadow: 6px 6px 0 0 rgba(0, 0, 0, 0.9);
  transform: rotate(-3deg);
  transition: transform 0.25s;
}

.polaroid:hover {
  transform: rotate(0deg);
}

.polaroid img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border: 2px solid #000;
  border-radius: 3px;
  display: block;
  filter: saturate(0.95);
}

.polaroid .tape {
  position: absolute;
  width: 96px;
  height: 28px;
  background: rgba(255, 214, 90, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.15);
  transform: rotate(-6deg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.polaroid .tape.t1 { top: -14px; left: 34px; }
.polaroid .tape.t2 { top: -14px; right: 34px; transform: rotate(5deg); }

.polaroid .caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 20px;
  text-align: center;
  font-family: "Comic Sans MS", "PingFang SC", cursive;
  font-size: 1.05rem;
  font-weight: 600;
  color: #333;
}

/* Hero 图标区 - 胶囊标签一行排布，薄阴影（1px 实心黑） */
.hero-icons {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
}

.hero-icon-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  background: #fff;
  border: var(--border-black);
  color: #000;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 1px 1px 0 0 #000;
  white-space: nowrap;
  transition: all 0.15s;
}

.hero-icon-pill .ico {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.hero-icon-pill:hover {
  transform: translate(1px, 1px);
  box-shadow: 0 0 0 0 transparent;
}

.hero-icon-pill.hero-icon-xhs:hover { background: #ff2442; border-color: #ff2442; color: #fff; }
.hero-icon-pill.hero-icon-github:hover { background: #181717; border-color: #181717; color: #fff; }
.hero-icon-pill.hero-icon-mail:hover { background: #2196f3; border-color: #2196f3; color: #fff; }
.hero-icon-pill.hero-icon-resume:hover { background: #ffd700; }

/* 邮箱弹窗 */
.email-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99;
}

.email-modal.open {
  display: flex;
  align-items: center;
  justify-content: center;
}

.email-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}

.email-modal-card {
  position: relative;
  z-index: 1;
  background: #fff;
  border: var(--border-black);
  border-radius: var(--radius-lg);
  box-shadow: 6px 6px 0 0 #000;
  padding: 28px 32px;
  width: 320px;
  max-width: 90vw;
  text-align: center;
}

.email-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
}

.email-modal-card h3 {
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.email-modal-address {
  font-size: 1rem;
  color: #333;
  margin-bottom: 18px;
  word-break: break-all;
}

.email-modal-copy {
  display: inline-block;
  padding: 8px 18px;
  background: #000;
  color: #fff;
  border: 2px solid #000;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

/* 底部提示（固定视口底部，随屏自适应，滚动到底切换为回到顶部） */
.scroll-hint {
  position: fixed;
  left: 50%;
  bottom: 1.6rem;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #888;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.scroll-hint-arrow {
  display: inline-block;
  animation: scroll-hint-drop 1.6s ease-in-out infinite;
  font-size: 1.3rem;
  line-height: 1;
  color: #000;
}

/* 回到顶部状态：箭头改为向上浮动 */
.scroll-hint--top .scroll-hint-arrow {
  animation: scroll-hint-rise 1.6s ease-in-out infinite;
}

@keyframes scroll-hint-drop {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(8px); opacity: 0.4; }
}

@keyframes scroll-hint-rise {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(-8px); opacity: 0.4; }
}
/* 内容区块 - 增加区块间垂直间距 */
.section {
  padding: 3rem 0;
}

.section + .section {
  padding-top: 4rem;
}

/* 区块标题 */
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
}

.section-title .highlight {
  padding: 0.1em 0.3em;
  border-radius: 0;
  display: inline-block;
  border: 2px solid #000;
  position: relative;
  min-width: 7.5em;
  text-align: center;
}

/* 阴影块：用伪元素实现带黑色边框的右下偏移色块 */
.section-title .highlight::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 6px;
  right: -6px;
  bottom: -6px;
  border: 2px solid #000;
  border-radius: 0;
  z-index: -1;
}

/* Articles 标题 - 浅粉填充 + 深粉阴影块 + 黑色边框 */
.section-title .highlight-docs {
  background: #ffd6e8;
  color: #333;
}

.section-title .highlight-docs::after {
  background: #e91e8c;
}

/* Skills 标题 - 浅绿填充 + 荧光绿阴影块 */
.section-title .highlight-skills {
  background: #d4f4dd;
  color: #333;
}

.section-title .highlight-skills::after {
  background: #39FF14;
}

/* Videos 标题 - 浅蓝填充 + 深蓝阴影块 + 黑色边框 */
.section-title .highlight-videos {
  background: #d4edff;
  color: #333;
}

.section-title .highlight-videos::after {
  background: #5c9ecd;
}

/* 经历 标题 */
.section-title .highlight-experience {
  background: #e8f4fd;
  color: #333;
}

.section-title .highlight-experience::after {
  background: #4182f9;
}

/* Products 标题 - 浅黄填充 + 深黄阴影块 + 黑色边框 */
.section-title .highlight-works {
  background: #fff9c4;
  color: #333;
}

.section-title .highlight-works::after {
  background: #f9a825;
}

.section-link {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.section-link:hover {
  color: #000;
}
/* 文档/视频/作品卡片网格 - 统一尺寸 */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  align-items: stretch;
}

.cards-grid .card {
  display: flex;
  flex-direction: column;
  min-height: 300px;
}

.card {
  background: var(--bg-card);
  border: var(--border-black);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-offset);
  transition: all 0.2s;
}

.card:hover {
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 0 #000;
}

.card-image {
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
  flex-shrink: 0;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-image-placeholder {
  width: 100%;
  min-height: 140px;
  background: var(--accent-blue);
}

.card-image-placeholder-pink {
  background: #FFE5F1;
}

.card-image-placeholder-blue {
  background: #E5FDFF;
}

.card-image-placeholder-yellow {
  background: #FFFFE5;
}

.card-image-placeholder-green {
  background: #d4f4dd;
}

.card-body {
  padding: 1rem;
  flex: 1;
  min-height: 110px;
  display: flex;
  flex-direction: column;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.card-tag {
  padding: 0.2em 0.5em;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  color: white;
}

.card-tag.pink {
  background: var(--accent-pink);
}

.card-tag.blue {
  background: var(--accent-blue);
  color: #333;
}

.card-tag.orange {
  background: #ff4500;
}

.card-tag.yellow {
  background: #FFE135;
  color: #333;
}

.card-tag.green {
  background: #44c176;
  color: #fff;
}

.card-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.card-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.card-desc-clamp {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 视频卡片 */
.video-tag {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.2em 0.5em;
  background: var(--accent-pink);
  color: white;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
}

.video-duration {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
  padding: 0.2em 0.5em;
  background: rgba(0,0,0,0.7);
  color: white;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
}

.video-stats {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.video-stat {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.video-stat .icon-eye {
  color: #2196f3;
  flex-shrink: 0;
  vertical-align: middle;
}

.video-stat .icon-heart {
  color: #ff69b4;
  flex-shrink: 0;
  vertical-align: middle;
}

.video-share {
  margin-left: auto;
  width: 36px;
  height: 36px;
  background: var(--accent-yellow);
  border: var(--border-black);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 2px 2px 0 0 #000;
}

.video-meta {
  display: flex;
  align-items: center;
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(0, 0, 0, 0.15);
}
/* 搜索栏 */
.search-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: var(--border-black);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-offset);
  max-width: 400px;
  margin-bottom: 1.5rem;
}

.search-icon {
  display: inline-flex;
  color: #000;
  opacity: 0.9;
  line-height: 0;
}

.search-bar input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 0.95rem;
  outline: none;
}

.search-bar input::placeholder {
  color: var(--text-muted);
}
/* 页面标题区 */
.page-header {
  margin-bottom: 2rem;
}

.page-label {
  display: inline-block;
  background: #000;
  color: white;
  padding: 0.25em 0.6em;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  margin-bottom: 0.5rem;
}

.page-title {
  font-size: 2rem;
  font-weight: 700;
}

.page-title .highlight {
  background: var(--accent-green);
  padding: 0.1em 0.3em;
}

.page-title .highlight-blue {
  background: #4285f4;
  color: white;
  padding: 0.1em 0.3em;
  transform: rotate(-3deg);
  display: inline-block;
}

.page-title .highlight-yellow {
  background: var(--accent-yellow);
  padding: 0.1em 0.3em;
}

.page-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}
