/* loc567-clone · 复刻站样式
   色板取自原站 bundle：主蓝 #1677ff / 危险 #ff4d4f / 紫 #aa3bff / 绿 #52c41a */
:root {
  --blue: #1677ff;
  --blue-2: #4f9dff;
  --blue-soft: #e8f1ff;
  --purple: #aa3bff;
  --purple-soft: #f5e9ff;
  --green: #52c41a;
  --green-soft: #eaf7e3;
  --danger: #ff4d4f;
  --danger-soft: #fff1f0;
  --ink: #111318;
  --ink-2: #4b5563;
  --ink-3: #8b93a1;
  --line: #eceef2;
  --fill: #f2f3f5;
  --bg: #f7f8fa;
  --card: #fff;
  --r: 24px;
  --shadow: 0 12px 40px rgba(17, 19, 24, .08), 0 2px 6px rgba(17, 19, 24, .04);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
  overflow-x: hidden;
}
#app { width: 100%; max-width: 420px; }

/* ------------------------------ 卡片 ------------------------------ */
.card {
  background: var(--card);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 30px 24px 26px;
  animation: rise .28s cubic-bezier(.2, .8, .3, 1);
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.badge-ico {
  width: 76px; height: 76px;
  margin: 4px auto 18px;
  border-radius: 20px;
  display: grid; place-items: center;
  font-size: 34px;
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
  box-shadow: 0 10px 24px rgba(22, 119, 255, .32);
}
.badge-ico.purple { background: linear-gradient(135deg, #8b2ff0, #c084fc); box-shadow: 0 10px 24px rgba(170, 59, 255, .3); }
.badge-ico.green { background: linear-gradient(135deg, #38a30f, #7bd44e); box-shadow: 0 10px 24px rgba(82, 196, 26, .3); }

h1 { font-size: 27px; line-height: 1.25; text-align: center; margin: 0 0 6px; letter-spacing: -.4px; font-weight: 700; }
h2 { font-size: 17px; margin: 22px 0 10px; font-weight: 700; }
.sub { text-align: center; color: var(--ink-3); font-size: 13.5px; margin: 0 0 18px; }

/* ------------------------------ 公告条 ------------------------------ */
.notice {
  display: block; text-align: center;
  background: var(--blue-soft);
  border: 1px solid #d6e6ff;
  border-radius: 14px;
  padding: 12px 14px;
  margin: 0 0 16px;
  text-decoration: none;
  color: var(--blue);
  font-size: 13.5px;
  line-height: 1.6;
}
.notice b { display: block; color: var(--ink); font-size: 13.5px; font-weight: 600; }
.notice span { font-size: 12.5px; }

.tip { color: var(--ink-2); font-size: 13px; line-height: 1.7; text-align: center; margin: 0 0 14px; }
.tip.warn { text-align: left; color: #d46b08; background: #fffbe6; border: 1px solid #ffe58f; border-radius: 10px; padding: 9px 11px; font-size: 12.5px; }

/* ------------------------------ 步骤 ------------------------------ */
.steps { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 8px; }
.steps li {
  display: flex; align-items: center; gap: 10px;
  background: var(--fill);
  border-radius: 12px;
  padding: 11px 13px;
  font-size: 14px;
}
.steps i {
  flex: none; width: 20px; height: 20px; border-radius: 50%;
  background: #e2e5ea; color: var(--ink-2);
  font-style: normal; font-size: 11.5px; font-weight: 700;
  display: grid; place-items: center;
}

/* ------------------------------ 按钮 ------------------------------ */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; height: 48px; border: 0; border-radius: 14px;
  font-family: inherit; font-size: 15px; font-weight: 600;
  cursor: pointer; text-decoration: none;
  transition: transform .12s ease, filter .12s ease;
}
.btn:active { transform: scale(.985); }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn-primary { background: linear-gradient(135deg, var(--blue), var(--blue-2)); color: #fff; box-shadow: 0 8px 20px rgba(22, 119, 255, .28); }
.btn-green { background: linear-gradient(135deg, #3faf12, #64cf33); color: #fff; box-shadow: 0 8px 20px rgba(82, 196, 26, .26); }
.btn-soft { background: var(--blue-soft); color: var(--blue); }
.btn-ghost { background: var(--fill); color: var(--ink-2); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-sm { height: 36px; border-radius: 10px; font-size: 13px; width: auto; padding: 0 14px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stack { display: grid; gap: 10px; }

/* ------------------------------ 表单 ------------------------------ */
.field { margin-bottom: 10px; }
.field label { display: block; font-size: 12.5px; color: var(--ink-3); margin: 0 0 6px 2px; }
input[type=text], input[type=email], input[type=password], input[type=search] {
  width: 100%; height: 48px;
  border: 1px solid var(--line); border-radius: 13px;
  background: #fbfbfc;
  padding: 0 14px;
  font-family: inherit; font-size: 15px; color: var(--ink);
  outline: none; transition: border-color .15s, background .15s;
}
input::placeholder { color: #b6bcc7; }
input:focus { border-color: var(--blue); background: #fff; box-shadow: 0 0 0 3px rgba(22, 119, 255, .12); }
.hint { font-size: 12px; color: var(--ink-3); margin: 8px 2px 0; line-height: 1.6; }

/* ------------------------------ 套餐卡 ------------------------------ */
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.plan {
  position: relative;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: 14px 12px 12px;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .12s;
}
.plan:active { transform: scale(.985); }
.plan.on { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(22, 119, 255, .12); }
.plan .tag {
  position: absolute; top: -9px; right: 8px;
  font-size: 10.5px; font-weight: 700; color: #fff;
  background: var(--purple); border-radius: 999px; padding: 2px 8px;
}
.plan.green .tag { background: var(--green); }
.plan .pn { font-size: 14px; font-weight: 700; }
.plan .pd { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.plan .pp { margin-top: 10px; font-size: 20px; font-weight: 800; letter-spacing: -.5px; }
.plan .pp small { font-size: 11px; font-weight: 600; color: var(--ink-3); margin-left: 2px; }

/* ------------------------------ 卡密 ------------------------------ */
.code-input input {
  letter-spacing: 2px; font-weight: 700; text-transform: uppercase;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  text-align: center; font-size: 15.5px;
}
.mine { display: grid; gap: 8px; margin-top: 12px; }
.mine .item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--fill); border-radius: 12px; padding: 10px 12px; font-size: 13px;
}
.mine .item code { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; }
.mine .item em { font-style: normal; color: var(--ink-3); font-size: 12px; }

.stat { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 4px; }
.stat div { background: var(--blue-soft); border-radius: 14px; padding: 12px 14px; }
.stat b { display: block; font-size: 22px; line-height: 1.2; color: var(--blue); }
.stat span { font-size: 11.5px; color: var(--ink-2); }

.domains { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 18px; min-width: 0; }
.domains code {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 11px; color: #1552b8; background: var(--blue-soft);
  border-radius: 7px; padding: 4px 7px; max-width: 100%; overflow-wrap: anywhere;
}
.domains-box { margin: 4px 0 14px; border: 1px solid var(--line); border-radius: 12px; background: #fbfbfc; }
.domains-box summary { cursor: pointer; padding: 11px 13px; font-size: 12.5px; color: var(--ink-2); }
.domains-box h2 { margin: 4px 13px 0; font-size: 12px; }
.domains-box .domains { margin: 8px 13px 12px; }
.card, .tip { overflow-wrap: anywhere; }

/* ------------------------------ 表格 / 后台 ------------------------------ */
.table-wrap { overflow-x: auto; margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
th, td { text-align: left; padding: 8px 10px; white-space: nowrap; border-bottom: 1px solid var(--line); }
th { background: #fafbfc; color: var(--ink-3); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
td code { font-family: ui-monospace, Menlo, monospace; }
.pill { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 10.5px; }
.pill.ok { background: var(--green-soft); color: #389e0d; }
.pill.used { background: var(--fill); color: var(--ink-3); }
.pill.rev { background: var(--danger-soft); color: var(--danger); }

.linkbar { text-align: center; margin-top: 16px; font-size: 13px; color: var(--ink-3); }
.linkbar a { color: var(--blue); text-decoration: none; margin: 0 6px; }

/* ------------------------------ 地图占位 ------------------------------ */
.mapbox {
  height: 210px; border-radius: 16px; margin: 6px 0 16px;
  background:
    radial-gradient(circle at 30% 30%, rgba(22,119,255,.10), transparent 60%),
    repeating-linear-gradient(0deg, #eef1f6 0 1px, transparent 1px 28px),
    repeating-linear-gradient(90deg, #eef1f6 0 1px, transparent 1px 28px),
    #f9fafc;
  display: grid; place-items: center; text-align: center;
  color: var(--ink-3); font-size: 12.5px; line-height: 1.7;
  border: 1px dashed #d9dee7;
}
.coord { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ------------------------------ 地图选点 ------------------------------ */
.map-pick { height: 280px; display: block; padding: 0; border: 1px solid #d9dee7; overflow: hidden; position: relative; z-index: 1; }
.map-pick .leaflet-control-attribution { font-size: 10px; }
.geo-search { display: flex; gap: 8px; margin: 4px 0 8px; }
.geo-search input {
  flex: 1 1 auto; width: 100%; min-width: 0; height: 44px; border: 1px solid var(--line); border-radius: 12px;
  padding: 0 12px; font: inherit; font-size: 14px; background: #fff; color: var(--ink);
}
.geo-search .btn { height: 44px; padding: 0 16px; white-space: nowrap; }
.geo-results { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.geo-item {
  text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 11px;
  padding: 9px 12px; font: inherit; color: var(--ink); cursor: pointer;
}
.geo-item:active { background: var(--blue-soft); }
.geo-item b { display: block; font-size: 14px; font-weight: 600; }
.geo-item small { display: block; color: var(--ink-3); font-size: 12px; margin-top: 2px; line-height: 1.4; }
.geo-empty { color: var(--ink-3); font-size: 12.5px; padding: 8px 2px; }
.fav-form { display: grid; gap: 8px; margin: 14px 0 10px; }
.fav-form input { height: 42px; font-size: 14px; }
.fav-form .btn { height: 42px; font-size: 14px; }
.fav-list { display: flex; flex-direction: column; gap: 7px; margin-bottom: 10px; }
.fav-item { display: flex; gap: 7px; align-items: stretch; }
.fav-main {
  flex: 1; min-width: 0; text-align: left; border: 1px solid var(--line); background: #fff;
  border-radius: 11px; padding: 9px 12px; font: inherit; color: var(--ink); cursor: pointer;
}
.fav-main b { display: block; font-size: 14px; }
.fav-main small { display: block; color: var(--ink-3); font-size: 11.5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fav-del { flex: none; border: 1px solid #ffd6d6; background: #fff5f5; color: #d4380d; border-radius: 11px; padding: 0 11px; font: inherit; font-size: 12px; cursor: pointer; }

/* ------------------------------ toast ------------------------------ */
.modal-mask {
  position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: rgba(10, 14, 24, .38); backdrop-filter: blur(3px);
}
.modal-card {
  width: 100%; max-width: 330px; background: #fff; border-radius: 20px; padding: 24px 22px 18px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .22); text-align: center;
}
.modal-card b { display: block; font-size: 17px; margin-bottom: 8px; }
.modal-card p { margin: 0 0 18px; color: var(--ink-2); font-size: 13.5px; line-height: 1.7; }
.modal-card button {
  width: 100%; height: 46px; border: 0; border-radius: 13px; background: var(--blue); color: #fff;
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
}
.toast {
  position: fixed; left: 50%; bottom: 40px; transform: translate(-50%, 20px);
  background: rgba(17, 19, 24, .9); color: #fff;
  font-size: 13px; padding: 10px 16px; border-radius: 10px;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  max-width: 86vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.foot { text-align: center; font-size: 11px; color: #b3b9c4; margin-top: 14px; }
.foot a { color: inherit; }
