:root {
  --brand: #174f9f;
  --brand-dark: #0c3675;
  --line: #dbe2ec;
  --muted: #687386;
  --paper: #ffffff;
  --bg: #f1f4f8;
  --danger: #c8342d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: #172033;
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

button, input, textarea { font: inherit; }

.survey-shell {
  width: min(100%, 430px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--paper);
  box-shadow: 0 0 24px rgba(20, 41, 77, 0.12);
}

.hero {
  border-top: 5px solid #8799b5;
  background: #f8fafc;
}

.hero img {
  display: block;
  width: 100%;
  height: 128px;
  object-fit: cover;
}

.intro, .survey-form, .success-panel { padding: 26px 20px; }

.logo {
  display: block;
  width: 210px;
  max-width: 72%;
  height: auto;
  margin: 0 auto 18px;
}

h1 {
  margin: 0 0 18px;
  color: var(--brand);
  font-size: 24px;
  line-height: 1.25;
  text-align: center;
}

.lead {
  margin: 0;
  color: #111827;
  font-size: 15px;
  line-height: 1.75;
}

.divider {
  height: 1px;
  margin: 24px 0 0;
  border: 0;
  border-top: 1px dashed #c7cfdb;
}

.section-title {
  margin: 28px 0 14px;
  color: var(--brand-dark);
  font-size: 15px;
  font-weight: 700;
}

.field { margin: 0 0 24px; }

.label {
  display: block;
  margin: 0 0 10px;
  font-size: 16px;
  line-height: 1.45;
}

.required {
  color: var(--danger);
  margin-right: 4px;
}

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

.text-input, .textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 9px 10px;
  color: #111827;
  background: #fff;
  outline: none;
}

.textarea {
  min-height: 88px;
  resize: vertical;
}

.text-input:focus, .textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(23, 79, 159, 0.12);
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-right: 0;
  border-bottom: 0;
}

.option {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 9px;
  padding: 11px 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: #243047;
  line-height: 1.35;
}

.option input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  accent-color: var(--brand);
}

.agree {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  margin: 18px 0 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.agree input {
  width: 17px;
  height: 17px;
  margin-top: 2px;
  accent-color: var(--brand);
}

.submit {
  width: 100%;
  height: 48px;
  border: 0;
  color: #fff;
  background: var(--brand);
  font-weight: 700;
}

.submit:disabled { background: #92a7c7; }

.message {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--danger);
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
}

.success-panel { text-align: center; }

.success-icon {
  display: inline-grid;
  width: 52px;
  height: 52px;
  place-items: center;
  margin: 20px auto 18px;
  border-radius: 50%;
  color: #fff;
  background: #1c8c57;
  font-size: 30px;
  font-weight: 700;
}

.footer {
  padding: 18px 20px 26px;
  color: #98a2b3;
  font-size: 13px;
  text-align: center;
}

.admin-body {
  min-height: 100vh;
  background: #f6f8fb;
}

.admin-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.admin-title h1 {
  margin: 0 0 6px;
  text-align: left;
}

.admin-title p {
  margin: 0;
  color: var(--muted);
}

.admin-card {
  background: #fff;
  border: 1px solid #e4e9f1;
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.admin-controls {
  display: grid;
  grid-template-columns: 1fr 1fr auto auto;
  gap: 10px;
  margin-bottom: 14px;
}

.admin-input {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
}

.admin-button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  padding: 0 14px;
  color: #fff;
  background: var(--brand);
  cursor: pointer;
}

.admin-button.secondary {
  color: var(--brand);
  background: #e8eef8;
}

.table-wrap {
  overflow: auto;
  border: 1px solid #e4e9f1;
  border-radius: 6px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 14px;
}

th, td {
  min-width: 120px;
  padding: 10px 12px;
  border-bottom: 1px solid #edf1f6;
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #344054;
  background: #f8fafc;
  font-weight: 700;
}

.admin-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 640px) {
  .survey-shell { box-shadow: none; }
  .option-grid { grid-template-columns: 1fr; }
  .admin-controls { grid-template-columns: 1fr; }
  .admin-topbar { display: block; }
}
