:root {
  color-scheme: light;
  --blue: #45a6f3;
  --text: #111;
  --muted: #7a7a7a;
  --line: #e4e4e4;
  --deep-line: #d9d9d9;
  --danger: #e75b5b;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: #f6f6f6;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
}

button,
input,
select {
  font: inherit;
}

.phone-page {
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  margin: 0 auto;
  background: #fff;
}

.wechat-shell {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #f3f3f3;
}

.status-bar {
  height: 43px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 29px 0 30px;
  background: #f3f3f3;
  color: #202124;
  user-select: none;
}

.status-time {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0;
}

.status-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-badge {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #e42525;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.status-right {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 800;
}

.net-speed {
  font-size: 9px;
  line-height: 0.9;
  text-align: left;
}

.mute-icon {
  position: relative;
  width: 20px;
  height: 18px;
  transform: rotate(43deg);
  border-left: 4px solid #252525;
  border-radius: 2px;
}

.mute-icon::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 2px;
  width: 10px;
  height: 12px;
  border-left: 4px solid #252525;
  border-radius: 6px 0 0 6px;
}

.mute-icon::after {
  content: "";
  position: absolute;
  left: -5px;
  top: 7px;
  width: 25px;
  height: 3px;
  background: #252525;
  border-radius: 2px;
}

.signal-set {
  display: grid;
  grid-template-columns: repeat(4, 4px);
  grid-template-rows: 11px 18px;
  column-gap: 2px;
  align-items: end;
}

.signal-set span {
  grid-column: 1 / -1;
  align-self: start;
  font-size: 9px;
  line-height: 1;
  text-align: center;
}

.bar {
  display: block;
  width: 4px;
  background: #252525;
  border-radius: 2px 2px 0 0;
}

.b1 { height: 7px; }
.b2 { height: 11px; }
.b3 { height: 15px; }
.b4 { height: 18px; }

.battery {
  min-width: 34px;
  height: 19px;
  line-height: 19px;
  padding: 0 5px;
  background: #7d7d7d;
  color: #fff;
  border-radius: 6px;
  font-size: 15px;
  text-align: center;
  position: relative;
}

.battery::after {
  content: "";
  position: absolute;
  right: -4px;
  top: 5px;
  width: 3px;
  height: 9px;
  border-radius: 0 2px 2px 0;
  background: #9d9d9d;
}

.browser-bar {
  height: 54px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f3f3;
}

.browser-title {
  width: 68%;
  text-align: center;
  line-height: 1.05;
}

.browser-page-title {
  display: none;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 18px;
  font-weight: 700;
}

.browser-domain {
  color: #111;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0;
}

.is-scrolled .browser-page-title {
  display: block;
}

.is-scrolled .browser-domain {
  margin-top: 4px;
  color: #7a7a7a;
  font-size: 14px;
  font-weight: 700;
}

.icon-button,
.more-button {
  position: absolute;
  top: 0;
  width: 54px;
  height: 54px;
  border: 0;
  background: transparent;
  color: #111;
}

.close-button {
  left: 6px;
}

.close-button span,
.close-button span::after {
  content: "";
  position: absolute;
  left: 15px;
  top: 26px;
  width: 23px;
  height: 2px;
  background: #202124;
  border-radius: 2px;
  transform: rotate(45deg);
}

.close-button span::after {
  left: 0;
  top: 0;
  transform: rotate(90deg);
}

.more-button {
  right: 7px;
  padding-bottom: 14px;
  font-size: 27px;
  font-weight: 800;
  letter-spacing: 2px;
}

.browser-divider {
  height: 7px;
  background: #cacaca;
}

.form-page {
  padding: 0 20px 52px;
}

.survey-title {
  margin: 44px auto 0;
  max-width: 362px;
  color: var(--blue);
  font-size: 25px;
  line-height: 1.45;
  font-weight: 800;
  text-align: center;
  letter-spacing: 0;
}

.survey-form {
  margin-top: 34px;
}

.question {
  margin-top: 38px;
}

.question:first-child {
  margin-top: 0;
}

.question-label {
  display: block;
  font-size: 24px;
  line-height: 1.32;
  font-weight: 600;
  color: #030303;
}

.required {
  color: var(--danger);
  font-size: 21px;
  font-weight: 700;
}

.wjx-input,
.select-box {
  margin-top: 30px;
  height: 47px;
  border: 1px solid var(--line);
  background: #fff;
  display: flex;
  align-items: center;
  position: relative;
}

.wjx-input:focus-within,
.select-box:focus-within {
  border-color: #b7d9f7;
}

.wjx-input input,
.select-box select {
  width: 100%;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #222;
  font-size: 20px;
}

.wjx-input input {
  padding: 0 14px;
}

.wjx-input.with-icon input {
  padding-left: 48px;
}

.person-icon {
  position: absolute;
  left: 17px;
  top: 50%;
  width: 19px;
  height: 19px;
  transform: translateY(-50%);
}

.person-icon::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 0;
  width: 8px;
  height: 8px;
  background: #939393;
  border-radius: 50%;
}

.person-icon::after {
  content: "";
  position: absolute;
  left: 2px;
  bottom: 0;
  width: 15px;
  height: 10px;
  background: #939393;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.radio-grid {
  margin-top: 30px;
  height: 52px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
}

.radio-cell {
  display: flex;
  align-items: center;
  min-width: 0;
  padding-left: 14px;
  border-right: 1px solid var(--line);
  color: #636363;
  cursor: pointer;
}

.radio-cell:last-child {
  border-right: 0;
}

.radio-cell input,
.candidate-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.fake-radio,
.candidate-radio {
  width: 28px;
  height: 28px;
  border: 2px solid #b7b7b7;
  border-radius: 50%;
  background: #fff;
  flex: 0 0 auto;
}

.radio-cell input:checked + .fake-radio,
.candidate-row input:checked + .candidate-radio {
  border-color: var(--blue);
  box-shadow: inset 0 0 0 7px #fff;
  background: var(--blue);
}

.radio-text {
  margin-left: 20px;
  font-size: 24px;
  font-weight: 500;
}

.select-box select {
  appearance: none;
  padding: 0 52px 0 13px;
  color: #686868;
}

.select-arrow {
  position: absolute;
  right: 20px;
  top: 50%;
  width: 0;
  height: 0;
  margin-top: -2px;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid #8a8a8a;
  pointer-events: none;
}

.vote-question {
  margin-top: 80px;
}

.candidate-board {
  margin-top: 30px;
  border: 1px solid var(--line);
  background: #fff;
}

.candidate-row {
  min-height: 58px;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 17px;
  align-items: center;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  color: #555;
  cursor: pointer;
}

.candidate-row:last-child {
  border-bottom: 0;
}

.candidate-name {
  font-size: 20px;
  color: #333;
}

.candidate-unit {
  color: #818181;
  font-size: 15px;
}

.submit-button {
  width: 100%;
  height: 52px;
  margin: 54px 0 30px;
  border: 0;
  border-radius: 2px;
  background: var(--blue);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
}

.submit-button:disabled {
  opacity: 0.72;
}

.invalid .wjx-input,
.invalid .radio-grid,
.invalid .select-box,
.invalid .candidate-board {
  border-color: var(--danger);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  z-index: 50;
  max-width: min(320px, calc(100vw - 48px));
  transform: translate(-50%, 18px);
  padding: 10px 16px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-size: 15px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.error {
  background: rgba(170, 44, 44, 0.92);
}

.toast.success {
  background: rgba(31, 121, 74, 0.92);
}

.qr-body,
.admin-body {
  min-height: 100vh;
  display: grid;
  place-items: start center;
  padding: 32px 18px;
  background: #f3f6f9;
}

.qr-panel,
.admin-page {
  width: min(960px, 100%);
  background: #fff;
  border: 1px solid #e5e8ef;
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(26, 40, 61, 0.08);
}

.qr-panel {
  max-width: 420px;
  padding: 30px 24px;
  text-align: center;
}

.qr-panel h1,
.admin-header h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.25;
}

.qr-note,
.admin-header p {
  margin: 10px 0 0;
  color: #6f7785;
  line-height: 1.6;
}

.qr-card {
  width: 294px;
  height: 294px;
  margin: 28px auto 16px;
  display: grid;
  place-items: center;
  border: 1px solid #edf0f4;
  background: #fff;
}

.qr-card img {
  width: 260px;
  height: 260px;
}

.qr-url {
  word-break: break-all;
  color: #4b5565;
  font-size: 14px;
  line-height: 1.5;
}

.qr-actions {
  display: flex;
  gap: 12px;
  margin-top: 22px;
}

.qr-link,
.admin-actions button {
  flex: 1;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #1f7fd7;
  border-radius: 4px;
  background: #1f7fd7;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
}

.qr-link.muted,
.admin-actions button:nth-child(2) {
  background: #fff;
  color: #1f7fd7;
}

.admin-page {
  padding: 26px;
}

.admin-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.admin-actions {
  display: flex;
  gap: 10px;
}

.admin-actions button {
  min-width: 96px;
  flex: 0 0 auto;
  cursor: pointer;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.result-card,
.empty-card {
  border: 1px solid #e6eaf1;
  border-radius: 6px;
  padding: 16px;
  background: #fbfcfe;
}

.result-card span {
  display: block;
  color: #6a7280;
  font-size: 14px;
}

.result-card strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
  line-height: 1;
}

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

table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid #eef1f5;
  text-align: left;
  font-size: 14px;
}

th {
  background: #f8fafc;
  color: #485160;
  font-weight: 700;
}

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

@media (max-width: 480px) {
  body {
    background: #fff;
  }

  .phone-page {
    max-width: none;
  }

  .form-page {
    padding-left: 20px;
    padding-right: 20px;
  }

  .admin-header,
  .qr-actions {
    flex-direction: column;
  }

  .admin-actions {
    width: 100%;
  }

  .admin-actions button {
    flex: 1;
  }
}
