:root {
  --bg: #f3f6fa;
  --card: #ffffff;
  --ink: #152033;
  --muted: #66758b;
  --line: #d9e2ef;
  --blue: #1f5f9a;
  --blue-2: #2f7cc0;
  --orange: #e86a1a;
  --ok: #1f8a4c;
  --warn: #b7791f;
  --danger: #c53030;
  --shadow: 0 10px 30px rgba(21, 32, 51, 0.08);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
}

body {
  padding: 0;
}

.wrap {
  width: min(100%, 480px);
  margin: 0 auto;
  min-height: 100dvh;
  padding: 16px 16px calc(24px + env(safe-area-inset-bottom));
}

.hero {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(160deg, #1f5f9a 0%, #2a73b3 55%, #1a4f82 100%);
  color: #fff;
  border-radius: 20px;
  padding: 28px 18px 26px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
  text-align: center;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../img/logo.png") center 58% / 48% no-repeat;
  opacity: 0.38;
  pointer-events: none;
}

.hero h1,
.hero-en {
  position: relative;
  z-index: 1;
}

.hero h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.25;
}

.hero-en {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.4;
  opacity: 0.92;
  letter-spacing: 0.02em;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.field { margin-bottom: 14px; }

.field label {
  display: block;
  margin-bottom: 6px;
}

.label-zh {
  display: block;
  font-size: 14px;
  font-weight: 650;
}

.label-en {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.field .req { color: var(--orange); }

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 12px;
  font: inherit;
  font-size: 16px;
  background: #fff;
  color: #152033;
  outline: none;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #c2cad4;
  opacity: 1;
  font-size: 13px;
}

.field select:invalid {
  color: #c2cad4;
}

.field select option {
  color: #152033;
}

.field textarea { min-height: 84px; resize: vertical; }

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--blue-2);
  box-shadow: 0 0 0 3px rgba(47, 124, 192, 0.15);
}

.btn {
  width: 100%;
  border: 0;
  border-radius: 14px;
  min-height: 50px;
  font: inherit;
  font-size: 17px;
  font-weight: 750;
  cursor: pointer;
  display: grid;
  gap: 2px;
  place-items: center;
  line-height: 1.2;
  padding: 10px 12px;
}

.btn-en {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.88;
}

.btn-primary {
  background: linear-gradient(180deg, #2f7cc0, #1f5f9a);
  color: #fff;
}

.btn-primary:disabled { opacity: 0.55; }

.btn-secondary {
  background: #eef3f9;
  color: var(--blue);
}

.btn-danger {
  background: #fdecec;
  color: var(--danger);
}

.btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.hint {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.hint-zh,
.hint-en {
  display: block;
}

.hint-en {
  margin-top: 4px;
  font-size: 11px;
}

.banner {
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.45;
  margin-bottom: 12px;
}

.banner.warn {
  background: #fff7e8;
  color: #8a5a10;
  border: 1px solid #f0d9a6;
}

.banner.ok {
  background: #eaf8f0;
  color: #1f8a4c;
  border: 1px solid #b7e2c7;
}

.banner.info {
  background: #eaf2fb;
  color: #1f5f9a;
  border: 1px solid #c5d9ef;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 10%;
  transform: translateX(-50%);
  background: rgba(21, 32, 51, 0.92);
  color: #fff;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 14px;
  z-index: 50;
  display: none;
}

.toast.show { display: block; }

.success-box {
  text-align: center;
  padding: 28px 10px 10px;
}

.success-box h2 {
  margin: 0 0 12px;
  font-size: 22px;
}

.success-box h2 .label-en {
  margin-top: 4px;
  font-size: 14px;
  font-weight: 600;
}

.success-box p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.btn-again {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding: 8px 12px;
  font-size: 14px;
  display: grid;
  gap: 2px;
  place-items: center;
}

.btn-exit {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  font-size: 14px;
  display: grid;
  gap: 2px;
  place-items: center;
  background: #eef3f9;
  border: 1px solid var(--line);
  color: var(--ink);
}

.btn-exit .btn-en,
.btn-again .btn-en {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.88;
}

.btn-dark {
  background: #eef3f9;
  color: var(--ink);
}

.btn-again .btn-zh {
  font-size: 14px;
  font-weight: 700;
}

.btn-again .btn-en {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.88;
}

.success-phone {
  margin-top: 12px !important;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 8px;
}

.success-phone .phone-label-zh {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.success-phone .phone-number {
  margin-top: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.topbar h1 {
  margin: 0;
  font-size: 20px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}

.tab {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 8px 6px;
  font: inherit;
  font-size: 13px;
  color: var(--muted);
}

.tab.on {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  font-weight: 700;
}

.list { display: grid; gap: 10px; }

.item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow);
}

.item-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 8px;
}

.item-head strong { font-size: 17px; }
.badge {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.badge.pending { background: #fff4df; color: var(--warn); }
.badge.scheduled { background: #eaf8f0; color: var(--ok); }
.badge.done { background: #eef3f9; color: var(--muted); }

.meta {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.meta a { color: var(--blue); text-decoration: none; font-weight: 700; }

.type-pill {
  display: inline-block;
  margin-top: 8px;
  background: #eaf2fb;
  color: var(--blue);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 13px;
  font-weight: 700;
}

.visit-box {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.visit-box input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  font: inherit;
  font-size: 15px;
  margin-bottom: 8px;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 40px 10px;
}

.login-card {
  margin-top: 18vh;
}

.password-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrap input {
  padding-right: 48px;
}

.eye-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  border-radius: 10px;
  line-height: 1;
}

.eye-btn:active {
  background: #eef3f9;
}

.setup details {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #f8fbff;
}

.setup summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--blue);
}

.setup ol {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.hidden { display: none !important; }

.overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(7, 12, 20, 0.72);
  display: grid;
  place-items: center;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
}

.panel {
  width: min(100%, 480px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px 22px 18px 18px;
  padding: 18px 16px 14px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 10px;
}

.panel h2 {
  margin: 0;
  text-align: center;
  font-size: 20px;
}

.sms-preview {
  margin: 0;
  padding: 12px;
  border-radius: 12px;
  background: #f3f6fa;
  border: 1px solid var(--line);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  text-align: left;
}

.btn-text {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--muted);
  min-height: 40px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
