:root {
  --primary: #2a5cff; --primary-dark: #1e46d8;
  --up: #f53f3f; --down: #00b42a;
  --text: #1d2129; --text-2: #4e5969; --text-3: #86909c;
  --bg: #f6f7fa; --card: #fff; --border: #eceef2;
  --radius: 14px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px;
  -webkit-font-smoothing: antialiased; line-height: 1.6;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select { font-family: inherit; font-size: 14px; }
.auth-shell { min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 36px 18px 48px; }
.auth-brand { text-align: center; margin-bottom: 22px; }
.auth-brand .mark { display: inline-flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 600; letter-spacing: .3px; }
.auth-brand .dot { width: 30px; height: 30px; border-radius: 9px; background: var(--primary); color: #fff; display: grid; place-items: center; font-size: 15px; }
.auth-brand .sub { color: var(--text-3); font-size: 12.5px; margin-top: 7px; }
.card { width: 100%; max-width: 440px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 30px 30px 26px; box-shadow: 0 6px 24px rgba(29, 33, 41, .05); }
.card.wide { max-width: 940px; padding: 0; }
.card h2 { font-size: 19px; font-weight: 600; margin-bottom: 6px; }
.card .lead { color: var(--text-2); font-size: 13px; margin-bottom: 22px; }
.view { display: none; }
.view.active { display: block; animation: fadein .2s ease; }
@keyframes fadein { from { opacity: .4; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 7px; font-weight: 500; }
.field label .req { color: var(--up); margin-left: 2px; }
.input {
  width: 100%; height: 42px; padding: 0 13px; border: 1px solid #dfe3eb;
  border-radius: 9px; background: #fff; color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(42, 92, 255, .1); }
.input:disabled { background: #f5f6f8; color: var(--text-3); }
.field .tip { font-size: 12px; color: var(--text-3); margin-top: 6px; line-height: 1.5; }
.field .tip.ok { color: var(--down); }
.field .tip.bad { color: var(--up); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row.tight { margin: 2px 0 20px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; user-select: none; }
.check input { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; }
.btn {
  height: 42px; padding: 0 18px; border: 1px solid transparent; border-radius: 9px;
  background: var(--primary); color: #fff; cursor: pointer; font-weight: 500; transition: background .15s, opacity .15s;
}
.btn:hover { background: var(--primary-dark); }
.btn:disabled { background: #c9d2e8; cursor: not-allowed; }
.btn.block { width: 100%; }
.btn.ghost { background: #fff; color: var(--primary); border-color: #cdd8f5; }
.btn.ghost:hover { background: #f2f5ff; }
.btn.danger { background: var(--up); }
.btn.danger:hover { background: #d92f2f; }
.btn.small { height: 32px; padding: 0 13px; font-size: 12.5px; }
.btn.plain { background: transparent; color: var(--text-2); border-color: var(--border); }
.btn.plain:hover { background: #f5f6f9; }
.links { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; font-size: 13px; flex-wrap: wrap; gap: 8px; }
.notice { border-radius: 9px; padding: 11px 13px; font-size: 12.5px; line-height: 1.65; margin-bottom: 16px; }
.notice.info { background: #eef3ff; color: #254a9e; border: 1px solid #d6e2ff; }
.notice.warn { background: #fff7e8; color: #8a5a00; border: 1px solid #ffe3ae; }
.notice.ok { background: #eafbf0; color: #12713a; border: 1px solid #c6efd5; }
.notice.err { background: #ffefef; color: #b32424; border: 1px solid #ffd3d3; }
.notice[hidden] { display: none; }
.divider { height: 1px; background: var(--border); margin: 22px 0; }
.collapse summary { cursor: pointer; font-size: 13px; color: var(--primary); outline: none; }
.collapse .collapse-body { margin-top: 14px; }
.result-icon { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; margin: 4px auto 16px; font-size: 26px; background: #eafbf0; color: #12713a; }
.result-icon.bad { background: #ffefef; color: #b32424; }
.result-center { text-align: center; }
.result-center h2 { margin-bottom: 8px; }
.result-center .lead { margin-bottom: 20px; }
.outbox-list { margin-top: 12px; font-size: 12.5px; }
.outbox-list a { display: block; word-break: break-all; padding: 7px 0; border-bottom: 1px dashed var(--border); }
.auth-foot { margin-top: 22px; text-align: center; color: var(--text-3); font-size: 12px; line-height: 1.8; max-width: 560px; }

/* ---------------- 账号安全设置 ---------------- */
.settings-head { padding: 22px 28px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.settings-head h2 { margin: 0; font-size: 18px; }
.settings-head .who { color: var(--text-2); font-size: 13px; }
.settings-body { display: grid; grid-template-columns: 190px 1fr; min-height: 430px; }
.settings-nav { border-right: 1px solid var(--border); padding: 16px 10px; background: #fbfcfe; border-radius: 0 0 0 var(--radius); }
.settings-nav button {
  display: block; width: 100%; text-align: left; border: none; background: none; cursor: pointer;
  padding: 10px 14px; border-radius: 8px; color: var(--text-2); font-size: 13.5px; margin-bottom: 3px;
}
.settings-nav button:hover { background: #f0f3fb; }
.settings-nav button.active { background: #eaf0ff; color: var(--primary); font-weight: 600; }
.settings-pane { padding: 24px 28px 28px; }
.settings-pane .pane { display: none; }
.settings-pane .pane.active { display: block; animation: fadein .2s ease; }
.pane h3 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.pane .desc { color: var(--text-3); font-size: 12.5px; margin-bottom: 20px; }
.pane-section { border: 1px solid var(--border); border-radius: 11px; padding: 18px; margin-bottom: 18px; }
.pane-section h4 { font-size: 13.5px; font-weight: 600; margin-bottom: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.table-wrap { overflow-x: auto; }
table.devices { width: 100%; border-collapse: collapse; font-size: 13px; }
table.devices th, table.devices td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.devices th { color: var(--text-3); font-weight: 500; font-size: 12px; }
table.devices td { color: var(--text-2); }
.tag { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 999px; background: #eaf0ff; color: var(--primary); }
.tag.gray { background: #f0f1f4; color: var(--text-3); }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px dashed var(--border); }
.setting-row:last-child { border-bottom: none; }
.setting-row .label { font-size: 13px; }
.setting-row .label small { display: block; color: var(--text-3); font-size: 12px; margin-top: 2px; }
.select { height: 34px; padding: 0 10px; border: 1px solid #dfe3eb; border-radius: 8px; background: #fff; color: var(--text); }
.switch { position: relative; width: 42px; height: 23px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #d5d9e2; border-radius: 999px; cursor: pointer; transition: background .15s; }
.switch span:before { content: ''; position: absolute; width: 17px; height: 17px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .15s; }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span:before { transform: translateX(19px); }
.policy-list { padding-left: 18px; color: var(--text-2); font-size: 13px; }
.policy-list li { margin-bottom: 8px; }
.danger-zone { border-color: #ffd3d3; background: #fffafa; }
.danger-zone h4 { color: #b32424; }

/* ---------------- 弹窗 / 提示 ---------------- */
.modal-mask { position: fixed; inset: 0; background: rgba(16, 22, 36, .45); display: none; align-items: center; justify-content: center; padding: 18px; z-index: 90; }
.modal-mask.open { display: flex; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 430px; padding: 24px; }
.modal h3 { font-size: 16px; margin-bottom: 10px; }
.modal p { color: var(--text-2); font-size: 13px; margin-bottom: 14px; }
.modal ul { padding-left: 18px; color: var(--text-2); font-size: 13px; margin-bottom: 16px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
#toast {
  position: fixed; left: 50%; top: 24px; transform: translate(-50%, -14px); z-index: 120;
  background: #1d2129; color: #fff; padding: 10px 18px; border-radius: 9px; font-size: 13px;
  opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; max-width: 90vw;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.err { background: #b32424; }
#toast.ok { background: #12713a; }
@media (max-width: 720px) {
  .settings-body { grid-template-columns: 1fr; }
  .settings-nav { display: flex; overflow-x: auto; border-right: none; border-bottom: 1px solid var(--border); border-radius: 0; padding: 8px; }
  .settings-nav button { width: auto; white-space: nowrap; margin: 0 3px 0 0; }
  .settings-pane { padding: 20px 18px; }
  .grid-2 { grid-template-columns: 1fr; }
  .card { padding: 24px 20px; }
}
