:root {
  --primary: #2BA8B8;
  --primary-dark: #1E8A98;
  --primary-light: #E0F5F7;
  --bg: #F4F6F7;
  --surface: #fff;
  --text-1: #1C2B2D;
  --text-2: #5A6B6D;
  --text-3: #9AA8A9;
  --border: #E2E8E8;
  --success: #27AE60;
  --error: #E74C3C;
  --radius: 12px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text-1);
  line-height: 1.6;
}
.app { max-width: 480px; margin: 0 auto; min-height: 100vh; background: var(--bg); }
.brand-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  padding: 36px 24px 28px;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.brand-header:after {
  content: "";
  position: absolute;
  right: -30px;
  top: -30px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}
.brand-row { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.brand-logo {
  width: 52px;
  height: 52px;
  padding: 0;
  border: 0;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  flex-shrink: 0;
  cursor: default;
  -webkit-tap-highlight-color: transparent;
}
button.brand-logo { cursor: pointer; }
button.brand-logo:active { transform: scale(0.96); }
.brand-logo img { width: 100%; height: 100%; object-fit: cover; }
.brand-name { font-size: 20px; font-weight: 700; letter-spacing: 1px; }
.brand-sub { font-size: 12px; opacity: 0.9; margin-top: 2px; line-height: 1.45; }
.hero-title { font-size: 24px; font-weight: 700; margin-top: 24px; position: relative; z-index: 1; }
.hero-desc { font-size: 14px; opacity: 0.9; margin-top: 6px; position: relative; z-index: 1; }
.hero-address {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  position: relative;
  z-index: 1;
}
.addr-label {
  flex: none;
  font-size: 12px;
  font-weight: 650;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 6px;
  color: #fff;
  background: rgba(255, 255, 255, 0.22);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.addr-link {
  color: #fff;
  font-size: 13px;
  line-height: 1.5;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.addr-link:active { opacity: 0.75; }
.view { display: none; }
.view.active { display: block; }
.form-wrap { padding: 20px 16px 12px; }
.form-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px 20px;
  box-shadow: 0 2px 12px rgba(43, 168, 184, 0.08);
}
.field { margin-bottom: 18px; }
.field-label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 8px; }
.required { color: var(--error); }
.optional { font-size: 12px; color: var(--text-3); font-weight: 400; margin-left: 6px; }
.field-note { font-size: 12px; color: var(--text-3); margin: -2px 0 8px; line-height: 1.5; }
.field-input, .field-select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text-1);
  background: #FAFBFB;
  outline: none;
  appearance: none;
}
.field-input:focus, .field-select:focus { border-color: var(--primary); background: #fff; }
.field-input::placeholder { color: var(--text-3); }
.field-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239AA8A9' stroke-width='2' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.field-error { font-size: 12px; color: var(--error); margin-top: 6px; display: none; }
.field.has-error .field-input,
.field.has-error .field-select,
.field.has-error .reason-trigger { border-color: var(--error); }
.drop { position: relative; }
.reason-trigger {
  width: 100%;
  padding: 12px 36px 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  text-align: left;
  color: var(--text-3);
  background: #fafbfb url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239AA8A9' stroke-width='2' fill='none'/%3E%3C/svg%3E") no-repeat right 14px center;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.reason-trigger.chosen { color: var(--text-1); }
.reason-trigger.open {
  border-color: var(--primary);
  background-color: #fff;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.drop-menu {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: -1.5px;
  background: #fff;
  border: 1.5px solid var(--primary);
  border-top: 0;
  border-radius: 0 0 12px 12px;
  box-shadow: 0 14px 28px rgba(30, 138, 152, 0.14);
  overflow: hidden;
  transform-origin: top center;
  animation: drop-in 0.22s cubic-bezier(0.2, 0.75, 0.2, 1);
}
.drop-menu[hidden] { display: none; }
.reason-option {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 13px 14px;
  border: 0;
  border-top: 1px solid #eef3f4;
  background: #fff;
  color: var(--text-1);
  font-size: 15px;
  text-align: left;
  border-radius: 0;
  animation: option-in 0.24s ease both;
}
.reason-option:active { background: var(--primary-light); }
.reason-option.selected { color: var(--primary-dark); font-weight: 650; background: var(--primary-light); }
.reason-option:nth-child(2) { animation-delay: 0.03s; }
.reason-option:nth-child(3) { animation-delay: 0.05s; }
.reason-option:nth-child(4) { animation-delay: 0.07s; }
.reason-option:nth-child(5) { animation-delay: 0.09s; }
.reason-option:nth-child(6) { animation-delay: 0.11s; }
@keyframes drop-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes option-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.photo-row { display: flex; gap: 12px; align-items: stretch; }
.auth-col { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.auth-btn {
  flex: 1;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  background: #fff;
  color: var(--text-1);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.3;
  padding: 8px;
}
.auth-btn small { display: block; margin-top: 3px; font-size: 11px; font-weight: 400; color: var(--text-3); }
.auth-btn.active { border-color: var(--primary); background: var(--primary-light); color: var(--primary-dark); }
.auth-btn.active small { color: var(--primary-dark); }
.field.has-error .auth-col { outline: 1.5px solid transparent; }
.field.has-error .field-error { display: block; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.photo-frame {
  position: relative;
  display: grid;
  place-items: center;
  width: 148px;
  height: 184px;
  border: 1.5px dashed #b7dfe4;
  border-radius: 14px;
  background: #f7fbfb;
  overflow: hidden;
  cursor: pointer;
}
.photo-frame input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-frame img { width: 100%; height: 100%; object-fit: cover; }
.photo-empty { color: var(--text-3); font-size: 13px; text-align: center; padding: 0 14px; }
.photo-hint { display: block; margin-top: 8px; font-size: 12px; color: var(--primary-dark); }
.submit-btn {
  width: 100%;
  padding: 15px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  margin-top: 28px;
  letter-spacing: 1px;
}
.submit-btn:disabled { background: var(--text-3); cursor: wait; }
.form-tip { text-align: center; font-size: 12px; color: var(--text-3); margin-top: 14px; }
.sync-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.97);
  z-index: 100;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.sync-overlay.active { display: flex; }
.sync-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--primary-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.sync-text { margin-top: 20px; font-size: 15px; font-weight: 500; }
.success-card {
  background: var(--surface);
  border-radius: var(--radius);
  margin: 20px 16px;
  padding: 36px 24px;
  text-align: center;
  box-shadow: 0 2px 16px rgba(43, 168, 184, 0.1);
}
.success-icon {
  width: 72px;
  height: 72px;
  background: #E8F8EF;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}
.success-icon svg { width: 36px; height: 36px; }
.success-title { font-size: 20px; font-weight: 700; }
.success-desc { font-size: 14px; color: var(--text-2); margin-top: 8px; }
.success-actions { margin-top: 28px; display: flex; gap: 12px; }
.btn-outline, .btn-primary {
  flex: 1;
  padding: 13px;
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
}
.btn-outline { border: 1.5px solid var(--border); background: #fff; }
.btn-primary { background: var(--primary); color: #fff; border: none; font-weight: 600; }
.footer { text-align: center; padding: 20px; font-size: 11px; color: var(--text-3); }
.back-link { color: var(--primary-dark); text-decoration: none; }
.desk-title { font-size: 18px; font-weight: 700; }
.desk-lead { font-size: 13px; color: var(--text-2); margin: 6px 0 18px; }
.code-row { display: flex; gap: 8px; align-items: stretch; }
.code-row .field-input { flex: 1; min-width: 0; }
.sms-btn {
  flex: none;
  min-width: 108px;
  border: 1.5px solid var(--primary);
  background: var(--primary-light);
  color: var(--primary-dark);
  border-radius: 10px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 650;
  font-family: inherit;
}
.sms-btn:disabled { opacity: 0.55; }
.desk-msg { min-height: 0; margin: 4px 0 0; font-size: 13px; color: var(--error); }
.desk-msg:empty { display: none; }
.link-box { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.or-line { text-align: center; color: var(--text-3); font-size: 12px; margin: 16px 0; }
.outline-btn {
  width: 100%;
  margin-top: 8px;
  padding: 13px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--text-1);
  font-size: 15px;
  font-weight: 650;
  font-family: inherit;
}
.submit-btn.compact { margin-top: 8px; }
.desk-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.tabs { display: flex; gap: 4px; padding: 4px; background: #fff; border-radius: 12px; box-shadow: 0 2px 12px rgba(43, 168, 184, 0.08); }
.tabs button {
  border: 0;
  background: transparent;
  color: var(--text-2);
  font-family: inherit;
  font-size: 14px;
  font-weight: 650;
  padding: 8px 14px;
  border-radius: 9px;
}
.tabs button.current { background: var(--primary); color: #fff; }
.text-btn { border: 0; background: transparent; color: var(--primary-dark); font-family: inherit; font-size: 14px; font-weight: 650; }
.list { display: flex; flex-direction: column; gap: 12px; }
.visitor {
  display: flex;
  gap: 12px;
  background: #fff;
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 2px 12px rgba(43, 168, 184, 0.08);
}
.visitor img, .visitor .ph {
  width: 72px;
  height: 90px;
  border-radius: 10px;
  object-fit: cover;
  flex: none;
  background: #f7fbfb;
}
.visitor .ph { display: grid; place-items: center; color: var(--text-3); font-size: 12px; text-align: center; padding: 6px; }
.visitor h3 { font-size: 16px; font-weight: 700; }
.meta { white-space: pre-line; font-size: 13px; color: var(--text-2); margin-top: 4px; }
.row-actions { display: flex; gap: 8px; margin-top: 12px; }
.btn-ok, .btn-no {
  flex: 1;
  border: 0;
  border-radius: 10px;
  padding: 10px 8px;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 650;
}
.btn-ok { background: var(--success); }
.btn-no { background: var(--error); }
.btn-ok:disabled, .btn-no:disabled { opacity: 0.5; }
.empty {
  text-align: center;
  color: var(--text-3);
  font-size: 14px;
  padding: 28px 12px;
  background: #fff;
  border-radius: 12px;
}
.choices { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.choices button {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1.5px solid var(--primary);
  background: var(--primary-light);
  color: var(--primary-dark);
  font-family: inherit;
  font-size: 15px;
  font-weight: 650;
}
