/* ========== 全局重置 ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --primary: #4F6EF6;
  --primary-dark: #3A56D4;
  --primary-light: #EEF1FF;
  --success: #00C48C;
  --warning: #FF9500;
  --danger: #FF4D4F;
  --bg: #F5F6FA;
  --card: #FFFFFF;
  --text: #1A1A2E;
  --text-secondary: #8C8CA1;
  --text-third: #BFBFBF;
  --border: #ECECF0;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
  --max-width: 430px;
}

html, body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

#app {
  max-width: var(--max-width);
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  background: var(--bg);
}

/* ========== 页面切换 ========== */
.page {
  display: none;
  min-height: 100vh;
  padding-bottom: 80px;
  animation: fadeIn 0.25s ease;
}
.page.active { display: block; }

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

/* ========== 顶部导航 ========== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px);
}
.navbar .nav-back {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
  color: var(--text);
}
.navbar .nav-title {
  font-size: 16px;
  font-weight: 600;
}
.navbar .nav-right {
  width: 32px;
  text-align: right;
  font-size: 13px;
  color: var(--primary);
  cursor: pointer;
}

/* ========== 积分卡片 ========== */
.points-card {
  margin: 16px;
  background: linear-gradient(135deg, #4F6EF6, #6B5DE6);
  border-radius: var(--radius);
  padding: 20px 24px;
  color: #fff;
  box-shadow: 0 8px 24px rgba(79, 110, 246, 0.3);
  position: relative;
  overflow: hidden;
}
.points-card::after {
  content: '';
  position: absolute;
  right: -30px;
  top: -30px;
  width: 120px;
  height: 120px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}
.points-card::before {
  content: '';
  position: absolute;
  right: 20px;
  bottom: -40px;
  width: 80px;
  height: 80px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 50%;
}
.points-card .label {
  font-size: 13px;
  opacity: 0.85;
  margin-bottom: 6px;
}
.points-card .value {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -1px;
}
.points-card .unit {
  font-size: 14px;
  font-weight: 400;
  opacity: 0.8;
  margin-left: 4px;
}
.points-card .tip {
  font-size: 12px;
  opacity: 0.7;
  margin-top: 8px;
}

/* ========== 功能网格 ========== */
.section {
  margin: 16px;
}
.section-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.section-title .more {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 400;
}

.func-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.func-item {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: var(--shadow);
  border: none;
}
.func-item:active {
  transform: scale(0.97);
}
.func-item .icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 10px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}
.func-item .icon.img { background: #EEF1FF; }
.func-item .icon.video { background: #FFF4E6; }
.func-item .icon.invite { background: #E8F8F0; }
.func-item .icon.card { background: #FFF0F0; }
.func-item .icon.recharge { background: #F0EEFF; }
.func-item .icon.history { background: #F0F4FF; }
.func-item .name {
  font-size: 14px;
  font-weight: 600;
}
.func-item .desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ========== 首页工具区 · 单栏纵向列表 ========== */
.func-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.func-list .func-item {
  display: flex;
  align-items: center;
  text-align: left;
  padding: 14px 16px;
}
.func-list .func-item:active {
  transform: scale(0.98);
}
.func-list .func-item .icon {
  width: 46px;
  height: 46px;
  margin: 0 14px 0 0;
  flex-shrink: 0;
}
.func-list .func-item .func-info {
  flex: 1;
  min-width: 0;
}
.func-list .func-item .name {
  font-size: 15px;
}
.func-list .func-item .desc {
  margin-top: 3px;
}
.func-list .func-arrow {
  flex-shrink: 0;
  color: var(--text-third);
  display: flex;
  align-items: center;
  margin-left: 8px;
}

/* ========== 卡片通用 ========== */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

/* ========== 按钮 ========== */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 48px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:disabled {
  opacity: 0.5;
}
.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-success {
  background: var(--success);
  color: #fff;
}
.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-sm {
  height: 36px;
  font-size: 13px;
  width: auto;
  padding: 0 16px;
  border-radius: 8px;
}

/* ========== 底部 Tab ========== */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-width);
  background: var(--card);
  display: flex;
  border-top: 1px solid var(--border);
  z-index: 90;
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar .tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 0 6px;
  cursor: pointer;
  color: var(--text-third);
  transition: color 0.2s;
}
.tabbar .tab.active { color: var(--primary); }
.tabbar .tab .tab-icon {
  font-size: 22px;
  line-height: 1;
  margin-bottom: 2px;
}
.tabbar .tab .tab-label {
  font-size: 11px;
}

/* ========== 上传区域 ========== */
.upload-zone {
  margin: 16px;
  background: var(--card);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.upload-zone:active {
  border-color: var(--primary);
  background: var(--primary-light);
}
.upload-zone .upload-icon {
  font-size: 48px;
  margin-bottom: 12px;
}
.upload-zone .upload-text {
  font-size: 15px;
  color: var(--text);
  font-weight: 500;
}
.upload-zone .upload-hint {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 6px;
}

/* ========== Canvas 区域 ========== */
.canvas-wrap {
  margin: 16px;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  position: relative;
}
.canvas-wrap canvas {
  display: block;
  width: 100%;
  touch-action: none;
}
.canvas-toolbar {
  display: flex;
  gap: 8px;
  padding: 12px;
  flex-wrap: wrap;
}
.canvas-toolbar .tool-btn {
  flex: 1;
  min-width: 70px;
  height: 38px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  color: var(--text);
  transition: all 0.15s;
}
.canvas-toolbar .tool-btn.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}
.brush-size-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 4px 4px 0;
}
.brush-size-label {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
}
.brush-size-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  min-width: 24px;
  text-align: right;
}
#brush-size-slider {
  flex: 1;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--border);
  border-radius: 2px;
  outline: none;
}
#brush-size-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
#brush-size-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 2px solid #fff;
}

/* ========== 费用提示 ========== */
.cost-tip {
  margin: 0 16px 12px;
  padding: 12px 16px;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cost-tip .cost-num {
  font-weight: 700;
  font-size: 15px;
}

/* ========== 输入框 ========== */
.input-group {
  margin-bottom: 16px;
}
.input-group label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.input-group input,
.input-group textarea,
.input-group select {
  width: 100%;
  height: 48px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  font-size: 15px;
  background: var(--card);
  color: var(--text);
  transition: border-color 0.2s;
}
.input-group input:focus,
.input-group textarea:focus,
.input-group select:focus {
  outline: none;
  border-color: var(--primary);
}
.input-group textarea {
  height: auto;
  padding: 12px 14px;
  resize: none;
  min-height: 80px;
}

/* ========== 列表 ========== */
.list-item {
  display: flex;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.list-item:last-child { border-bottom: none; }
.list-item .li-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-right: 12px;
  flex-shrink: 0;
}
.list-item .li-content {
  flex: 1;
  min-width: 0;
}
.list-item .li-title {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-item .li-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.list-item .li-right {
  text-align: right;
  flex-shrink: 0;
  margin-left: 12px;
}
.list-item .li-amount {
  font-size: 15px;
  font-weight: 600;
}
.list-item .li-amount.plus { color: var(--success); }
.list-item .li-amount.minus { color: var(--text); }
.list-item .li-time {
  font-size: 11px;
  color: var(--text-third);
  margin-top: 2px;
}

/* ========== 弹窗 ========== */
.modal-mask {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-mask.show { display: flex; }
.modal {
  background: var(--card);
  border-radius: 20px;
  padding: 24px;
  width: 100%;
  max-width: 320px;
  animation: modalIn 0.25s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}
.modal .modal-title {
  font-size: 17px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 16px;
}
.modal .modal-body {
  margin-bottom: 20px;
}
.modal .modal-footer {
  display: flex;
  gap: 12px;
}
.modal .modal-footer .btn { flex: 1; }

/* ========== Toast ========== */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  z-index: 2000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s;
  max-width: 280px;
  text-align: center;
}
.toast.show { opacity: 1; }

/* ========== 充值套餐 ========== */
.recharge-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin: 16px 0;
}
.recharge-item {
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
}
.recharge-item.active {
  border-color: var(--primary);
  background: var(--primary-light);
}
.recharge-item .ri-points {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
}
.recharge-item .ri-price {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}
.recharge-item .ri-tag {
  font-size: 10px;
  color: var(--warning);
  margin-top: 4px;
}

/* ========== 邀请页 ========== */
.invite-card {
  margin: 16px;
  background: linear-gradient(135deg, #FF6B6B, #FF8E53);
  border-radius: var(--radius);
  padding: 24px 20px;
  color: #fff;
  text-align: center;
  box-shadow: 0 8px 24px rgba(255, 107, 107, 0.3);
}
.invite-card .ic-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
}
.invite-card .ic-desc {
  font-size: 13px;
  opacity: 0.85;
  margin-bottom: 16px;
}
.invite-card .ic-reward {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 16px;
}
.invite-card .ic-reward span {
  font-size: 14px;
  font-weight: 400;
}
.invite-link-box {
  margin: 16px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.invite-link-box .ilb-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.invite-link-box .ilb-link {
  background: var(--bg);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--text-secondary);
  word-break: break-all;
  margin-bottom: 12px;
  font-family: monospace;
}

/* ========== 卡密列表（后台） ========== */
.table-wrap {
  overflow-x: auto;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th {
  text-align: left;
  padding: 10px 12px;
  background: var(--bg);
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
}
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.data-table tr:hover {
  background: var(--bg);
}
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}
.badge-unused { background: #E8F8F0; color: var(--success); }
.badge-used { background: #FFF0F0; color: var(--danger); }

/* ========== 后台样式 ========== */
.admin-body {
  background: var(--bg);
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
}
.admin-header {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
}
.admin-header h1 {
  font-size: 20px;
  font-weight: 700;
}
.admin-header .back-link {
  font-size: 14px;
  color: var(--primary);
  text-decoration: none;
}
.admin-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 4px;
}
.admin-tab {
  flex: 1;
  text-align: center;
  padding: 10px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s;
}
.admin-tab.active {
  background: var(--primary);
  color: #fff;
  font-weight: 500;
}
.admin-panel { display: none; }
.admin-panel.active { display: block; }
.admin-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.admin-card h3 {
  font-size: 16px;
  margin-bottom: 16px;
}
.form-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.form-row label {
  width: 180px;
  font-size: 14px;
  flex-shrink: 0;
}
.form-row input {
  flex: 1;
  height: 42px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 0 12px;
  font-size: 14px;
}
.form-row input:focus {
  outline: none;
  border-color: var(--primary);
}

/* ========== 空状态 ========== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-third);
}
.empty-state .es-icon {
  font-size: 48px;
  margin-bottom: 12px;
}
.empty-state .es-text {
  font-size: 14px;
}

/* ========== 加载动画 ========== */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1500;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
}
.loading-overlay.show { display: flex; }
.loading-overlay .lo-text {
  color: #fff;
  font-size: 14px;
}
.loading-overlay .lo-bar {
  width: 200px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  overflow: hidden;
}
.loading-overlay .lo-bar-fill {
  height: 100%;
  background: #fff;
  border-radius: 2px;
  transition: width 0.3s;
}

/* ========== 首页头像入口 ========== */
.nav-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 1.5px solid var(--primary);
  overflow: hidden;
}
.nav-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ========== 公告栏 ========== */
.announce-bar {
  margin: 12px 16px 0;
  background: #FFF9EB;
  border: 1px solid #F5E3B8;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  overflow: hidden;
}
.announce-bar .announce-icon {
  color: var(--warning);
  flex-shrink: 0;
  display: flex;
}
.announce-bar .announce-text {
  flex: 1;
  font-size: 13px;
  color: #8A6D1F;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.announce-bar .announce-arrow {
  color: #C9B27A;
  flex-shrink: 0;
  display: flex;
}

/* ========== 积分卡操作按钮 ========== */
.points-card-actions {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 8px;
  margin-top: 14px;
}
.pca-btn {
  padding: 6px 18px;
  border-radius: 20px;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background 0.15s;
}
.pca-btn:active {
  background: rgba(255, 255, 255, 0.32);
}

/* ========== 个人中心 ========== */
.profile-header {
  margin: 16px;
  background: linear-gradient(135deg, #4F6EF6, #7A5DF0);
  border-radius: var(--radius);
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  color: #fff;
  box-shadow: 0 8px 24px rgba(79, 110, 246, 0.3);
  position: relative;
  overflow: hidden;
}
.profile-header::after {
  content: '';
  position: absolute;
  right: -40px;
  top: -40px;
  width: 140px;
  height: 140px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}
.profile-avatar {
  position: relative;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  border: 2px solid rgba(255, 255, 255, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  overflow: hidden;
}
.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-avatar-edit {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #7A5DF0;
}
.profile-info {
  position: relative;
  z-index: 1;
  min-width: 0;
}
.profile-nickname {
  font-size: 19px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.profile-points {
  font-size: 13px;
  opacity: 0.85;
  margin-top: 6px;
}
.profile-points b {
  font-size: 18px;
  margin: 0 2px;
}

/* ========== 菜单列表 ========== */
.menu-list {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}
.menu-item:last-child { border-bottom: none; }
.menu-item:active { background: var(--bg); }
.mi-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.mi-icon.c-recharge { background: #F0EEFF; }
.mi-icon.c-service { background: #FFF4E6; }
.mi-icon.c-card { background: #FFF0F0; }
.mi-icon.c-invite { background: #E8F8F0; }
.mi-icon.c-history { background: #F0F4FF; }
.mi-icon.c-tsc { background: #E8F7FB; }
.mi-content { flex: 1; min-width: 0; }
.mi-title { font-size: 15px; font-weight: 500; }
.mi-desc { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.mi-arrow {
  color: var(--text-third);
  font-size: 18px;
  flex-shrink: 0;
}

/* ========== 上传方式切换 ========== */
.import-switcher {
  display: flex;
  margin: 16px 16px 0;
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 3px;
  box-shadow: var(--shadow);
  gap: 3px;
}
.import-tab {
  flex: 1;
  text-align: center;
  padding: 10px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s;
}
.import-tab.active {
  background: var(--primary);
  color: #fff;
}

/* ========== 链接导入区域 ========== */
.link-import-zone {
  margin: 8px 16px 16px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px 16px;
  box-shadow: var(--shadow);
}
.link-platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.lp-tag {
  padding: 5px 12px;
  border-radius: 20px;
  background: var(--bg);
  font-size: 12px;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.15s;
}
.lp-tag:active {
  transform: scale(0.95);
}
.lp-tag.lp-tag-active {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
  font-weight: 500;
}
.link-import-zone .input-group {
  margin-bottom: 10px;
}
.link-import-zone .input-group input {
  height: 46px;
}
.link-import-zone .btn {
  margin-top: 4px;
}
.link-hint {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-third);
  text-align: center;
  line-height: 1.6;
}

/* 平台自动识别提示 */
.link-detected {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 8px 12px;
  background: #F0FDF4;
  border-radius: 8px;
  border: 1px solid #BBF7D0;
}
.link-detected .ld-badge {
  font-size: 10px;
  font-weight: 600;
  color: var(--success);
  background: #DCFCE7;
  padding: 2px 8px;
  border-radius: 4px;
}
.link-detected .ld-name {
  font-size: 13px;
  color: #166534;
  font-weight: 500;
}

/* ========== 后台套餐编辑器 ========== */
.pkg-edit-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.pkg-edit-fields {
  flex: 1;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.pkg-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pkg-field label {
  font-size: 11px;
  color: var(--text-third);
}
.pkg-field input, .pkg-field select {
  height: 38px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 0 8px;
  font-size: 14px;
}
.pkg-edit-actions {
  display: flex;
  gap: 6px;
  align-items: flex-end;
}
.pkg-edit-actions .btn-sm {
  height: 38px;
  min-width: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pkg-edit-actions .btn-sm:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ========== 后台 API 配置卡片 ========== */
.api-config-card {
  border: 1.5px solid var(--border);
  border-radius: 12px;
  margin-bottom: 16px;
  overflow: hidden;
}
.acc-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.acc-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.acc-title {
  flex: 1;
}
.acc-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
}
.acc-body {
  padding: 16px;
}
.acc-quota-bar {
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 8px;
}
.aqb-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}
.aqb-track {
  height: 8px;
  background: #E0E0E0;
  border-radius: 4px;
  overflow: hidden;
}
.aqb-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s;
}

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

/* ========== 底部备案号 ========== */
.footer-icp {
  margin: 24px 16px 8px;
  padding: 12px 0 4px;
  text-align: center;
  font-size: 12px;
  color: var(--text-third);
}
.icp-link {
  color: var(--text-third);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.icp-link:active {
  color: var(--primary);
}
