/* ==============================
   兜兜の成长日记 - Doudou's Diary
   ============================== */

/* ===== CSS Variables - Two Themes ===== */
:root {
  /* 浅色主题 */
  --bg-light: #eeeeee;
  --surface-light: #ffffff;
  --surface-hover-light: #f3f2f0;
  --border-light: #e0dcd7;
  --text-light: #2a2825;
  --text-secondary-light: #78736a;
  --text-tertiary-light: #a5a097;
  --accent-light: #e8a86c;
  --accent-hover-light: #d8985c;
  --accent-subtle-light: rgba(232, 168, 108, 0.12);
  --soft-light: rgba(232, 168, 108, 0.06);
  --timeline-line-light: #e8e4de;

  /* 深色主题 */
  --bg-dark: #121110;
  --surface-dark: #1c1b19;
  --surface-hover-dark: #252422;
  --border-dark: #2a2926;
  --text-dark: #f0efec;
  --text-secondary-dark: #a5a097;
  --text-tertiary-dark: #6a655e;
  --accent-dark: #f0b87c;
  --accent-hover-dark: #f8c88c;
  --accent-subtle-dark: rgba(240, 184, 124, 0.14);
  --soft-dark: rgba(240, 184, 124, 0.06);
  --timeline-line-dark: #2a2926;

  /* 共用 */
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm-light: 0 2px 10px rgba(42, 40, 37, 0.06);
  --shadow-light: 0 4px 20px rgba(42, 40, 37, 0.08);
  --shadow-lg-light: 0 8px 32px rgba(42, 40, 37, 0.12);
  --shadow-sm-dark: 0 2px 10px rgba(0, 0, 0, 0.35);
  --shadow-dark: 0 4px 20px rgba(0, 0, 0, 0.45);
  --shadow-lg-dark: 0 8px 32px rgba(0, 0, 0, 0.55);
  --transition: all 0.3s ease;
}

/* ===== Light Theme ===== */
[data-theme="light"] {
  --bg: var(--bg-light);
  --surface: var(--surface-light);
  --surface-hover: var(--surface-hover-light);
  --border: var(--border-light);
  --text: var(--text-light);
  --text-secondary: var(--text-secondary-light);
  --text-tertiary: var(--text-tertiary-light);
  --accent: var(--accent-light);
  --accent-hover: var(--accent-hover-light);
  --accent-subtle: var(--accent-subtle-light);
  --soft: var(--soft-light);
  --timeline-line: var(--timeline-line-light);
  --shadow-sm: var(--shadow-sm-light);
  --shadow: var(--shadow-light);
  --shadow-lg: var(--shadow-lg-light);
}

/* ===== Dark Theme (Default) ===== */
[data-theme="dark"] {
  --bg: var(--bg-dark);
  --surface: var(--surface-dark);
  --surface-hover: var(--surface-hover-dark);
  --border: var(--border-dark);
  --text: var(--text-dark);
  --text-secondary: var(--text-secondary-dark);
  --text-tertiary: var(--text-tertiary-dark);
  --accent: var(--accent-dark);
  --accent-hover: var(--accent-hover-dark);
  --accent-subtle: var(--accent-subtle-dark);
  --soft: var(--soft-dark);
  --timeline-line: var(--timeline-line-dark);
  --shadow-sm: var(--shadow-sm-dark);
  --shadow: var(--shadow-dark);
  --shadow-lg: var(--shadow-lg-dark);
}

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

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Noto Serif SC', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', serif;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
}

::selection {
  background: var(--accent-subtle);
  color: var(--text);
}

::-webkit-scrollbar {
  width: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

/* ===== Layout ===== */
.container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 32px;
}

.section {
  padding: 88px 0;
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 8px;
  font-family: 'Noto Sans SC', sans-serif;
}

.section-title {
  font-family: 'Noto Serif SC', serif;
  font-size: 28px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: 0.06em;
}

/* ===== Loading & Empty ===== */
.loading, .empty-tip, .error-tip {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-tertiary);
  font-size: 14px;
}

.loading i, .error-tip i {
  font-size: 32px;
  margin-bottom: 8px;
  display: block;
}

.error-tip {
  color: #e07060;
}

/* ===== Header ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: transparent;
  padding: 18px 0;
  transition: var(--transition);
}

.header.scrolled {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  font-size: 26px;
  line-height: 1;
}

.logo-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.logo-cn {
  font-family: 'Noto Serif SC', serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.12em;
}

.logo-en {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-tertiary);
  letter-spacing: 0.12em;
  font-family: 'Noto Sans SC', sans-serif;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
}

.nav-link {
  font-size: 13.5px;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
  font-family: 'Noto Sans SC', sans-serif;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: var(--transition);
  border-radius: 99px;
}

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

.nav-link:hover::after {
  width: 100%;
}

.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: var(--accent-subtle);
  color: var(--accent);
  border-color: var(--accent);
}

/* ===== Hero Section ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 80px;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 100px 0 80px;
}

.hero-text {
  animation: fadeInUp 1s ease both;
}

.hero-subtitle {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 16px;
  font-family: 'Noto Sans SC', sans-serif;
}

.hero-title {
  font-family: 'Noto Serif SC', serif;
  font-size: 44px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: 0.18em;
  margin-bottom: 14px;
}

.hero-desc {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 32px;
  letter-spacing: 0.02em;
  font-family: 'Noto Sans SC', sans-serif;
}

.hero-stats {
  display: flex;
  gap: 48px;
  justify-content: center;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-number {
  font-family: 'Noto Serif SC', serif;
  font-size: 32px;
  font-weight: 600;
  color: var(--accent);
  line-height: 1;
}

.stat-label {
  font-size: 12px;
  color: var(--text-tertiary);
  letter-spacing: 0.06em;
  font-family: 'Noto Sans SC', sans-serif;
}

.scroll-hint {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  animation: bounce 2s infinite;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.scroll-hint i {
  font-size: 22px;
  color: var(--text-tertiary);
}

.scroll-hint span {
  font-size: 11px;
  color: var(--text-tertiary);
  letter-spacing: 0.06em;
  font-family: 'Noto Sans SC', sans-serif;
}

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

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

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

/* ===== Timeline Section ===== */
.timeline {
  background: var(--surface);
}

.timeline-list {
  max-width: 760px;
  margin: 0 auto;
  position: relative;
}

.timeline-list::before {
  content: '';
  position: absolute;
  left: 60px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--timeline-line);
}

.timeline-item {
  display: flex;
  gap: 24px;
  margin-bottom: 40px;
  position: relative;
  animation: fadeInUp 0.4s ease both;
}

.timeline-date {
  width: 70px;
  flex-shrink: 0;
  font-family: 'Noto Serif SC', serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  text-align: right;
  padding-top: 2px;
}

.timeline-content {
  flex: 1;
  padding-left: 30px;
  position: relative;
}

.timeline-content::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 8px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--soft);
}

.timeline-photos {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.photo-placeholder {
  width: 120px;
  height: 120px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
}

.photo-placeholder:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  border-color: rgba(232, 168, 108, 0.35);
}

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

.timeline-text {
  font-size: 14.5px;
  color: var(--text);
  line-height: 1.9;
}

.load-more {
  text-align: center;
  margin-top: 24px;
}

.btn {
  display: inline-block;
  padding: 11px 32px;
  border-radius: 99px;
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: var(--transition);
  cursor: pointer;
  border: none;
  font-family: 'Noto Sans SC', sans-serif;
}

.btn.secondary {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn.secondary:hover {
  background: var(--accent-subtle);
  transform: translateY(-2px);
}

/* ===== About Section ===== */
.about {
  background: var(--bg);
}

.about-card {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 48px;
  max-width: 800px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 44px;
  box-shadow: var(--shadow-sm);
  align-items: center;
}

.about-left {
  display: flex;
  align-items: center;
  justify-content: center;
}

.about-avatar {
  width: 160px;
  height: 160px;
  background: linear-gradient(135deg, var(--accent-subtle) 0%, var(--soft) 100%);
  border: 2px solid var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(232, 168, 108, 0.2);
  overflow: hidden;
}

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

.about-avatar-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.about-avatar-placeholder i {
  font-size: 72px;
  color: var(--accent);
}

.about-name {
  font-family: 'Noto Serif SC', serif;
  font-size: 26px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  letter-spacing: 0.08em;
}

.about-breed {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  font-family: 'Noto Sans SC', sans-serif;
}

.about-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Noto Sans SC', sans-serif;
}

.info-label i {
  color: var(--accent);
  font-size: 15px;
}

.info-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.about-quote {
  font-family: 'Noto Serif SC', serif;
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.9;
  padding: 16px 20px;
  background: var(--bg);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ===== Footer ===== */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 48px 0 28px;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-logo .logo-icon {
  font-size: 24px;
}

.footer-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  align-items: center;
}

.footer-cn {
  font-family: 'Noto Serif SC', serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.12em;
}

.footer-en {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary);
  letter-spacing: 0.08em;
  font-family: 'Noto Sans SC', sans-serif;
}

.footer-desc {
  font-size: 14px;
  color: var(--text-secondary);
}

.footer-bottom {
  text-align: center;
}

.footer-bottom p {
  font-size: 12.5px;
  color: var(--text-tertiary);
  letter-spacing: 0.04em;
  font-family: 'Noto Sans SC', sans-serif;
}

/* ===== Photo Preview ===== */
.photo-preview {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 10, 10, 0.92);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 32px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.photo-preview.show {
  display: flex;
  animation: fadeIn 0.2s ease;
}

.preview-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
}

.preview-close {
  position: absolute;
  top: -52px;
  right: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  z-index: 10;
}

.preview-close:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.preview-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 56px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: rgba(255, 255, 255, 0.75);
  font-size: 24px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  z-index: 10;
}

.preview-nav:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.preview-nav.prev { left: -58px; }
.preview-nav.next { right: -58px; }

.preview-image {
  max-width: 100%;
  max-height: 85vh;
  border-radius: var(--radius);
  display: block;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

.preview-index {
  position: absolute;
  bottom: -32px;
  left: 0;
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
  font-family: 'Noto Sans SC', sans-serif;
}

/* ===== Responsive ===== */
@media (max-width: 960px) {
  .container { padding: 0 24px; }
  .section { padding: 72px 0; }
  .about-card { grid-template-columns: 1fr; gap: 32px; }
  .about-avatar { width: 140px; height: 140px; }
  .about-avatar i { font-size: 60px; }
  .hero-title { font-size: 36px; }
  .nav-links .nav-link { display: none; }
  .timeline-list::before { left: 50px; }
  .timeline-date { width: 60px; }
  .photo-placeholder { width: 100px; height: 100px; }
  .preview-nav.prev { left: -46px; }
  .preview-nav.next { right: -46px; }
}

@media (max-width: 640px) {
  .section-title { font-size: 24px; }
  .hero-title { font-size: 28px; }
  .hero-desc { font-size: 14px; }
  .hero-stats { gap: 32px; }
  .about-card { padding: 28px 24px; }
  .about-avatar { width: 120px; height: 120px; }
  .about-avatar i { font-size: 52px; }
  .timeline-list::before { left: 42px; }
  .timeline-date { width: 52px; font-size: 13px; }
  .timeline-content { padding-left: 24px; }
  .photo-placeholder { width: 86px; height: 86px; }
  .preview-nav { display: none; }
}
