@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;600;700&display=swap');

:root {
  --cinnabar:      #C41E24;
  --brown:         #6B4C3B;
  --gold:          #C9A94E;
  --cream:         #FDF6EC;
  --brown-dark:    #3D2B1F;
  --cream-muted:   #F5ECD7;
  --text-dark:     #2C1810;
  --text-muted:    #7A6655;
  --deep-brown:    #6B4C3B;
  --muted-cream:   #D4C5A9;
  --gold-light:    #E8D5A3;

  --s-1:  4px;
  --s-2:  8px;
  --s-3:  12px;
  --s-4:  16px;
  --s-5:  24px;
  --s-6:  32px;
  --s-7:  48px;
  --s-8:  64px;
  --s-9:  80px;

  --r-sm:  4px;
  --r-md:  8px;
  --r-lg:  12px;

  --shadow-1: 0 1px 2px rgba(61,43,31,.05), 0 1px 1px rgba(61,43,31,.03);
  --shadow-2: 0 2px 8px rgba(61,43,31,.08), 0 1px 3px rgba(61,43,31,.05);
  --shadow-3: 0 4px 16px rgba(61,43,31,.10), 0 2px 6px rgba(61,43,31,.06);

  --font-serif: 'Noto Serif SC', 'Source Han Serif SC', 'SimSun', serif;
  --font-body:  'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', sans-serif;

  --max-w: 1200px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-dark);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  padding-bottom: 50px;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
}

.shell-top-stripe {
  display: block;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--gold) 0%, var(--cinnabar) 100%);
  flex-shrink: 0;
}

.shell-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--s-6);
  background: var(--deep-brown);
  border-bottom: 2px solid var(--gold);
  font-family: var(--font-body);
}

.shell-nav__brand {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  text-decoration: none;
  flex-shrink: 0;
}

.shell-nav__emblem {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  background: var(--cinnabar);
  color: var(--cream);
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}

.shell-nav__title {
  color: var(--cream);
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.shell-nav__links {
  display: flex;
  align-items: center;
  gap: var(--s-5);
  list-style: none;
  flex-shrink: 1;
  justify-content: center;
}

.shell-nav__link {
  position: relative;
  color: var(--cream);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 1px;
  text-decoration: none;
  padding: 4px 0;
  transition: color 160ms cubic-bezier(.2,.8,.2,1);
  white-space: nowrap;
}

.shell-nav__link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gold);
  transition: width 240ms cubic-bezier(.3,0,0,1);
}

.shell-nav__link:hover {
  color: var(--gold-light);
}

.shell-nav__link:hover::after {
  width: 100%;
}

.shell-nav__link--active {
  color: var(--gold);
  font-weight: 600;
}

.shell-nav__link--active::after {
  width: 100%;
}

.shell-nav__actions {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  flex-shrink: 0;
}

.shell-nav__btn-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 16px;
  font-size: 14px;
  font-family: var(--font-body);
  letter-spacing: 1px;
  color: var(--cream);
  background: transparent;
  border: 1px solid var(--muted-cream);
  border-radius: var(--r-sm);
  cursor: pointer;
  text-decoration: none;
  transition: border-color 160ms cubic-bezier(.2,.8,.2,1), color 160ms cubic-bezier(.2,.8,.2,1);
}

.shell-nav__btn-login:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.shell-nav__btn-register {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 16px;
  font-size: 14px;
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--cream);
  background: var(--cinnabar);
  border: 1px solid var(--cinnabar);
  border-radius: var(--r-sm);
  cursor: pointer;
  text-decoration: none;
  transition: background 160ms cubic-bezier(.2,.8,.2,1);
}

.shell-nav__btn-register:hover {
  background: #A8181F;
}

.shell-nav__mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  padding: 4px;
}

.shell-nav__mobile-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--cream);
  border-radius: 1px;
  transition: all 200ms ease;
}

.shell-nav__mobile-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--brown-dark);
  border-bottom: 2px solid var(--gold);
  padding: var(--s-4);
  flex-direction: column;
  gap: var(--s-2);
}

.shell-nav__mobile-menu.active {
  display: flex;
}

.shell-nav__mobile-menu .shell-nav__link {
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-sm);
}

.shell-nav__mobile-menu .shell-nav__link:hover {
  background: rgba(255,255,255,.1);
}

.shell-main {
  background: var(--cream);
  min-height: calc(100vh - 64px - 280px);
}

.page-container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--s-6);
}

.shell-footer {
  background: var(--brown-dark);
  border-top: 1px solid var(--gold);
  font-family: var(--font-body);
  color: var(--muted-cream);
}

.shell-footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--s-7) var(--s-6) var(--s-5);
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.8fr;
  gap: var(--s-8);
}

.shell-footer__brand {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}

.shell-footer__brand-header {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}

.shell-footer__emblem {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
  background: var(--cinnabar);
  color: var(--cream);
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}

.shell-footer__brand-name {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--cream);
  letter-spacing: 0.03em;
}

.shell-footer__slogan {
  font-size: 14px;
  color: var(--muted-cream);
  line-height: 1.6;
}

.shell-footer__contact {
  font-size: 13px;
  color: var(--muted-cream);
  line-height: 1.8;
  opacity: 0.85;
}

.shell-footer__links-group {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

.shell-footer__links-title {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
  color: var(--cream);
  margin-bottom: var(--s-2);
}

.shell-footer__links-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-2) var(--s-6);
}

.shell-footer__link-item a {
  display: block;
  font-size: 13px;
  color: var(--muted-cream);
  text-decoration: none;
  padding: 2px 0;
  transition: color 160ms cubic-bezier(.2,.8,.2,1);
}

.shell-footer__link-item a:hover {
  color: var(--gold);
}

.shell-footer__qrcode {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-3);
}

.shell-footer__qrcode-placeholder {
  width: 110px;
  height: 110px;
  border: 1px dashed var(--muted-cream);
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--muted-cream);
  opacity: 0.6;
  background: rgba(255,255,255,.03);
}

.shell-footer__qrcode-label {
  font-size: 13px;
  color: var(--muted-cream);
  text-align: center;
}

.shell-footer__bottom {
  border-top: 1px solid rgba(201,169,78,.25);
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--s-4) var(--s-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted-cream);
  opacity: 0.75;
}

.shell-footer__copyright a,
.shell-footer__credit a {
  color: var(--muted-cream);
  text-decoration: none;
  transition: color 160ms cubic-bezier(.2,.8,.2,1);
}

.shell-footer__copyright a:hover,
.shell-footer__credit a:hover {
  color: var(--gold);
}

.section-heading {
  text-align: center;
  margin-bottom: var(--s-7);
}

.section-heading__title {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 700;
  color: var(--brown-dark);
  letter-spacing: 0.06em;
  margin-bottom: var(--s-2);
}

.section-heading__line {
  display: inline-block;
  width: 48px;
  height: 2px;
  background: var(--gold);
  border-radius: 1px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 28px;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font-body);
  letter-spacing: 1px;
  color: #fff;
  background: var(--cinnabar);
  border: 1px solid var(--cinnabar);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background 160ms ease, transform 120ms ease;
}

.btn-primary:hover {
  background: #A8181F;
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 28px;
  font-size: 15px;
  font-weight: 400;
  font-family: var(--font-body);
  letter-spacing: 1px;
  color: var(--brown);
  background: transparent;
  border: 1px solid #D9CDB8;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease;
}

.btn-secondary:hover {
  border-color: var(--brown);
  color: var(--brown-dark);
}

.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(44,24,16,.6);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: var(--s-4);
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--cream);
  border-radius: var(--r-md);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(44,24,16,.2);
  animation: modalFadeIn 200ms ease;
}

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

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s-5) var(--s-6);
  border-bottom: 1px solid var(--cream-muted);
}

.modal__title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--brown-dark);
}

.modal__close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  border-radius: var(--r-sm);
  transition: background 160ms ease;
}

.modal__close:hover {
  background: var(--cream-muted);
}

.modal__body {
  padding: var(--s-5) var(--s-6);
}

.modal__footer {
  display: flex;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-6);
  border-top: 1px solid var(--cream-muted);
  justify-content: flex-end;
}

.toast {
  position: fixed;
  bottom: 60px;
  right: var(--s-6);
  padding: var(--s-4) var(--s-5);
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 500;
  z-index: 3000;
  opacity: 0;
  transform: translateX(100%);
  transition: opacity 300ms ease, transform 300ms ease;
  box-shadow: var(--shadow-2);
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.toast--success {
  background: rgba(46,139,87,.9);
  color: #fff;
}

.toast--error {
  background: rgba(196,30,36,.9);
  color: #fff;
}

.toast--info {
  background: rgba(61,43,31,.9);
  color: var(--cream);
}

.back-to-top {
  position: fixed;
  bottom: 60px;
  left: var(--s-6);
  width: 48px;
  height: 48px;
  background: var(--cinnabar);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 200ms ease;
  z-index: 100;
  box-shadow: var(--shadow-2);
}

.back-to-top.active {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: #A8181F;
  transform: translateY(-2px);
}

.page-info-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(61,43,31,.95);
  padding: var(--s-3) var(--s-6);
  font-size: 12px;
  color: var(--muted-cream);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 500;
  border-top: 1px solid var(--gold);
}

.page-info-bar__left {
  display: flex;
  gap: var(--s-6);
}

.page-info-bar__item {
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

.page-info-bar__item span:first-child {
  color: var(--gold);
}

.page-info-bar__author {
  color: var(--gold);
}

.page-info-bar__author a {
  color: var(--gold-light);
}

.page-info-bar__author a:hover {
  text-decoration: underline;
}

@media (max-width: 1024px) {
  .shell-footer__inner {
    grid-template-columns: 1fr 1fr;
    gap: var(--s-6);
  }

  .shell-footer__qrcode {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: center;
    padding-top: var(--s-4);
    border-top: 1px solid rgba(201,169,78,.15);
  }
}

@media (max-width: 768px) {
  .shell-nav {
    height: 56px;
    padding: 0 var(--s-4);
  }

  .shell-nav__links {
    display: none;
  }

  .shell-nav__mobile-toggle {
    display: flex;
  }

  .shell-nav__title {
    font-size: 15px;
  }

  .shell-footer__inner {
    grid-template-columns: 1fr;
    gap: var(--s-5);
  }

  .shell-footer__links-list {
    grid-template-columns: 1fr 1fr;
  }

  .shell-footer__qrcode {
    border-top: none;
    padding-top: 0;
  }

  .shell-footer__bottom {
    flex-direction: column;
    gap: var(--s-2);
    text-align: center;
  }

  .shell-main {
    min-height: calc(100vh - 59px - 340px);
  }

  .page-container {
    padding: 0 var(--s-4);
  }

  .page-info-bar {
    flex-direction: column;
    gap: var(--s-2);
    padding: var(--s-3);
  }

  .page-info-bar__left {
    gap: var(--s-4);
  }
}

.lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.9);
  z-index: 4000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-6);
  opacity: 0;
  visibility: hidden;
  transition: opacity 300ms ease, visibility 300ms ease;
}

.lightbox-overlay.active {
  opacity: 1;
  visibility: visible;
}

.lightbox {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-4);
}

.lightbox__close {
  position: absolute;
  top: -40px;
  right: 0;
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 200ms ease;
  z-index: 10;
}

.lightbox__close:hover {
  background: rgba(255,255,255,0.2);
}

.lightbox__img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: var(--r-md);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.lightbox__title {
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  text-align: center;
  font-family: var(--font-serif);
  letter-spacing: 0.05em;
}

.origin-gen__char {
  cursor: pointer;
  transition: all 200ms ease;
}

.origin-gen__char:hover,
.origin-gen__char.active {
  background: var(--cinnabar);
  color: var(--cream);
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(196,30,36,0.3);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
  }

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

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