/* ============================================
   Resarc Group — Design System
   Classical restraint meets modern confidence
   ============================================ */

/* --- CSS Variables --- */
:root {
  --color-bg: #FCFAF5;
  --color-surface: #FFFFFF;
  --color-text: #1B1B20;
  --color-text-muted: #6E6D74;
  --color-gold: #B8923E;
  --color-gold-light: #D9C48E;
  --color-gold-pale: #F2EBD8;
  --color-border: #E8E2D4;
  --color-border-light: #F0ECE3;

  /* Subsidiary accents */
  --color-hephaestus: #47407A;
  --color-hephaestus-light: #EDEBF5;
  --color-athena: #C4563A;
  --color-athena-light: #FAEEE9;
  --color-prometheus: #1D7A5F;
  --color-prometheus-light: #E5F4EE;
  --color-demeter: #A6703E;
  --color-demeter-light: #F7F0E7;

  --font-display: 'Nunito', 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', sans-serif;
  --font-body: 'Nunito Sans', 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.08);

  --max-width: 1200px;
  --header-height: 72px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
}

/* --- Typography --- */
.display-xl {
  font-family: var(--font-display);
  font-size: clamp(3rem, 6vw, 5.5rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: 0.04em;
}

.display-lg {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4.5vw, 3.5rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: 0.03em;
}

.display-md {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.heading-sm {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: 0.03em;
}

.text-body {
  font-size: 1rem;
  line-height: 1.85;
  color: var(--color-text-muted);
}

.text-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-gold);
}

/* --- Gold Rule --- */
.gold-rule {
  width: 60px;
  height: 1px;
  background: var(--color-gold-light);
  margin: 0 auto;
  border: none;
}

.gold-rule--left {
  margin: 0;
}

/* --- Layout --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

.section {
  padding: 7rem 0;
}

.section--tight {
  padding: 4rem 0;
}

.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

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

.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }

/* --- Header --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-height);
  display: flex;
  align-items: center;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.site-header.scrolled {
  background: rgba(252, 250, 245, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--color-border-light);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.header-logo {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--color-text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-logo::after {
  content: '';
  display: block;
  width: 5px;
  height: 5px;
  background: var(--color-gold);
  border-radius: 50%;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  list-style: none;
}

.header-nav a {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 0.2s ease;
  position: relative;
}

.header-nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--color-gold);
  transition: width 0.25s ease;
}

.header-nav a:hover,
.header-nav a.active {
  color: var(--color-text);
}

.header-nav a:hover::after,
.header-nav a.active::after {
  width: 100%;
}

/* Mobile menu button */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--color-text);
  margin: 5px 0;
  transition: 0.3s ease;
}

@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  .header-nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--color-bg);
    flex-direction: column;
    padding: 2rem;
    gap: 1.5rem;
    transform: translateY(-100%);
    opacity: 0;
    transition: 0.3s ease;
    pointer-events: none;
    border-bottom: 1px solid var(--color-border-light);
  }

  .header-nav.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .header-nav a {
    font-size: 1rem;
  }
}

/* --- Hero Section --- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Subtle decorative background */
.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 800px;
  height: 800px;
  border-radius: 50%;
  border: 1px solid var(--color-gold-pale);
  opacity: 0.4;
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 500px;
  height: 500px;
  border-radius: 50%;
  border: 1px solid var(--color-gold-pale);
  opacity: 0.2;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 700px;
}

.hero-label {
  margin-bottom: 2rem;
}

.hero-title-group {
  margin-bottom: 1.5rem;
}

.hero-subtitle {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--color-gold);
  font-style: italic;
  letter-spacing: 0.04em;
  margin-bottom: 1.5rem;
}

.hero-rule {
  width: 80px;
  height: 1px;
  background: var(--color-gold-light);
  margin: 0 auto 2rem;
}

.hero-description {
  font-size: 1.1rem;
  color: var(--color-text-muted);
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.8;
}

/* --- Section Header --- */
.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-header .text-label {
  margin-bottom: 1rem;
  display: block;
}

.section-header .display-md {
  margin-bottom: 1rem;
}

.section-header .gold-rule {
  margin: 1.5rem auto 0;
}

/* --- Subsidiary Grid (Home) --- */
.subsidiary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.subsidiary-card {
  display: block;
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  text-decoration: none;
  color: var(--color-text);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  position: relative;
  overflow: hidden;
}

.subsidiary-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  transition: width 0.3s ease;
}

.subsidiary-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.subsidiary-card:hover::before {
  width: 6px;
}

.subsidiary-card__domain {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
}

.subsidiary-card__name {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.subsidiary-card__tagline {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-style: italic;
  color: var(--color-text-muted);
  margin-bottom: 1.25rem;
}

.subsidiary-card__desc {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.7;
}

.subsidiary-card__arrow {
  display: inline-block;
  margin-top: 1.25rem;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-style: italic;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.subsidiary-card:hover .subsidiary-card__arrow {
  opacity: 1;
  transform: translateX(0);
}

/* Subsidiary color accents */
.card--hephaestus::before { background: var(--color-hephaestus); }
.card--hephaestus .subsidiary-card__domain { color: var(--color-hephaestus); }
.card--athena::before { background: var(--color-athena); }
.card--athena .subsidiary-card__domain { color: var(--color-athena); }
.card--prometheus::before { background: var(--color-prometheus); }
.card--prometheus .subsidiary-card__domain { color: var(--color-prometheus); }
.card--demeter::before { background: var(--color-demeter); }
.card--demeter .subsidiary-card__domain { color: var(--color-demeter); }

@media (max-width: 768px) {
  .subsidiary-grid {
    grid-template-columns: 1fr;
  }

  .subsidiary-card {
    padding: 2rem 1.5rem;
  }

  .subsidiary-card__name {
    font-size: 1.6rem;
  }
}

/* --- About Section (Home) --- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.about-quote {
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1.3;
  font-style: italic;
  color: var(--color-text);
  position: relative;
}

.about-quote::before {
  content: '';
  display: block;
  width: 30px;
  height: 1px;
  background: var(--color-gold);
  margin-bottom: 1.5rem;
}

.about-body p {
  margin-bottom: 1rem;
}

.about-body p:last-child {
  margin-bottom: 0;
}

@media (max-width: 768px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* --- Subsidiary Page Hero --- */
.sub-hero {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
}

.sub-hero-content {
  position: relative;
  z-index: 1;
}

.sub-hero .display-xl {
  margin-bottom: 0.5rem;
}

.sub-hero-domain {
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 1.5rem;
}

.sub-hero-tagline {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-style: italic;
  margin-bottom: 1.5rem;
}

.sub-hero-desc {
  font-size: 1rem;
  color: var(--color-text-muted);
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.8;
}

/* Background accents for sub-hero */
.sub-hero--hephaestus { background: var(--color-hephaestus-light); }
.sub-hero--hephaestus .sub-hero-tagline,
.sub-hero--hephaestus .sub-hero-domain { color: var(--color-hephaestus); }

.sub-hero--athena { background: var(--color-athena-light); }
.sub-hero--athena .sub-hero-tagline,
.sub-hero--athena .sub-hero-domain { color: var(--color-athena); }

.sub-hero--prometheus { background: var(--color-prometheus-light); }
.sub-hero--prometheus .sub-hero-tagline,
.sub-hero--prometheus .sub-hero-domain { color: var(--color-prometheus); }

.sub-hero--demeter { background: var(--color-demeter-light); }
.sub-hero--demeter .sub-hero-tagline,
.sub-hero--demeter .sub-hero-domain { color: var(--color-demeter); }

/* --- Services Grid (Subsidiary pages) --- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.service-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  padding: 2rem 1.5rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.service-card__icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.service-card__title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.service-card__desc {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.7;
}

@media (max-width: 768px) {
  .services-grid {
    grid-template-columns: 1fr;
  }
}

/* --- CTA Section --- */
.cta-section {
  text-align: center;
  padding: 6rem 0;
}

.cta-section .display-md {
  margin-bottom: 1rem;
}

.cta-section .text-body {
  margin-bottom: 2rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.85rem 2rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: all 0.25s ease;
  cursor: pointer;
  border: none;
}

.btn--primary {
  background: var(--color-text);
  color: var(--color-bg);
}

.btn--primary:hover {
  background: var(--color-gold);
  color: #fff;
}

.btn--outline {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn--outline:hover {
  border-color: var(--color-text);
}

/* --- Contact Page --- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.contact-info h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

.contact-detail {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.contact-detail__label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-gold);
  margin-bottom: 0.25rem;
}

.contact-detail__value {
  font-size: 1rem;
  color: var(--color-text);
}

.contact-form {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--color-text);
  background: var(--color-bg);
  transition: border-color 0.2s ease;
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--color-gold);
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
}

@media (max-width: 768px) {
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* --- Footer --- */
.site-footer {
  border-top: 1px solid var(--color-border-light);
  padding: 4rem 0 2rem;
  text-align: center;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  text-align: left;
  margin-bottom: 3rem;
}

.footer-col h4 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 1rem;
  letter-spacing: 0.04em;
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: 0.5rem;
}

.footer-col ul li a {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-col ul li a:hover {
  color: var(--color-text);
}

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

.footer-bottom .gold-rule {
  margin-bottom: 1.5rem;
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --- Text Align Utilities --- */
.text-center { text-align: center; }

/* --- Spacing Utilities --- */
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }

/* --- Back to top link --- */
.back-home {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
  margin-top: 2rem;
}

.back-home:hover {
  color: var(--color-text);
}

/* --- Page transition for sub pages --- */
.page-content {
  padding-top: var(--header-height);
}

/* --- Research Section (Prometheus) --- */
.research-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.research-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  text-decoration: none;
  color: var(--color-text);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

.research-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.research-card__tag {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-prometheus);
  margin-bottom: 0.75rem;
}

.research-card__title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.research-card__desc {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  flex: 1;
}

.research-card__meta {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* --- Research Viewer (iframe wrapper) --- */
.iframe-viewer {
  width: 100%;
  border: none;
  background: #fff;
  min-height: 80vh;
}

.viewer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  border-bottom: 1px solid var(--color-border-light);
  margin-bottom: 1rem;
}

.viewer-toolbar__title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 500;
}

@media (max-width: 768px) {
  .research-grid {
    grid-template-columns: 1fr;
  }
}

/* ICP 备案号（footer） */
.footer-beian { font-size: 12px; color: #8a7f6a; margin-top: 6px; }
.footer-beian a { color: #8a7f6a; text-decoration: none; }
.footer-beian a:hover { color: #b08d57; text-decoration: underline; }
