/* ========== 信可维移动端样式 ========== */

:root {
  --bg-primary: #f6f7fb;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.92);
  --bg-elevated: #ffffff;
  --bg-input: #f0f4f8;
  --border: rgba(91, 95, 214, 0.15);
  --border-hover: rgba(91, 95, 214, 0.35);
  --text-primary: #1a2233;
  --text-secondary: #4a5568;
  --text-muted: #5f6f8a;
  --accent: #5b5fd6;
  --accent-glow: rgba(91, 95, 214, 0.12);
  --accent-green: #0e9f6e;
  --accent-orange: #c2621a;
  --accent-rose: #e02444;
  --gradient-main: linear-gradient(135deg, #8b7cf8 0%, #6366f1 100%);
  --gradient-glow: radial-gradient(ellipse 100vw 50vh at 30% 10%, rgba(91,95,214,0.06) 0%, transparent 60%);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 2px 8px rgba(15,23,42,0.08);
  --shadow-md: 0 4px 20px rgba(15,23,42,0.12);
  --shadow-lg: 0 8px 32px rgba(15,23,42,0.16);
  --font-sans: -apple-system, system-ui, 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
  --tabbar-height: 44px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html, body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: var(--gradient-glow);
  pointer-events: none;
  z-index: 0;
}

#app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

/* ========== 页面容器 ========== */
.page-container {
  min-height: 100vh;
  padding-bottom: calc(var(--tabbar-height) + var(--safe-bottom) + 16px);
}

/* ========== 桌面端访问移动页：居中手机宽度，不拉伸 ========== */
@media (min-width: 768px) {
  html, body { background: var(--bg-primary); }
  body::before { max-width: 480px; margin: 0 auto; left: 0; right: 0; }
  #app { max-width: 480px; margin: 0 auto; min-height: 100vh; border-left: 1px solid rgba(255,255,255,0.06); border-right: 1px solid rgba(255,255,255,0.06); }
  .m-navbar { max-width: 480px; }
  .m-tabbar { left: 0; right: 0; margin: 0 auto; width: 100%; max-width: 480px; }
}

.m-page {
  display: none;
  min-height: 100vh;
  animation: mFadeIn 0.3s ease;
  padding-bottom: calc(var(--tabbar-height) + var(--safe-bottom) + 20px);
}
.m-page.active { display: block; }

@keyframes mFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========== 通用导航栏 ========== */
.m-navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 16px;
  padding-top: env(safe-area-inset-top, 0px);
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.m-navbar-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.m-navbar-back {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  margin-top: env(safe-area-inset-top, 0px);
  background: none;
  border: none;
  color: var(--accent);
  font-size: 24px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}
.m-navbar-right {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  margin-top: env(safe-area-inset-top, 0px);
  font-size: 14px;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
}

/* ========== 登录页 ========== */
.m-login {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  padding-top: env(safe-area-inset-top, 0px);
}
.m-login-logo {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  margin-bottom: 16px;
  background: var(--gradient-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 700;
  color: var(--bg-primary);
  box-shadow: 0 8px 32px rgba(129,140,248,0.3);
}
.m-login-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}
.m-login-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 36px;
}
.m-login-form {
  width: 100%;
  max-width: 360px;
}
.m-input-group {
  margin-bottom: 20px;
}
.m-input-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.m-input-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}
.m-input {
  flex: 1;
  height: 48px;
  padding: 0 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 15px;
  font-family: var(--font-sans);
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-backdrop-filter: blur(8px);
}
.m-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(129,140,248,0.12);
}
.m-input::placeholder { color: var(--text-muted); }
.m-input-code {
  letter-spacing: 4px;
  text-align: center;
}
.m-sms-btn {
  flex-shrink: 0;
  min-width: 110px;
  height: 48px;
  padding: 0 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.m-sms-btn:active { transform: scale(0.96); }
.m-sms-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.m-btn {
  width: 100%;
  height: 48px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--gradient-main);
  background-size: 200% 200%;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.m-btn:active { transform: scale(0.97); box-shadow: 0 4px 20px rgba(129,140,248,0.3); }
.m-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.m-btn-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.m-btn-secondary:active { border-color: var(--accent); color: var(--accent); }
.m-login-tip {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 20px;
}
.m-login-contact {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--accent);
  cursor: pointer;
  padding: 8px 0;
}
.m-login-contact:active { opacity: 0.7; }
.m-login-contact .m-ico-inline { width: 15px; height: 15px; }

/* ========== 首页 ========== */
.m-home-header {
  padding: 20px 16px 16px;
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.m-home-greeting {
  font-size: 14px;
  color: var(--text-secondary);
}
.m-home-greeting strong {
  color: var(--text-primary);
  font-size: 18px;
  display: block;
  margin-top: 2px;
}
.m-home-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gradient-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  color: var(--bg-primary);
  flex-shrink: 0;
}

/* 配额卡片 */
.m-quota-card {
  margin: 0 16px 20px;
  padding: 24px 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(129,140,248,0.12), rgba(74,240,182,0.06));
  border: 1px solid rgba(129,140,248,0.15);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.m-quota-card::before {
  content: '';
  position: absolute;
  top: -20px;
  right: -20px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(129,140,248,0.1), transparent);
}
.m-quota-info {
  flex: 1;
  min-width: 0;
}
.m-quota-buy {
  flex-shrink: 0;
  padding: 10px 18px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), #818cf8);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(129,140,248,0.35);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.m-quota-buy .m-ico { width: 16px; height: 16px; }
.m-quota-buy:active { transform: scale(0.96); }
.m-quota-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.m-quota-value {
  font-size: 40px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.m-quota-level {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* 购买套餐页 */
.m-pricing-status {
  margin: 0 16px 16px;
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  background: rgba(129,140,248,0.08);
  border: 1px solid rgba(129,140,248,0.15);
  display: flex;
  gap: 12px;
}
.m-pricing-status-item {
  flex: 1;
}
.m-pricing-status-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.m-pricing-status-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
}
.m-pricing-list {
  margin: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.m-plan-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 16px;
  border-radius: var(--radius-lg);
  background: var(--bg-card, #1a2035);
  border: 1px solid var(--border-color, rgba(255,255,255,0.08));
  position: relative;
  overflow: hidden;
}
.m-plan-card.featured {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 8px 24px rgba(129,140,248,0.15);
}
.m-plan-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 8px 24px rgba(129,140,248,0.15);
  background: linear-gradient(135deg, rgba(129,140,248,0.10), rgba(129,140,248,0.03));
}
.m-plan-card.selected .m-plan-name { color: var(--accent); }
.m-plan-badge {
  position: absolute;
  top: 0;
  right: 0;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #f59e0b, #f97316);
  border-radius: 0 var(--radius-lg) 0 var(--radius-lg);
}
.m-plan-info {
  flex: 1;
  min-width: 0;
}
.m-plan-name {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}
.m-plan-desc {
  font-size: 12px;
  color: var(--text-muted);
}
.m-plan-features {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.m-plan-features li {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
}
.m-plan-features .m-ico {
  width: 14px;
  height: 14px;
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 2px;
}
.m-plan-right {
  flex-shrink: 0;
  text-align: right;
}
.m-plan-price {
  font-size: 18px;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 8px;
}
.m-plan-btn {
  padding: 8px 18px;
  font-size: 13px;
}
.m-pricing-tip {
  margin: 16px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(74,240,182,0.06);
  border: 1px solid rgba(74,240,182,0.12);
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* 快捷操作 */
.m-section-title {
  font-size: 16px;
  font-weight: 600;
  margin: 24px 16px 12px;
  letter-spacing: -0.01em;
}
.m-quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 16px;
  margin-bottom: 20px;
}
.m-quick-card {
  padding: 20px 16px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.m-quick-card:active { transform: scale(0.96); border-color: var(--border-hover); }
.m-quick-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(129,140,248,0.1);
  color: var(--accent);
}
.m-quick-icon .m-ico { width: 24px; height: 24px; }
.m-quick-label {
  font-size: 15px;
  font-weight: 600;
}
.m-quick-desc {
  font-size: 12px;
  color: var(--text-muted);
}

/* 软著列表卡片 */
.m-soft-list {
  padding: 0 16px;
}
.m-soft-card {
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.2s;
}
.m-soft-card:active { transform: scale(0.98); }
.m-soft-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.m-soft-name {
  font-size: 15px;
  font-weight: 600;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.m-soft-status {
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 10px;
  flex-shrink: 0;
  margin-left: 8px;
}
.m-soft-status.done { background: rgba(74,240,182,0.12); color: var(--accent-green); }
.m-soft-status.generating { background: rgba(129,140,248,0.12); color: var(--accent); }
.m-soft-status.failed { background: rgba(247,107,138,0.12); color: var(--accent-rose); }
.m-soft-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  gap: 12px;
}

/* ========== 生成表单页 ========== */
.m-form-section {
  padding: 0 16px;
}
.m-form-group {
  margin-bottom: 18px;
}
.m-form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.m-form-group label .required {
  color: var(--accent-rose);
  margin-left: 2px;
}
.m-form-input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 15px;
  font-family: var(--font-sans);
  transition: border-color 0.2s;
}
.m-form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(129,140,248,0.12);
}
.m-form-input::placeholder { color: var(--text-muted); }
/* 著作权人提醒高亮（AI 生成后闪烁提示用户填真实全名） */
.m-input-attention {
  border-color: var(--accent-rose, #f56c6c) !important;
  box-shadow: 0 0 0 3px rgba(245, 108, 108, 0.18) !important;
  animation: m-attention-pulse 1s ease-in-out 3;
}
@keyframes m-attention-pulse {
  0%, 100% { border-color: var(--accent-rose, #f56c6c); }
  50% { border-color: var(--accent); }
}
/* 邀请码弹窗：显式复制按钮 */
.m-invite-box {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px dashed var(--accent);
}
.m-invite-code {
  flex: 1;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--accent);
  font-family: var(--font-mono, monospace);
}
.m-invite-copy {
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 4px 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  border-radius: 6px;
}
.m-invite-copy:active { background: rgba(129,140,248,0.12); }
.m-invite-count {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}
/* AI 智能生成按钮 */
.m-ai-prefill { margin-top: 10px; }
/* AI 预填按钮行内化：输入框 + 按钮同行（与 PC 端一致） */
.m-input-row { display: flex; gap: 10px; align-items: stretch; }
.m-input-row .m-form-input { flex: 1; min-width: 0; }
.m-input-row .m-ai-prefill-btn {
  width: auto;
  flex-shrink: 0;
  padding: 0 16px;
  white-space: nowrap;
  font-size: 14px;
}
.m-ai-prefill-btn {
  width: 100%;
  height: 48px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #818cf8, #6366f1);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  box-shadow: 0 4px 14px rgba(99,102,241,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.m-ai-prefill-btn .m-ico { width: 20px; height: 20px; }
.m-ai-prefill-btn:active { transform: scale(0.98); }
.m-ai-prefill-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.m-ai-prefill-tip {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}
textarea.m-form-input {
  height: auto;
  min-height: 100px;
  padding: 12px 16px;
  resize: vertical;
  line-height: 1.6;
}
select.m-form-input {
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%237a8aa3' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

/* 类型选择 */
.m-type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.m-type-card {
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-input);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}
.m-type-card:active { transform: scale(0.96); }
.m-type-card.selected {
  border-color: var(--accent);
  background: rgba(129,140,248,0.1);
  color: var(--accent);
}
.m-type-card-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(129,140,248,0.1);
  color: var(--accent);
}
.m-type-card-icon .m-ico { width: 22px; height: 22px; }

/* 语言标签 */
.m-lang-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.m-lang-tag {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}
.m-lang-tag:active { transform: scale(0.94); }
.m-lang-tag.selected {
  border-color: var(--accent);
  background: rgba(129,140,248,0.12);
  color: var(--accent);
}

.m-form-submit {
  padding: 24px 16px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
}

/* ========== 订单页 ========== */
.m-order-card {
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  margin: 0 16px 12px;
}
.m-order-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.m-order-plan {
  font-size: 15px;
  font-weight: 600;
}
.m-order-amount {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent-green);
}
.m-order-status {
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 10px;
}
.m-order-status.paid { background: rgba(74,240,182,0.12); color: var(--accent-green); }
.m-order-status.pending { background: rgba(242,181,106,0.12); color: var(--accent-orange); }
.m-order-status.refunded { background: rgba(247,107,138,0.12); color: var(--accent-rose); }
.m-order-status.cancelled { background: rgba(122,138,163,0.12); color: var(--text-muted); }
.m-order-time {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* 空状态 */
.m-empty {
  text-align: center;
  padding: 60px 24px;
}
.m-empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  opacity: 0.35;
}
.m-empty-icon .m-ico { width: 48px; height: 48px; }
.m-empty-text { font-size: 15px; color: var(--text-muted); }
.m-empty-sub { font-size: 13px; color: var(--text-muted); opacity: 0.6; margin-top: 6px; }

/* ========== 我的页 ========== */
.m-profile-header {
  padding: 24px 16px;
  padding-top: calc(20px + env(safe-area-inset-top, 0px));
  display: flex;
  align-items: center;
  gap: 16px;
}
.m-profile-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--gradient-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: var(--bg-primary);
  flex-shrink: 0;
}
.m-profile-info { flex: 1; }
.m-profile-phone {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.m-profile-level {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.m-profile-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1px;
  margin: 0 16px 20px;
  background: var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.m-profile-stat {
  padding: 16px 8px;
  text-align: center;
  background: var(--bg-card);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background .2s;
}
.m-profile-stat:active {
  background: var(--bg-hover, rgba(99,102,241,0.06));
}
.m-profile-stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
}
.m-profile-stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.m-menu-list {
  margin: 0 16px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  overflow: hidden;
}
.m-menu-item {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  cursor: pointer;
  transition: background 0.2s;
  border-bottom: 1px solid var(--border);
}
.m-menu-item:last-child { border-bottom: none; }
.m-menu-item:active { background: rgba(129,140,248,0.05); }
.m-menu-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--accent);
}
.m-menu-icon .m-ico { width: 18px; height: 18px; }
.m-menu-label { flex: 1; font-size: 15px; }
.m-menu-arrow { color: var(--text-muted); font-size: 18px; }

/* ========== 底部Tab栏 ========== */
.m-tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--tabbar-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(255, 255, 255, 0.96);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.06);
  display: flex;
  padding: 0 6px;
  z-index: 200;
}
.m-tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  font-size: 11px;
  color: var(--text-muted);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
  margin: 3px 5px;
  border-radius: 10px;
}
.m-tab-item:active { background: rgba(91, 95, 214, 0.1); }
.m-tab-item.active {
  color: #fff;
  background: linear-gradient(135deg, #8b7cf8 0%, #6366f1 100%);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4), inset 0 0 0 1px rgba(167, 139, 250, 0.6);
}
.m-tab-item.active .m-tab-icon { transform: scale(1.05); }
.m-tab-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  transition: transform 0.2s;
}
.m-tab-icon svg { width: 22px; height: 22px; }
.m-tab-label { font-size: 10.5px; line-height: 1.2; }

.m-btn .m-ico { width: 18px; height: 18px; }

/* ========== 扁平线性图标（SVG sprite） ========== */
.m-ico {
  display: inline-block;
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.15em;
  flex-shrink: 0;
}
.m-ico-btn { width: 16px; height: 16px; vertical-align: -2px; margin-right: 4px; }
.m-ico-xl { width: 48px; height: 48px; }
.m-ico-guide { width: 22px; height: 22px; vertical-align: -4px; margin-right: 6px; }

/* ========== Toast ========== */
.m-toast {
  position: fixed;
  bottom: calc(80px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-family: var(--font-sans);
  white-space: nowrap;
  z-index: 9999;
  animation: mToastIn 0.3s ease;
  max-width: 90vw;
}
.m-toast.info { background: rgba(129,140,248,0.15); border: 1px solid rgba(129,140,248,0.3); color: var(--accent); }
.m-toast.success { background: rgba(74,240,182,0.15); border: 1px solid rgba(74,240,182,0.3); color: var(--accent-green); }
.m-toast.error { background: rgba(247,107,138,0.15); border: 1px solid rgba(247,107,138,0.3); color: var(--accent-rose); }
@keyframes mToastIn { from { opacity: 0; transform: translateX(-50%) translateY(10px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* ========== 弹窗 ========== */
.m-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 9998;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.m-modal-overlay.active { display: flex; }
.m-modal {
  width: 100%;
  max-width: 320px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  animation: mModalIn 0.25s ease;
}
@keyframes mModalIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
.m-modal-title {
  padding: 20px 20px 8px;
  font-size: 17px;
  font-weight: 600;
  text-align: center;
}
.m-modal-body {
  padding: 8px 20px 20px;
  font-size: 14px;
  color: var(--text-secondary);
  white-space: pre-line;
  text-align: center;
  line-height: 1.6;
}
.m-modal-input {
  margin: 12px 0;
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 15px;
  font-family: var(--font-sans);
}
.m-modal-input:focus { outline: none; border-color: var(--accent); }
.m-modal-actions {
  display: flex;
  border-top: 1px solid var(--border);
}
.m-modal-btn {
  flex: 1;
  height: 48px;
  border: none;
  background: none;
  font-size: 16px;
  font-family: var(--font-sans);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.m-modal-btn.cancel { color: var(--text-muted); border-right: 1px solid var(--border); }
.m-modal-btn.confirm { color: var(--accent); font-weight: 600; }
.m-modal-btn:active { background: rgba(129,140,248,0.05); }

/* ========== 加载动画 ========== */
.m-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.m-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: mSpin 0.8s linear infinite;
}
@keyframes mSpin { to { transform: rotate(360deg); } }

/* ========== 下拉刷新 ========== */
.m-pull-refresh {
  text-align: center;
  padding: 12px;
  font-size: 12px;
  color: var(--text-muted);
  height: 0;
  overflow: hidden;
  transition: height 0.2s;
}
.m-pull-refresh.active { height: 44px; }

/* ========== 生成进度 ========== */
.m-progress-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.m-progress-overlay.active { display: flex; }
.m-progress-box {
  width: 100%;
  max-width: 340px;
  text-align: center;
}
.m-progress-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: var(--accent);
}
.m-progress-icon .m-ico { width: 52px; height: 52px; }
.m-progress-title { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.m-progress-text { font-size: 14px; color: var(--text-secondary); margin-bottom: 24px; }
.m-progress-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 12px;
}
.m-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--gradient-main);
  border-radius: 3px;
  transition: width 0.3s ease;
}
.m-progress-percent { font-size: 13px; color: var(--accent); }

/* ========== 分割线 ========== */
.m-divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

/* ========== 版本信息 ========== */
.m-version {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  padding: 20px;
  opacity: 0.5;
}

/* ========== 新手引导 / 使用教程 ========== */
.m-guide-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  padding: 20px;
  animation: mFadeIn 0.25s ease;
}
@keyframes mFadeIn { from { opacity: 0; } to { opacity: 1; } }
.m-guide-box {
  width: 100%;
  max-width: 400px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px 22px 20px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.18), 0 0 40px rgba(129, 140, 248, 0.08);
  animation: mGuideUp 0.3s ease;
}
@keyframes mGuideUp { from { transform: translateY(24px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.m-guide-header { text-align: center; margin-bottom: 20px; }
.m-guide-title { font-size: 19px; font-weight: 700; color: var(--text-primary); }
.m-guide-sub { font-size: 13px; color: var(--text-muted); margin-top: 6px; }
.m-guide-steps { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }
.m-guide-step { display: flex; gap: 12px; align-items: flex-start; }
.m-guide-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a78bfa, #6366f1);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 12px rgba(129, 140, 248, 0.4);
}
.m-guide-body { flex: 1; }
.m-guide-name { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.m-guide-desc { font-size: 12.5px; color: var(--text-muted); line-height: 1.6; margin-top: 3px; }
.m-guide-btn {
  width: 100%;
  height: 46px;
  border: none;
  border-radius: 14px;
  background: var(--gradient-main);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
  transition: transform 0.15s, opacity 0.2s;
}
.m-guide-btn:active { transform: scale(0.98); opacity: 0.9; }
.m-guide-tip { text-align: center; font-size: 12px; color: var(--text-muted); margin-top: 12px; }

/* P3-1：发票/优惠券卡片列表（弹窗内） */
.m-list-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.m-list-card-main { flex: 1; min-width: 0; }
.m-list-card-title { font-size: 14px; font-weight: 600; color: var(--text-primary, #e5e7eb); margin-bottom: 3px; }
.m-list-card-meta { font-size: 12px; color: var(--text-secondary, #9ca3af); }
.m-list-card-sub { font-size: 12px; color: #f43f5e; margin-top: 2px; }
.m-list-card-status {
  flex-shrink: 0;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(129,140,248,0.12);
  color: #818cf8;
  white-space: nowrap;
}
.m-list-card-status.ok { background: rgba(74,222,128,0.12); color: #4ade80; }
.m-list-card-status.bad { background: rgba(244,63,94,0.12); color: #f43f5e; }

/* 同名软著提醒（行内轻提示） */
.m-dup-tip {
  display: flex; align-items: flex-start; gap: 6px;
  margin-top: 8px; padding: 8px 10px;
  background: rgba(242,181,106,0.08);
  border: 1px solid rgba(242,181,106,0.22);
  border-radius: 8px;
  font-size: 12px; color: #fbbf24;
  line-height: 1.5;
}
.m-dup-tip .m-ico { width: 14px; height: 14px; flex-shrink: 0; margin-top: 2px; }
