:root {
  --paper: #fdf6ea;
  --paper-alt: #f7ead0;
  --ink: #2b1a12;
  --muted: #7c6650;
  --red: #b3121b;
  --red-dark: #7a0c12;
  --red-deep: #4c080d;
  --gold: #b8892b;
  --gold-light: #f0d78c;
  --border: #e6d3a4;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(92, 9, 16, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "PT Serif", "Noto Serif SC", Georgia, "Times New Roman", serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.container.narrow { max-width: 720px; }

a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 {
  font-family: "PT Serif", "Noto Serif SC", Georgia, serif;
  font-weight: 700;
  color: var(--red-deep);
  line-height: 1.25;
}

/* ---------- Header ---------- */
.site-header {
  background: linear-gradient(180deg, var(--red) 0%, var(--red-dark) 100%);
  border-bottom: 3px solid var(--gold);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; gap: 16px; }

.logo { display: flex; align-items: center; gap: 10px; color: #fff; }
.logo:hover { text-decoration: none; }
.logo-seal {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--gold-light);
  color: var(--red-dark);
  font-weight: 700;
  font-family: "Ma Shan Zheng", cursive;
  font-size: 20px;
  border: 2px solid var(--gold);
}
.logo-text { font-weight: 700; font-size: 18px; letter-spacing: .3px; }
.logo-text .accent { color: var(--gold-light); font-weight: 400; margin-left: 4px; }

.main-nav { display: flex; gap: 18px; flex-wrap: wrap; }
.main-nav a { color: #fbe9c9; font-size: 14px; font-weight: 600; }
.main-nav a:hover { color: #fff; text-decoration: none; }

.header-right { display: flex; align-items: center; gap: 12px; }

.online-badge {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: #fbe9c9;
  background: rgba(0,0,0,0.18);
  border: 1px solid var(--gold);
  padding: 6px 12px; border-radius: 999px;
  white-space: nowrap;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: #6fd18a; animation: pulse 2s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(111,209,138,.5); }
  70% { box-shadow: 0 0 0 8px rgba(111,209,138,0); }
  100% { box-shadow: 0 0 0 0 rgba(111,209,138,0); }
}

.nav-toggle {
  display: none; flex-direction: column; justify-content: center; align-items: center;
  gap: 4px; background: none; border: none; cursor: pointer;
  width: 44px; height: 44px; flex-shrink: 0;
}
.nav-toggle span { width: 22px; height: 2px; background: #fff; display: block; }

@media (max-width: 860px) {
  .main-nav {
    display: none;
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--red-dark);
    flex-direction: column;
    gap: 0;
    padding: 8px 20px 12px;
    border-bottom: 3px solid var(--gold);
    max-height: calc(100vh - 60px);
    overflow-y: auto;
  }
  .main-nav.open { display: flex; }
  .main-nav a {
    padding: 13px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }
  .nav-toggle { display: flex; }
  .site-header { position: relative; }
}

@media (max-width: 420px) {
  .online-badge span:not(.dot) { max-width: 40px; overflow: hidden; text-overflow: ellipsis; }
  .header-row { gap: 8px; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background: radial-gradient(circle at 20% 20%, var(--red) 0%, var(--red-dark) 55%, var(--red-deep) 100%);
  color: #fff8ea;
  overflow: hidden;
}
.hero-pattern {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 85% 10%, rgba(240,215,140,0.18) 0, transparent 40%),
    radial-gradient(circle at 10% 90%, rgba(240,215,140,0.12) 0, transparent 35%);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  display: flex; align-items: center; gap: 36px;
  padding: 56px 20px;
}
.hero-image {
  width: 140px; height: 140px; object-fit: cover;
  border-radius: 50%; border: 4px solid var(--gold-light);
  box-shadow: var(--shadow);
  flex-shrink: 0;
}
.hero-seal {
  width: 140px; height: 140px; flex-shrink: 0;
  border-radius: 50%;
  border: 4px solid var(--gold-light);
  display: flex; align-items: center; justify-content: center;
  font-family: "Ma Shan Zheng", cursive;
  font-size: 56px;
  color: var(--gold-light);
  background: rgba(0,0,0,0.15);
}
.hero-eyebrow { color: var(--gold-light); text-transform: uppercase; letter-spacing: 2px; font-size: 12px; margin: 0 0 8px; }
.hero h1 { color: #fff; font-size: 32px; margin: 0 0 12px; }
.hero-text { color: #f6e6c8; max-width: 560px; margin: 0 0 20px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

@media (max-width: 720px) {
  .hero-inner { flex-direction: column; text-align: center; padding: 40px 20px; }
  .hero-image, .hero-seal { width: 108px; height: 108px; }
  .hero-seal { font-size: 44px; }
  .hero h1 { font-size: 26px; }
  .hero-actions { justify-content: center; }
  .hero-actions a { flex: 1 1 160px; text-align: center; }
}

/* ---------- Buttons ---------- */
.btn-primary, .btn-ghost, button[type="submit"], #saveRateBtn, #savePaymentUrlBtn, #saveBannerTextBtn, #changePasswordBtn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  border: 2px solid transparent;
}
.btn-primary {
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  color: var(--red-deep);
  border-color: var(--gold);
}
.btn-primary:hover { filter: brightness(1.05); text-decoration: none; }
.btn-ghost {
  background: transparent;
  color: var(--gold-light);
  border-color: var(--gold-light);
}
.btn-ghost:hover { background: rgba(255,255,255,0.1); text-decoration: none; }

/* ---------- Sections ---------- */
.section { padding: 56px 0; }
.section.alt { background: var(--paper-alt); }

@media (max-width: 720px) {
  .section { padding: 36px 0; }
}
.section-eyebrow {
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 12px;
  font-weight: 700;
  margin: 0 0 6px;
}
.section h2 { font-size: 26px; margin: 0 0 24px; }
.section h2::after {
  content: "";
  display: block;
  width: 56px; height: 3px;
  background: var(--gold);
  margin-top: 12px;
  border-radius: 2px;
}

@media (max-width: 720px) {
  .section h2 { font-size: 22px; margin: 0 0 18px; }
}

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.two-col p { margin: 0; color: var(--ink); }

@media (max-width: 720px) {
  .two-col { grid-template-columns: 1fr; }
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.card h3 { font-size: 17px; margin: 0 0 8px; }
.card p { margin: 0; color: var(--muted); font-size: 14px; }

.card-icon {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--red);
  color: var(--gold-light);
  display: flex; align-items: center; justify-content: center;
  font-family: "Ma Shan Zheng", cursive;
  font-size: 22px;
  margin-bottom: 14px;
  border: 2px solid var(--gold);
}

/* ---------- Steps ---------- */
.steps {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 22px;
}
.steps li {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
}
.step-num {
  display: block;
  font-family: "Noto Serif SC", serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 8px;
}
.steps h3 { font-size: 16px; margin: 0 0 6px; }
.steps p { margin: 0; color: var(--muted); font-size: 14px; }

/* ---------- Calculator / order form ---------- */
.main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 720px) { .main-grid { grid-template-columns: 1fr; } }

.calc-card h3 { margin-top: 0; }
.rate-line { color: var(--muted); }
.rate-line #rateValue { color: var(--red); font-weight: 700; font-size: 18px; }

.field { display: block; margin: 14px 0; }
.field span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--paper);
  color: var(--ink);
  font-size: 16px; /* >=16px не даёт iOS Safari зумить страницу при фокусе на поле */
  font-family: inherit;
}
.field input:focus, .field textarea:focus { outline: 2px solid var(--gold); }

.calc-result {
  margin-top: 16px;
  padding: 14px;
  border-radius: 10px;
  background: #fbeecb;
  border: 1px solid var(--gold);
}
.calc-result strong { color: var(--red); font-size: 18px; }

.qr-preview-wrap img, .reference-qr {
  max-width: 140px;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-top: 8px;
}

.hint { margin-top: 14px; font-size: 13px; color: var(--muted); }

form button[type="submit"] {
  width: 100%;
  margin-top: 6px;
  background: linear-gradient(180deg, var(--red), var(--red-dark));
  color: #fff8ea;
  border-color: var(--red-dark);
}
form button[type="submit"]:hover { filter: brightness(1.08); }
form button[type="submit"]:disabled { opacity: .6; cursor: not-allowed; }

.error { color: #a4222b; font-size: 14px; }
.muted { color: var(--muted); font-size: 13px; }

/* ---------- News ---------- */
.news-grid { align-items: stretch; }
.news-card time { font-size: 12px; color: var(--gold); font-weight: 700; }
.news-card h2, .news-card h3 { font-size: 17px; margin: 8px 0; }
.news-cover { width: 100%; height: 150px; object-fit: cover; border-radius: 10px; margin-bottom: 10px; }
.card-link { display: inline-block; margin-top: 10px; font-weight: 700; font-size: 14px; }

.news-article h1 { font-size: 34px; margin: 4px 0 10px; }
.news-article time {
  display: inline-block;
  font-size: 13px;
  letter-spacing: .5px;
  color: var(--gold);
  font-weight: 700;
  text-transform: uppercase;
}
.news-article .article-cover {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin: 24px 0 8px;
}

.article-body {
  margin-top: 24px;
  font-size: 18px;
  line-height: 1.85;
  color: var(--ink);
}
.article-body p { margin: 0 0 20px; }
.article-body > p:first-of-type {
  font-size: 20px;
  color: var(--red-deep);
}
.article-body h2 {
  font-size: 21px;
  margin: 40px 0 14px;
  padding-left: 16px;
  border-left: 3px solid var(--gold);
  line-height: 1.3;
}
.article-body img { max-width: 100%; border-radius: 10px; }
.article-body a { text-decoration: underline; text-underline-offset: 2px; }

@media (max-width: 720px) {
  .news-article h1 { font-size: 26px; }
  .article-body { font-size: 16px; line-height: 1.75; }
  .article-body > p:first-of-type { font-size: 17px; }
  .article-body h2 { font-size: 19px; margin: 32px 0 12px; }
}

/* ---------- FAQ ---------- */
.faq-list { display: flex; flex-direction: column; gap: 12px; }
.faq-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
}
.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--red-deep);
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before { content: "问 "; color: var(--gold); font-family: "Ma Shan Zheng", cursive; }
.faq-item[open] summary { margin-bottom: 10px; }
.faq-item p { margin: 0; color: var(--muted); }

/* ---------- Page hero (news list, legal) ---------- */
.page-hero {
  background: linear-gradient(180deg, var(--red), var(--red-dark));
  color: #fff8ea;
  padding: 44px 0;
}
.page-hero h1 { color: #fff; margin: 0 0 8px; }
.page-hero .hero-text { color: #f6e6c8; margin: 0; }

.legal-page h2 { font-size: 19px; margin-top: 32px; }
.legal-page p { color: var(--ink); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--red-deep);
  color: #ecd9b8;
  padding: 48px 0 24px;
  margin-top: 20px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 24px;
}
@media (max-width: 780px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; gap: 28px; } }

.footer-logo { margin-bottom: 10px; }
.site-footer h3 { color: var(--gold-light); font-size: 14px; text-transform: uppercase; letter-spacing: 1px; margin: 0 0 12px; }
.footer-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.footer-list a { color: #ecd9b8; font-size: 14px; }
.footer-list a:hover { color: #fff; }
.site-footer .muted { color: #c9b088; }

.footer-legal {
  margin-top: 32px;
  padding-top: 18px;
  border-top: 1px solid rgba(236,217,184,0.25);
  font-size: 12px;
  color: #c9b088;
}
