:root {
  color-scheme: light;
  --ink: #17211c;
  --muted: #5b6861;
  --line: #d8ded9;
  --paper: #fbfcfb;
  --soft: #eef4ef;
  --green: #1f6f4a;
  --green-dark: #155237;
  --gold: #a27224;
  --blue: #275d8f;
  --white: #ffffff;
  --shadow: 0 18px 44px rgba(31, 55, 45, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
  line-height: 1.6;
}

body.modal-open {
  overflow: hidden;
}

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

.site-header {
  min-height: 84vh;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.96), rgba(238, 244, 239, 0.9)),
    linear-gradient(135deg, #fff8f3 0%, #eef4ef 48%, #e5eef7 100%);
  border-bottom: 1px solid var(--line);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

.brand img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.brand span {
  max-width: 360px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 15px;
}

.nav-links a:hover {
  color: var(--green-dark);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(380px, 1fr);
  align-items: center;
  gap: 40px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 70px 24px 66px;
}

.hero-copy {
  max-width: 760px;
}

.hero-logo {
  width: min(520px, 100%);
  height: auto;
  margin-bottom: 28px;
}

.hero-media,
.photo-grid figure {
  margin: 0;
}

.hero-media {
  position: relative;
  overflow: hidden;
  min-height: 430px;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero-media img,
.photo-grid img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-media img {
  position: absolute;
  inset: 0;
}

.hero-media::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 52%, rgba(0, 0, 0, 0.54) 100%);
}

.hero-media figcaption,
.photo-grid figcaption {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 16px;
  z-index: 1;
  color: var(--white);
  font-size: 14px;
  font-weight: 700;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 780px;
  margin-bottom: 22px;
  font-size: clamp(38px, 6vw, 68px);
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.16;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 20px;
  line-height: 1.35;
}

.lead {
  max-width: 690px;
  margin-bottom: 30px;
  color: var(--muted);
  font-size: 20px;
}

.hero-actions,
.form-footer,
.toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.button:hover {
  border-color: rgba(31, 111, 74, 0.5);
  box-shadow: 0 10px 24px rgba(31, 55, 45, 0.12);
  transform: translateY(-1px);
}

.button.primary {
  border-color: var(--green);
  background: var(--green);
  color: var(--white);
}

.button.ghost {
  background: rgba(255, 255, 255, 0.72);
}

.section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 72px 24px;
}

.section-heading {
  margin-bottom: 28px;
}

.section-heading p:last-child {
  max-width: 760px;
  color: var(--muted);
}

.about-section {
  padding-bottom: 38px;
}

.photo-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(280px, 0.88fr);
  gap: 16px;
}

.photo-grid figure {
  position: relative;
  overflow: hidden;
  min-height: 330px;
  border-radius: 8px;
  background: var(--soft);
}

.photo-grid .photo-feature {
  min-height: 420px;
}

.photo-grid figure::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.5) 100%);
}

.standard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.standard-card {
  display: grid;
  gap: 16px;
  min-height: 180px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 12px 30px rgba(31, 55, 45, 0.07);
}

.standard-card p {
  margin-bottom: 0;
  color: var(--muted);
}

.standard-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
}

.standard-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--soft);
  color: var(--green-dark);
  font-weight: 800;
}

.form-section {
  max-width: 100%;
  background: var(--soft);
}

.form-section > * {
  max-width: 1180px;
  margin-left: auto;
  margin-right: auto;
}

.opinion-form {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-weight: 700;
}

label span {
  font-size: 14px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-weight: 400;
  padding: 10px 12px;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(31, 111, 74, 0.14);
  outline: none;
}

.wide {
  grid-column: 1 / -1;
}

.consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 18px 0 24px;
  color: var(--muted);
  font-weight: 400;
}

.consent input {
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  margin-top: 4px;
}

.form-footer {
  justify-content: space-between;
}

#formMessage {
  min-height: 28px;
  margin: 0;
  color: var(--green-dark);
  font-weight: 700;
}

#formMessage.error {
  color: #a63326;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px 24px 38px;
  color: var(--muted);
}

.admin-header {
  background: var(--soft);
  border-bottom: 1px solid var(--line);
}

.admin-title {
  max-width: 1180px;
  margin: 0 auto;
  padding: 54px 24px 46px;
}

.admin-title h1 {
  margin-bottom: 12px;
  font-size: clamp(34px, 5vw, 54px);
}

.admin-title p:last-child {
  max-width: 680px;
  color: var(--muted);
}

.admin-main {
  padding-top: 36px;
}

.toolbar {
  justify-content: space-between;
  margin-bottom: 22px;
}

.toolbar label {
  min-width: min(360px, 100%);
}

.summary-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.summary-box {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.summary-box strong {
  display: block;
  font-size: 26px;
  line-height: 1.2;
}

.summary-box span {
  color: var(--muted);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

table {
  width: 100%;
  min-width: 1040px;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: #f5f8f5;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

td {
  font-size: 14px;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.cell-muted {
  color: var(--muted);
}

.preview-dialog {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(18, 27, 23, 0.58);
}

.preview-dialog.open {
  display: flex;
}

.preview-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  width: min(1020px, 100%);
  max-height: min(86vh, 920px);
  overflow: hidden;
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
}

.preview-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--line);
}

.preview-header h2 {
  margin-bottom: 0;
  font-size: clamp(22px, 3vw, 32px);
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
  font-size: 30px;
  line-height: 1;
}

.preview-notice {
  padding: 10px 24px;
  border-bottom: 1px solid var(--line);
  background: #fff8ec;
  color: #7c4c00;
  font-size: 14px;
  font-weight: 700;
}

.preview-body {
  position: relative;
  overflow: auto;
  padding: 32px;
  user-select: text;
}

.preview-body h3 {
  margin: 24px 0 12px;
  font-size: 24px;
  text-align: center;
}

.preview-body h4 {
  margin: 22px 0 8px;
  font-size: 18px;
}

.preview-body p {
  margin-bottom: 10px;
}

.preview-watermark {
  position: sticky;
  top: 0;
  z-index: 1;
  display: inline-flex;
  margin-bottom: 18px;
  padding: 5px 10px;
  border: 1px solid rgba(162, 114, 36, 0.32);
  border-radius: 6px;
  background: rgba(255, 248, 236, 0.92);
  color: #7c4c00;
  font-size: 13px;
  font-weight: 700;
}

.preview-table-wrap {
  overflow-x: auto;
  margin: 18px 0;
}

.preview-table {
  min-width: 640px;
  font-size: 14px;
}

.preview-table td {
  border: 1px solid var(--line);
}

.preview-loading,
.preview-error {
  color: var(--muted);
  font-weight: 700;
}

.preview-error {
  color: #a63326;
}

@media (max-width: 860px) {
  .topbar,
  .footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-links {
    flex-wrap: wrap;
  }

  .hero {
    grid-template-columns: 1fr;
    padding-top: 54px;
  }

  .hero-media {
    min-height: 340px;
  }

  .standard-grid,
  .form-grid,
  .summary-row,
  .photo-grid {
    grid-template-columns: 1fr;
  }

  .photo-grid figure,
  .photo-grid .photo-feature {
    min-height: 300px;
  }

  .opinion-form {
    padding: 20px;
  }

  .preview-dialog {
    padding: 12px;
  }

  .preview-panel {
    max-height: 92vh;
  }

  .preview-body {
    padding: 22px 18px;
  }
}

@media (max-width: 520px) {
  .section,
  .hero,
  .topbar,
  .admin-title {
    padding-left: 18px;
    padding-right: 18px;
  }

  h1 {
    font-size: 36px;
  }

  .lead {
    font-size: 18px;
  }

  .brand span {
    max-width: 260px;
  }

  .hero-logo {
    margin-bottom: 22px;
  }

  .hero-media {
    min-height: 260px;
  }

  .button {
    width: 100%;
  }

  .standard-actions,
  .form-footer {
    align-items: stretch;
    flex-direction: column;
  }
}

@media print {
  .preview-dialog {
    display: none !important;
  }
}
