:root {
  --ink: #17231f;
  --muted: #68746f;
  --green: #174c3c;
  --green-light: #dcebe5;
  --coral: #b95046;
  --gold: #bb8a27;
  --paper: #ffffff;
  --surface: #f4f7f5;
  --line: #d8dfdc;
  --shadow: 0 16px 50px rgba(23, 35, 31, 0.11);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: var(--ink);
  background: var(--surface);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--surface); }
button, input { font: inherit; letter-spacing: 0; }
button, label, input[type="radio"] { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

.survey-shell { width: min(100%, 720px); margin: 0 auto; background: var(--paper); min-height: 100vh; box-shadow: var(--shadow); }
.survey-header { min-height: 230px; padding: 48px 24px 40px; text-align: center; color: white; background: var(--green); position: relative; overflow: hidden; }
.survey-header::before, .survey-header::after { content: ""; position: absolute; width: 110px; height: 110px; border: 1px solid rgba(255,255,255,.18); transform: rotate(45deg); }
.survey-header::before { left: -68px; top: 54px; }
.survey-header::after { right: -68px; bottom: 48px; }
.date { margin: 0 0 18px; color: var(--gold); font-size: 13px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; }
.survey-header h1 { margin: 0; font: 500 40px/1.1 Georgia, serif; letter-spacing: 0; }
.survey-header h1 span { color: #e3b550; font-style: italic; }
.survey-header > p:last-child { margin: 16px 0 0; font-size: 15px; letter-spacing: 1px; color: #d9e8e2; }

.survey-form { padding: 12px 24px 40px; }
.returning-guest { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 0 10px; color: var(--muted); font-size: 13px; }
.returning-guest a { flex: 0 0 auto; color: var(--green); font-weight: 700; text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 2px; }
.returning-guest a:hover { color: var(--coral); }
.question { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; padding: 30px 0; border-bottom: 1px solid var(--line); animation: reveal .28s ease-out; }
.question-number { color: var(--coral); font: 700 13px/1.4 Georgia, serif; padding-top: 3px; }
.question-body { min-width: 0; border: 0; padding: 0; margin: 0; }
.question-title { display: block; margin: 0 0 18px; font-size: 18px; line-height: 1.55; font-weight: 700; }

input[type="text"], input[type="tel"], input[type="search"], input[type="password"] { width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: 6px; padding: 11px 13px; outline: none; color: var(--ink); background: white; transition: border-color .2s, box-shadow .2s; }
input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(23,76,60,.12); }
input::placeholder { color: #9aa29f; }

.option { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 11px; align-items: start; padding: 14px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 7px; cursor: pointer; transition: background .2s, border-color .2s; }
.option:hover { border-color: #a9bbb4; }
.option:has(input:checked) { border-color: var(--green); background: var(--green-light); }
.option input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--green); }
.option strong, .option small { display: block; }
.option strong { line-height: 1.5; }
.option small { margin-top: 5px; color: var(--muted); line-height: 1.6; }
.room-option { padding-block: 16px; }

.segment-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.segment-options input { position: absolute; opacity: 0; pointer-events: none; }
.segment-options span { display: flex; align-items: center; justify-content: center; height: 48px; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; font-weight: 700; }
.segment-options input:checked + span { color: white; background: var(--green); border-color: var(--green); }

.submit-button, .invitation-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 20px; border: 0; border-radius: 6px; text-decoration: none; font-weight: 700; cursor: pointer; }
.submit-button { width: 100%; margin-top: 28px; color: white; background: var(--coral); box-shadow: 0 8px 22px rgba(185,80,70,.2); }
.submit-button:disabled { opacity: .65; cursor: wait; }
.form-error { margin: 20px 0 0; padding: 12px 14px; color: #8d2f28; background: #fae8e6; border-left: 3px solid var(--coral); font-size: 14px; }

.success-view { min-height: 540px; padding: 74px 28px 60px; text-align: center; animation: reveal .4s ease-out; }
.success-mark { display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 24px; border-radius: 50%; color: white; background: var(--green); font-size: 28px; }
.success-view h2 { margin: 0 0 12px; font: 500 30px/1.3 Georgia, "Microsoft YaHei", serif; }
.success-view > p { color: var(--muted); line-height: 1.8; }
.invitation-button { margin: 24px 0; color: white; background: var(--green); }
.success-view .wishes { margin: 18px auto 0; max-width: 500px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 14px; }
footer { padding: 28px; text-align: center; color: #89928e; font: 12px Georgia, serif; }

.login-page { display: grid; place-items: center; padding: 24px; background: var(--green); }
.login-panel { width: min(100%, 410px); padding: 36px; border-radius: 8px; background: white; box-shadow: var(--shadow); }
.login-panel h1 { margin: 0 0 28px; font-size: 26px; }
.login-panel label { display: block; margin-bottom: 8px; font-weight: 700; }
.login-panel .text-link { display: block; margin-top: 24px; text-align: center; }
.text-link { color: var(--green); text-underline-offset: 3px; }

.admin-shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 34px 0 60px; }
.admin-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.admin-header h1 { margin: 0; font-size: 30px; }
.admin-header .date { margin-bottom: 8px; color: var(--coral); }
.admin-actions { display: flex; align-items: center; gap: 18px; }
.secondary-button { min-height: 40px; color: white; background: var(--green); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 3px solid var(--green); background: white; box-shadow: 0 7px 24px rgba(23,35,31,.07); }
.stats div { padding: 22px; border-right: 1px solid var(--line); }
.stats div:last-child { border-right: 0; }
.stats span, .stats small { display: block; }
.stats span { font: 700 28px Georgia, serif; }
.stats small { margin-top: 5px; color: var(--muted); }
.data-toolbar { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin: 28px 0 12px; }
.search-box { width: min(360px, 100%); }
.search-box span { display: block; margin-bottom: 6px; font-size: 13px; color: var(--muted); }
.filter-tabs { display: flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.filter-tabs button { min-height: 38px; padding: 0 18px; border: 0; border-right: 1px solid var(--line); background: white; cursor: pointer; }
.filter-tabs button:last-child { border-right: 0; }
.filter-tabs button.active { color: white; background: var(--green); }
.table-wrap { overflow-x: auto; background: white; border: 1px solid var(--line); border-radius: 6px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 15px 13px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { white-space: nowrap; color: var(--muted); background: #edf2ef; font-size: 12px; }
tbody tr:last-child td { border-bottom: 0; }
td small { display: block; margin-top: 4px; color: var(--muted); }
.status { display: inline-block; padding: 4px 8px; border-radius: 4px; font-size: 12px; font-weight: 700; }
.status.yes { color: var(--green); background: var(--green-light); }
.status.no { color: #8d2f28; background: #fae8e6; }
.empty-state { margin: 0; padding: 46px 20px; text-align: center; color: var(--muted); }

@keyframes reveal { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (max-width: 700px) {
  .survey-header { min-height: 205px; padding-top: 40px; }
  .survey-header h1 { font-size: 35px; }
  .survey-form { padding-inline: 18px; }
  .returning-guest { align-items: flex-start; flex-direction: column; gap: 7px; padding-top: 14px; }
  .question { grid-template-columns: 32px minmax(0, 1fr); gap: 8px; }
  .question-title { font-size: 17px; }
  .admin-shell { width: min(100% - 24px, 1180px); padding-top: 22px; }
  .admin-header, .data-toolbar { align-items: stretch; flex-direction: column; }
  .admin-actions { justify-content: space-between; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats div:nth-child(2) { border-right: 0; }
  .stats div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .filter-tabs button { flex: 1; }
  table, tbody { display: block; }
  thead { display: none; }
  tr { display: block; padding: 10px 14px; border-bottom: 1px solid var(--line); }
  tbody tr:last-child { border-bottom: 0; }
  td { display: grid; grid-template-columns: 92px minmax(0, 1fr); padding: 7px 0; border: 0; }
  td::before { content: attr(data-label); color: var(--muted); font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
