/* ============ 用户前台：卡密查询 / 核销页 ============ */

.page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.card {
  width: 100%;
  max-width: 420px;
  padding: 36px 32px 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
}

/* ---------------- 头部 ---------------- */
.head {
  margin-bottom: 24px;
  text-align: center;
}

/* 头部 Logo：使用本地 favicon.ico，不走外链 */
.mark {
  display: block;
  width: 42px;
  height: 42px;
  margin: 0 auto 14px;
  border-radius: var(--r-md);
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.head h1 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.head p {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-tertiary);
}

/* ---------------- 分段切换 ---------------- */
.segment {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  padding: 3px;
  margin-bottom: 22px;
  background: var(--surface-sunken);
  border-radius: var(--r-md);
}

.segment-item {
  height: 36px;
  border: none;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}

.segment-item:hover:not(.is-active) {
  color: var(--text);
}

.segment-item.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px rgb(16 24 40 / 6%);
}

.segment-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}

/* ---------------- 表单 ---------------- */
.hint {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-tertiary);
}

.hint--center {
  margin-top: 14px;
  text-align: center;
}

.hint strong {
  color: var(--text-secondary);
  font-weight: 600;
}

/* ---------------- 区服选择 ---------------- */
.region-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.region-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 11px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.region-option:hover:not(.is-active) {
  border-color: #cfd4db;
  background: var(--surface-hover);
}

.region-option.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px rgb(31 111 235 / 8%);
}

.region-option:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.region-name {
  font-size: 14px;
  font-weight: 600;
}

.region-option.is-active .region-name {
  color: var(--accent);
}

.region-desc {
  font-size: 12px;
  color: var(--text-tertiary);
}

/* ---------------- 结果面板 ---------------- */
.result {
  display: none;
}

.result.is-visible {
  display: block;
}

.result-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 14px;
  font-weight: 600;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.dot--success {
  background: var(--success);
}

.rows {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 46px;
  padding: 11px 16px;
}

.row + .row {
  border-top: 1px solid var(--line);
}

.row-key {
  font-size: 14px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.row-value {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 500;
  text-align: right;
  word-break: break-all;
  overflow-wrap: anywhere;
}

.invite-code {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--accent);
  text-align: right;
  word-break: break-all;
  user-select: all;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.actions-item {
  flex: 1;
}

.actions-item .btn {
  width: 100%;
}

.result > .hint {
  margin-top: 12px;
}

/* ---------------- 页脚 ---------------- */
.foot {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--text-tertiary);
  text-align: center;
}

@media (max-width: 480px) {
  .page {
    padding: 0;
    align-items: stretch;
  }

  .card {
    max-width: none;
    min-height: 100vh;
    padding: 40px 22px 28px;
    border: none;
    border-radius: 0;
  }

  .actions {
    flex-direction: column;
  }
}
