/* 忆梦云团队开发 */
/* 全局样式 - 现代移动 APP UI 风格 */

.membership-note { margin-top: 16px; padding: 12px; border-radius: 10px; background: var(--bg-soft); color: var(--text-sec); font-size: 13px; }
.card-code-create-btn { padding: 8px 14px; white-space: nowrap; }
.card-code-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.card-code-generate-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: end; }
.card-code-generate-form .card-code-modal-actions { grid-column: 1 / -1; }
.card-code-charsets { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 16px; padding: 0; border: 0; color: var(--text-main); }
.card-code-charsets legend { margin-bottom: 8px; font-weight: 600; }
.card-code-charsets label { display: inline-flex; align-items: center; gap: 6px; }
.card-code-filter { display: grid; grid-template-columns: minmax(180px, 1fr) 160px auto; gap: 10px; margin-bottom: 16px; }
.card-code-batch-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; padding: 10px 12px; border-radius: 10px; background: var(--bg-soft); }
.card-code-select-all { display: inline-flex; align-items: center; gap: 7px; color: var(--text-main); font-size: 13px; cursor: pointer; }
.card-code-selected-count { color: var(--text-sec); font-size: 13px; }
.card-code-batch-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.card-code-batch-btn { padding: 7px 10px; font-size: 12px; }
.card-code-check-cell { width: 42px; text-align: center !important; }
.card-code-checkbox { width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary); }
.card-code-checkbox:disabled { cursor: not-allowed; opacity: .35; }
.card-code-value { user-select: all; white-space: nowrap; }
.card-code-action { padding: 6px 10px; margin: 2px; font-size: 12px; }
.card-code-delete { color: var(--danger); }
.card-code-empty { padding: 36px !important; text-align: center; color: var(--text-sec); }
.card-code-modal { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px; background: rgba(15,23,42,.55); }
.card-code-modal[hidden] { display: none !important; }
.card-code-modal-panel { width: min(680px, 100%); max-height: 85vh; overflow: auto; padding: 22px; border-radius: 16px; background: var(--bg-card); box-shadow: 0 24px 60px rgba(15,23,42,.25); }
.card-code-modal-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.card-code-modal-header h2 { margin: 0; font-size: 18px; }
.card-code-modal-close { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: var(--bg-soft); color: var(--text-sec); cursor: pointer; }
.card-code-modal-close .ui-icon { width: 17px; height: 17px; }
.card-code-generated-list { margin: 16px 0; max-height: 50vh; overflow: auto; border: 1px solid var(--border); border-radius: 10px; }
.card-code-generated-list > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 12px; border-bottom: 1px solid var(--border-light); }
.card-code-generated-list > div:last-child { border-bottom: 0; }
.card-code-modal-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.card-code-redeem-card { margin: 0 16px 24px; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--module-bg); }
.card-code-redeem-card h2 { margin-bottom: 12px; font-size: 15px; }
.card-code-redeem-card p { margin-top: 10px; color: var(--text-sec); font-size: 12px; }
.card-code-redeem-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
@media (max-width: 640px) {
  .card-code-create-btn { padding: 7px 10px; font-size: 12px; }
  .card-code-stats { grid-template-columns: repeat(2, 1fr); }
  .card-code-generate-form, .card-code-filter { grid-template-columns: 1fr; }
  .card-code-batch-actions { width: 100%; margin-left: 0; }
  .card-code-batch-btn { flex: 1; }
  .card-code-redeem-row { grid-template-columns: 1fr; }
  .card-code-modal-panel { padding: 18px; }
}


:root {
  --primary: #07C160;
  --primary-dark: #06ad56;
  --primary-light: #e8f8ee;
  --danger: #e53935;
  --warning: #ff9800;
  --success: #07C160;
  --bg-page: #ffffff;
  --bg-soft: #f7f7f8;
  --bg-card: #ffffff;
  --text-main: #1a1a2e;
  --text-sec: #8e8ea0;
  --text-light: #c4c4cc;
  --border: #e8e8ef;
  --border-light: #f0f0f5;
  --header-bg: #ffffff;
  --header-text: #1a1a2e;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-card: 0 2px 12px rgba(0,0,0,0.06);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* 确保 hidden 属性始终生效，不被 display 声明覆盖 */
[hidden] { display: none !important; }

html, body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 14px;
  color: var(--text-main);
  background: var(--bg-page);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }

/* ========== 顶部导航 ========== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 50px;
  background: var(--header-bg);
  color: var(--header-text);
  display: flex;
  align-items: center;
  padding: 0 16px;
  font-size: 17px;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

.header-title {
  flex: 1;
  text-align: center;
}

.header-back {
  font-size: 22px;
  padding: 4px 8px 4px 0;
  cursor: pointer;
  color: var(--text-main);
  font-weight: 500;
}

.header-actions {
  font-size: 13px;
  color: var(--primary);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-tag {
  display: inline-block;
  padding: 3px 10px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 11px;
  color: var(--text-sec);
  font-weight: 500;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ========== 底部导航 ========== */
.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  display: flex;
  height: calc(64px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -8px 24px rgba(15,23,42,.04);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #64748b;
  font-weight: 600;
  transition: color 0.15s;
}

.nav-item:hover, .nav-item.active, .nav-item[aria-current="page"] { color: var(--primary); }
@media (hover: none) and (pointer: coarse) {
  body.keyboard-open .bottom-nav { display: none; }
  body.keyboard-open .app-wrapper { padding-bottom: 0; }
}
.nav-icon { width: 22px; height: 22px; display: grid; place-items: center; font-size: 22px; }
.nav-icon .ui-icon { width: 21px; height: 21px; }
.nav-label { font-size: 10px; font-weight: 500; }

/* ========== 新邮件通知弹窗（QQ 风格顶部横幅） ========== */
.mail-notification-stack {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 0;
  pointer-events: none;
  padding: calc(env(safe-area-inset-top, 0px) + 2px) 0 0 0;
}
body.keyboard-open .mail-notification-stack { display: none; }

.mail-notification {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(0,0,0,.10);
  cursor: pointer;
  pointer-events: auto;
  user-select: none;
  -webkit-user-select: none;
  transform: translateY(-100%);
  opacity: 0;
  transition: transform .28s cubic-bezier(.4,0,.2,1), opacity .22s;
}
.mail-notification:first-child {
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
}
.mail-notification:focus { outline: 2px solid var(--primary); outline-offset: -2px; }
.mail-notification.is-visible { transform: translateY(0); opacity: 1; }
.mail-notification.is-leaving { transform: translateY(-100%); opacity: 0; }
.mail-notification.is-spam { border-left: 3px solid var(--warning); }

.mail-notification__icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: var(--primary-light);
  border-radius: 50%;
  color: var(--primary);
}
.mail-notification__icon .ui-icon { width: 20px; height: 20px; }
.mail-notification.is-spam .mail-notification__icon { background: #fff3e0; color: var(--warning); }

.mail-notification__content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mail-notification__heading {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
}
.mail-notification.is-spam .mail-notification__heading { color: var(--warning); }
.mail-notification__sender {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mail-notification__subject {
  font-size: 12px;
  color: var(--text-sec);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mail-notification__close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: none;
  background: transparent;
  color: var(--text-hint);
  border-radius: 50%;
  cursor: pointer;
  transition: background .15s;
}
.mail-notification__close:hover { background: var(--bg-soft); color: var(--text-sec); }
.mail-notification__close .ui-icon { width: 14px; height: 14px; }

@media (min-width: 480px) {
  .mail-notification-stack { max-width: 480px; margin: 0 auto; }
}
@media (max-width: 360px) {
  .mail-notification { padding: 10px 12px; gap: 8px; }
  .mail-notification__icon { width: 34px; height: 34px; }
  .mail-notification__icon .ui-icon { width: 17px; height: 17px; }
}

/* ========== 页面容器 ========== */
.app-wrapper {
  max-width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  background: var(--bg-page);
}

/* ========== 创建邮箱 ========== */
.create-page {
  max-width: 420px;
  margin: 0 auto;
  padding: 28px 20px 0;
}

.cp-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 28px;
  text-align: left;
  line-height: 1.3;
}

.cp-field {
  margin-bottom: 22px;
}

.cp-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
  margin-bottom: 8px;
}

.cp-input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1.5px solid #e0e0e0;
  border-radius: 12px;
  font-size: 15px;
  color: var(--text-main);
  background: #f7f7f8;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}

.cp-input:focus { border-color: var(--primary); background: #fff; }
.cp-input::placeholder { color: #c0c0cc; }

.cp-hint {
  font-size: 12px;
  color: #b0b0b8;
  margin-top: 6px;
  margin-left: 2px;
}

/* 域名下拉选择框 */
.cp-select-wrap {
  position: relative;
}

.cp-select-wrap::after {
  content: '▾';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--text-sec);
  pointer-events: none;
}

.cp-select {
  width: 100%;
  height: 46px;
  padding: 0 36px 0 14px;
  border: 1.5px solid #e0e0e0;
  border-radius: 12px;
  font-size: 15px;
  color: var(--text-main);
  background: #f7f7f8;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
}

.cp-select:focus { border-color: var(--primary); background: #fff; }

.cp-domain-list { display: flex; flex-direction: column; gap: 8px; }

.cp-domain-item {
  padding: 12px 16px;
  border: 1.5px solid #e0e0e0;
  border-radius: 12px;
  font-size: 14px;
  color: var(--text-sec);
  background: #fff;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.cp-domain-item:active { opacity: 0.7; }

.cp-domain-item.active {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
  font-weight: 600;
}

.cp-quick-row { display: flex; gap: 8px; }

.cp-quick-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  border: 1.5px solid #e0e0e0;
  border-radius: 12px;
  font-size: 14px;
  color: var(--text-sec);
  background: #fff;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.cp-quick-btn:active {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.cp-preview {
  background: #f7f7f8;
  border: 1.5px dashed #e0e0e0;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 22px;
  text-align: center;
  transition: all 0.3s;
}

.cp-preview-text {
  font-family: 'SF Mono', 'Courier New', monospace;
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
  word-break: break-all;
}

.cp-btn-primary {
  width: 100%;
  height: 50px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  margin-bottom: 10px;
}

.cp-btn-primary:active { background: var(--primary-dark); }
.cp-btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.cp-btn-secondary {
  width: 100%;
  height: 46px;
  background: #f7f7f8;
  color: var(--text-sec);
  border: 1.5px solid #e0e0e0;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.cp-btn-secondary:active { background: #eeeeee; }

.cp-footer {
  text-align: center;
  font-size: 12px;
  color: #c0c0cc;
  margin-top: 32px;
  margin-bottom: 60px;
}

/* ========== 登录/注册 ========== */
.auth-page { display: flex; flex-direction: column; min-height: 100vh; background: var(--bg-soft); }

.auth-brand {
  text-align: center;
  padding: 48px 20px 16px;
}

.auth-brand-icon {
  font-size: 48px;
  margin-bottom: 8px;
}

.auth-brand-name {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.auth-brand-desc {
  font-size: 13px;
  color: var(--text-sec);
}

.auth-form { padding: 8px 20px 40px; display: flex; justify-content: center; }

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-card);
  border-radius: 20px;
  padding: 28px 24px;
  box-shadow: var(--shadow-card);
}

.auth-title {
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 4px;
  color: var(--text-main);
}

.auth-subtitle {
  text-align: center;
  color: var(--text-sec);
  font-size: 13px;
  margin-bottom: 28px;
}

/* 输入框图标 */
.input-icon-wrap {
  display: flex;
  align-items: center;
  background: var(--bg-soft);
  border: 1.5px solid #e0e0e0;
  border-radius: 12px;
  transition: border-color 0.2s, background 0.2s;
}

.input-icon-wrap:focus-within {
  border-color: var(--primary);
  background: #fff;
}

.input-icon {
  flex-shrink: 0;
  width: 40px;
  text-align: center;
  font-size: 16px;
  color: var(--text-light);
}

.input-icon-wrap .form-input {
  border: none;
  background: transparent;
  padding-left: 0;
  height: 48px;
}

.input-icon-wrap .form-input:focus {
  border: none;
  background: transparent;
}

.captcha-input-wrap {
  flex: 1;
}

.form-group {
  margin-bottom: 16px;
}

.form-input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 1.5px solid #e0e0e0;
  border-radius: 12px;
  font-size: 15px;
  color: var(--text-main);
  background: #f7f7f8;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}

.form-input:focus { border-color: var(--primary); background: #fff; }
.form-input::placeholder { color: #c0c0cc; }
.form-input:disabled { background: #f0f0f2; color: var(--text-sec); }
.form-textarea { height: auto; padding: 12px 16px; resize: vertical; min-height: 120px; }

.captcha-group { display: flex; gap: 10px; }
.captcha-input { flex: 1; }
.captcha-img { height: 48px; border-radius: 12px; cursor: pointer; border: 1.5px solid #e0e0e0; }

/* 登录注册拖动滑块验证码 */
.slider-captcha { --slider-target: 80%; width: 100%; }
.slider-captcha-track {
  position: relative;
  height: 46px;
  overflow: hidden;
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
  background: var(--bg-soft);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.slider-captcha-target {
  position: absolute;
  z-index: 1;
  top: 5px;
  bottom: 5px;
  left: var(--slider-target);
  width: 48px;
  transform: translateX(-50%);
  border: 2px dashed var(--primary);
  border-radius: 8px;
  background: rgba(37, 99, 235, .08);
}
.slider-captcha-progress {
  position: absolute;
  z-index: 2;
  inset: 0 auto 0 0;
  width: 24px;
  background: rgba(37, 99, 235, .14);
  pointer-events: none;
}
.slider-captcha-text {
  position: absolute;
  z-index: 3;
  inset: 0 52px;
  display: grid;
  place-items: center;
  color: var(--text-sec);
  font-size: 13px;
  white-space: nowrap;
  pointer-events: none;
}
.slider-captcha-handle {
  position: absolute;
  z-index: 4;
  inset: 0 auto 0 0;
  width: 48px;
  border: 0;
  border-right: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--primary);
  box-shadow: 0 1px 5px rgba(15, 23, 42, .15);
  font-size: 28px;
  line-height: 1;
  cursor: grab;
  touch-action: none;
}
.slider-captcha.is-dragging .slider-captcha-handle { cursor: grabbing; }
.slider-captcha.is-passed .slider-captcha-track { border-color: #16a34a; background: rgba(22, 163, 74, .08); }
.slider-captcha.is-passed .slider-captcha-progress,
.slider-captcha.is-passed .slider-captcha-handle { background: #16a34a; color: #fff; }
.slider-captcha.is-passed .slider-captcha-target { display: none; }
.slider-captcha.is-passed .slider-captcha-text { color: #15803d; font-weight: 600; }
.slider-captcha.is-error .slider-captcha-track { border-color: #dc2626; background: rgba(220, 38, 38, .06); }
.slider-captcha.is-error .slider-captcha-text { color: #dc2626; }
.slider-captcha-modal[hidden] { display: none !important; }
.slider-captcha-modal {
  position: fixed;
  z-index: 2400;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  isolation: isolate;
}
.slider-captcha-modal-backdrop {
  position: absolute;
  z-index: -1;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: rgba(15, 23, 42, .58);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity .2s ease;
  cursor: default;
}
.slider-captcha-modal-panel {
  position: relative;
  width: min(92vw, 420px);
  padding: 28px 24px 26px;
  border: 1px solid rgba(226, 232, 240, .95);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(15, 23, 42, .28);
  opacity: 0;
  transform: translateY(12px) scale(.98);
  transition: opacity .2s ease, transform .2s ease;
}
.slider-captcha-modal.is-visible .slider-captcha-modal-backdrop { opacity: 1; }
.slider-captcha-modal.is-visible .slider-captcha-modal-panel { opacity: 1; transform: none; }
.slider-captcha-modal-title { margin: 0 36px 8px; color: var(--text-main); font-size: 20px; text-align: center; }
.slider-captcha-modal-desc { margin: 0 0 22px; color: var(--text-sec); font-size: 14px; line-height: 1.6; text-align: center; }
.slider-captcha-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: var(--bg-soft);
  color: var(--text-sec);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.slider-captcha-modal-close:hover { color: var(--text-main); background: var(--border-light); }

.auth-links {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--text-sec);
}

.auth-links a { color: var(--primary); font-weight: 500; }
.auth-links-stack { display: flex; flex-direction: column; gap: 12px; }
.auth-brand-compact { padding-bottom: 14px; }
.reset-code-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; }
.reset-code-row .btn { min-width: 112px; padding: 0 14px; }
.admin-card-desc { margin: -4px 0 18px; color: var(--text-sec); font-size: 13px; line-height: 1.6; }

.switch { position: relative; display: inline-block; width: 48px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: 0.3s; border-radius: 26px; }
.switch-slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 3px; bottom: 3px; background-color: white; transition: 0.3s; border-radius: 50%; }
.switch input:checked + .switch-slider { background-color: var(--primary); }
.switch input:checked + .switch-slider:before { transform: translateX(22px); }

/* ========== 按钮 ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 24px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  outline: none;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:active:not(:disabled) { background: var(--primary-dark); }
.btn-block { width: 100%; }
.btn-sm { height: 34px; padding: 0 14px; font-size: 12px; border-radius: 8px; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:active { opacity: 0.7; }

/* ========== 消息框 ========== */
.msg-box {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  margin-bottom: 16px;
  text-align: center;
  line-height: 1.4;
}

.msg-success {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary);
}

.msg-error {
  background: #fdecea;
  color: var(--danger);
  border: 1px solid #f5c6cb;
}

/* ========== 收件箱 ========== */
.inbox-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
}

.inbox-search-input {
  flex: 1;
  height: 38px;
  padding: 0 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  color: var(--text-main);
  background: var(--bg-soft);
  outline: none;
  transition: border-color 0.2s;
}

.inbox-search-input:focus { border-color: var(--primary); }
.inbox-search-input::placeholder { color: var(--text-light); }

.inbox-search-btn {
  flex-shrink: 0;
  height: 38px;
  padding: 0 16px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.inbox-search-btn:active { background: var(--primary-dark); }

.inbox-search-clear {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-sec);
  font-size: 16px;
  cursor: pointer;
}

.inbox-list { background: var(--bg-card); }

.inbox-item {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  text-decoration: none;
  transition: background 0.1s;
}

.inbox-item:active { background: #f5f5f6; }

.inbox-item.unread {
  background: #f8faff;
  padding-left: 14px;
}

.inbox-item.unread .inbox-item-avatar {
  position: relative;
}

.inbox-item.unread .inbox-item-avatar::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 10px;
  height: 10px;
  background: var(--primary);
  border-radius: 50%;
  border: 2px solid #f8faff;
}

.inbox-item.unread .inbox-item-from {
  font-weight: 600;
  color: var(--text-main);
}

.inbox-item.unread .inbox-item-subject {
  font-weight: 500;
}

.inbox-item.read .inbox-item-from { font-weight: 400; color: var(--text-sec); }
.inbox-item.read .inbox-item-subject { font-weight: 400; color: var(--text-sec); }

.inbox-item-avatar {
  width: 40px;
  height: 40px;
  margin-right: 12px;
  flex-shrink: 0;
  position: relative;
}

.avatar-text {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
}

.avatar-img {
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-card);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.avatar-lg { width: 50px; height: 50px; font-size: 20px; }
.avatar-xl { width: 64px; height: 64px; font-size: 26px; }

.inbox-item-content { flex: 1; min-width: 0; }

.inbox-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.inbox-item-from {
  font-size: 14px;
  color: var(--text-main);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inbox-item-time {
  font-size: 11px;
  color: var(--text-light);
  flex-shrink: 0;
  margin-left: 8px;
}

.inbox-item-subject {
  font-size: 13px;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inbox-item-body-preview {
  font-size: 12px;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

/* ========== 邮件详情 ========== */
.email-page {
  padding: 0;
}

.email-detail-card {
  margin: 12px 16px;
  background: var(--bg-card);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.email-sender-bar {
  display: flex;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--border-light);
}

.email-sender-avatar { margin-right: 12px; }

.email-sender-info {
  flex: 1;
  min-width: 0;
}

.email-sender-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
}

.email-meta-row {
  font-size: 12px;
  color: var(--text-sec);
  margin-top: 3px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.email-meta-row span + span::before {
  content: '·';
  margin: 0 4px;
  color: var(--text-light);
}

.email-subject-bar {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
}

.email-subject-text {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
  word-break: break-word;
}

.email-time-text {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 6px;
}

.email-attachments {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
}

.email-attachments-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sec);
  margin-bottom: 8px;
}

.email-attachment-item {
  display: inline-flex;
  align-items: center;
  background: var(--bg-soft);
  border-radius: 8px;
  padding: 6px 12px;
  margin-right: 6px;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--text-main);
}

.email-body-section {
  padding: 16px;
}

.email-body-html { line-height: 1.7; font-size: 14px; }
.email-body-html img { max-width: 100%; height: auto; }

.email-body-text {
  font-family: 'Courier New', monospace;
  font-size: 13px;
  white-space: pre-wrap;
  word-wrap: break-word;
  line-height: 1.6;
  color: var(--text-main);
}

/* ========== 个人中心 ========== */
.profile-page {
  padding: 16px;
  padding-bottom: 80px;
}

.profile-header-card {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: 16px;
  padding: 28px 24px;
  text-align: center;
  margin-bottom: 16px;
  color: #fff;
}

.profile-avatar-wrap {
  margin-bottom: 12px;
}

.profile-avatar-wrap .avatar-text {
  width: 64px;
  height: 64px;
  font-size: 26px;
  background: rgba(255,255,255,0.25);
  border: 3px solid rgba(255,255,255,0.4);
}

.profile-name-text {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}

.profile-email-text {
  font-size: 13px;
  opacity: 0.85;
}

.profile-section {
  background: var(--bg-card);
  border-radius: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.profile-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sec);
  padding: 16px 16px 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.profile-section-body {
  padding: 8px 16px 16px;
}

.profile-link-item {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.1s;
  cursor: pointer;
}

.profile-link-item:active { background: #f5f5f6; }
.profile-link-item:last-child { border-bottom: none; }

.profile-link-icon {
  font-size: 18px;
  margin-right: 12px;
  width: 24px;
  text-align: center;
}

.profile-link-text {
  flex: 1;
  font-size: 14px;
  color: var(--text-main);
  font-weight: 500;
}

.profile-link-arrow {
  color: var(--text-light);
  font-size: 14px;
}

.profile-form-section {
  padding: 0 16px 16px;
}

.profile-form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sec);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* 个人资料字段 */
.profile-field {
  margin-bottom: 16px;
}

.profile-field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sec);
  margin-bottom: 6px;
}

.profile-field-value {
  font-size: 15px;
  color: var(--text-main);
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}

/* 快捷链接行 */
.profile-link-row {
  display: flex;
  align-items: center;
  padding: 16px;
  background: var(--bg-card);
  border-radius: 16px;
  margin-bottom: 12px;
  text-decoration: none;
  box-shadow: var(--shadow-card);
  transition: background 0.1s;
}

.profile-link-row:active { background: #f5f5f6; }

.profile-link-logout {
  border: 1px solid #fdecea;
}

/* ========== 邮箱列表 ========== */
.mailbox-page {
  padding: 12px 16px 80px;
}

.mailbox-search {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.mailbox-search-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--text-light);
  pointer-events: none;
}

.mailbox-search-input {
  width: 100%;
  height: 44px;
  padding: 0 44px 0 42px;
  border: 1px solid var(--border-light);
  border-radius: 14px;
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 14px;
  outline: none;
  box-shadow: var(--shadow-sm);
  transition: border-color .2s, box-shadow .2s;
}

.mailbox-search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}

.mailbox-search-input::placeholder { color: var(--text-light); }
.mailbox-search-input::-webkit-search-cancel-button { display: none; }

.mailbox-search-clear {
  position: absolute;
  right: 8px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-sec);
  cursor: pointer;
}

.mailbox-search-clear:hover { background: var(--bg-light); color: var(--text-main); }
.mailbox-search-clear .ui-icon { width: 16px; height: 16px; }

.mailbox-search-summary {
  min-height: 20px;
  margin-bottom: 6px;
  color: var(--text-sec);
  font-size: 12px;
}

.mailbox-search-empty {
  padding: 48px 20px;
  text-align: center;
}

.mailbox-search-reset { margin-top: 16px; }

.mailbox-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mailbox-item {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow-card);
}

.mailbox-info {
  margin-bottom: 12px;
}

.mailbox-email-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mailbox-email {
  display: inline;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  font-family: 'SF Mono', 'Courier New', monospace;
  word-break: break-all;
  cursor: pointer;
}

.mailbox-email:active { color: var(--primary); }

.mailbox-copy-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px 8px;
  font-size: 15px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}

.mailbox-copy-btn:active { background: var(--primary-light); }

.mailbox-time {
  display: block;
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
}

.mailbox-actions {
  display: flex;
  gap: 8px;
}

.mailbox-action-btn {
  flex: 1;
  height: 34px;
  border: none;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s;
}

.mailbox-action-btn:active { opacity: 0.7; }
.mailbox-action-btn.primary { background: var(--primary); color: #fff; }
.mailbox-action-btn.sent { background: #6366f1; color: #fff; }
.mailbox-action-btn.send { background: #10b981; color: #fff; }
.mailbox-action-btn.danger { background: transparent; color: var(--danger); border: 1.5px solid var(--danger); }

/* ========== 发件界面 ========== */
.compose-page { padding: 16px; padding-bottom: 80px; }
.compose-form { display: flex; flex-direction: column; gap: 16px; }
.compose-field { display: flex; flex-direction: column; gap: 6px; }
.compose-label { font-size: 13px; font-weight: 600; color: var(--text-sec); }
.compose-hint { font-size: 12px; color: var(--text-light); }

/* ========== 发件记录 ========== */
.sent-page { padding-bottom: 80px; }
.sent-list { background: var(--bg-card); }

.sent-item {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  text-decoration: none;
  transition: background 0.1s;
}

.sent-item:active { background: #f5f5f6; }

.sent-item-avatar { width: 40px; height: 40px; margin-right: 12px; flex-shrink: 0; }

.sent-avatar-text {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #6366f1;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
}

.sent-item-content { flex: 1; min-width: 0; }

.sent-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3px;
}

.sent-item-to {
  font-size: 14px;
  color: var(--text-main);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sent-item-time {
  font-size: 11px;
  color: var(--text-light);
  flex-shrink: 0;
}

.sent-item-subject {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.sent-item-meta { font-size: 11px; color: var(--text-sec); }

/* ========== 空状态 ========== */
.empty-state { text-align: center; padding: 64px 20px; }
.empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.3; }
.empty-text { font-size: 16px; color: var(--text-sec); margin-bottom: 6px; }
.empty-hint { font-size: 13px; color: var(--text-light); }

/* ========== 日志页面 ========== */
.logs-page { padding: 16px; }
.logs-card { background: var(--bg-card); border-radius: 16px; box-shadow: var(--shadow-card); overflow: hidden; }
.log-item { padding: 12px 16px; border-bottom: 1px solid var(--border-light); font-size: 12px; color: var(--text-sec); line-height: 1.6; word-break: break-all; }
.log-item:last-child { border-bottom: none; }

/* 操作日志工具栏：条数信息 + 每页条数选择 */
.logs-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  padding: 0 2px;
}
.logs-count { font-size: 13px; color: var(--text-sec); }
.logs-size-picker { display: flex; gap: 6px; }
.logs-size-btn {
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sec);
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  transition: all .16s ease;
}
.logs-size-btn:active { opacity: .7; }
.logs-size-btn.active { color: #fff; background: var(--primary); border-color: var(--primary); }

/* 操作日志分页 */
.logs-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px 0 4px;
  flex-wrap: wrap;
}
.logs-page-numbers { display: flex; align-items: center; gap: 5px; }
.logs-page-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sec);
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  transition: all .16s ease;
}
.logs-page-num:active { opacity: .7; }
.logs-page-num.active { color: #fff; background: var(--primary); border-color: var(--primary); }
.logs-page-ellipsis { padding: 0 2px; color: var(--text-light); font-size: 13px; }
.page-btn.disabled { opacity: .4; pointer-events: none; }
@media (max-width: 480px) {
  .logs-toolbar { flex-direction: column; align-items: flex-start; }
  .logs-pagination { gap: 8px; }
  .logs-page-num { min-width: 28px; height: 28px; padding: 0 6px; font-size: 12px; }
}

/* ========== Toast ========== */
.toast-notice {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
  background: #333; color: #fff; padding: 12px 24px; border-radius: 12px;
  font-size: 14px; font-weight: 500; z-index: 9999; white-space: nowrap;
  max-width: 88%; overflow: hidden; text-overflow: ellipsis;
  box-shadow: 0 6px 24px rgba(0,0,0,0.2);
  animation: toastIn 0.25s ease;
}

.toast-notice.fade-out { opacity: 0; transition: opacity 0.25s; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ========== 管理中心 ========== */
.admin-wrapper { background: var(--bg-soft); }
.header-admin { background: linear-gradient(135deg, #2563EB, #1d4ed8); color: #fff; border-bottom: none; }
.header-admin .header-back { color: #fff; }
.header-admin .header-actions { color: #fff; }
.admin-content { padding: 16px; padding-bottom: 80px; }

/* Admin card */
.admin-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
}

.admin-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-card-desc {
  font-size: 12px;
  color: var(--text-sec);
  margin-bottom: 14px;
  line-height: 1.5;
}

.admin-card-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 8px;
  border-radius: 11px;
  background: var(--bg-soft);
  color: var(--text-sec);
  font-size: 11px;
  font-weight: 600;
}

.admin-user-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  background: rgba(255,255,255,0.2);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

/* Stats grid */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }

.stat-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow-card);
  border-top: 3px solid var(--primary);
}

.stat-card-purple { border-top-color: #6366f1; }
.stat-card-purple .stat-value { color: #6366f1; }
.stat-card-blue { border-top-color: #3b82f6; }
.stat-card-blue .stat-value { color: #3b82f6; }
.stat-card-orange { border-top-color: #f59e0b; }
.stat-card-orange .stat-value { color: #f59e0b; }

.stat-value { font-size: 28px; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 12px; color: var(--text-sec); margin-top: 4px; font-weight: 500; }

/* Admin menu */
.admin-menu { background: var(--bg-card); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-card); }

.admin-menu-title {
  padding: 16px 18px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sec);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.menu-item { display: flex; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--border-light); transition: background 0.1s; cursor: pointer; text-decoration: none; }
.menu-item:active { background: #f5f5f6; }
.menu-item:last-child { border-bottom: none; }
.menu-icon { font-size: 18px; margin-right: 12px; width: 24px; text-align: center; }
.menu-text { flex: 1; font-size: 14px; color: var(--text-main); }
.menu-badge { font-size: 11px; color: var(--text-sec); background: var(--bg-soft); padding: 2px 10px; border-radius: 10px; margin-right: 8px; }
.menu-arrow { color: var(--text-light); font-size: 16px; }
.menu-item-logout { border-top: 8px solid var(--bg-soft); }

/* ========== 数据列表（管理端） ========== */
.search-bar { display: flex; gap: 10px; }
.search-bar .form-input { flex: 1; }
.search-bar .btn { flex-shrink: 0; white-space: nowrap; }

.data-list { border-radius: 12px; overflow: hidden; border: 1px solid var(--border-light); }
.data-item { display: flex; align-items: center; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--border-light); }
.data-item:last-child { border-bottom: none; }
.data-item-content { flex: 1; min-width: 0; }
.data-item-title { font-size: 14px; font-weight: 500; color: var(--text-main); margin-bottom: 3px; }
.data-item-meta { font-size: 11px; color: var(--text-sec); line-height: 1.5; }
.data-item-action { flex-shrink: 0; margin-left: 10px; display: flex; align-items: center; gap: 6px; }
.data-item-left { margin-right: 12px; flex-shrink: 0; }

.status-badge { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 11px; font-weight: 500; }
.status-badge.active { background: var(--primary-light); color: var(--primary); }
.status-badge.disabled { background: #fdecea; color: var(--danger); }

/* 邮箱号管理：收件/发件统计 */
.mail-stat-row { display: flex; gap: 12px; margin-top: 6px; }
.mail-stat { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: var(--text-sec); }
.mail-stat .ui-icon { width: 13px; height: 13px; }
.mail-stat.inbox .ui-icon { color: var(--primary); }
.mail-stat.sent .ui-icon { color: #3b82f6; }
.mail-stat b { color: var(--text-main); font-size: 12px; }

/* ========== 用户列表移动端适配 ========== */
@media (max-width: 640px) {
  .admin-card { padding: 16px; }
  .data-item { padding: 12px 14px; }
  .data-item-action {
    width: 100%;
    margin-left: 0;
    margin-top: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  /* 放大触控目标，适配手指操作 */
  .data-item-action .btn-sm {
    height: 40px;
    padding: 0 14px;
    font-size: 12px;
    border-radius: 9px;
  }
  .data-item-action .status-badge {
    height: 40px;
    line-height: 40px;
    padding: 0 16px;
    font-size: 12px;
  }
}

/* ========== 分页 ========== */
.pagination { display: flex; justify-content: center; align-items: center; padding: 20px; gap: 16px; }
.page-btn { padding: 8px 18px; border: 1.5px solid var(--border); border-radius: 10px; font-size: 13px; color: var(--primary); background: var(--bg-card); font-weight: 500; cursor: pointer; }
.page-btn:active { opacity: 0.7; }
.page-info { font-size: 13px; color: var(--text-sec); }

/* ========== 通用徽章 ========== */
.badge { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 11px; }
.badge-unread { background: var(--primary-light); color: var(--primary); font-weight: 500; }

/* ========== 设置表单（管理端） ========== */
.settings-form { display: flex; flex-direction: column; gap: 0; }
.security-content { width: min(100%, 1280px); margin: 0 auto; }
.security-intro { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; padding: 18px 20px; color: #fff; background: linear-gradient(135deg, #1e3a8a, #2563eb); border-radius: 16px; box-shadow: var(--shadow); }
.security-intro-icon { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22); border-radius: 13px; }
.security-intro-icon .ui-icon { width: 24px; height: 24px; }
.security-intro strong, .security-intro span { display: block; }
.security-intro strong { margin-bottom: 3px; font-size: 16px; font-weight: 800; }
.security-intro span { color: rgba(255,255,255,.78); font-size: 12px; line-height: 1.55; }
.security-master-card { border: 1px solid #bfdbfe; box-shadow: 0 10px 36px rgba(37,99,235,.1); }
.security-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.security-grid .admin-card { min-width: 0; margin-bottom: 0; border: 1px solid var(--border); }
.security-grid .admin-card-title .ui-icon { width: 19px; height: 19px; color: var(--primary); }
.security-switch-list { margin-bottom: 16px; border-top: 1px solid var(--border-light); }
.security-switch-list .switch-row { border-bottom: 1px solid var(--border-light); cursor: pointer; }
.security-switch-list .switch-row > span:first-child { min-width: 0; padding-right: 14px; }
.security-fields-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.security-list-input { resize: vertical; font-family: 'DM Sans', 'Segoe UI', system-ui; line-height: 1.55; }
.form-help { margin-top: 6px; color: var(--text-light); font-size: 11px; line-height: 1.5; }
.badge-spam { color: #b45309; background: #fffbeb; border: 1px solid #fde68a; font-weight: 700; vertical-align: middle; }
.spam-notice { display: flex; align-items: center; gap: 12px; margin: 16px; padding: 13px 15px; color: #92400e; background: #fffbeb; border: 1px solid #fde68a; border-radius: 12px; }
.spam-notice > .ui-icon { flex: 0 0 auto; width: 22px; height: 22px; }
.spam-notice strong, .spam-notice span { display: block; }
.spam-notice strong { font-size: 13px; }
.spam-notice span { margin-top: 2px; color: #b45309; font-size: 11px; }

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sec);
  margin-bottom: 6px;
}

.switch-group { padding: 0; }
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
}
.switch-label { font-size: 14px; font-weight: 500; color: var(--text-main); }
.switch-desc { font-size: 11px; color: var(--text-light); margin-top: 2px; }

/* ========== 域名管理（管理端） ========== */
.domain-create { display: flex; gap: 10px; }
.domain-create .form-input { flex: 1; }
.domain-create .btn { flex-shrink: 0; white-space: nowrap; }

.domain-list { border: 1px solid var(--border-light); border-radius: 12px; overflow: hidden; }
.domain-item { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border-light); }
.domain-item:last-child { border-bottom: none; }

.domain-info { display: flex; align-items: center; gap: 10px; }
.domain-name { font-size: 14px; font-weight: 600; color: var(--text-main); font-family: 'SF Mono', 'Courier New', monospace; }
.domain-status { font-size: 11px; padding: 3px 10px; border-radius: 20px; flex-shrink: 0; }
.domain-status.active { background: var(--primary-light); color: var(--primary); }
.domain-status.disabled { background: #fdecea; color: var(--danger); }
.domain-actions { display: flex; gap: 6px; flex-shrink: 0; }

.domain-action-btn {
  padding: 6px 14px;
  border: none;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.domain-action-btn:active { opacity: 0.7; }
.domain-action-btn.primary { background: var(--primary); color: #fff; }
.domain-action-btn.warning { background: var(--warning); color: #fff; }
.domain-action-btn.danger { background: transparent; color: var(--danger); border: 1.5px solid var(--danger); }

.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:active { opacity: 0.8; }

.empty-domains { text-align: center; padding: 32px 20px; color: var(--text-sec); font-size: 13px; }
.empty-domains-icon { font-size: 36px; margin-bottom: 8px; opacity: 0.3; }
.empty-domains-hint { font-size: 12px; color: var(--text-light); margin-top: 4px; }

/* ========== 桌面端适配 ========== */
@media (min-width: 768px) {
  .app-wrapper { max-width: 480px; margin: 0 auto; border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
  .bottom-nav { right: auto; left: 50%; width: 480px; transform: translateX(-50%); }
  .auth-form { padding: 40px 20px; }
  .admin-wrapper { max-width: 680px; margin: 0 auto; border: 1px solid var(--border); border-top: none; min-height: 100vh; }
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
  .create-page { padding: 40px 24px 0; }
  .cp-title { font-size: 30px; }
  .header-admin { border-radius: 0 0 0 0; }
}

@media (min-width: 1024px) {
  .admin-wrapper { max-width: 800px; }
}

@media (max-width: 360px) {
  .inbox-item { padding: 12px 14px; }
  .auth-card { padding: 20px 16px; }
  .create-page { padding: 20px 16px 0; }
  .cp-title { font-size: 24px; }
  .profile-header-card { padding: 24px 20px; }
  .mailbox-item { padding: 14px; }
}

/* 现代 SaaS 视觉统一层 */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: rgba(37, 99, 235, 0.1);
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
  --bg-page: #f8fafc;
  --bg-soft: #f8fafc;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-sec: #475569;
  --text-light: #94a3b8;
  --border: #e2e8f0;
  --border-light: #eef2f7;
  --header-bg: rgba(255, 255, 255, 0.95);
  --header-text: #0f172a;
  --shadow: 0 10px 40px rgba(37, 99, 235, 0.12);
  --shadow-sm: 0 2px 10px rgba(15, 23, 42, 0.05);
  --shadow-card: 0 10px 30px rgba(37, 99, 235, 0.08);
}

html, body {
  font-family: 'DM Sans', 'Segoe UI', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg-page);
}
body { min-width: 320px; }
button, input, select, textarea { font: inherit; }
a, button, input, select, textarea { outline: none; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ui-icon { width: 1em; height: 1em; display: inline-block; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.header {
  height: 68px;
  padding: 0 18px;
  background: var(--header-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  font-size: 17px;
}
.header-title { font-weight: 700; letter-spacing: -0.01em; }
.header-back { width: 36px; height: 36px; padding: 0; border-radius: 10px; display: grid; place-items: center; color: var(--text-sec); }
.header-back:hover { color: var(--primary); background: var(--primary-light); }
.header-admin { background: rgba(255,255,255,.95); color: var(--text-main); border-bottom: 1px solid var(--border); }
.header-admin .header-back, .header-admin .header-actions { color: var(--text-sec); }
.admin-user-badge { color: var(--primary); background: var(--primary-light); border: 1px solid rgba(37,99,235,.15); }

.app-wrapper { background: var(--bg-page); }

.auth-page { background: var(--bg-soft); position: relative; overflow: hidden; }
.auth-page::before { content: ''; position: absolute; inset: 0 0 auto; height: 260px; background: #eff6ff; border-bottom: 1px solid #dbeafe; }
.auth-brand { position: relative; padding: 54px 20px 20px; }
.auth-brand-icon { width: 56px; height: 56px; display: grid; place-items: center; margin: 0 auto 14px; color: var(--primary); background: #fff; border: 1px solid #dbeafe; border-radius: 15px; box-shadow: var(--shadow); font-size: 28px; }
.auth-brand-icon .ui-icon { width: 28px; height: 28px; }
.auth-brand-name { font-size: 26px; font-weight: 800; letter-spacing: -.03em; }
.auth-brand-desc { color: var(--text-sec); margin-top: 5px; }
.auth-form { position: relative; padding: 10px 20px 48px; }
.auth-card { border-radius: 16px; border: 1px solid var(--border); padding: 30px 26px; box-shadow: var(--shadow); }
.auth-title { font-size: 24px; letter-spacing: -.03em; }
.input-icon-wrap, .form-input, .cp-input, .cp-select { background: #fff; border-color: var(--border); border-radius: 10px; }
.input-icon-wrap { box-shadow: 0 1px 2px rgba(15,23,42,.02); }
.input-icon-wrap:focus-within, .form-input:focus, .cp-input:focus, .cp-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.input-icon-wrap .form-input,
.input-icon-wrap .form-input:focus {
  border: 0;
  border-radius: 0 10px 10px 0;
  outline: 0;
  box-shadow: none;
}
.input-icon-wrap:focus-within .input-icon { color: var(--primary); }
.input-icon { color: #64748b; display: grid; place-items: center; }
.input-icon .ui-icon { width: 18px; height: 18px; }
.captcha-img { border-color: var(--border); border-radius: 10px; }

.btn, .cp-btn-primary, .cp-btn-secondary, .inbox-search-btn, .mailbox-action-btn, .domain-action-btn, .page-btn { border-radius: 10px; transition: background-color .16s, border-color .16s, color .16s, box-shadow .16s, transform .12s; }
.btn-primary, .cp-btn-primary, .inbox-search-btn { background: var(--primary); color: #fff; box-shadow: 0 6px 18px rgba(37,99,235,.2); }
.btn-primary:hover, .cp-btn-primary:hover, .inbox-search-btn:hover { background: var(--primary-dark); }
.btn:active:not(:disabled), .cp-btn-primary:active:not(:disabled), .inbox-search-btn:active { transform: translateY(1px); }
.btn-outline { border-color: var(--border); color: var(--text-main); background: #fff; }
.btn-outline:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-light); }

.create-page { padding-top: 34px; }
.cp-title { font-size: 29px; font-weight: 800; letter-spacing: -.04em; margin-bottom: 30px; }
.cp-label, .compose-label { font-weight: 600; }
.cp-quick-btn, .cp-preview, .cp-btn-secondary { border-color: var(--border); border-radius: 10px; background: #fff; }
.cp-quick-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.cp-preview { background: #eff6ff; border-style: solid; border-color: #bfdbfe; }
.cp-footer { color: var(--text-light); }

.inbox-search-bar { position: sticky; top: 68px; z-index: 50; padding: 12px 16px; border-bottom-color: var(--border); background: rgba(248,250,252,.96); backdrop-filter: blur(12px); }
.inbox-search-input { height: 42px; background: #fff; border-color: var(--border); }
.inbox-list, .sent-list { margin: 12px 16px; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-sm); }
.inbox-item, .sent-item { min-height: 72px; background: #fff; }
.inbox-item:hover, .sent-item:hover { background: #f8fafc; }
.inbox-item.unread { background: #eff6ff; border-left: 3px solid var(--primary); padding-left: 13px; }
.inbox-item.unread:hover { background: #eaf2ff; }
.avatar-text, .sent-avatar-text { background: #e8efff; color: var(--primary); border: 1px solid #dbeafe; }
.inbox-item.unread .inbox-item-avatar::after { width: 8px; height: 8px; border-color: #eff6ff; }
.inbox-item-from, .inbox-item-subject { letter-spacing: -.01em; }

.email-detail-card, .profile-section, .profile-link-row, .mailbox-item, .logs-card, .admin-card, .admin-menu, .stat-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
}
.email-detail-card { margin-top: 16px; }
.email-attachment-item { border: 1px solid var(--border); color: var(--text-sec); }
.compose-page { margin: 16px; padding: 22px; background: #fff; border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-card); }
.compose-textarea { min-height: 190px; padding-top: 12px; resize: vertical; }

.profile-header-card { background: var(--primary); border: 1px solid #1d4ed8; border-radius: 14px; box-shadow: var(--shadow); }
.profile-avatar-wrap .avatar-text { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.5); color: #fff; }
.profile-link-row { padding: 15px 16px; }
.profile-link-row:hover { transform: translateY(-1px); border-color: #bfdbfe; box-shadow: var(--shadow); }
.profile-link-icon, .menu-icon { width: 36px; height: 36px; margin-right: 12px; display: grid; place-items: center; border-radius: 10px; background: var(--primary-light); color: var(--primary); font-size: 18px; }
.profile-link-icon .ui-icon, .menu-icon .ui-icon { width: 19px; height: 19px; }
.profile-link-arrow, .menu-arrow { display: grid; place-items: center; color: #94a3b8; }
.profile-link-arrow .ui-icon, .menu-arrow .ui-icon { width: 17px; height: 17px; }
.profile-link-logout .profile-link-icon, .menu-item-logout .menu-icon { color: var(--danger); background: #fef2f2; }

.mailbox-page { padding-top: 16px; }
.mailbox-item:hover, .admin-card:hover, .stat-card:hover { border-color: #bfdbfe; box-shadow: var(--shadow); }
.mailbox-copy-btn { width: 34px; height: 34px; padding: 0; display: grid; place-items: center; color: var(--text-sec); }
.mailbox-copy-btn:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-light); }
.mailbox-copy-btn .ui-icon { width: 16px; height: 16px; }
.mailbox-action-btn { height: 38px; border: 1px solid var(--border); background: #fff !important; color: var(--text-sec) !important; }
.mailbox-action-btn:hover { color: var(--primary) !important; border-color: var(--primary); background: var(--primary-light) !important; }
.mailbox-action-btn.danger:hover { color: var(--danger) !important; border-color: #fecaca; background: #fef2f2 !important; }

.empty-icon { color: var(--primary); }
.empty-icon .ui-icon { width: 44px; height: 44px; }
.toast-notice { background: var(--text-main); border-radius: 10px; box-shadow: 0 12px 30px rgba(15,23,42,.2); animation: none; }

.admin-content { padding-top: 20px; }
.stats-grid { gap: 12px; }
.stat-card { border-top: 1px solid var(--border); text-align: left; padding: 18px; }
.stat-card-purple, .stat-card-blue, .stat-card-orange { border-top-color: var(--border); }
.stat-value, .stat-card-purple .stat-value, .stat-card-blue .stat-value, .stat-card-orange .stat-value { color: var(--text-main); font-size: 27px; font-weight: 800; }
.stat-label { color: var(--text-sec); }
.admin-menu-title { padding-top: 18px; color: var(--text-sec); }
.menu-item { padding: 12px 18px; }
.menu-item:hover { background: #f8fafc; }
.menu-item-logout { border-top-color: var(--border-light); }
.data-list, .domain-list { border-color: var(--border); }
.data-item:hover, .domain-item:hover { background: #f8fafc; }
.admin-email-item { cursor: pointer; transition: background .18s ease, box-shadow .18s ease; }
.admin-email-item:focus-visible { position: relative; z-index: 1; outline: 3px solid rgba(37,99,235,.2); outline-offset: -3px; }
body.modal-open, body.app-dialog-open { overflow: hidden; }
.ui-modal[hidden] { display: none; }
.ui-modal { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 24px; isolation: isolate; }
.ui-modal__backdrop { position: absolute; inset: 0; z-index: -1; background: rgba(15,23,42,.56); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); opacity: 0; transition: opacity .18s ease; }
.ui-modal__panel { position: relative; display: flex; flex-direction: column; width: min(420px, 100%); max-height: calc(100dvh - 48px); overflow: hidden; overscroll-behavior: contain; text-align: center; background: #fff; border: 1px solid rgba(226,232,240,.95); border-radius: 18px; box-shadow: 0 28px 80px rgba(15,23,42,.26); opacity: 0; transform: translateY(10px) scale(.985); transition: opacity .18s ease, transform .18s ease; }
.ui-modal.is-visible .ui-modal__backdrop { opacity: 1; }
.ui-modal.is-visible .ui-modal__panel { opacity: 1; transform: none; }
.ui-modal__body { min-height: 0; padding: 28px 26px 8px; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; }
.ui-modal__icon { display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 16px; color: var(--primary); background: var(--primary-light); border-radius: 16px; }
.ui-modal__icon .ui-icon { width: 30px; height: 30px; }
.ui-modal__title { margin: 0 0 8px; color: var(--text-main); font-size: 20px; font-weight: 800; line-height: 1.35; letter-spacing: -.02em; }
.ui-modal__message { margin: 0; color: var(--text-sec); font-size: 14px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.ui-modal__highlight { margin-top: 18px; padding: 13px 14px; color: var(--primary); font: 600 14px/1.5 'SF Mono', Consolas, monospace; background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 11px; overflow-wrap: anywhere; }
.ui-modal__actions { flex: 0 0 auto; display: flex; justify-content: flex-end; gap: 10px; padding: 20px 26px 24px; background: #fff; }
.ui-modal__actions .btn { min-width: 108px; min-height: 46px; padding: 0 20px; }
.ui-modal__actions .btn[hidden] { display: none; }
.admin-mail-modal { z-index: 2200; }
.admin-mail-modal-panel { width: min(960px, 100%); height: min(880px, calc(100dvh - 48px)); overflow-y: auto; text-align: left; }
.admin-mail-modal-header { position: sticky; top: 0; z-index: 1; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 22px 24px 18px; background: rgba(255,255,255,.96); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }
.admin-mail-modal-heading { min-width: 0; }
.admin-mail-modal-kicker { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; color: var(--primary); font-size: 12px; font-weight: 700; letter-spacing: .08em; }
.admin-mail-modal-kicker span { padding: 3px 7px; color: var(--text-sec); font-size: 10px; font-weight: 600; letter-spacing: 0; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 6px; }
.admin-mail-modal-subject { margin: 0; color: var(--text-main); font-size: 22px; line-height: 1.4; word-break: break-word; }
.admin-mail-modal-close { flex: 0 0 auto; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; color: var(--text-sec); background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.admin-mail-modal-close:hover { color: var(--primary); border-color: #bfdbfe; background: var(--primary-light); }
.admin-mail-modal-close .ui-icon { width: 18px; height: 18px; }
.admin-mail-modal-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 24px; padding: 20px 24px; background: var(--bg-soft); border-bottom: 1px solid var(--border); }
.admin-mail-modal-meta div { min-width: 0; }
.admin-mail-modal-meta span { display: block; margin-bottom: 4px; color: var(--text-sec); font-size: 12px; }
.admin-mail-modal-meta strong { display: block; color: var(--text-main); font-size: 13px; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.admin-mail-modal-attachments { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 16px 24px; border-bottom: 1px solid var(--border); }
.admin-mail-modal-attachments strong { width: 100%; color: var(--text-main); font-size: 13px; }
.admin-mail-modal-attachments span { padding: 6px 9px; color: var(--text-sec); font-size: 12px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 7px; }
.admin-mail-modal-body { min-height: 360px; padding: 0; color: var(--text-main); font-size: 14px; line-height: 1.8; overflow-wrap: anywhere; }
.admin-mail-modal-body > .admin-mail-text-body { min-height: 360px; padding: 28px 32px 48px; }
.email-detail-wrapper { max-width: none; width: 100%; min-height: 100vh; border: 0; box-shadow: none; }
.email-detail-wrapper .email-page { min-height: calc(100vh - 68px); padding-bottom: 70px; }
.email-detail-wrapper .email-detail-card { min-height: calc(100vh - 138px); margin: 0; border: 0; border-radius: 0; box-shadow: none; }
.email-detail-wrapper .email-body-section { padding: 0; min-height: 240px; }
.email-detail-wrapper .email-body-text { min-height: 240px; margin: 0; padding: 24px; font-family: inherit; }
.email-html-frame, .admin-mail-html-frame { display: block; width: 100%; min-height: 240px; background: #fff; border: 0; overflow: hidden; }
.admin-mail-text-body { margin: 0; color: var(--text-main); font: inherit; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.compose-label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.compose-label-row .compose-label { margin-bottom: 0; }
.compose-type-select { height: 34px; padding: 0 30px 0 11px; color: var(--text-sec); font: inherit; font-size: 12px; font-weight: 600; background: #fff; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; }
.compose-type-select:focus { border-color: var(--primary); outline: 3px solid rgba(37,99,235,.12); }
.compose-code-input { color: #1e293b; font-family: Consolas, 'Courier New', monospace; font-size: 13px; line-height: 1.65; tab-size: 2; }
.status-badge, .badge, .menu-badge, .domain-status { font-weight: 600; }

/* ========== 扩展应用（QQ）样式 ========== */
.data-item-main { flex: 1; min-width: 0; }
.data-item-sub { font-size: 12px; color: var(--text-sec); line-height: 1.6; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.data-item-actions { flex-shrink: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* ========== QQ 账号列表卡片（用户端 /user/extensions/qq） ========== */
.qq-account-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.qq-account-card-item { display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 16px; background: var(--card-bg, #fff); border: 1px solid var(--border-light); border-radius: 14px; transition: border-color .15s ease, box-shadow .15s ease; }
.qq-account-card-item:hover { border-color: rgba(37,99,235,.35); }
.qq-account-card-item:focus-within { border-color: var(--primary); box-shadow: 0 6px 18px rgba(37,99,235,.1); }
.qq-account-card-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.qq-account-card-avatar { position: relative; overflow: hidden; display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 44px; color: #fff; font-size: 17px; font-weight: 800; background: linear-gradient(135deg, #2563eb, #60a5fa); border-radius: 13px; box-shadow: 0 8px 20px rgba(37,99,235,.18); }
.qq-account-card-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.qq-account-card-info { flex: 1; min-width: 0; }
.qq-account-card-name { color: var(--text-main); font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qq-account-card-uin { margin-top: 2px; color: var(--text-sec); font: 12px/1.4 Consolas, 'Courier New', monospace; }
.qq-account-card-head > .status-badge { flex: 0 0 auto; max-width: 40%; }
.qq-account-card-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; padding-top: 11px; border-top: 1px dashed var(--border-light); color: var(--text-sec); font-size: 12px; line-height: 1.6; }
.qq-account-card-meta b { color: var(--text-main); font-weight: 600; }
.qq-account-card-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.qq-account-card-actions .btn { flex: 1 1 0; min-width: 0; min-height: 40px; }
.qq-account-card-actions .btn-primary { flex: 1 1 100%; min-height: 42px; }
.status-online { background: #dcfce7; color: #16a34a; }
.status-offline, .status-pending { background: var(--border-light); color: var(--text-sec); }
.status-scanning { background: #dbeafe; color: var(--primary); }
.status-paused { background: #ede9fe; color: #6d28d9; }
.status-cancelled { background: var(--border-light); color: var(--text-sec); }
.status-error { background: #fdecea; color: var(--danger); }
.qq-uin-text { font-family: Consolas, 'Courier New', monospace; color: var(--text-sec); }
.qq-owner { color: var(--text-sec); }
.qq-owner b { color: var(--primary); }
.qq-control-page { display: grid; gap: 16px; max-width: 960px; margin: 0 auto; }
.qq-control-page .admin-card { margin-bottom: 0; }
.qq-account-card { position: relative; overflow: hidden; border: 1px solid rgba(37,99,235,.1); }
.qq-account-card::before { content: ''; position: absolute; top: 0; right: 0; width: 180px; height: 120px; background: radial-gradient(circle at top right, rgba(37,99,235,.12), transparent 68%); pointer-events: none; }
.qq-account-head { position: relative; display: flex; align-items: center; gap: 12px; }
.qq-account-avatar { position: relative; overflow: hidden; display: grid; place-items: center; width: 46px; height: 46px; flex: 0 0 46px; color: #fff; font-size: 18px; font-weight: 800; background: linear-gradient(135deg, #2563eb, #60a5fa); border-radius: 14px; box-shadow: 0 8px 20px rgba(37,99,235,.22); }
.qq-account-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.qq-account-primary { flex: 1; min-width: 0; }
.qq-account-name { color: var(--text-main); font-size: 17px; font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qq-account-uin { margin-top: 3px; color: var(--text-sec); font: 12px/1.4 Consolas, 'Courier New', monospace; }
.qq-account-stats { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 10px; margin-top: 18px; }
.qq-account-stat { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 12px 14px; background: var(--bg-soft); border: 1px solid var(--border-light); border-radius: 12px; }
.qq-account-stat-label { color: var(--text-sec); font-size: 11px; }
.qq-account-stat strong { color: var(--text-main); font-size: 13px; font-weight: 650; line-height: 1.45; overflow-wrap: anywhere; }
.qq-control-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.qq-control-actions .btn { width: 100%; min-height: 42px; }
.qq-send-format { display: flex; gap: 14px; margin-bottom: 8px; font-size: 13px; color: var(--text-main); }
.qq-send-format-option { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; user-select: none; }
.qq-send-format-option input { margin: 0; }
.qq-send-html-hint { margin-top: 6px; font-size: 12px; color: var(--text-sec); line-height: 1.6; }
.qq-send-html-hint code { background: var(--border-light); padding: 0 4px; border-radius: 4px; }
.qq-section-head .admin-card-title { margin-bottom: 5px; }
.qq-section-head .admin-card-desc { margin-bottom: 14px; }
.qq-group-search-wrap { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.qq-group-search { flex: 1; min-width: 0; }
.qq-group-search-clear { flex-shrink: 0; min-height: 42px; }
.qq-group-search-meta { margin-bottom: 10px; color: var(--text-secondary); font-size: 13px; }
.qq-group-list { max-height: 58vh; overflow-y: auto; }
.qq-group-item { flex-wrap: nowrap; gap: 12px; transition: background-color .15s ease; }
.qq-group-item:hover { background: rgba(37,99,235,.035); }
.qq-group-symbol { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 36px; color: var(--primary); font-size: 13px; font-weight: 750; background: var(--primary-light); border-radius: 11px; overflow: hidden; }
.qq-group-symbol img { width: 100%; height: 100%; object-fit: cover; display: block; }
.qq-group-item .data-item-title { font-weight: 650; }
.qq-group-item .data-item-sub span + span::before { content: '·'; margin-right: 6px; }
.qq-empty-state { padding: 44px 20px; text-align: center; }
.qq-empty-state-title { color: var(--text-main); font-size: 14px; font-weight: 650; }
.qq-empty-state p { margin: 7px 0 0; color: var(--text-sec); font-size: 12px; line-height: 1.6; }
.qq-node-form { margin-top: 14px; display: flex; flex-direction: column; gap: 12px; padding-top: 14px; border-top: 1px dashed var(--border); }
.qq-node-form-actions { display: flex; gap: 10px; }
.qq-node-item .domain-status { font-size: 11px; }
.extension-card { margin-bottom: 14px; }
.extension-card-head { display: flex; align-items: center; gap: 14px; }
.extension-icon { width: 44px; height: 44px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--primary-light); color: var(--primary); border-radius: 12px; }
.extension-icon .ui-icon { width: 22px; height: 22px; }
.extension-info { flex: 1; min-width: 0; }
.extension-name { font-size: 15px; font-weight: 600; color: var(--text-main); }
.extension-desc { font-size: 12px; color: var(--text-sec); margin-top: 4px; line-height: 1.6; }
.extension-card-actions { margin-top: 12px; display: flex; justify-content: flex-end; }
.qq-qr-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 8px 0; }
.qq-qr-img { width: 220px; height: 220px; border-radius: 12px; border: 1px solid var(--border); background: #fff; }
.qq-qr-status { font-size: 13px; font-weight: 600; color: var(--text-main); min-height: 18px; }
.qq-qr-hint { font-size: 12px; color: var(--text-sec); text-align: center; margin: 0; }
.qq-members-panel { width: min(720px, 100%); height: min(760px, calc(100dvh - 48px)); max-height: calc(100dvh - 48px); display: flex; flex-direction: column; text-align: left; }
.qq-members-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 24px 16px; border-bottom: 1px solid var(--border-light); }
.qq-members-header .ui-modal__title { margin: 0; text-align: left; }
.qq-members-sub { margin: 5px 0 0; color: var(--text-sec); font-size: 12px; line-height: 1.5; }
.qq-modal-close { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; padding: 0; color: var(--text-sec); font-size: 24px; line-height: 1; background: var(--bg-soft); border: 0; border-radius: 10px; cursor: pointer; }
.qq-modal-close:hover { color: var(--text-main); background: var(--border-light); }
.qq-members-panel .ui-modal__body { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; padding: 16px 24px 0; }
.qq-members-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) 136px; align-items: center; gap: 10px; padding: 0 0 12px; }
.qq-members-search, .qq-members-role-filter { height: 42px; }
.qq-members-search { min-width: 0; }
.qq-members-role-filter { width: 100%; }
.qq-members-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; color: var(--text-sec); font-size: 12px; background: var(--bg-soft); border: 1px solid var(--border-light); border-radius: 10px; }
.qq-check-all { display: flex; align-items: center; gap: 7px; color: var(--text-main); font-size: 13px; cursor: pointer; }
.qq-members-list { flex: 1; min-height: 0; overflow-y: auto; margin: 10px -6px 0; padding: 0 6px 8px; scrollbar-gutter: stable; }
.qq-member-item { display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 8px 10px; border: 1px solid transparent; border-bottom-color: var(--border-light); border-radius: 10px; cursor: pointer; transition: background-color .12s ease, border-color .12s ease; }
.qq-member-item:hover { background: rgba(37,99,235,.04); border-color: rgba(37,99,235,.1); }
.qq-member-item:last-child { border-bottom-color: transparent; }
.qq-members-actions { align-items: center; justify-content: space-between; padding: 16px 24px 20px; border-top: 1px solid var(--border-light); }
.qq-members-secondary-actions { display: flex; gap: 8px; }
.qq-members-actions .btn { min-width: 0; }
.qq-members-actions > .btn-primary { min-width: 170px; }
.qq-member-check { width: 17px; height: 17px; flex-shrink: 0; accent-color: var(--primary); }
.qq-member-avatar-wrap { position: relative; width: 20px; height: 20px; flex-shrink: 0; border-radius: 50%; overflow: hidden; background: linear-gradient(135deg, var(--primary-light), #dbeafe); }
.qq-member-avatar-fallback { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--primary); }
.qq-member-avatar { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.qq-member-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.qq-member-line1 { display: flex; align-items: center; gap: 6px; min-width: 0; }
.qq-member-name { flex: 0 1 auto; min-width: 0; font-size: 14px; color: var(--text-main); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.qq-member-role { flex-shrink: 0; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 600; line-height: 1.6; }
.qq-member-role.role-owner { color: #b45309; background: #fef3c7; }
.qq-member-role.role-admin { color: #1d4ed8; background: #dbeafe; }
.qq-member-title { flex-shrink: 0; max-width: 140px; padding: 1px 7px; border-radius: 999px; font-size: 11px; color: var(--text-sec); background: var(--border-light, #f1f5f9); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qq-member-line2 { font-size: 12px; color: var(--text-sec); font-family: Consolas, 'Courier New', monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-setting-item.is-disabled { opacity: 0.55; cursor: not-allowed; }

@media (min-width: 768px) {
  .app-wrapper { box-shadow: 0 0 0 1px var(--border), 0 18px 60px rgba(15,23,42,.06); border: 0; }
  .app-wrapper.email-detail-wrapper { max-width: none; margin: 0; box-shadow: none; }
  .app-wrapper.qq-control-app { max-width: 1000px; }
  .qq-control-app .bottom-nav { width: min(1000px, 100%); }
  .qq-control-app .qq-control-page { grid-template-columns: minmax(300px, .78fr) minmax(420px, 1.22fr); align-items: start; padding: 28px 24px 96px; }
  .qq-control-app .qq-account-card { position: sticky; top: 84px; }
  .admin-wrapper { max-width: 900px; border: 0; box-shadow: 0 0 0 1px var(--border), 0 18px 60px rgba(15,23,42,.06); }
  .auth-card { max-width: 410px; }
}
@media (max-width: 576px) {
  .admin-mail-modal { padding: 0; }
  .admin-mail-modal-panel { width: 100%; height: 100dvh; max-height: none; border: 0; border-radius: 0; }
  .admin-mail-modal-header { padding: max(16px, env(safe-area-inset-top, 0px)) 16px 15px; }
  .admin-mail-modal-meta, .admin-mail-modal-attachments { padding-left: 16px; padding-right: 16px; }
  .admin-mail-modal-body > .admin-mail-text-body { padding: 22px 16px 40px; }
  .admin-mail-modal-meta { grid-template-columns: 1fr; gap: 12px; }
  .admin-mail-modal-subject { font-size: 18px; }
  .mailbox-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .compose-page { margin: 12px; padding: 16px; }
  .inbox-list, .sent-list { margin: 8px 10px; }
  .auth-card { border-radius: 14px; }
}
/* 列表下拉刷新 */
.pull-refresh {
  --pull-distance: 0px;
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 1900;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 15px;
  color: var(--text-sec);
  font-size: 13px;
  font-weight: 600;
  background: rgba(255,255,255,.96);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(15,23,42,.12);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, calc(var(--pull-distance) - 52px));
  transition: opacity .12s ease, transform .12s ease;
}
.pull-refresh.is-visible { opacity: 1; }
.pull-refresh.is-ready { color: var(--primary); border-color: #bfdbfe; }
.pull-refresh__spinner {
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  opacity: .65;
}
.pull-refresh.is-refreshing .pull-refresh__spinner { animation: pull-refresh-spin .7s linear infinite; }
@keyframes pull-refresh-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .pull-refresh { transition: none; }
  .pull-refresh.is-refreshing .pull-refresh__spinner { animation-duration: 1.4s; }
}

/* 全局应用提示弹窗 */
.app-dialog { z-index: 3000; }
.app-dialog--success .app-dialog__icon { color: var(--success); background: #f0fdf4; }
.app-dialog--error .app-dialog__icon { color: var(--danger); background: #fef2f2; }
.app-dialog--warning .app-dialog__icon { color: var(--warning); background: #fffbeb; }
.app-dialog__input-wrap { margin-top: 18px; }
.app-dialog__input { text-align: left; scroll-margin: 24px; }
.app-dialog__input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(220,38,38,.12); }
@media (max-width: 576px) {
  .ui-modal:not(.ui-modal--detail) { place-items: center; padding: 18px; }
  .ui-modal:not(.ui-modal--detail) .ui-modal__panel { width: min(380px, 100%); max-height: calc(100dvh - 36px); border-radius: 18px; transform: translateY(8px) scale(.985); }
  .ui-modal__body { padding: 24px 20px 6px; }
  .ui-modal__actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 18px 20px 20px; }
  .ui-modal__actions .btn { width: 100%; min-width: 0; min-height: 48px; padding: 0 12px; }
  .ui-modal__actions .btn:only-child, .ui-modal__actions .btn[hidden] + .btn { grid-column: 1 / -1; }
  .qq-control-page { gap: 12px; padding: 14px 12px calc(28px + env(safe-area-inset-bottom, 0px)); }
  .qq-account-card, .qq-groups-card { padding: 16px; border-radius: 14px; }
  .qq-account-stats { grid-template-columns: 1fr; }
  .qq-control-actions { grid-template-columns: 1fr; }
  .qq-group-item { align-items: flex-start; padding: 12px; }
  .qq-group-symbol { width: 32px; height: 32px; flex-basis: 32px; }
  .qq-group-item .data-item-actions { width: 100%; padding-left: 44px; }
  .qq-group-item .data-item-actions .btn { flex: 1; }
  .ui-modal:not(.ui-modal--detail) .qq-members-panel { width: 100%; height: calc(100dvh - 36px); max-height: calc(100dvh - 36px); }
  .qq-members-header { padding: 18px 16px 14px; }
  .qq-members-panel .ui-modal__body { padding: 14px 16px 0; }
  .qq-members-toolbar { grid-template-columns: 1fr; }
  .qq-members-meta { align-items: flex-start; flex-direction: column; }
  .qq-members-actions { display: flex; flex-direction: column-reverse; align-items: stretch; padding: 12px 16px 16px; }
  .qq-members-actions > .btn-primary { width: 100%; min-width: 0; }
  .qq-members-secondary-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .qq-members-secondary-actions .btn { width: 100%; }
  .qq-member-title { display: none; }
  .qq-member-line2 { font-size: 11px; }
}
@media (max-width: 340px) {
  .ui-modal:not(.ui-modal--detail) { padding-right: 10px; padding-left: 10px; }
  .ui-modal__body { padding-right: 16px; padding-left: 16px; }
  .ui-modal__actions { gap: 8px; padding-right: 16px; padding-left: 16px; }
  .ui-modal__title { font-size: 18px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .ui-modal:not(.ui-modal--detail) { align-items: center; padding: 8px 16px; }
  .ui-modal:not(.ui-modal--detail) .ui-modal__panel { max-height: calc(100dvh - 16px); }
  .ui-modal__body { padding-top: 16px; }
  .ui-modal__icon { width: 44px; height: 44px; margin-bottom: 10px; }
  .ui-modal__actions { padding-top: 12px; padding-bottom: 12px; }
}
body.keyboard-open .app-dialog { align-items: center; padding-top: 8px; padding-bottom: 8px; }
body.keyboard-open .app-dialog__panel { max-height: calc(100dvh - 16px); }
@media (max-width: 768px) {
  .security-grid { grid-template-columns: 1fr; }
}
@media (max-width: 576px) {
  .security-content { padding-right: 12px; padding-left: 12px; }
  .security-intro { padding: 15px; }
  .security-grid { gap: 12px; }
  .security-grid .admin-card { padding: 16px; }
  .security-fields-row { grid-template-columns: 1fr; gap: 0; }
  .security-switch-list .switch-row { gap: 10px; }
  .ui-modal--detail { padding: 0; }
  .ui-modal--detail .admin-mail-modal-panel { width: 100%; height: 100dvh; max-height: none; border: 0; border-radius: 0; }
  .admin-mail-modal-body { padding-bottom: env(safe-area-inset-bottom, 0px); }
}
/* 证书上传弹窗 */
.cert-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15,23,42,.56);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.cert-modal-panel {
  width: min(480px, 100%);
  max-height: calc(100dvh - 48px);
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(226,232,240,.95);
  border-radius: 18px;
  box-shadow: 0 28px 80px rgba(15,23,42,.26);
  display: flex;
  flex-direction: column;
}
.cert-modal-header {
  padding: 20px 24px 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
}
.cert-modal-body {
  padding: 16px 24px 8px;
  overflow-y: auto;
}
.cert-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px 20px;
}
@media (max-width: 576px) {
  .cert-modal-overlay { padding: 16px; align-items: flex-end; }
  .cert-modal-panel { border-radius: 18px 18px 0 0; max-height: calc(100dvh - 32px); }
  .cert-modal-header { padding: 18px 18px 0; font-size: 17px; }
  .cert-modal-body { padding: 14px 18px 6px; }
  .cert-modal-footer { padding: 12px 18px 18px; }
}
/* 个人中心展示页 */
.profile-topbar .header-title { text-align: left; font-size: 20px; }
.profile-overview {
  width: 100%;
  padding: 22px 18px calc(32px + env(safe-area-inset-bottom, 0px));
}
.profile-identity { display: none; }
/* APP 风格资料卡片 */
.profile-hero {
  position: relative;
  overflow: hidden;
  padding: 22px 20px 16px;
  color: #fff;
  background: linear-gradient(135deg, #07C160 0%, #059669 100%);
  border-radius: 18px;
  box-shadow: 0 10px 26px rgba(7, 193, 96, .28);
}
.profile-hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 90% -12%, rgba(255, 255, 255, .16) 0 92px, transparent 93px),
    radial-gradient(circle at 4% 118%, rgba(255, 255, 255, .12) 0 112px, transparent 113px);
  pointer-events: none;
}
.profile-hero-main {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
}
.profile-avatar {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  overflow: hidden;
  background: linear-gradient(135deg, #ffffff 0%, #d1fae5 100%);
  border-radius: 50%;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .18), inset 0 0 0 2px rgba(255, 255, 255, .55);
}
.profile-avatar-letter {
  color: #047857;
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
}
.profile-hero-info { flex: 1; min-width: 0; }
.profile-hero-name {
  overflow: hidden;
  margin: 0 0 4px;
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-hero-email {
  overflow: hidden;
  margin: 0;
  color: rgba(255, 255, 255, .85);
  font-size: 12.5px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-hero-email.is-unbound { color: rgba(255, 255, 255, .6); }
.profile-edit-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 30px;
  padding: 0 12px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 999px;
  backdrop-filter: blur(4px);
  transition: background-color .16s ease;
}
.profile-edit-chip .ui-icon { width: 13px; height: 13px; }
.profile-edit-chip:hover { background: rgba(255, 255, 255, .28); }
.profile-assets {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, .22);
}
.profile-asset {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 0;
  padding: 2px 0 4px;
  border-radius: 10px;
  transition: background-color .16s ease;
}
.profile-asset:hover { background: rgba(255, 255, 255, .12); }
.profile-asset-label { color: rgba(255, 255, 255, .82); font-size: 12px; line-height: 1.4; }
.profile-asset-value {
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.profile-asset-divider {
  flex: 0 0 auto;
  width: 1px;
  height: 32px;
  background: rgba(255, 255, 255, .25);
}
/* 头像按钮（点击更换头像） */
.profile-avatar-btn {
  position: relative;
  padding: 0;
  border: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.profile-avatar-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.profile-avatar-btn .profile-avatar-mask {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(0, 0, 0, .45);
  border-radius: 50%;
  opacity: 0;
  transition: opacity .16s ease;
}
.profile-avatar-btn:hover .profile-avatar-mask,
.profile-avatar-btn:focus-visible .profile-avatar-mask { opacity: 1; }
.profile-avatar-mask .ui-icon { width: 22px; height: 22px; }
.profile-avatar-img {
  display: block;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .18), inset 0 0 0 2px rgba(255, 255, 255, .55);
}
/* 更换头像弹窗 */
.avatar-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, .5);
}
.avatar-modal-overlay[hidden] { display: none; }
.avatar-modal {
  width: 100%;
  max-width: 420px;
  padding: 22px 20px 18px;
  background: #fff;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .18);
}
.avatar-modal [hidden] { display: none !important; }
.avatar-modal-title {
  margin: 0 0 16px;
  color: var(--text-main);
  font-size: 17px;
  font-weight: 800;
  text-align: center;
}
.avatar-modal-preview {
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  margin: 0 auto 14px;
  background: linear-gradient(135deg, #ffffff 0%, #d1fae5 100%);
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px rgba(7, 193, 96, .18);
}
.avatar-modal-preview-img {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
}
.avatar-modal-preview-letter { color: #047857; font-size: 40px; font-weight: 800; line-height: 1; }
.avatar-modal-pick { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.avatar-modal-pick .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.avatar-modal-pick .ui-icon { width: 16px; height: 16px; }
.avatar-modal-remove {
  padding: 4px 8px;
  color: var(--danger);
  font-size: 13px;
  background: none;
  border: 0;
  cursor: pointer;
}
.avatar-modal-remove:hover { text-decoration: underline; }
.avatar-modal-hint {
  margin: 10px 0 0;
  color: var(--text-light);
  font-size: 12px;
  text-align: center;
}
.avatar-modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.avatar-modal-actions .btn { flex: 1; }
@media (min-width: 768px) {
  .avatar-modal-overlay { align-items: center; }
  .avatar-modal { border-radius: 20px; }
}
.profile-settings-group { margin-top: 26px; }
.profile-group-title {
  margin: 0 0 9px;
  padding: 0 4px;
  color: var(--text-sec);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: .04em;
}
.profile-settings-list {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}
.profile-setting-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 70px;
  padding: 12px 16px;
  background: #fff;
  transition: background-color .16s ease;
}
.profile-setting-item + .profile-setting-item::before {
  content: '';
  position: absolute;
  top: 0;
  right: 16px;
  left: 61px;
  height: 1px;
  background: var(--border-light);
}
.profile-setting-item:hover { background: #f8fafc; }
.profile-setting-item:active { background: #f1f5f9; }
.profile-setting-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--primary);
  background: var(--primary-light);
  border-radius: 10px;
}
.profile-setting-icon .ui-icon { width: 18px; height: 18px; }
.profile-setting-content { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.profile-setting-title { color: var(--text-main); font-size: 15px; font-weight: 700; }
.profile-setting-description {
  overflow: hidden;
  color: var(--text-sec);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-setting-arrow { flex: 0 0 auto; display: grid; place-items: center; color: var(--text-light); }
.profile-setting-arrow .ui-icon { width: 17px; height: 17px; }
.profile-danger-zone {
  margin-top: 26px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #fecaca;
  border-radius: 14px;
}
.profile-logout-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 12px 16px;
  color: var(--danger);
  font-size: 14px;
  font-weight: 700;
  background: #fff;
  transition: background-color .16s ease;
}
.profile-logout-action .ui-icon { width: 18px; height: 18px; }
.profile-logout-action:hover, .profile-logout-action:active { background: #fef2f2; }

@media (max-width: 390px) {
  .profile-overview { padding-right: 14px; padding-left: 14px; }
  .profile-hero { padding: 18px 16px 14px; }
  .profile-hero-main { gap: 12px; }
  .profile-avatar { width: 56px; height: 56px; }
  .profile-avatar-img { width: 56px; height: 56px; }
  .profile-avatar-letter { font-size: 23px; }
  .profile-hero-name { font-size: 19px; }
  .profile-edit-chip { width: 34px; padding: 0; }
  .profile-edit-chip span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .profile-asset-value { font-size: 20px; }
}

@media (min-width: 768px) {
  .profile-overview { padding: 28px 24px 40px; }
  .profile-hero { padding: 26px 24px 18px; }
}

.qq-send-panel { width: min(560px, 100%); }
.qq-send-panel textarea { resize: vertical; min-height: 120px; }
.qq-sender-label-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.qq-sender-label-row .form-label { margin: 0; }
.qq-sender-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; max-height: 154px; overflow-y: auto; padding: 8px; background: var(--bg-soft); border: 1px solid var(--border-light); border-radius: 11px; }
.qq-sender-option { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 8px 9px; background: var(--card-bg, #fff); border: 1px solid var(--border-light); border-radius: 8px; cursor: pointer; }
.qq-sender-option:has(input:checked) { color: var(--primary); background: var(--primary-light); border-color: rgba(37,99,235,.28); }
.qq-sender-option input { width: 17px; height: 17px; flex: 0 0 17px; accent-color: var(--primary); }
.qq-sender-option span { min-width: 0; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.qq-sender-selected { margin-top: 6px; color: var(--text-sec); font-size: 11px; }
.qq-mail-tasks-trigger { position: relative; }
.qq-task-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: 7px; padding: 0 6px; color: #fff; font-size: 11px; font-weight: 750; line-height: 1; background: var(--danger); border-radius: 999px; }
.qq-task-count[hidden] { display: none; }
.qq-mail-tasks-modal { padding: 0; }
.qq-mail-tasks-panel { width: 100%; height: 100dvh; max-height: none; text-align: left; border: 0; border-radius: 0; }
.qq-mail-tasks-header { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: max(20px, env(safe-area-inset-top, 0px)) max(24px, calc((100vw - 1120px) / 2)) 18px; background: #fff; border-bottom: 1px solid var(--border-light); }
.qq-mail-tasks-header .ui-modal__title { margin: 0; text-align: left; }
.qq-mail-tasks-sub { margin: 5px 0 0; color: var(--text-sec); font-size: 12px; }
.qq-mail-tasks-actions { display: flex; align-items: center; gap: 10px; }
.qq-mail-tasks-body { flex: 1; min-height: 0; display: grid; align-content: start; gap: 12px; padding: 20px max(24px, calc((100vw - 1120px) / 2)) calc(28px + env(safe-area-inset-bottom, 0px)); overflow-y: auto; background: var(--bg-soft); }
.qq-mail-task-card { padding: 18px 20px; background: #fff; border: 1px solid var(--border-light); border-left: 4px solid #94a3b8; border-radius: 14px; box-shadow: 0 3px 12px rgba(15,23,42,.04); }
.qq-mail-task-card.status-pending { border-left-color: #d97706; }
.qq-mail-task-card.status-running { border-left-color: var(--primary); }
.qq-mail-task-card.status-completed { border-left-color: #16a34a; }
.qq-mail-task-card.status-partial_failed { border-left-color: #ea580c; }
.qq-mail-task-card.status-failed { border-left-color: var(--danger); }
.qq-mail-task-card.is-highlighted { animation: qq-task-highlight 1.5s ease-out; box-shadow: 0 0 0 3px rgba(37,99,235,.18); }
.qq-mail-task-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.qq-mail-task-title { min-width: 0; color: var(--text-main); font-size: 16px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qq-mail-task-status { flex: 0 0 auto; padding: 4px 10px; color: var(--text-sec); font-size: 12px; font-weight: 650; background: var(--bg-soft); border-radius: 999px; }
.qq-mail-task-card.status-running .qq-mail-task-status { color: var(--primary); background: var(--primary-light); }
.qq-mail-task-card.status-completed .qq-mail-task-status { color: #15803d; background: #dcfce7; }
.qq-mail-task-card.status-pending .qq-mail-task-status { color: #b45309; background: #fef3c7; }
.qq-mail-task-card.status-partial_failed .qq-mail-task-status { color: #c2410c; background: #ffedd5; }
.qq-mail-task-card.status-failed .qq-mail-task-status { color: var(--danger); background: #fee2e2; }
.qq-mail-task-card.status-paused .qq-mail-task-status { color: #6d28d9; background: #ede9fe; }
.qq-mail-task-card.status-cancelled .qq-mail-task-status { color: var(--text-sec); background: var(--border-light); }
.qq-mail-task-meta { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; margin-top: 10px; color: var(--text-sec); font-size: 12px; }
.qq-mail-task-meta span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qq-mail-task-progress-row { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.qq-mail-task-progress-row strong { width: 42px; flex: 0 0 42px; color: var(--primary); font-size: 13px; text-align: right; }
.qq-mail-task-track { flex: 1; height: 9px; overflow: hidden; background: #e2e8f0; border-radius: 999px; }
.qq-mail-task-track span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), #60a5fa); border-radius: inherit; transition: width .25s ease; }
.qq-mail-task-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.qq-mail-task-stats span { padding: 9px 10px; color: var(--text-sec); font-size: 12px; text-align: center; background: var(--bg-soft); border-radius: 9px; }
.qq-mail-task-stats b { margin-left: 3px; color: var(--text-main); font-size: 14px; }
.qq-mail-task-stats .is-success b { color: #16a34a; }
.qq-mail-task-stats .is-danger b { color: var(--danger); }
.qq-mail-task-detail { margin-top: 12px; color: var(--text-sec); font-size: 12px; }
.qq-mail-task-errors { margin-top: 8px; padding: 8px 10px; color: var(--danger); font-size: 12px; line-height: 1.5; background: #fef2f2; border-radius: 8px; overflow-wrap: anywhere; }
@keyframes qq-task-highlight { 0%, 45% { background: #eff6ff; } 100% { background: #fff; } }

/* QQ 控制中心手机端最终适配（放在通用个人中心规则之后，避免被覆盖） */
@media (max-width: 767px) {
  .app-wrapper.qq-control-app { width: 100%; max-width: none; overflow-x: hidden; }
  .qq-control-app .profile-topbar { padding-right: 14px; padding-left: 14px; }
  .qq-control-app .profile-topbar .header-title { min-width: 0; font-size: 18px; }
  .qq-control-app .qq-control-page { display: block; width: 100%; padding: 14px 12px calc(84px + env(safe-area-inset-bottom, 0px)); }
  .qq-control-app .qq-account-card { margin-bottom: 12px; padding: 16px; border-radius: 14px; }
  .qq-control-app .qq-groups-card { padding: 16px; border-radius: 14px; }
  .qq-account-head { align-items: flex-start; flex-wrap: wrap; gap: 10px; }
  .qq-account-avatar { width: 40px; height: 40px; flex-basis: 40px; border-radius: 12px; font-size: 16px; }
  .qq-account-primary { padding-top: 1px; }
  .qq-account-head > .status-badge { flex: 0 0 auto; max-width: 100%; }
  .qq-account-stats { grid-template-columns: 1fr; gap: 8px; margin-top: 14px; }
  .qq-account-stat { padding: 10px 12px; }
  .qq-control-actions { grid-template-columns: 1fr; gap: 8px; }
  .qq-control-actions .btn { min-height: 44px; }
  .qq-group-search-wrap { align-items: stretch; }
  .qq-group-search, .qq-group-search-clear { min-height: 44px; }
  .qq-group-list { max-height: none; overflow: visible; }
  .qq-group-item { align-items: center; flex-wrap: wrap; gap: 10px; padding: 12px; }
  .qq-group-symbol { width: 32px; height: 32px; flex-basis: 32px; }
  .qq-group-item .data-item-main { flex: 1 1 calc(100% - 44px); }
  .qq-group-item .data-item-title { white-space: normal; overflow-wrap: anywhere; }
  .qq-group-item .data-item-sub { gap: 4px; }
  .qq-group-item .data-item-actions { width: 100%; padding-left: 42px; gap: 8px; }
  .qq-group-item .data-item-actions .btn { flex: 1 1 0; min-width: 0; min-height: 40px; }

  /* QQ 账号列表卡片（用户端 /user/extensions/qq）窄屏适配：单列 + 加大触控 */
  .qq-account-cards { grid-template-columns: 1fr; }
  .qq-account-card-item { padding: 14px; border-radius: 14px; }
  .qq-account-card-avatar { width: 40px; height: 40px; flex-basis: 40px; border-radius: 12px; font-size: 16px; }
  .qq-account-card-name { white-space: normal; overflow-wrap: anywhere; }
  .qq-account-card-actions .btn { min-height: 42px; }

  #qqMembersModal.ui-modal { align-items: stretch; padding: 0; }
  #qqMembersModal .qq-members-panel { width: 100%; height: 100dvh; max-height: 100dvh; border: 0; border-radius: 0; transform: translateY(12px); }
  #qqMembersModal.is-visible .qq-members-panel { transform: none; }
  .qq-members-header { padding: max(16px, env(safe-area-inset-top, 0px)) 14px 12px; }
  .qq-members-header .ui-modal__title { font-size: 18px; }
  .qq-modal-close { width: 38px; height: 38px; flex-basis: 38px; }
  .qq-members-panel .ui-modal__body { padding: 12px 12px 0; }
  .qq-members-toolbar { grid-template-columns: minmax(0, 1fr) 112px; gap: 8px; padding-bottom: 10px; }
  .qq-members-search, .qq-members-role-filter { height: 42px; font-size: 14px; }
  .qq-members-meta { padding: 9px 10px; }
  .qq-members-list { margin-top: 8px; padding-bottom: 8px; }
  .qq-member-item { min-height: 52px; padding: 8px 6px; gap: 8px; border-radius: 8px; }
  .qq-member-check { width: 19px; height: 19px; }
  .qq-member-line1 { gap: 4px; }
}

/* ===== 每日签到页面 ===== */
.checkin-page { padding-bottom: 24px; }
.checkin-status-card { margin: 0 16px 16px; padding: 18px; }
.checkin-status-head { display: flex; align-items: center; gap: 14px; }
.checkin-stamp { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; font-size: 24px; font-weight: 800; color: #fff; background: linear-gradient(135deg, #2563eb, #60a5fa); box-shadow: 0 8px 20px rgba(37,99,235,.22); flex: 0 0 auto; }
.checkin-status-title { font-size: 17px; font-weight: 700; color: var(--text-main); }
.checkin-status-sub { margin-top: 4px; font-size: 13px; color: var(--text-sec); line-height: 1.5; }
.checkin-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.checkin-stat { text-align: center; padding: 12px; background: rgba(37,99,235,.05); border-radius: 12px; }
.checkin-stat-value { font-size: 22px; font-weight: 800; color: var(--primary); }
.checkin-stat-label { margin-top: 4px; font-size: 12px; color: var(--text-sec); }
.checkin-reward-card { margin: 0 16px 16px; padding: 18px; }
.checkin-rewards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.checkin-reward { display: flex; align-items: center; gap: 10px; padding: 12px; background: rgba(37,99,235,.05); border-radius: 12px; }
.checkin-reward-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #fff; background: linear-gradient(135deg, #2563eb, #60a5fa); flex: 0 0 auto; }
.checkin-reward-name { flex: 1; min-width: 0; font-size: 13px; color: var(--text-sec); }
.checkin-reward-value { font-size: 15px; font-weight: 700; color: var(--text-main); }
.checkin-action { margin: 0 16px; }
.checkin-action .btn { width: 100%; padding: 13px; font-size: 15px; }

@media (max-width: 767px) {
  .qq-member-name { font-size: 13px; }
  .qq-member-role { padding: 1px 5px; font-size: 10px; }
  .qq-member-title { display: none; }
  .qq-member-line2 { font-size: 10px; }
  .qq-members-actions { flex: 0 0 auto; display: flex; flex-direction: column-reverse; align-items: stretch; gap: 8px; padding: 10px 12px calc(12px + env(safe-area-inset-bottom, 0px)); }
  .qq-members-actions > .btn-primary { width: 100%; min-width: 0; min-height: 46px; }
  .qq-members-secondary-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .qq-members-secondary-actions .btn { width: 100%; min-height: 42px; }

  #qqSendModal.ui-modal { align-items: flex-end; padding: 10px; }
  #qqSendModal .qq-send-panel { width: 100%; max-height: calc(100dvh - 20px); border-radius: 18px; }
  #qqSendModal .ui-modal__body { padding: 20px 16px 6px; overflow-y: auto; text-align: left; }
  #qqSendModal .ui-modal__actions { padding: 12px 16px calc(16px + env(safe-area-inset-bottom, 0px)); }
  .qq-sender-list { grid-template-columns: 1fr; max-height: 132px; }
  .qq-sender-option { min-height: 40px; }
  #qqMailTasksModal.ui-modal { padding: 0; }
  #qqMailTasksModal .qq-mail-tasks-panel { width: 100%; height: 100dvh; max-height: none; border-radius: 0; }
  .qq-mail-tasks-header { align-items: flex-start; padding: max(14px, env(safe-area-inset-top, 0px)) 14px 12px; }
  .qq-mail-tasks-sub { display: none; }
  .qq-mail-tasks-actions { gap: 7px; }
  .qq-mail-tasks-body { gap: 10px; padding: 12px 10px calc(16px + env(safe-area-inset-bottom, 0px)); }
  .qq-mail-task-card { padding: 14px 12px; border-radius: 12px; }
  .qq-mail-task-title { font-size: 14px; }
  .qq-mail-task-meta { grid-template-columns: 1fr; gap: 5px; }
  .qq-mail-task-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qq-mail-task-stats span { padding: 8px 5px; }
}

@media (max-width: 380px) {
  .qq-control-app .qq-control-page { padding-right: 10px; padding-left: 10px; }
  .qq-account-head > .status-badge { width: 100%; text-align: center; }
  .qq-group-item .data-item-actions { padding-left: 0; }
  .qq-members-toolbar { grid-template-columns: 1fr; }
  .qq-members-meta { align-items: flex-start; flex-direction: column; }
  .qq-member-line2 { max-width: 210px; }
}

@media (max-height: 520px) and (orientation: landscape) {
  #qqMembersModal .qq-members-panel { height: 100dvh; max-height: 100dvh; }
  .qq-members-header { padding-top: 10px; padding-bottom: 8px; }
  .qq-members-panel .ui-modal__body { padding-top: 8px; }
  .qq-members-actions { flex-direction: row; padding-top: 8px; padding-bottom: 8px; }
  .qq-members-secondary-actions { display: flex; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* ==============================
   性能优化：长列表渲染优化（浏览器跳过屏外元素渲染）
   ============================== */
.inbox-item, .sent-item { content-visibility: auto; contain-intrinsic-size: auto 76px; }

/* ==============================
   版本号
   ============================== */
.version-bar { text-align: center; padding: 16px 0 24px; font-size: 12px; color: var(--text-muted, #94a3b8); }

/* ==============================
   QQ 扩展发信配置（页面内展开 + 标签页）
   ============================== */
.qq-send-config-inline[hidden] { display: none !important; }

.qq-send-config-tabs {
  display: flex; gap: 0;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--border, #e2e8f0);
}
.qq-send-config-tab {
  padding: 10px 20px;
  border: 0; border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  background: none;
  color: var(--text-sec, #64748b);
  font-size: 14px; font-weight: 500;
  cursor: pointer;
  transition: color .18s, border-color .18s;
}
.qq-send-config-tab:hover { color: var(--text-main, #1e293b); }
.qq-send-config-tab.active {
  color: var(--primary, #2563eb);
  border-bottom-color: var(--primary, #2563eb);
}

.qq-send-config-panel { display: none; }
.qq-send-config-panel.active { display: block; }

.qq-send-config-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  margin-top: 16px; padding: 14px 16px;
  background: var(--bg-card, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
}

/* 只读显示字段 */
.form-readonly {
  padding: 10px 14px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  background: var(--bg-soft, #f8fafc);
  color: var(--text-main, #1e293b);
  font-size: 14px;
  word-break: break-all;
}
