:root {
  --sand-0: #fffdf7;
  --sand-50: #faf8f0;
  --sand-100: #f5f4ee;
  --sand-150: #f2efe5;
  --sand-300: #e2ddcf;
  --sand-500: #b3ac9a;
  --sand-650: #7d7869;
  --sand-700: #6e685b;
  --sand-750: #57534a;
  --sand-900: #26241f;
  --clay-500: #c2613f;
  --clay-600: #a34e30;
  --clay-50: #f9ede7;
  --clay-200: #f3e3dc;
  --moss-600: #4f7a4a;
  --moss-50: #e7f0e4;
  --brick-600: #b3392b;
  --brick-50: #f7e6e2;
  --ocean-600: #2b6cb0;

  --background: var(--sand-100);
  --foreground: var(--sand-900);
  --card: var(--sand-0);
  --primary: var(--clay-500);
  --primary-foreground: #ffffff;
  --ink-2: var(--sand-750);
  --ink-3: var(--sand-650);
  --muted-foreground: var(--sand-700);
  --input: var(--sand-300);
  --border: var(--sand-300);
  --muted: var(--sand-150);
  --placeholder: var(--sand-500);
  --link: var(--ocean-600);

  --font-sans: "Noto Sans SC Variable", system-ui, -apple-system, BlinkMacSystemFont,
    "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  border: 0 solid var(--border);
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  tab-size: 4;
  line-height: 1.5;
  font-family: var(--font-sans);
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100dvh;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
  font-feature-settings: inherit;
  font-variation-settings: inherit;
  letter-spacing: inherit;
  color: inherit;
  background: none;
}

button {
  cursor: pointer;
}

input {
  border-radius: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

.material-symbols-rounded {
  font-family: "Material Symbols Rounded";
  font-weight: normal;
  font-style: normal;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  font-feature-settings: "liga";
  -webkit-font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
  user-select: none;
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
}

/* 页面容器 */
#phone-shell {
  position: relative;
  margin: 0 auto;
  display: flex;
  height: 100dvh;
  width: 100%;
  max-width: 430px;
  flex-direction: column;
  overflow: hidden;
  background: var(--background);
}

.page {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  gap: 24px;
  overflow-y: auto;
  padding: 32px 26px 60px;
}

.page.center {
  justify-content: center;
}

/* 顶部标识 */
.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.brand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 15px;
  background: var(--primary);
  color: var(--primary-foreground);
}

.brand-sub {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted-foreground);
}

/* 表单 */
.form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field > label {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-2);
}

.input {
  width: 100%;
  height: 46px;
  border: 1px solid var(--input);
  border-radius: 11px;
  background: var(--card);
  color: var(--foreground);
  font-size: 15px;
  line-height: 1.5;
  padding: 0 12px;
  outline: none;
}

.input::placeholder {
  color: var(--placeholder);
  opacity: 1;
}

.input:focus {
  border-color: var(--primary);
}

.pw {
  position: relative;
}

.pw .input {
  padding-right: 40px;
}

.pw-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 4px;
  color: var(--muted-foreground);
  transition: color 0.15s;
}

.pw-toggle:hover {
  color: var(--foreground);
}

.agree {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-2);
}

.agree input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex: none;
  accent-color: var(--primary);
}

.agree button {
  margin-left: -8px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--link);
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 48px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 15.5px;
  font-weight: 500;
  line-height: 1.5;
  transition: opacity 0.15s;
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-foreground);
}

.btn-primary:disabled {
  opacity: 0.7;
  cursor: default;
}

.btn-outline {
  background: var(--card);
  border-color: var(--border);
  color: var(--foreground);
  font-size: 15px;
  font-weight: 400;
}

.btn-transfer {
  background: var(--card);
  border-color: var(--border);
  color: var(--link);
  font-weight: 400;
}

.btn-transfer:hover {
  background: var(--sand-150);
}

.form-footer {
  text-align: center;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted-foreground);
}

.form-footer a {
  color: var(--link);
}

/* 下拉选择 */
.select-row {
  display: flex;
  gap: 8px;
}

.select {
  position: relative;
  flex: none;
  width: 124px;
}

.select.full {
  width: 100%;
}

.select-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 46px;
  border: 1px solid var(--input);
  border-radius: 11px;
  background: var(--card);
  padding: 0 12px;
  font-size: 15px;
  color: var(--foreground);
  text-align: left;
  outline: none;
}

.select-trigger:focus-visible {
  border-color: var(--primary);
}

.select-trigger .value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.select-trigger .chev {
  flex: none;
  font-size: 18px;
  color: var(--ink-3);
  transition: transform 0.15s;
}

.select.open .select-trigger .chev {
  transform: rotate(180deg);
}

.select-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 20;
  display: none;
  max-height: 220px;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--card);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.select.open .select-menu {
  display: block;
}

.select-item {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
  cursor: pointer;
}

.select-item:hover {
  background: #f2efe5;
}

.select-item.selected {
  color: var(--primary);
  font-weight: 500;
}

/* 弹窗 */
.dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(38, 36, 31, 0.28);
}

.dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 51;
  display: flex;
  flex-direction: column;
  width: calc(100vw - 32px);
  max-width: 358px;
  max-height: calc(100dvh - 94px);
  padding: 16px;
  border-radius: 12.6px;
  background: var(--card);
  color: var(--foreground);
  font-size: 14px;
  transform: translate(-50%, -50%);
}

.dialog[hidden],
.dialog-overlay[hidden] {
  display: none;
}

.dialog-title {
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  margin: 0;
}

.dialog-divider {
  height: 1px;
  margin: 16px -16px 0;
  background: var(--border);
}

.dialog-body-wrap {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 16px;
  flex-direction: column;
}

.dialog-body-wrap::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 40px;
  background: linear-gradient(to top, var(--card), rgba(255, 253, 247, 0));
  pointer-events: none;
}

.dialog-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 20px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  font-size: 13.5px;
  line-height: 1.625;
  color: var(--foreground);
}

.dialog-body p {
  margin: 0;
}

.dialog .btn {
  height: 32px;
  margin-top: 20px;
  border-radius: 9px;
  font-size: 14px;
  line-height: 20px;
}

.dialog-close {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7.2px;
  color: var(--foreground);
}

.dialog-close:hover {
  background: var(--sand-150);
}

.dialog-close svg {
  width: 16px;
  height: 16px;
}

/* 用户协议弹窗：与线上一致的紧凑版 */
.dialog.agreement {
  width: min(400px, calc(100vw - 32px));
  max-width: none;
  gap: 16px;
  max-height: none;
}

.dialog.agreement .btn {
  margin-top: 0;
}

.agreement-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-left: 20px;
  list-style: decimal;
  font-size: 13.5px;
  line-height: 1.625;
  color: var(--ink-2);
}


/* Toast：与线上一致，底部居中、深色胶囊 */
.toast-wrap {
  position: fixed;
  left: 50%;
  bottom: 96px;
  z-index: 9999;
  display: flex;
  width: calc(100vw - 32px);
  max-width: 356px;
  flex-direction: column-reverse;
  gap: 14px;
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  padding: 13px 24px;
  border-radius: 11px;
  background: #3d3a32;
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  box-shadow: 0 16px 40px rgba(38, 36, 31, 0.3);
  pointer-events: auto;
  animation: toast-in 0.3s ease;
}

.toast.success {
  background: var(--moss-600, #4f7a4a);
}

.toast.error {
  background: var(--brick-600, #b3392b);
}

.toast .material-symbols-rounded {
  flex: none;
  font-size: 18px;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* 个人中心 */
.profile-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--card);
  font-size: 14px;
}

.profile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink-2);
}

.profile-row b {
  color: var(--foreground);
  font-weight: 500;
}

/* ============ PC 端（?ui=pc 或桌面 UA） ============ */
.pc-root {
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--background);
  padding: 40px 16px;
}

.pc-card {
  width: min(420px, 92vw);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16.2px;
  background: var(--card);
  box-shadow: 0 20px 50px rgba(38, 36, 31, 0.12);
}

.pc-card.wide {
  width: min(480px, 92vw);
}

.pc-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 30px 26px 22px;
}

.pc-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--primary);
  color: var(--primary-foreground);
}

.pc-icon .material-symbols-rounded {
  font-size: 24px;
}

.pc-sub {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted-foreground);
}

.pc-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0 26px 24px;
}

.pc-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.pc-field > label {
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--ink-2);
}

.pc-input-wrap {
  position: relative;
}

.pc-input {
  width: 100%;
  height: 40px;
  border: 1px solid var(--input);
  border-radius: 9px;
  background: var(--card);
  color: var(--foreground);
  font-size: 13.5px;
  line-height: 1.5;
  padding: 0 12px;
  outline: none;
}

.pc-input::placeholder {
  color: var(--placeholder);
  opacity: 1;
}

.pc-input:focus {
  border-color: var(--primary);
}

.pc-input.has-icon {
  padding-left: 40px;
}

.pc-input.has-toggle {
  padding-right: 40px;
}

.pc-field-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: var(--muted-foreground);
  pointer-events: none;
}

.pc-pw-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 4px;
  color: var(--muted-foreground);
}

.pc-pw-toggle:hover {
  color: var(--foreground);
}

.pc-row {
  display: flex;
  gap: 12px;
}

.pc-row > * {
  flex: 1;
  min-width: 0;
}

.pc-contact-row {
  display: flex;
  gap: 12px;
}

.pc-contact-row .select {
  width: 124px;
  flex: none;
}

.pc-form .select-trigger {
  height: 40px;
  border-radius: 9px;
  font-size: 13.5px;
}

.pc-form .select-trigger .value {
  font-weight: 500;
}

.pc-form .select-menu {
  font-size: 13.5px;
}

.pc-btn {
  height: 42px;
  margin-top: 4px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 20px;
}

.pc-btn-outline {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--primary);
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  transition: background 0.15s;
}

.pc-btn-outline:hover {
  background: var(--sand-150);
}

.pc-btn-transfer {
  background: var(--card);
  border-color: var(--border);
  color: var(--link);
  font-weight: 500;
}

.pc-btn-transfer:hover {
  background: var(--sand-150);
}

.pc-footer {
  margin-top: -1px;
  text-align: center;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted-foreground);
}

.pc-footer a {
  color: var(--link);
}

.pc-footer a:hover {
  text-decoration: underline;
}
