body {
  min-height: 100vh;
  background: var(--color-cream);
  color: var(--color-text);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
  transition: background-color 0.2s ease, color 0.2s ease;
}

body::before,
body::after {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  content: "";
}

body::before {
  opacity: 0.18;
  background-image: url("../assets/icon.png");
  background-position: 0 0;
  background-size: 750px 750px;
  background-repeat: repeat;
  animation: tech-symbol-drift 72s linear infinite;
}

body::after {
  z-index: -3;
  opacity: 0;
  background-image: none;
  background-position: 0 0;
  background-size: 230px 230px;
  background-repeat: repeat;
  animation: tech-underlay-drift 28s linear infinite;
}

:root[data-theme="dark"] body::before {
  opacity: 0.18;
  background-image: url("../assets/icon-night2.png");
}

:root[data-theme="dark"] body::after {
  opacity: 0;
  background-image: none;
  animation: none;
}

.site-shell {
  position: relative;
  z-index: 0;
  width: min(calc(100% - 32px), var(--container-width));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.site-eyebrow,
.section-kicker,
.hero-kicker {
  color: var(--color-sage-700);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.site-title,
.section-title,
.page h1,
.page h2 {
  color: var(--color-brown);
  line-height: 1.1;
}

.site-title {
  font-size: clamp(2rem, 3vw, 3rem);
}

.page {
  display: grid;
  gap: 24px;
}

.hero-panel,
.horse-detail-card,
.comment-panel,
.auth-card {
  background: var(--color-panel);
  color: var(--color-panel-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.hero-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
  background: var(--color-panel);
  border-color: var(--color-border);
  border-left: 8px solid var(--color-sage-500);
}

.hero-panel h2 {
  margin-top: 8px;
  font-size: clamp(2rem, 4vw, 3.2rem);
}

.hero-text {
  max-width: 700px;
  margin-top: 14px;
  color: var(--color-muted);
}

.section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.section-title {
  margin-top: 8px;
  font-size: 1.9rem;
}

.section-meta {
  color: var(--color-muted);
}

.status-box {
  padding: 16px 18px;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-panel);
  color: var(--color-muted);
}

.hidden {
  display: none !important;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  color: var(--color-brown);
  font-weight: 600;
}

input,
textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-white);
  color: var(--color-panel-text);
}

:root[data-theme="dark"] .hero-panel,
:root[data-theme="dark"] .horse-detail-card,
:root[data-theme="dark"] .comment-panel,
:root[data-theme="dark"] .auth-card,
:root[data-theme="dark"] .upload-page-panel,
:root[data-theme="dark"] .profile-panel,
:root[data-theme="dark"] .admin-panel {
  background: var(--color-panel);
  border-color: var(--color-border);
}

:root[data-theme="dark"] input,
:root[data-theme="dark"] textarea,
:root[data-theme="dark"] select {
  background: var(--color-white);
  color: var(--color-panel-text);
  border-color: var(--color-border);
}

:root[data-theme="dark"] input::placeholder,
:root[data-theme="dark"] textarea::placeholder {
  color: var(--color-muted);
}

input:focus,
textarea:focus {
  outline: 2px solid rgba(140, 179, 173, 0.5);
  border-color: var(--color-teal);
}

@media (max-width: 768px) {
  .site-shell {
    width: min(calc(100% - 24px), var(--container-width));
    padding-top: 16px;
  }

  .site-header,
  .hero-panel,
  .section-header {
    align-items: start;
    flex-direction: column;
  }
}

@keyframes tech-symbol-drift {
  from {
    background-position: 0 0;
  }

  to {
    background-position: 750px 750px;
  }
}

@keyframes tech-underlay-drift {
  from {
    background-position: 0 0;
  }

  to {
    background-position: 760px 570px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body::before,
  body::after {
    animation: none;
  }
}
