/* 经销商套餐续费 - 独立样式（手机优先，无页面级横向滚动） */
:root {
  --dl-primary: #00a884;
  --dl-primary-grad: linear-gradient(135deg, #00a884 0%, #00c2a0 100%);
  --dl-bg: #f5f6f8;
  --dl-card-bg: #ffffff;
  --dl-text: #333333;
  --dl-muted: #888888;
  --dl-border: #eeeeee;
  --dl-success: #27ae60;
  --dl-danger: #e74c3c;
  --dl-warn: #f39c12;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%;
  overflow-x: hidden;
}

body.dealer-subscription-renew-page {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--dl-bg);
  color: var(--dl-text);
  font-size: 16px;
  min-height: 100vh;
  padding-bottom: 32px;
}

/* ===== 顶栏 ===== */
.dl-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 44px;
  padding: 0 6px;
  background: var(--dl-card-bg);
  border-bottom: 1px solid #e4e9ed;
}

.dl-header-inner {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.dl-btn-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  min-width: 26px;
  height: 26px;
  min-height: 26px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #555;
  font-size: 14px;
  cursor: pointer;
  flex-shrink: 0;
}

.dl-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 18px;
  font-weight: 400;
  margin: 0;
  white-space: nowrap;
  text-align: center;
  color: var(--dl-text);
}

.dl-header-spacer {
  width: 26px;
  flex-shrink: 0;
}

/* ===== 主容器 ===== */
.dl-container {
  max-width: 640px;
  margin: 0 auto;
  padding: 6px;
}

/* ===== 状态卡片（权限/未登录） ===== */
.dl-state-card {
  max-width: 640px;
  margin: 6px auto;
  padding: 6px;
  background: var(--dl-card-bg);
  border-radius: 16px;
  text-align: center;
}

.dl-state-card.is-denied .dl-state-icon {
  font-size: 44px;
  margin-bottom: 6px;
}

.dl-state-text {
  font-size: 16px;
  color: var(--dl-muted);
  margin-bottom: 6px;
  line-height: 1.6;
  word-break: break-all;
}

/* ===== 按钮 ===== */
.dl-btn-primary {
  min-height: 44px;
  padding: 6px 12px;
  border: none;
  border-radius: 10px;
  background: var(--dl-primary-grad);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.dl-btn-primary:disabled {
  opacity: 0.55;
  cursor: wait;
}

.dl-btn-ghost {
  min-height: 44px;
  padding: 6px 12px;
  border: 1px solid #ddd;
  border-radius: 10px;
  background: #fff;
  color: #555;
  font-size: 14px;
  cursor: pointer;
}

.dl-btn-danger {
  min-height: 44px;
  padding: 6px 12px;
  border: none;
  border-radius: 10px;
  background: var(--dl-danger);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.dl-btn-danger:disabled {
  opacity: 0.55;
  cursor: wait;
}

/* ===== 到期提醒 ===== */
.dl-reminder {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  background: #fff7e8;
  border: 1px solid #f3d9a4;
  border-radius: 14px;
  padding: 6px;
  margin-bottom: 6px;
}

.dl-reminder-icon {
  font-size: 22px;
  line-height: 1.2;
}

.dl-reminder-text {
  font-size: 14px;
  font-weight: 600;
  color: #b26a00;
  margin-bottom: 4px;
}

.dl-reminder-sub {
  font-size: 12px;
  font-weight: 500;
  color: #a5814a;
  line-height: 1.5;
}

/* ===== 当前套餐卡片 ===== */
.dl-now-card {
  background: var(--dl-primary-grad);
  border-radius: 16px;
  padding: 6px;
  color: #fff;
  margin-bottom: 6px;
}

.dl-now-label {
  font-size: 12px;
  font-weight: 500;
  opacity: 0.92;
  margin-bottom: 6px;
}

.dl-now-name {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 6px;
  word-break: break-all;
}

.dl-now-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.dl-now-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 12px;
  font-weight: 500;
}

/* ===== 区块 ===== */
.dl-section {
  background: var(--dl-card-bg);
  border-radius: 16px;
  padding: 6px;
  margin-bottom: 6px;
}

.dl-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--dl-text);
  margin-bottom: 6px;
}

.dl-section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.dl-section-row .dl-section-title {
  margin-bottom: 0;
}

.dl-filter {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--dl-muted);
}

.dl-select {
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  color: var(--dl-text);
}

/* ===== 套餐选择 ===== */
.dl-package-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.dl-package-card {
  border: 1px solid var(--dl-border);
  border-radius: 14px;
  padding: 6px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dl-package-card.is-current {
  border-color: var(--dl-primary);
  background: #f0fbf8;
}

.dl-package-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--dl-text);
  word-break: break-all;
}

.dl-package-desc {
  font-size: 16px;
  color: var(--dl-muted);
  line-height: 1.5;
  min-height: 36px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dl-package-price {
  font-size: 18px;
  font-weight: 800;
  color: var(--dl-danger);
}

.dl-package-duration {
  font-size: 12px;
  font-weight: 500;
  color: var(--dl-muted);
}

/* ===== 订单表格 ===== */
.dl-table-wrap {
  overflow-x: auto;
}

.dl-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
  min-width: 560px;
}

.dl-table th,
.dl-table td {
  padding: 10px 8px;
  text-align: left;
  border-bottom: 1px solid var(--dl-border);
  vertical-align: middle;
}

.dl-table th {
  font-size: 12px;
  font-weight: 500;
  color: var(--dl-muted);
  background: #fafbfc;
}

.dl-table td {
  color: var(--dl-text);
  word-break: break-all;
}

.dl-btn-sm {
  min-height: 32px;
  padding: 6px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fff;
  color: #555;
  font-size: 14px;
  cursor: pointer;
}

.dl-btn-sm.danger {
  border-color: var(--dl-danger);
  color: var(--dl-danger);
}

.dl-btn-sm:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 状态徽标 */
.dl-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.dl-badge.pending { background: #fef3e2; color: var(--dl-warn); }
.dl-badge.paid { background: #e8f8ef; color: var(--dl-success); }
.dl-badge.failed { background: #fdecea; color: var(--dl-danger); }
.dl-badge.cancelled { background: #eef1f4; color: #7f8c8d; }
.dl-badge.refunded { background: #eef1f4; color: #7f8c8d; }

/* ===== 加载/空/错误 ===== */
.dl-loading, .dl-empty {
  font-size: 16px;
  text-align: center;
  padding: 6px 0;
}

.dl-loading { color: var(--dl-muted); }
.dl-empty { color: #aaa; }

/* ===== 对话框 ===== */
.dl-dialog-mask {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* hidden 属性必须保持隐藏（覆盖上方 display:flex），打开对话框时才显示 */
.dl-dialog-mask[hidden],
.dl-dialog-error[hidden] {
  display: none;
}

.dl-dialog {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 16px;
  padding: 6px;
}

.dl-dialog-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
  gap: 6px;
}

.dl-dialog-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  min-width: 26px;
  height: 26px;
  min-height: 26px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  color: var(--dl-muted);
  cursor: pointer;
}

.dl-dialog-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  font-size: 18px;
  font-weight: 400;
  white-space: nowrap;
  color: var(--dl-text);
}

.dl-dialog-spacer {
  width: 26px;
  flex-shrink: 0;
}

.dl-dialog-text {
  font-size: 16px;
  color: #555;
  line-height: 1.6;
  margin-bottom: 6px;
  white-space: pre-line;
}

.dl-dialog-error {
  font-size: 12px;
  font-weight: 500;
  color: var(--dl-danger);
  line-height: 1.5;
  margin-bottom: 6px;
}

.dl-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 4px;
}

.dl-reason-input {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid #ddd;
  border-radius: 10px;
  font-size: 14px;
  color: var(--dl-text);
  margin-bottom: 6px;
}

@media (max-width: 380px) {
  .dl-package-grid {
    grid-template-columns: 1fr;
  }
  .dl-btn-primary {
    width: 100%;
  }
}

/* G-20 unified nav icon */
.nav-icon-img { width: 22px; height: 22px; display: block; }
.btn-back, .dpm-back, .r-back, .rm-back, .dl-btn-back, .preview-back, .dealer-forgot-back, .sf-image-trigger { display: flex; align-items: center; justify-content: center; }


/* dealer header title: never cover back button; wrap + half size when overflow */
.dl-header { min-height: 44px; height: auto; }
.dl-header-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  height: auto;
  gap: 6px;
  padding: 4px 0;
}
.dl-title {
  position: static !important;
  left: auto !important;
  transform: none !important;
  flex: 1;
  min-width: 0;
  max-width: calc(100% - 72px);
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
  text-align: center;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: unset !important;
  overflow-wrap: anywhere;
  word-break: break-word;
  z-index: 0;
}
.dl-title.is-compact { font-size: 9px !important; }
.dl-btn-back { position: relative; z-index: 2; flex-shrink: 0; }
.dl-btn-debug { margin-left: 8px; background: #fff7ed; border: 1px solid #f97316; color: #c2410c; }
