/* =====================================================================
   寺庙结缘品地址登记 & 物流查询 H5 · 素雅禅意风格
   纯原生 CSS，无第三方依赖，微信内置浏览器 / iOS / Android 均兼容
   ===================================================================== */

:root {
  --paper:        #f6f2ea;   /* 素纸底色 */
  --paper-2:      #fffdf8;
  --ink:          #3a3226;   /* 正文墨色 */
  --ink-2:        #6b6152;   /* 次要文字 */
  --ink-3:        #9b917f;   /* 辅助文字 */
  --gold:         #b08b3f;   /* 主色：沉金 */
  --gold-dark:    #8d6d2c;
  --gold-soft:    #e8dcc0;
  --line:         #e6dfd0;
  --red:          #a4352f;   /* 印章红（必填星号、警示） */
  --green:        #4a7c59;   /* 成功/在途 */
  --radius:       14px;
  --shadow:       0 2px 14px rgba(112, 96, 66, .08);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Helvetica Neue", Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

body { padding-bottom: env(safe-area-inset-bottom); }

.page {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 14px 34px;
  min-height: 100vh;
  background:
    radial-gradient(1200px 260px at 50% -60px, rgba(201, 162, 39, .13), transparent 70%);
}

/* ---------------- 顶部 ---------------- */
.hero {
  text-align: center;
  padding: 30px 0 18px;
}
.hero .lotus { line-height: 0; margin-bottom: 6px; }
.hero h1 {
  margin: 0;
  font-size: 25px;
  letter-spacing: 2px;
  font-weight: 600;
  color: var(--ink);
}
.hero .sub {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--ink-3);
  letter-spacing: 1px;
}
.hero::after {
  content: "";
  display: block;
  width: 72px; height: 1px;
  margin: 16px auto 0;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 16px;
  margin-top: 16px;
}

.notice {
  background: linear-gradient(180deg, #fdf8ec, #fffdf8);
  border-left: 3px solid var(--gold);
}
.notice-t {
  margin: 0 0 6px;
  font-size: 15px;
  color: var(--gold-dark);
  font-weight: 600;
  letter-spacing: 1px;
  display: flex; align-items: center;
}
.notice-t .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold); margin-right: 8px; display: inline-block;
}
.notice p {
  margin: 0;
  font-size: 14.5px;
  color: var(--ink-2);
  text-align: justify;
  word-break: break-word;
}

.sec-title {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 1px;
  display: flex; align-items: center;
}
.sec-title .num {
  display: inline-block;
  width: 26px; height: 26px; line-height: 26px;
  text-align: center;
  margin-right: 9px;
  border-radius: 6px;
  background: var(--gold-soft);
  color: var(--gold-dark);
  font-size: 14px;
  font-weight: 700;
}
.sec-tip {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--ink-3);
  padding-left: 35px;
}

/* ---------------- 表单 ---------------- */
.field { margin-bottom: 15px; }
.field label {
  display: block;
  font-size: 14px;
  color: var(--ink-2);
  margin-bottom: 6px;
  letter-spacing: .5px;
}
.field label i { color: var(--red); font-style: normal; }
.field label small { color: var(--ink-3); font-size: 12px; }
.field .help { display: block; font-size: 12px; color: var(--ink-3); margin-top: 4px; }

input[type=text], input[type=tel], select, textarea {
  width: 100%;
  padding: 11px 12px;
  font-size: 16px;               /* ≥16px 防止 iOS 聚焦时缩放 */
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color .18s, box-shadow .18s;
}
textarea { resize: none; line-height: 1.6; }
select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239b917f' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(176, 139, 63, .12);
}
input::placeholder, textarea::placeholder { color: #c3bba9; }
select:disabled { background-color: #f5f2ea; color: #b5ab98; }

.area-row { display: flex; gap: 8px; }
.area-row select { flex: 1; min-width: 0; }
.mt8 { margin-top: 8px; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: block;
  width: 100%;
  padding: 13px;
  font-size: 16.5px;
  font-family: inherit;
  letter-spacing: 2px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: transform .12s, opacity .2s;
}
.btn:active { transform: scale(.985); }
.btn[disabled] { opacity: .6; cursor: not-allowed; }
.btn.primary {
  background: linear-gradient(135deg, #c09a4a, #a37c32);
  color: #fff;
  box-shadow: 0 4px 14px rgba(163, 124, 50, .24);
}
.btn.ghost {
  background: #fff;
  color: var(--gold-dark);
  border: 1px solid var(--gold);
}
.safe-tip {
  margin: 10px 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--ink-3);
}

/* ---------------- 查询 ---------------- */
.query-row { display: flex; gap: 9px; }
.query-row input { flex: 1; min-width: 0; }
.query-row .btn { width: 108px; flex: none; padding: 12px 0; letter-spacing: 1px; font-size: 15px; }

.query-result { margin-top: 18px; }
.empty-box {
  text-align: center;
  padding: 22px 12px;
  background: #fbf8f1;
  border: 1px dashed var(--gold-soft);
  border-radius: 12px;
  color: var(--ink-2);
  font-size: 14.5px;
}
.empty-box .em {
  display: block; font-size: 22px; margin-bottom: 6px; opacity: .5;
}

.pkg {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
  background: #fff;
}
.pkg + .pkg { margin-top: 0; }
.pkg-head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 10px; margin-bottom: 10px;
  border-bottom: 1px dashed var(--line);
}
.pkg-co { font-weight: 600; letter-spacing: .5px; }
.pkg-status {
  font-size: 12.5px; padding: 3px 10px; border-radius: 20px;
  background: #f2ece0; color: var(--ink-2); white-space: nowrap;
}
.pkg-status.in_transit { background: #e7f0e9; color: var(--green); }
.pkg-status.signed    { background: #e7f0e9; color: #35603f; font-weight: 600; }
.pkg-status.pending   { background: #f2ece0; color: #8a785a; }
.pkg-status.failed    { background: #f7e9e8; color: var(--red); }

.line-item { display: flex; font-size: 14px; padding: 3px 0; }
.line-item .k { width: 74px; flex: none; color: var(--ink-3); }
.line-item .v { flex: 1; word-break: break-all; color: var(--ink-2); }
.line-item .v.mono { font-family: Menlo, Consolas, monospace; letter-spacing: .5px; user-select: all; }
.copy-btn {
  margin-left: 6px; font-size: 12px; color: var(--gold-dark);
  background: #fbf6ea; border: 1px solid var(--gold-soft);
  border-radius: 6px; padding: 1px 7px; cursor: pointer;
}

.trace-toggle {
  margin-top: 8px; font-size: 13.5px; color: var(--gold-dark);
  background: none; border: none; padding: 0; cursor: pointer; font-family: inherit;
}
.trace-list { margin: 8px 0 0; padding: 0; list-style: none; border-left: 2px solid var(--gold-soft); }
.trace-list li { padding: 7px 0 7px 14px; position: relative; font-size: 13.5px; color: var(--ink-2); }
.trace-list li::before {
  content: ""; position: absolute; left: -5px; top: 15px;
  width: 8px; height: 8px; border-radius: 50%;
  background: #fff; border: 2px solid var(--gold);
}
.trace-list li:first-child::before { background: var(--gold); }
.trace-list .t { display: block; font-size: 12px; color: var(--ink-3); }

/* ---------------- 底部 ---------------- */
.footer {
  text-align: center;
  color: var(--ink-3);
  font-size: 12.5px;
  padding: 26px 0 6px;
  letter-spacing: 1px;
}

/* ---------------- 弹窗 / 提示 ---------------- */
.mask {
  position: fixed; inset: 0;
  background: rgba(38, 32, 22, .45);
  display: none;
  align-items: center; justify-content: center;
  z-index: 90;
  padding: 20px;
}
.mask.show { display: flex; }
.dialog {
  width: 100%; max-width: 340px;
  background: var(--paper-2);
  border-radius: 18px;
  padding: 26px 22px 20px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(60, 45, 20, .25);
  animation: pop .22s ease-out;
}
@keyframes pop { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.dlg-icon {
  width: 52px; height: 52px; line-height: 52px; margin: 0 auto 12px;
  border-radius: 50%; font-size: 26px; color: #fff;
  background: linear-gradient(135deg, #7fa381, #4a7c59);
}
.dlg-icon.warn { background: linear-gradient(135deg, #d0a24f, #a37c32); }
.dialog h3 { margin: 0 0 10px; font-size: 18px; letter-spacing: 1px; }
.dialog .dlg-text { font-size: 14.5px; color: var(--ink-2); text-align: left; }
.dialog .dlg-meta { font-size: 13px; color: var(--ink-3); margin-top: 8px; }
.dialog .btn { margin-top: 18px; }

.toast {
  position: fixed; left: 50%; top: 22%;
  transform: translate(-50%, -10px);
  background: rgba(43, 36, 26, .9);
  color: #fff; font-size: 14.5px;
  padding: 10px 18px; border-radius: 22px;
  opacity: 0; pointer-events: none; z-index: 99;
  transition: opacity .25s, transform .25s;
  max-width: 80%; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- 微信可选授权模块 ---------------- */
.wx-card { border-left: 3px solid #3ba55d; }
.wx-t {
  margin: 0 0 8px; font-size: 15px; font-weight: 600; color: #2f6b45;
  display: flex; align-items: center; gap: 7px; letter-spacing: .5px;
}
.wx-t .tag {
  font-style: normal; font-size: 11.5px; font-weight: 500;
  background: #e7f3ea; color: #3ba55d; padding: 1px 7px; border-radius: 10px;
}
.wx-notice { margin: 0 0 10px; font-size: 14.5px; color: var(--ink-2); text-align: justify; }
.wx-privacy {
  font-size: 13px; color: #6b5a33; line-height: 1.65;
  background: #fdf8ec; border: 1px dashed var(--gold-soft);
  border-radius: 10px; padding: 9px 11px; margin-bottom: 12px; text-align: justify;
}
.wx-btns { display: flex; gap: 10px; }
.wx-btns .btn { flex: 1; padding: 11px; font-size: 15.5px; letter-spacing: 1px; }
.btn.wx { background: linear-gradient(135deg, #4cb06a, #2f8c4e); box-shadow: 0 4px 14px rgba(47, 140, 78, .22); }
.wx-foot { margin: 10px 0 0; font-size: 12px; color: var(--ink-3); text-align: center; }

.wx-authed {
  margin-top: 14px; text-align: center; font-size: 12.5px; color: #3ba55d;
  background: #eef7f0; border: 1px solid #d6ebdc; border-radius: 10px; padding: 7px 10px;
}

.hidden { display: none !important; }

/* ---------------- 小屏适配 ---------------- */
@media (max-width: 360px) {
  .hero h1 { font-size: 22px; }
  .query-row .btn { width: 92px; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
