/* =====================================================================
   访客端 H5 skin —— 与后台登录页共用同一视觉语言
   米白画布 / 藏青蓝 #2E4A7D / 天地人三色 CI / Pretendard GOV
   所有原有类名与交互逻辑保持不变，仅替换视觉 token。
   ===================================================================== */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
  --font-sans: "Pretendard GOV", "Pretendard Variable", Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", -apple-system, "Segoe UI", sans-serif;
  --primary: #2E4A7D; --primary-hover: #263E6B; --primary-dark: #1F3459;
  --primary-tint: #EEF2F8; --primary-border: #DCE5F1;
  --bg: #F8F7F3; --card: #FFFFFF; --surface-subtle: #F2F1EC;
  --text: #211F1C; --muted: #57534B; --text-tertiary: #8C867C;
  --border: #E7E4DC; --border-strong: #D2CEC4;
  --accent-red: #C4453C; --danger: #9E2F28; --danger-bg: #FDF2F0; --ok: #5F8268;
  --on-primary: #FFFFFF;
  --focus-ring: rgba(46, 74, 125, .16);
  --brand-heaven: #2E4A7D; --brand-human: #C4453C; --brand-earth: #C89B3C;
  --radius-card: 12px; --radius-control: 8px; --radius-pill: 999px;
  --ease: cubic-bezier(.2, .7, .3, 1); --duration: 160ms;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1A1A18; --card: #232320; --surface-subtle: #2C2B27;
    --border: #3A3833; --border-strong: #4A473F;
    --text: #F2F0EA; --muted: #B3AEA3; --text-tertiary: #8E8A80;
    --primary: #7FA3D9; --primary-hover: #93B4E3; --primary-dark: #B4CCEB;
    --primary-tint: #28374E; --primary-border: #3C4E6B;
    --accent-red: #E8776E; --danger: #F0A9A2; --danger-bg: #3A2422;
    --on-primary: #1A1A18;
    --focus-ring: rgba(127, 163, 217, .20);
  }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
#app { max-width: 520px; margin: 0 auto; min-height: 100vh; padding-bottom: 40px; }
.page { padding: 0 16px; }

/* ---- 顶部品牌条（对应参考界面移动端左栏） ---- */
.hero { padding: 22px 0 18px; }
.hero-brand { display: flex; align-items: center; justify-content: flex-start; gap: 10px; margin-bottom: 16px; padding-right: 96px; }
.hero-ci { width: 28px; height: 28px; flex: none; }
.hero-brand__names { display: flex; flex-direction: column; gap: 1px; text-align: left; }
.hero-brand__name { font-size: 15px; font-weight: 600; line-height: 1.25; letter-spacing: -.01em; }
.hero-brand__en { font-size: 10px; font-weight: 600; letter-spacing: .12em; color: var(--text-tertiary); }
.hero h1 { margin: 0 0 6px; font-size: 1.75rem; font-weight: 600; line-height: 1.35; letter-spacing: -.015em; }
.hero p { margin: 0; color: var(--muted); font-size: 13px; }

/* 门禁页 / 成功页的圆形图标沿用主色 */
.hero-icon {
  width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px;
  background: var(--primary); color: var(--on-primary);
  display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 700;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px 18px;
  margin-bottom: 14px;
}
.field { margin-bottom: 18px; position: relative; }
.field:last-child { margin-bottom: 0; }
label { display: block; font-weight: 500; margin-bottom: 8px; font-size: .8125rem; color: var(--muted); }
/* 必填：由原来的红色 * 改为 4px 小红点（HTML 结构不变） */
.req {
  display: inline-block; width: 4px; height: 4px; border-radius: var(--radius-pill);
  background: var(--accent-red); color: transparent; font-size: 0;
  overflow: hidden; vertical-align: middle; margin-left: 2px;
}
input, select, textarea {
  width: 100%; min-height: 48px; padding: 11px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-control);
  font-size: 15px; background: var(--card); color: var(--text);
  outline: none; font-family: inherit;
  transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
input:hover, select:hover, textarea:hover { border-color: var(--border-strong); }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--focus-ring); }
input:disabled, textarea:disabled, select:disabled { background: var(--surface-subtle); color: var(--text-tertiary); }
textarea { resize: vertical; }
.err { display: block; color: var(--danger); font-size: .75rem; margin-top: 6px; min-height: 0; }
.err:empty { display: none; }
.err.block { margin: 4px 0 12px; }
/* 字段下方的补充说明（如到访日期提示） */
.field-hint { margin: 6px 0 0; font-size: .75rem; line-height: 1.5; color: var(--text-tertiary); }
/* 日期控件：移动端统一高度、避免部分浏览器默认内边距导致错位 */
input[type="date"] { -webkit-appearance: none; appearance: none; }

/* 被访人搜索 */
.host-results {
  border: 1px solid var(--border); border-radius: var(--radius-control);
  margin-top: 6px; max-height: 200px; overflow-y: auto; background: var(--card);
}
.host-item { padding: 10px 12px; border-bottom: 1px solid var(--border); cursor: pointer; }
.host-item:last-child { border-bottom: 0; }
.host-item:active { background: var(--surface-subtle); }
.host-item b { font-size: 14px; }
.host-item span { color: var(--muted); font-size: 12px; margin-left: 8px; }
.host-empty { padding: 12px; color: var(--muted); font-size: 13px; text-align: center; }
.host-chosen {
  margin-top: 6px; padding: 9px 12px;
  background: var(--primary-tint); border: 1px solid var(--primary-border);
  border-radius: var(--radius-control); font-size: 14px;
  display: flex; justify-content: space-between; align-items: center;
}
.host-chosen button { background: none; border: 0; color: var(--primary); font-size: 13px; cursor: pointer; }

/* 告知书 */
.consent-card h3 { margin: 0 0 10px; font-size: 15px; font-weight: 600; }
.notice {
  background: var(--surface-subtle); border: 1px solid var(--border);
  border-radius: var(--radius-control); padding: 12px;
  font-size: 12.5px; color: var(--muted); max-height: 200px; overflow-y: auto;
}
.notice p { margin: 0 0 8px; }
.notice ul { margin: 0 0 8px; padding-left: 18px; }
.notice li { margin-bottom: 4px; }
.notice .version { color: var(--text-tertiary); margin: 0; }
.check-line { display: flex; align-items: flex-start; gap: 9px; font-weight: 400; font-size: 13px; margin-top: 14px; line-height: 1.5; cursor: pointer; }
.check-line input { width: 18px; height: 18px; min-height: 0; flex: none; margin-top: 1px; accent-color: var(--primary); }

/* 主按钮：静止无阴影，hover 才浮起 */
.submit-btn {
  width: 100%; min-height: 48px; padding: 13px;
  border: 1px solid transparent; border-radius: var(--radius-control);
  background: var(--primary); color: var(--on-primary);
  font-family: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  transition: background-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease), transform var(--duration) var(--ease);
}
.submit-btn:hover { background: var(--primary-hover); box-shadow: 0 4px 12px rgba(46, 74, 125, .18); transform: translateY(-1px); }
.submit-btn:active { background: var(--primary-dark); box-shadow: 0 2px 6px rgba(46, 74, 125, .15); transform: none; }
.submit-btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.footer-note { text-align: center; color: var(--text-tertiary); font-size: 12px; margin: 12px 0 0; }

.ghost-btn, .text-btn { width: 100%; padding: 12px; border: 0; border-radius: var(--radius-control); font-size: 15px; cursor: pointer; font-family: inherit; }
.ghost-btn { background: var(--card); color: var(--danger); border: 1px solid var(--border); margin-top: 14px; }
.text-btn { background: none; color: var(--primary); margin-top: 8px; }

/* 成功 / 门禁页 */
.success-box { text-align: center; padding: 40px 16px; }
.success-icon { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 50%; background: var(--ok); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 34px; }
.success-box h2 { margin: 0 0 6px; font-weight: 600; }
.success-box > p { color: var(--muted); margin: 0 0 22px; font-size: 13px; }
.gate-page .hero-icon, .success-box .hero-icon { border-radius: 16px; }
.gate-sub { display: block; margin-top: -12px !important; padding: 12px; background: var(--primary-tint); border-radius: var(--radius-control); color: var(--primary) !important; line-height: 1.6; }
.summary { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 16px; text-align: left; }
.summary .row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.summary .row:last-child { border-bottom: 0; }
.summary .row span:first-child { color: var(--muted); }
.sub { color: var(--muted); font-size: 13px; margin-top: -4px; }

/* 取消登记验证码 */
.code-row { display: flex; gap: 8px; }
.code-row input { flex: 1; min-height: 0; }
.code-btn { white-space: nowrap; padding: 0 14px; border: 1px solid var(--primary-border); background: var(--primary-tint); color: var(--primary); border-radius: var(--radius-control); font-size: 13px; cursor: pointer; font-family: inherit; }
.code-btn:disabled { opacity: .6; cursor: not-allowed; }

.toast { position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%); background: #211F1C; color: #fff; padding: 10px 18px; border-radius: var(--radius-pill); font-size: 14px; z-index: 99; max-width: 80%; text-align: center; }
.host-selected { background: var(--primary-tint) !important; border-color: var(--primary) !important; color: var(--primary) !important; font-weight: 600; cursor: pointer !important; }
.lookup-entry-btn {
  display: block; width: 100%; max-width: 320px; margin: 22px auto 0; padding: 12px;
  border: 1px solid var(--primary-border); background: var(--card); color: var(--primary);
  border-radius: var(--radius-control); font-size: 15px; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: background-color var(--duration) var(--ease);
}
.lookup-entry-btn:active { background: var(--primary-tint); }
.form-lookup-entry { margin: 14px 0 0; max-width: none; }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
[hidden] { display: none !important; }
@media (max-width: 379px) {
  .page { padding: 0 12px; }
  .card { padding: 16px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
