码桶

发现社区成员的开源项目

CMR /

爱情苦海

公开
main
爱情苦海/css/style.css
style.css13.1 KB
/* ========================================
   aqkh.com — 爱情苦海 Base Styles
   ======================================== */

/* --- CSS Custom Properties (Default = Modern Minimal) --- */
:root {
  --bg-primary: #fafafa;
  --bg-hero-start: #fafafa;
  --bg-hero-end: #f0f4f8;
  --bg-interlude-start: #f0f4f8;
  --bg-interlude-mid: #dce4ef;
  --bg-interlude-end: #c8d6e5;
  --text-primary: #1a1a1a;
  --text-body: #333;
  --accent: #4a6fa5;
  --accent-light: #8b9dc3;
  --border: #e0e0e0;
  --font-cn: 'Noto Serif SC', serif;
  --font-en: 'Inter', sans-serif;
}

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

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

body {
  font-family: var(--font-en), var(--font-cn), sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.8;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.5s ease, color 0.5s ease;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Typography --- */
h1, h2, h3 {
  font-family: var(--font-cn);
  font-weight: 600;
}

/* --- Fade-in Animation --- */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========================================
   Theme Switcher
   ======================================== */
.theme-switcher {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 1000;
}

.theme-toggle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--bg-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  color: var(--text-primary);
}

.theme-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

.theme-panel {
  position: absolute;
  top: 56px;
  right: 0;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  min-width: 200px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.3s ease;
}

.theme-panel.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.theme-panel-title {
  font-family: var(--font-cn);
  font-size: 0.8rem;
  color: var(--accent-light);
  margin-bottom: 8px;
  padding: 0 8px;
  letter-spacing: 0.1em;
}

.theme-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: background-color 0.2s ease;
  color: var(--text-primary);
}

.theme-option:hover {
  background: var(--border);
}

.theme-option.active {
  background: var(--border);
}

.theme-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.theme-swatch::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  height: 100%;
}

.theme-swatch-dark {
  background: #0a0e17;
}
.theme-swatch-dark::after {
  background: #1a2744;
}

.theme-swatch-chinese {
  background: #f5efe0;
}
.theme-swatch-chinese::after {
  background: #c23a2b;
}

.theme-swatch-minimal {
  background: #fafafa;
}
.theme-swatch-minimal::after {
  background: #4a6fa5;
}

.theme-swatch-romantic {
  background: #fff5f2;
}
.theme-swatch-romantic::after {
  background: #d4728c;
}

.theme-option-label {
  display: flex;
  flex-direction: column;
}

.theme-option-name {
  font-family: var(--font-cn);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.3;
}

.theme-option-desc {
  font-family: var(--font-en);
  font-size: 0.7rem;
  color: var(--accent-light);
  font-weight: 300;
  line-height: 1.3;
}

/* ========================================
   Hero Section
   ======================================== */
.hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  background: linear-gradient(180deg, var(--bg-hero-start) 0%, var(--bg-hero-end) 100%);
  transition: background 0.5s ease;
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 0 24px;
}

.hero-title {
  font-family: var(--font-cn);
  font-size: clamp(3rem, 10vw, 6rem);
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--text-primary);
  margin-bottom: 24px;
  animation: titleFadeIn 1.5s ease forwards;
}

.hero-subtitle-cn {
  font-family: var(--font-cn);
  font-size: clamp(1rem, 3vw, 1.35rem);
  color: var(--accent);
  margin-bottom: 12px;
  opacity: 0;
  animation: subtitleFadeIn 1.5s ease 0.5s forwards;
}

.hero-subtitle-en {
  font-family: var(--font-en);
  font-size: clamp(0.85rem, 2vw, 1.05rem);
  font-weight: 300;
  color: var(--accent-light);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  opacity: 0;
  animation: subtitleFadeIn 1.5s ease 0.9s forwards;
}

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

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

/* --- Hero Waves --- */
.wave-container {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 180px;
  z-index: 1;
}

.wave {
  position: absolute;
  bottom: 0;
  left: -5%;
  width: 110%;
  height: 100%;
  background-repeat: repeat-x;
  background-size: 1000px 180px;
}

.wave-1 {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 180'%3E%3Cpath fill='%234a6fa520' d='M0,80 C250,140 350,0 500,80 C650,160 750,20 1000,80 L1000,180 L0,180Z'/%3E%3C/svg%3E");
  animation: waveMove 8s ease-in-out infinite;
}

.wave-2 {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 180'%3E%3Cpath fill='%238b9dc320' d='M0,100 C200,40 400,140 600,80 C800,20 900,120 1000,100 L1000,180 L0,180Z'/%3E%3C/svg%3E");
  animation: waveMove 10s ease-in-out infinite reverse;
}

.wave-3 {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 180'%3E%3Cpath fill='%234a6fa510' d='M0,120 C150,60 350,150 500,100 C650,50 850,130 1000,120 L1000,180 L0,180Z'/%3E%3C/svg%3E");
  animation: waveMove 12s ease-in-out infinite;
}

@keyframes waveMove {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(-40px); }
}

/* --- Scroll Indicator --- */
.scroll-indicator {
  position: absolute;
  bottom: 200px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0;
  animation: scrollIndicatorFadeIn 1.5s ease 1.5s forwards;
}

.scroll-text {
  font-family: var(--font-cn);
  font-size: 0.8rem;
  color: var(--accent-light);
  letter-spacing: 0.15em;
}

.scroll-arrow {
  width: 20px;
  height: 20px;
  border-right: 1.5px solid var(--accent-light);
  border-bottom: 1.5px solid var(--accent-light);
  transform: rotate(45deg);
  animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollIndicatorFadeIn {
  to { opacity: 1; }
}

@keyframes scrollBounce {
  0%, 100% { transform: rotate(45deg) translate(0, 0); }
  50% { transform: rotate(45deg) translate(5px, 5px); }
}

/* ========================================
   Philosophy Section
   ======================================== */
.philosophy {
  padding: 120px 0;
  background-color: var(--bg-primary);
  transition: background-color 0.5s ease;
}

.poem-lines {
  text-align: center;
}

.poem-line {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  line-height: 2;
  margin-bottom: 8px;
}

.poem-line:nth-child(odd) {
  font-family: var(--font-cn);
  color: var(--text-primary);
  font-size: clamp(1.15rem, 3vw, 1.45rem);
}

.poem-line:nth-child(even) {
  font-family: var(--font-en);
  font-weight: 300;
  color: var(--accent-light);
  font-size: clamp(0.85rem, 2vw, 1rem);
  font-style: italic;
  margin-bottom: 0;
}

.poem-divider {
  width: 40px;
  height: 1px;
  background-color: var(--border);
  margin: 40px auto;
}

/* ========================================
   Visual Interlude
   ======================================== */
.interlude {
  position: relative;
  height: 80vh;
  min-height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(180deg, var(--bg-interlude-start) 0%, var(--bg-interlude-mid) 50%, var(--bg-interlude-end) 100%);
  transition: background 0.5s ease;
}

.ocean {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 50%;
}

.ocean-wave {
  position: absolute;
  left: -5%;
  width: 110%;
  height: 100%;
  background-repeat: repeat-x;
}

.ocean-wave-1 {
  bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 200'%3E%3Cpath fill='%234a6fa530' d='M0,100 C300,20 400,160 600,100 C800,40 900,150 1200,100 L1200,200 L0,200Z'/%3E%3C/svg%3E");
  background-size: 1200px 200px;
  animation: oceanWave1 7s ease-in-out infinite;
}

.ocean-wave-2 {
  bottom: -10px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 200'%3E%3Cpath fill='%234a6fa540' d='M0,120 C200,60 500,160 700,100 C900,40 1100,140 1200,120 L1200,200 L0,200Z'/%3E%3C/svg%3E");
  background-size: 1200px 200px;
  animation: oceanWave2 9s ease-in-out infinite;
}

.ocean-wave-3 {
  bottom: -20px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 200'%3E%3Cpath fill='%238b9dc330' d='M0,80 C150,140 350,40 600,100 C850,160 950,60 1200,80 L1200,200 L0,200Z'/%3E%3C/svg%3E");
  background-size: 1200px 200px;
  animation: oceanWave1 11s ease-in-out infinite reverse;
}

.ocean-wave-4 {
  bottom: -30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 200'%3E%3Cpath fill='%234a6fa550' d='M0,130 C250,70 450,160 650,110 C850,60 1050,150 1200,130 L1200,200 L0,200Z'/%3E%3C/svg%3E");
  background-size: 1200px 200px;
  animation: oceanWave2 13s ease-in-out infinite;
}

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

@keyframes oceanWave2 {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(50px); }
}

.interlude-quote {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 24px;
}

.quote-text {
  font-family: var(--font-cn);
  font-size: clamp(1.5rem, 5vw, 2.5rem);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.quote-translation {
  font-family: var(--font-en);
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  font-weight: 300;
  color: var(--accent);
  font-style: italic;
}

/* ========================================
   About Section
   ======================================== */
.about {
  padding: 120px 0;
  background-color: var(--bg-primary);
  transition: background-color 0.5s ease;
}

.about-title {
  font-family: var(--font-cn);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 600;
  text-align: center;
  margin-bottom: 48px;
  color: var(--text-primary);
}

.about-text {
  margin-bottom: 40px;
}

.about-text p {
  font-family: var(--font-cn);
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  color: var(--text-body);
  margin-bottom: 20px;
  text-align: justify;
}

.about-english {
  border-top: 1px solid var(--border);
  padding-top: 32px;
}

.about-english p {
  font-family: var(--font-en);
  font-size: clamp(0.85rem, 1.8vw, 0.95rem);
  font-weight: 300;
  color: var(--accent-light);
  line-height: 1.9;
  font-style: italic;
}

/* ========================================
   Footer
   ======================================== */
.footer {
  padding: 48px 0;
  text-align: center;
  border-top: 1px solid var(--border);
  background-color: var(--bg-primary);
  transition: background-color 0.5s ease, border-color 0.5s ease;
}

.footer-name {
  font-family: var(--font-cn);
  font-size: 1.1rem;
  color: var(--accent);
  margin-bottom: 8px;
}

.footer-copy {
  font-family: var(--font-en);
  font-size: 0.8rem;
  font-weight: 300;
  color: var(--accent-light);
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
  .philosophy {
    padding: 80px 0;
  }

  .poem-divider {
    margin: 28px auto;
  }

  .interlude {
    height: 60vh;
    min-height: 400px;
  }

  .about {
    padding: 80px 0;
  }

  .about-title {
    margin-bottom: 32px;
  }

  .scroll-indicator {
    bottom: 200px;
  }

  .theme-switcher {
    top: 16px;
    right: 16px;
  }

  .theme-toggle {
    width: 38px;
    height: 38px;
    font-size: 16px;
  }

  .theme-panel {
    min-width: 180px;
  }
}

@media (max-width: 480px) {
  .hero-title {
    letter-spacing: 0.1em;
  }

  .wave-container {
    height: 120px;
  }

  .scroll-indicator {
    bottom: 150px;
  }

  .philosophy {
    padding: 60px 0;
  }

  .about {
    padding: 60px 0;
  }
}