/* 应创账号中心 - 设计基础
   遵循 Design_Specification.json：Apple HIG 排版/颜色/圆角/动效
   不使用渐变、不使用 emoji */

:root {
  --primary: #007AFF;
  --primary-pressed: #0062cc;
  --success: #34C759;
  --warning: #FF9500;
  --error: #FF3B30;

  --label: #1d1d1f;
  --secondary-label: #6e6e73;
  --tertiary-label: #86868b;
  --background: #ffffff;
  --surface: #f5f5f7;
  --card: #ffffff;
  --card-border: #e8e8ed;
  --separator: #e5e5ea;
  --fill: #e9e9ec;
  --fill-secondary: #f2f2f7;
  --overlay: rgba(0, 0, 0, 0.4);

  --font: "Segoe UI Variable", "Segoe UI", -apple-system, BlinkMacSystemFont,
    "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 18px;
  --r-pill: 980px;

  --sp-xs: 4px;
  --sp-sm: 8px;
  --sp-md: 16px;
  --sp-lg: 24px;
  --sp-xl: 32px;
  --sp-xxl: 48px;

  --dur-fast: 150ms;
  --dur-normal: 250ms;
  --dur-slow: 350ms;
  --ease: cubic-bezier(0.42, 0, 0.58, 1);

  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-pop: 0 12px 40px rgba(0, 0, 0, 0.16);
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #0A84FF;
    --primary-pressed: #409cff;
    --success: #30D158;
    --warning: #FF9F0A;
    --error: #FF453A;

    --label: #f5f5f7;
    --secondary-label: #a1a1a6;
    --tertiary-label: #86868b;
    --background: #000000;
    --surface: #1c1c1e;
    --card: #1c1c1e;
    --card-border: #2c2c2e;
    --separator: #38383a;
    --fill: #2c2c2e;
    --fill-secondary: #1c1c1e;
    --overlay: rgba(0, 0, 0, 0.6);

    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-pop: 0 12px 40px rgba(0, 0, 0, 0.6);
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.47;
  color: var(--label);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--label); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4, p { margin: 0; }

button { font-family: inherit; }

/* ---------- 排版 ---------- */
.t-large-title { font-size: 34px; line-height: 41px; font-weight: 600; letter-spacing: -0.4px; }
.t-title1 { font-size: 28px; line-height: 34px; font-weight: 600; letter-spacing: -0.3px; }
.t-title2 { font-size: 22px; line-height: 28px; font-weight: 600; }
.t-title3 { font-size: 20px; line-height: 25px; font-weight: 600; }
.t-headline { font-size: 17px; line-height: 22px; font-weight: 600; }
.t-body { font-size: 17px; line-height: 22px; font-weight: 400; }
.t-callout { font-size: 16px; line-height: 21px; }
.t-subhead { font-size: 15px; line-height: 20px; }
.t-footnote { font-size: 13px; line-height: 18px; }
.t-caption { font-size: 12px; line-height: 16px; }

.text-secondary { color: var(--secondary-label); }
.text-tertiary { color: var(--tertiary-label); }
.text-error { color: var(--error); }
.text-center { text-align: center; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: var(--r-md);
  font-size: 17px;
  font-weight: 600;
  height: 44px;
  padding: 0 22px;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease),
    transform var(--dur-fast) var(--ease);
  user-select: none;
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-pressed); }

.btn-secondary { background: var(--fill); color: var(--label); }
.btn-secondary:hover:not(:disabled) { background: var(--separator); }

/* 浅灰底 + #1b1b1f 文字（授权页次级操作：否 / 不允许） */
.btn-soft {
  background: var(--fill);
  color: #1b1b1f;
}
.btn-soft:hover:not(:disabled) { background: var(--separator); }
@media (prefers-color-scheme: dark) {
  .btn-soft { color: #f5f5f7; }
}

.btn-plain {
  background: transparent;
  color: var(--primary);
  height: 40px;
  padding: 0 10px;
  font-weight: 400;
}
.btn-plain:hover { text-decoration: underline; }

.btn-danger { background: var(--error); color: #fff; }
.btn-danger:hover:not(:disabled) { filter: brightness(0.92); }

.btn-sm { height: 32px; font-size: 14px; padding: 0 14px; }
.btn-block { width: 100%; }

/* ---------- 输入 ---------- */
.field {
  width: 100%;
  height: 48px;
  border-radius: var(--r-md);
  border: 1px solid var(--separator);
  background: var(--card);
  color: var(--label);
  font-size: 17px;
  font-family: inherit;
  padding: 0 14px;
  outline: none;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.field:focus {
  border-color: var(--secondary-label);
}
.field::placeholder { color: var(--tertiary-label); }
textarea.field { height: auto; min-height: 88px; padding: 12px 14px; resize: vertical; }

select.field {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2386868b' d='M1.4.6 6 5.2 10.6.6 12 2 6 8 0 2z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.field-label {
  display: block;
  font-size: 13px;
  color: var(--secondary-label);
  margin-bottom: 6px;
  padding-left: 2px;
}

.field-group { margin-bottom: 14px; }
.field-row { display: flex; gap: 12px; }
.field-row > * { flex: 1; min-width: 0; }

/* 浮动标签输入（Apple id 风格） */
.float-field { position: relative; }
.float-field input {
  width: 100%;
  height: 62px;
  border-radius: var(--r-md);
  border: 1px solid var(--separator);
  background: var(--card);
  color: var(--label);
  font-size: 17px;
  font-family: inherit;
  padding: 30px 14px 8px;
  outline: none;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.float-field input:focus {
  border-color: var(--secondary-label);
}
.float-field label {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 17px;
  color: var(--tertiary-label);
  pointer-events: none;
  transition: all var(--dur-fast) var(--ease);
}
.float-field input:focus + label,
.float-field input:not(:placeholder-shown) + label {
  top: 9px;
  transform: none;
  font-size: 12px;
  line-height: 15px;
  color: var(--secondary-label);
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--r-xl);
  padding: 20px;
  box-shadow: var(--shadow-card);
}
.card-muted { background: var(--surface); border-color: transparent; }

/* 账户页功能卡片（右上角图标） */
.acct-card {
  position: relative;
  display: block;
  width: 100%;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--r-xl);
  padding: 20px 24px;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
  font-family: inherit;
  color: inherit;
}
.acct-card:hover { background: var(--surface); }
.acct-card:active { transform: scale(0.99); }
.acct-card .acct-card-title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 6px;
  padding-right: 36px;
}
.acct-card .acct-card-body { font-size: 14px; color: var(--secondary-label); line-height: 1.5; }
.acct-card .acct-card-icon {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 28px;
  height: 28px;
  color: var(--primary);
}
.acct-card .acct-card-icon svg { width: 100%; height: 100%; }

/* ---------- 列表 ---------- */
.list {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--r-xl);
  overflow: hidden;
}
.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--separator);
  min-height: 56px;
}
.list-row:last-child { border-bottom: none; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .row-title { font-size: 16px; font-weight: 500; }
.list-row .row-sub { font-size: 13px; color: var(--secondary-label); margin-top: 2px; }

/* ---------- 复选框 / 开关 ---------- */
.check-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 0;
  cursor: pointer;
}
/* 自定义复选框：小号细对勾，圆角方框 */
.check-row input[type="checkbox"] {
  width: 17px;
  height: 17px;
  margin: 3px 0 0;
  flex-shrink: 0;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  border: 1.5px solid var(--separator);
  border-radius: 5px;
  background: var(--card);
  position: relative;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.check-row input[type="checkbox"]:hover { border-color: var(--secondary-label); }
.check-row input[type="checkbox"]:checked {
  background: var(--primary);
  border-color: var(--primary);
}
.check-row input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1.5px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}
.check-row .check-text { font-size: 15px; line-height: 1.45; }
.check-row .check-desc { font-size: 13px; color: var(--secondary-label); margin-top: 4px; }

.switch {
  position: relative;
  width: 51px;
  height: 31px;
  flex-shrink: 0;
  cursor: pointer;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track {
  position: absolute;
  inset: 0;
  background: var(--fill);
  border-radius: var(--r-pill);
  transition: background var(--dur-normal) var(--ease);
}
.switch .track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform var(--dur-normal) var(--ease);
}
.switch input:checked + .track { background: var(--success); }
.switch input:checked + .track::after { transform: translateX(20px); }

/* ---------- 头像 ---------- */
.avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--fill);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: var(--secondary-label);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 500;
  user-select: none;
  flex-shrink: 0;
}
.avatar-sm { width: 40px; height: 40px; font-size: 16px; }

/* ---------- 顶部栏 ---------- */
.topbar {
  border-bottom: 1px solid var(--separator);
  background: var(--background);
}
.topbar-inner {
  max-width: 1024px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.topbar-title { font-size: 21px; font-weight: 600; letter-spacing: -0.2px; }
.topbar-title a { color: var(--label); }
.topbar-title a:hover { text-decoration: none; }

/* ---------- 弹窗 ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-normal) var(--ease);
}
.modal-backdrop.open { opacity: 1; pointer-events: auto; }
.modal {
  width: 100%;
  max-width: 440px;
  max-height: 86vh;
  overflow: auto;
  background: var(--card);
  border-radius: var(--r-xl);
  padding: 24px;
  box-shadow: var(--shadow-pop);
  transform: translateY(12px) scale(0.98);
  transition: transform var(--dur-normal) var(--ease);
}
.modal-backdrop.open .modal { transform: none; }
.modal-title { font-size: 20px; font-weight: 600; margin-bottom: 6px; }
.modal-desc { font-size: 14px; color: var(--secondary-label); margin-bottom: 18px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* ---------- 提示条 ---------- */
.toast-wrap {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  color: var(--label);
  border: 1px solid var(--separator);
  padding: 10px 18px;
  border-radius: var(--r-md);
  font-size: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  opacity: 0;
  transform: translateY(-8px);
  transition: all var(--dur-normal) var(--ease);
  max-width: 90vw;
}
.toast.show { opacity: 1; transform: none; }
.toast.enter { opacity: 0; transform: translateY(-16px); }
.toast.dismissing {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  margin-inline: auto;
  width: fit-content;
  transform: translateY(-8px);
  opacity: 0;
}
@media (prefers-color-scheme: dark) {
  .toast { background: rgba(44, 44, 46, 0.72); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35); }
}

/* ---------- 状态标签 ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 600;
  background: var(--fill);
  color: var(--secondary-label);
}
.badge-green { background: rgba(52, 199, 89, 0.14); color: #248a3d; }
.badge-orange { background: rgba(255, 149, 0, 0.16); color: #c93400; }
.badge-red { background: rgba(255, 59, 48, 0.14); color: #d70015; }
.badge-blue { background: rgba(0, 122, 255, 0.12); color: var(--primary); }

@media (prefers-color-scheme: dark) {
  .badge-green { color: #63d471; }
  .badge-orange { color: #ffb340; }
  .badge-red { color: #ff6961; }
}

/* ---------- 分区标题 ---------- */
.section-title {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 6px;
  letter-spacing: -0.2px;
}
.section-desc { font-size: 14px; color: var(--secondary-label); margin-bottom: 22px; }

.divider { height: 1px; background: var(--separator); border: none; margin: 24px 0; }

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
.spinner-dark {
  border-color: var(--fill);
  border-top-color: var(--secondary-label);
}
@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }

/* ---------- 输入控件高度归一化（三星浏览器等移动端表现差异） ---------- */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
select,
textarea {
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  font-family: inherit;
}
.field:not(textarea),
.float-field input,
.btn {
  overflow: hidden;
}
.field:not(textarea) {
  min-height: 48px;
  max-height: 48px;
  line-height: normal;
}
.float-field input {
  min-height: 62px;
  max-height: 62px;
  line-height: normal;
}
.btn {
  line-height: 1;
  -webkit-appearance: none;
  appearance: none;
}

@media (max-width: 767px) {
  .field-row {
    flex-direction: column;
    gap: 12px;
  }
  .field-row > * {
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
  }
  .btn { height: 48px; }
}
