/* ============================================================
   通信+ 代理商产品中心 - 样式表
   ============================================================ */

:root {
  --primary: #1a73e8;
  --primary-dark: #1557b0;
  --success: #34a853;
  --warning: #fbbc04;
  --danger: #ea4335;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --bg-body: #f3f4f6;
  --bg-card: #ffffff;
  --border-color: #e5e7eb;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', sans-serif; background: var(--bg-body); color: var(--text-primary); line-height: 1.6; }
[v-cloak] { display: none; }

/* 水印层 */
#watermark-canvas {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  z-index: 9999; pointer-events: none;
}

/* ========== 登录页 ========== */
.login-container {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 20px;
}
.login-card {
  width: 100%; max-width: 420px; background: var(--bg-card); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.login-header {
  text-align: center; padding: 40px 30px 20px;
  background: linear-gradient(135deg, #1a73e8, #0d47a1);
  color: #fff;
}
.login-logo { font-size: 48px; margin-bottom: 10px; }
.login-logo-img { height: 40px; width: auto; object-fit: contain; margin-bottom: 20px; }
.login-header h1 { font-size: 28px; font-weight: 700; margin-bottom: 4px; }
.login-header p { opacity: 0.85; font-size: 14px; }
.login-form { padding: 30px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; color: var(--text-secondary); font-size: 14px; }
.form-group label i { width: 18px; }
.form-group input {
  width: 100%; padding: 12px 16px; border: 2px solid var(--border-color); border-radius: var(--radius-sm);
  font-size: 16px; transition: border-color 0.2s; outline: none;
}
.form-group input:focus { border-color: var(--primary); }
.form-hint { display: block; margin-top: 6px; color: var(--text-secondary); font-size: 12px; }
.error-msg { background: #fef2f2; color: var(--danger); padding: 10px 14px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 16px; }
.btn-login {
  width: 100%; padding: 14px; background: var(--primary); color: #fff; border: none; border-radius: var(--radius-sm);
  font-size: 16px; font-weight: 600; cursor: pointer; transition: background 0.2s;
}
.btn-login:hover { background: var(--primary-dark); }
.btn-login:disabled { opacity: 0.6; cursor: not-allowed; }
.login-footer { text-align: center; padding: 20px; color: var(--text-secondary); font-size: 13px; border-top: 1px solid var(--border-color); }

/* ========== 主界面布局 ========== */
.main-app { min-height: 100vh; display: flex; flex-direction: column; }

/* 顶部导航 */
.top-nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; height: 64px; background: #fff; box-shadow: var(--shadow-sm);
}
.nav-brand { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 700; font-size: 18px; color: var(--primary); }
.brand-icon { font-size: 24px; }
.brand-logo-img { height: 48px; width: auto; object-fit: contain; }
.nav-tabs { display: flex; gap: 4px; }
.nav-tabs a {
  padding: 8px 20px; border-radius: 20px; text-decoration: none; color: var(--text-secondary);
  font-weight: 500; font-size: 14px; transition: all 0.2s; cursor: pointer;
}
.nav-tabs a.active { background: var(--primary); color: #fff; }
.nav-tabs a:hover:not(.active) { background: #e8f0fe; color: var(--primary); }
.nav-user { display: flex; align-items: center; gap: 12px; }
.user-role-badge {
  padding: 4px 12px; border-radius: 12px; color: #fff; font-size: 12px; font-weight: 600;
}
.user-phone { color: var(--text-secondary); font-size: 13px; }
.btn-logout {
  background: none; border: 1px solid var(--border-color); border-radius: 50%; width: 32px; height: 32px;
  cursor: pointer; color: var(--text-secondary); transition: all 0.2s;
}
.btn-logout:hover { border-color: var(--danger); color: var(--danger); }

/* ========== 筛选栏（新设计：品牌Tab → 一级分类 → 二级分类 → 标签）========== */

/* 🔥 品牌Tab栏 — 最醒目的第一行 */
.brand-tabs-bar {
  background: #fff; padding: 14px 24px;
  border-bottom: 1px solid var(--border-color);
  position: sticky; top: 64px; z-index: 98;
}
.brand-tabs-label {
  font-size: 11px; color: #999; margin-bottom: 8px;
  text-transform: uppercase; letter-spacing: 1px; font-weight: 600;
}
.brand-tabs-row {
  display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none;
  -ms-overflow-style: none; padding-bottom: 2px;
}
.brand-tabs-row::-webkit-scrollbar { display: none; }
.brand-tab {
  flex-shrink: 0; padding: 10px 22px; border-radius: 24px;
  border: 2px solid var(--border-color); background: #fff;
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex; align-items: center; gap: 6px; color: var(--text-secondary);
  user-select: none; white-space: nowrap;
}
.brand-tab:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }
.brand-tab .brand-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.brand-tab.all-tab { border-style: dashed; }

/* 已选筛选条件状态条 */
.active-filters-bar {
  background: linear-gradient(135deg, #e8f4fd, #f0f7ff);
  padding: 8px 24px; display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--primary); border-bottom: 1px solid #d6ebff;
  flex-wrap: wrap;
}
.aff-label { font-weight: 600; color: var(--primary); }
.aff-tag {
  background: #fff; padding: 3px 10px; border-radius: 12px;
  font-size: 11px; color: var(--primary); border: 1px solid #b3d8ff;
  display: inline-flex; align-items: center; gap: 4px; cursor: pointer;
  transition: all 0.15s;
}
.aff-tag:hover { background: #e8f0fe; }
.aff-close { font-size: 10px; opacity: 0.6; }
.aff-clear-all {
  color: var(--danger); cursor: pointer; font-weight: 700;
  margin-left: auto; white-space: nowrap;
}
.aff-clear-all:hover { text-decoration: underline; }

/* 筛选行（通用）— 一级/二级/标签共用 */
.filter-section {
  background: #fff; padding: 10px 24px;
  border-bottom: 1px solid #f5f5f5;
}
.filter-label {
  font-size: 11px; color: #999; margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600;
}
.filter-scroll-row {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  -ms-overflow-style: none; padding-bottom: 2px;
}
.filter-scroll-row::-webkit-scrollbar { display: none; }
.filter-chip {
  flex-shrink: 0; padding: 6px 16px; border-radius: 16px;
  border: 1.5px solid var(--border-color); background: #fafafa;
  font-size: 13px; color: var(--text-secondary); cursor: pointer;
  transition: all 0.2s ease; white-space: nowrap; user-select: none;
}
.filter-chip:hover { border-color: var(--primary); color: var(--primary); background: #f0f7ff; transform: translateY(-1px); }
.filter-chip.active {
  background: var(--primary); color: #fff; border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(26,115,232,0.25);
}
.filter-chip.all-chip { border-style: dashed; }
.filter-chip.tag-chip.active { box-shadow: 0 2px 8px rgba(0,0,0,0.15); }

/* 搜索行 */
.search-section { padding: 10px 24px 14px; display: flex; gap: 8px; align-items: center; }
.search-input {
  flex: 1; padding: 10px 18px; border: 1.5px solid var(--border-color);
  border-radius: 20px; font-size: 14px; outline: none; transition: border-color 0.2s;
}
.search-input:focus { border-color: var(--primary); }
.btn-search {
  padding: 10px 18px; background: var(--primary); color: #fff; border: none;
  border-radius: 20px; cursor: pointer; transition: all 0.2s; flex-shrink: 0;
}
.btn-search:hover { background: var(--primary-dark); }

/* ========== 产品网格 ========== */
.products-page { padding: 24px; max-width: 1400px; margin: 0 auto; width: 100%; }
.products-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px; margin-top: 20px;
}

/* ========== 🔥 卡片视图 v3 — 背景叠加价格 ========== */
.product-card {
  background: #fff; border-radius: var(--radius-md); overflow: hidden;
  box-shadow: var(--shadow-sm); transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); cursor: pointer;
  position: relative; border-top: 4px solid #e74c3c;
}
.product-card:hover { transform: translateY(-6px); box-shadow: 0 16px 40px rgba(0,0,0,0.12); }

/* ====== 卡片视图 v4 — 背景区放名称+原价，body区放现价+交易信息 ====== */

/* Hero背景区 — 品牌 + 产品名称 + 原价划线 */
.card-hero-section {
  height: 120px; padding: 10px 14px 0;
  position: relative; overflow: hidden;
  display: flex; flex-direction: column;
}
.card-hero-section img.card-thumb-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0.12; transition: transform 0.4s ease;
  z-index: 1; pointer-events: none;
}
.product-card:hover .card-thumb-img { transform: scale(1.05); }
.img-placeholder-text {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 900; opacity: 0.06; color: #fff;
  z-index: 1; pointer-events: none;
}

/* 背景区顶行：品牌标签 + 角标 */
.hero-top-row {
  display: flex; justify-content: space-between; align-items: flex-start;
  position: relative; z-index: 3; margin-bottom: 6px;
}
.card-brand-tag {
  padding: 3px 10px; border-radius: 6px; color: #fff; font-size: 11px; font-weight: 700;
  letter-spacing: 0.5px; backdrop-filter: blur(8px);
}
.card-corner-tags {
  display: flex; gap: 4px;
}

/* 🔥 产品名称 — 在背景区白色大字 */
.hero-product-name {
  position: relative; z-index: 3;
  font-size: 16px; font-weight: 800; color: #fff;
  line-height: 1.25; margin: auto 0 24px 0;
  text-shadow: 0 2px 8px rgba(0,0,0,0.2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* 底部产品名称 — 白色大字 */
.hero-package-name {
  position: absolute; bottom: 8px; left: 14px; right: 14px;
  z-index: 5;
  color: #fff; font-size: 15px;
  font-weight: 800; letter-spacing: 0.3px;
  text-shadow: 0 2px 6px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ====== Body区：现价 + 标签 + 佣金 + 按钮 ====== */
.card-body { padding: 12px 14px 14px; }

/* 现价 — 醒目红色 */
.card-deal-price {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 10px;
}
.deal-price-value {
  font-size: 23px; font-weight: 900; color: #dc2626;
  letter-spacing: -0.5px;
}
.deal-save-badge {
  background: linear-gradient(135deg, #dcfce7, #bbf7d0);
  color: #15803d; font-size: 11px; font-weight: 700;
  padding: 3px 9px; border-radius: 10px;
  white-space: nowrap;
}

/* 标签行 */
.card-tags { margin-bottom: 8px; display: flex; flex-wrap: wrap; gap: 4px; }
.tag { display: inline-block; padding: 2px 8px; background: #f0f9ff; color: #0369a1; border-radius: 6px; font-size: 11px; font-weight: 600; }
.pkg-tag { background: linear-gradient(135deg, #fdf4ff, #fae8ff); color: #c026d3; }

/* 佣金 */
.card-commission-row {
  font-size: 12px; color: #9ca3af;
  display: flex; align-items: center; gap: 4px; margin-bottom: 10px;
  padding: 4px 10px; background: #f9fafb; border-radius: 8px;
}
.card-commission-row small { font-size: 10px; opacity: 0.7; }
.card-commission-row strong { color: #16a34a; font-weight: 700; }

/* 操作按钮 */
.card-actions { display: flex; gap: 10px; align-items: center; }
.btn-detail-primary {
  flex: 1; padding: 10px 16px; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); 
  color: #fff; border: none; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all 0.25s ease; display: flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-detail-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(26,115,232,0.35); }
.btn-detail-primary:active { transform: translateY(0); }
.btn-copy-icon {
  width: 42px; height: 42px; background: #f0fdf4; color: var(--success); border: none;
  border-radius: 10px; cursor: pointer; font-size: 16px; transition: all 0.25s ease;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.btn-copy-icon:hover { background: #dcfce7; transform: scale(1.08); }

/* 锁定卡片 */
.product-card.locked { opacity: 0.6; cursor: not-allowed; }
.product-card.locked:hover { transform: none; box-shadow: var(--shadow-sm); }
.card-locked-content { text-align: center; padding: 16px 0 0; color: var(--text-secondary); }
.card-locked-content i { font-size: 28px; color: var(--text-secondary); margin-bottom: 6px; display: block; }
.card-locked-content p { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.card-locked-content small { font-size: 11px; }
/* 产品卡片 - 更新时间 */
.card-update-time {
  text-align: center;
  font-size: 11px;
  color: var(--text-secondary, #9ca3af);
  padding: 6px 0 2px;
  border-top: 1px solid rgba(128,128,128,0.08);
  margin-top: 8px;
}
.card-update-time i { margin-right: 3px; }


/* 分页 */
.pagination { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 30px; padding-bottom: 20px; }
.pagination button {
  padding: 8px 18px; border: 1px solid var(--border-color); border-radius: 6px;
  background: #fff; cursor: pointer; font-size: 14px; transition: all 0.2s;
}
.pagination button:hover:not(:disabled) { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }

/* 空状态 / 加载 */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-secondary); }
.empty-state i { font-size: 56px; opacity: 0.3; margin-bottom: 16px; }
.empty-state p { font-size: 16px; margin-bottom: 16px; }
.empty-state button {
  padding: 10px 24px; background: var(--primary); color: #fff; border: none; border-radius: 6px; cursor: pointer;
}
.loading-state { text-align: center; padding: 40px; color: var(--text-secondary); }
.spinner {
  width: 36px; height: 36px; border: 3px solid var(--border-color); border-top-color: var(--primary);
  border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ========== 我的政策页 ========== */
.commission-page { padding: 24px; max-width: 1100px; margin: 0 auto; width: 100%; }
.role-card {
  background: #fff; border-radius: var(--radius-md); padding: 24px; margin-bottom: 24px;
  box-shadow: var(--shadow-sm); border-left: 5px solid;
}
.role-card h2 { font-size: 20px; margin-bottom: 16px; }
.role-stats { display: flex; gap: 24px; }
.stat-item { text-align: center; }
.stat-item strong { display: block; font-size: 26px; color: var(--text-primary); }
.stat-item span { font-size: 13px; color: var(--text-secondary); }
.stat-item.highlight strong { color: var(--success); }

.section { margin-bottom: 28px; }
.section-title { font-size: 17px; font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.brand-dot-lg { width: 14px; height: 14px; border-radius: 50%; display: inline-block; }

.commission-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow-sm); }
.commission-table th, .commission-table td { padding: 12px 16px; text-align: left; font-size: 14px; border-bottom: 1px solid var(--border-color); }
.commission-table th { background: #f9fafb; font-weight: 600; color: var(--text-secondary); font-size: 13px; }
.commission-table tbody tr:hover { background: #f9fafb; }
.commission-cell { color: var(--success); font-weight: 700; }

/* 收入预估 */
.income-estimate-section { margin-top: 28px; }
.income-estimate-section h3 { font-size: 17px; margin-bottom: 16px; }
.estimate-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.estimate-card {
  background: #fff; border-radius: var(--radius-md); padding: 20px; text-align: center;
  box-shadow: var(--shadow-sm); border-top: 4px solid;
}
.estimate-card.conservative { border-top-color: #94a3b8; }
.estimate-card.normal { border-top-color: var(--primary); }
.estimate-card.optimistic { border-top-color: var(--success); }
.estimate-card h4 { font-size: 14px; color: var(--text-secondary); margin-bottom: 8px; }
.estimate-card .orders { font-size: 13px; color: var(--text-secondary); margin-bottom: 4px; }
.estimate-card .amount { font-size: 28px; font-weight: 800; }
.estimate-card.conservative .amount { color: #64748b; }
.estimate-card.normal .amount { color: var(--primary); }
.estimate-card.optimistic .amount { color: var(--success); }

/* ========== 产品详情页 ========== */
.detail-page { padding: 24px; max-width: 900px; margin: 0 auto; width: 100%; }
.btn-back {
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 20px;
  background: #fff; border: 1px solid var(--border-color); border-radius: 8px;
  cursor: pointer; font-size: 14px; color: var(--text-secondary); margin-bottom: 20px; transition: all 0.2s;
}
.btn-back:hover { border-color: var(--primary); color: var(--primary); }

.detail-hero {
  border-radius: var(--radius-lg); padding: 40px; color: #fff; text-align: center;
  margin-bottom: 24px; position: relative; overflow: hidden;
}
.hero-brand {
  display: inline-block; padding: 4px 14px; background: rgba(255,255,255,0.25);
  border-radius: 20px; font-size: 13px; font-weight: 700; margin-bottom: 12px;
}
.detail-hero h1 { font-size: 28px; font-weight: 800; margin-bottom: 8px; }
.hero-price { font-size: 36px; font-weight: 900; margin-bottom: 12px; }
.hero-commission {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 20px;
  background: rgba(255,255,255,0.2); border-radius: 20px; font-size: 15px; font-weight: 600;
}

/* 🆕 Hero区 - slogan */
.hero-slogan { font-size: 14.5px; opacity: 0.92; margin-bottom: 10px; line-height: 1.4; }

/* 🆕 Hero区 - 价格块（原价+现价） */
.hero-price-block { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.price-original { font-size: 14px; opacity: 0.65; text-decoration: line-through; }
.price-current { font-size: 38px; font-weight: 900; }

/* 🆕 标签行（详情页） */
.tag-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed #eee; }
.tag-pill.portal-tag-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 11px; border-radius: 14px; font-size: 11.5px; font-weight: 500;
  border: 1px solid #e5e7eb;
}

/* 🆕 ⚠️ 注意事项 */
.notice-box {
  background: linear-gradient(135deg,#fef2f2,#fff1f2);
  border: 1px solid #fecaca; border-radius: 12px; overflow: hidden;
}
.notice-box .notice-header {
  background: #fecaca; padding: 9px 16px; font-size: 13px; font-weight: 700;
  color: #991b1b; display: flex; align-items: center; gap: 6px;
}
.notice-box .notice-list { list-style: none; padding: 12px 16px; margin: 0; }
.notice-box .notice-list li {
  padding: 7px 0 7px 24px; position: relative; font-size: 13px;
  color: #7f1d1d; line-height: 1.6; border-bottom: 1px dashed #fecdd3;
}
.notice-box .notice-list li:last-child { border-bottom: none; }
.notice-box .notice-list li::before {
  content: '!'; position: absolute; left: 4px; top: 7px;
  width: 16px; height: 16px; background: #ef4444; color: #fff;
  border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 10px; font-weight: bold;
}

.detail-content { background: #fff; border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow-sm); }
.detail-section { margin-bottom: 28px; padding-bottom: 28px; border-bottom: 1px solid var(--border-color); }
.detail-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.detail-section h3 { font-size: 17px; font-weight: 700; margin-bottom: 14px; color: var(--text-primary); }
.detail-section h3 i { color: var(--primary); margin-right: 6px; }

.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.info-item { display: flex; justify-content: space-between; padding: 10px 14px; background: #f9fafb; border-radius: 8px; }
.info-item .label { color: var(--text-secondary); font-size: 13px; }
.info-item .value { font-weight: 600; font-size: 14px; }
.price-highlight { color: var(--primary); font-size: 16px !important; }
.commission-highlight { color: var(--success); }

.description { color: var(--text-secondary); line-height: 1.8; font-size: 15px; }
.extra-gifts-text { color: #b45309; line-height: 1.8; font-size: 15px; background: #fffbeb; padding: 12px 16px; border-radius: 8px; border-left: 3px solid #f59e0b; }
.features-list { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.features-list li { padding: 10px 14px; background: #f0fdf4; border-radius: 8px; font-size: 14px; color: #166534; }
.features-list li::before { content: '✅ '; margin-right: 4px; }

.promo-section { text-align: center; }
.btn-promo-primary {
  display: inline-flex; align-items: center; gap: 8px; padding: 14px 32px;
  background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; border: none;
  border-radius: 30px; font-size: 16px; font-weight: 700; cursor: pointer; transition: transform 0.2s;
}
.btn-promo-primary:hover { transform: scale(1.04); }

.faq-section .faq-item { margin-bottom: 16px; }
.faq-section h4 { font-size: 15px; font-weight: 600; margin-bottom: 6px; color: var(--text-primary); }
.faq-section p { color: var(--text-secondary); font-size: 14px; padding-left: 12px; border-left: 3px solid var(--primary); }

/* ========== 推广文案弹窗 ========== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 2000;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-content {
  background: #fff; border-radius: var(--radius-lg); width: 100%; max-width: 580px;
  max-height: 90vh; overflow-y: auto; box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 24px; border-bottom: 1px solid var(--border-color);
}
.modal-header h3 { font-size: 17px; font-weight: 700; }
.modal-close {
  background: none; border: none; font-size: 28px; cursor: pointer; color: var(--text-secondary);
  line-height: 1;
}
.modal-body { padding: 24px; }
.promo-type-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.promo-type-tabs button {
  flex: 1; padding: 10px; border: 1px solid var(--border-color); border-radius: 8px;
  background: #fff; cursor: pointer; font-size: 14px; transition: all 0.2s;
}
.promo-type-tabs button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.promo-output textarea {
  width: 100%; min-height: 160px; padding: 16px; border: 1px solid var(--border-color); border-radius: 8px;
  font-size: 14px; line-height: 1.7; resize: vertical; font-family: inherit;
}
.promo-actions { text-align: center; margin-top: 16px; }
.btn-copy-promo {
  padding: 12px 36px; background: var(--success); color: #fff; border: none; border-radius: 8px;
  font-size: 15px; font-weight: 600; cursor: pointer; transition: all 0.2s;
}
.btn-copy-promo:hover { background: #22c55e; transform: scale(1.02); }

/* ========== 🆕 标签筛选 ========== */
.tag-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tag-filter-btn {
  padding: 5px 14px; border: 1px solid var(--border-color); border-radius: 20px;
  background: #fff; cursor: pointer; font-size: 13px; transition: all 0.2s;
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
}
.tag-filter-btn:hover { box-shadow: var(--shadow-sm); }
.tag-filter-btn.active { color: #fff !important; }
.tag-filter-btn .tag-dot {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block;
}

/* ========== 🆕 产品卡片增强 ========== */
/* 卡片角标（右上角） */
.card-corner-tags {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  display: flex; flex-direction: column; gap: 4px; align-items: flex-end;
}
.corner-tag {
  padding: 2px 10px; border-radius: 4px 0 4px 0; font-size: 11px; font-weight: 600;
  color: #fff; line-height: 1.6;
}

/* 一句话卖点 */
.card-slogan {
  font-size: 13px; color: var(--text-secondary); margin-top: -4px; margin-bottom: 6px;
  line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Portal标签（卡片内） */
.portal-tag {
  font-size: 11px; padding: 1px 8px; border-radius: 10px; border: 1px solid;
  white-space: nowrap; font-weight: 500;
}

/* 佣金为零时的样式 */
.commission-zero {
  color: var(--text-secondary) !important; font-size: 12px;
}
.commission-inline small { font-size: 11px; opacity: 0.85; }

/* ========== 响应式 - 移动端适配 ========== */

/* --- 通用：汉堡按钮 --- */
.nav-left { display: flex; align-items: center; gap: 10px; }
.hamburger {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 36px; height: 36px; background: none; border: none;
  cursor: pointer; padding: 6px; border-radius: 8px; transition: background 0.2s;
}
.hamburger span {
  display: block; width: 22px; height: 2px; background: var(--text-primary);
  border-radius: 2px; transition: all 0.3s ease;
}
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* --- 移动端下拉菜单 --- */
.mobile-menu-overlay { display: none; }
.mobile-menu { display: none; }

/* --- 断点1：平板及以下 (<768px) --- */
@media (max-width: 768px) {

  /* 导航栏 */
  .top-nav { padding: 0 12px; height: 56px; }
  .hamburger { display: flex; }
  .nav-tabs { display: none; }          /* 隐藏桌面菜单 */
  .nav-user .user-phone { display: none; }
  .brand-logo-img { height: 36px; }

  /* 移动端遮罩 - 从导航栏下方开始 */
  .mobile-menu-overlay {
    display: block; position: fixed; top: 56px; left: 0; right: 0; bottom: 0; z-index: 198;
    background: rgba(0,0,0,0.3); animation: fadeIn 0.2s ease;
  }
  @keyframes fadeIn { from{opacity:0} to{opacity:1} }

  /* 移动端菜单面板 */
  .mobile-menu {
    display: flex; flex-direction: column;
    position: fixed; top: 56px; left: 0; right: 0; z-index: 199;
    background: #fff; box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    transform: translateY(-100%); opacity: 0;
    transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    padding-bottom: env(safe-area-inset-bottom, 12px);
  }
  .mobile-menu.open { transform: translateY(0); opacity: 1; }
  .mobile-menu a {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 20px; font-size: 15px; font-weight: 500;
    color: var(--text-primary); text-decoration: none;
    border-bottom: 1px solid #f0f0f0; transition: background 0.15s;
  }
  .mobile-menu a:active { background: #f5f5f5; }
  .mobile-menu a.active { color: var(--primary); font-weight: 700; background: #eef4ff; }
  .mobile-menu-divider { height: 1px; background: var(--border-color); margin: 4px 0; }
  .mobile-menu-user {
    display: flex; align-items: center; gap: 10px; padding: 12px 20px;
    font-size: 13px; color: var(--text-secondary);
  }
  .mobile-logout {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 20px; font-size: 15px; color: var(--danger) !important;
    text-decoration: none; cursor: pointer; border: none; background: none;
  }

  /* ===== Phase 2: 筛选栏 → 品牌Tab + 横向滚动 ===== */
  .brand-tabs-bar { padding: 10px 12px; top: 56px; }
  .brand-tabs-label { font-size: 10px; margin-bottom: 6px; }
  .brand-tab { padding: 8px 18px; font-size: 13px; border-radius: 20px; }

  /* 已选条件条 */
  .active-filters-bar { padding: 6px 12px; font-size: 11px; gap: 4px; }
  .aff-tag { padding: 2px 8px; font-size: 10px; }

  /* 筛选行 */
  .filter-section { padding: 8px 12px; }
  .filter-label { font-size: 10px; margin-bottom: 4px; }
  .filter-chip { padding: 5px 13px; font-size: 12px; border-radius: 14px; }

  /* 搜索 */
  .search-section { padding: 8px 12px 12px; }
  .search-input { font-size: 15px; padding: 9px 14px; }  /* iOS防缩放 */
  .btn-search { padding: 9px 14px; font-size: 14px; }

  /* ===== 产品网格 ===== */
  .products-page { padding: 12px; }
  .products-grid { grid-template-columns: 1fr; gap: 14px; margin-top: 14px; }
  .card-hero-section { height: 100px; padding: 8px 10px 0; }
  .card-body { padding: 12px 14px 14px; }
  .hero-product-name { font-size: 14px; margin-bottom: 18px; }
  .deal-price-value { font-size: 20px; }
  .hero-package-name { font-size: 13px; bottom: 6px; }
  .btn-detail-primary { padding: 9px 14px; font-size: 13px; }
  .btn-copy-icon { width: 38px; height: 38px; font-size: 14px; }

  /* ===== Phase 3: 我的政策页 ===== */
  .commission-page { padding: 14px; max-width: 100%; }
  .role-card { padding: 16px; margin-bottom: 16px; }
  .role-card h2 { font-size: 17px; }
  .role-stats { flex-direction: column; gap: 14px; }
  .stat-item strong { font-size: 22px; }

  /* 表格 → 横向滚动 */
  .commission-table-wrapper {
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    margin: 0 -14px; padding: 0 14px;
  }
  .commission-table { min-width: 480px; }
  .commission-table th, .commission-table td { padding: 10px 12px; font-size: 13px; }

  /* 收入预估 → 单列 */
  .estimate-cards { grid-template-columns: 1fr; gap: 12px; }
  .estimate-card { padding: 16px; }
  .estimate-card .amount { font-size: 24px; }

  .section { margin-bottom: 20px; }
  .section-title { font-size: 15px; }

  /* ===== Phase 4: 详情页 ===== */
  .detail-page { padding: 14px; max-width: 100%; }
  .btn-back { padding: 8px 14px; font-size: 13px; margin-bottom: 14px; }
  .detail-hero { padding: 24px 18px; margin-bottom: 14px; }
  .detail-hero h1 { font-size: 22px; }
  .hero-price { font-size: 26px; }
  .hero-commission { font-size: 13px; padding: 6px 14px; }
  .hero-slogan { font-size: 13px; }
  .price-current { font-size: 30px; }
  .price-original { font-size: 13px; }
  .tag-row { gap: 5px; margin-top: 10px; padding-top: 10px; }
  .notice-box .notice-header { padding: 7px 12px; font-size: 12px; }
  .notice-box .notice-list { padding: 10px 12px; }
  .notice-box .notice-list li { font-size: 12px; padding-left: 20px; }
  .detail-content { padding: 18px; box-shadow: var(--shadow-sm); }
  .detail-section { margin-bottom: 20px; padding-bottom: 20px; }
  .detail-section h3 { font-size: 15px; margin-bottom: 10px; }
  .info-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .info-item { padding: 8px 10px; flex-direction: column; gap: 2px; }
  .info-item .label { font-size: 12px; }
  .info-item .value { font-size: 13px; }
  .description { font-size: 14px; line-height: 1.7; }
  .features-list { grid-template-columns: 1fr; }
  .features-list li { font-size: 13px; padding: 8px 12px; }
  .btn-promo-primary { padding: 12px 24px; font-size: 14px; }
  .faq-section h4 { font-size: 14px; }
  .faq-section p { font-size: 13px; }

  /* ===== Phase 5: 推广弹窗 → 全屏 ===== */
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal-content {
    max-width: 100%; max-height: 85vh; border-radius: 20px 20px 0 0;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }
  @keyframes slideUp { from{transform:translateY(100%)} to{transform:translateY(0)} }
  .modal-header { padding: 16px 18px; }
  .modal-header h3 { font-size: 15px; }
  .modal-close { font-size: 24px; }
  .modal-body { padding: 16px 18px; }
  .promo-type-tabs { gap: 6px; margin-bottom: 12px; }
  .promo-type-tabs button { padding: 8px; font-size: 13px; }
  .promo-output textarea { min-height: 130px; padding: 12px; font-size: 14px; }
  .btn-copy-promo { padding: 10px 28px; font-size: 14px; }

  /* ===== Phase 6: 登录页 ===== */
  .login-container { padding: 0; }
  .login-card { max-width: 100%; border-radius: 0; min-height: 100vh; box-shadow: none; }
  .login-header { padding: 32px 20px 18px; }
  .login-logo-img { height: 44px; margin-bottom: 16px; }
  .login-header p { font-size: 13px; }
  .login-form { padding: 24px 20px; }
  .form-group { margin-bottom: 16px; }
  .form-group label { font-size: 13px; }
  .form-group input { padding: 12px 14px; font-size: 16px; }  /* iOS防缩放 */
  .btn-login { padding: 13px; font-size: 16px; }
  .login-footer { padding: 16px; font-size: 12px; }

  /* 分页 */
  .pagination { margin-top: 20px; gap: 12px; padding-bottom: 16px; }
  .pagination button { padding: 7px 14px; font-size: 13px; }

  /* 空状态 / 加载 */
  .empty-state { padding: 40px 16px; }
  .empty-state i { font-size: 44px; }
  .empty-state p { font-size: 14px; }
  .loading-state { padding: 30px; }
}

/* --- 断点2：小屏手机 (<480px) --- */
@media (max-width: 480px) {
  .top-nav { padding: 0 8px; height: 52px; }
  .hamburger { width: 32px; height: 32px; }
  .brand-logo-img { height: 32px; }
  .brand-tabs-bar { padding: 8px 8px; }
  .filter-section { padding: 6px 8px; }
  .active-filters-bar { padding: 5px 8px; }
  .products-page { padding: 10px 8px; }
  .products-grid { gap: 10px; }
  .card-hero-section { height: 92px; padding: 8px 10px 0; }
  .card-body { padding: 10px 12px 12px; }
  .hero-product-name { font-size: 13px; margin-bottom: 16px; }
  .deal-price-value { font-size: 19px; }
  .hero-package-name { font-size: 12px; bottom: 5px; }
  .detail-hero { padding: 20px 14px; }
  .detail-hero h1 { font-size: 20px; }
  .hero-price { font-size: 24px; }
  .price-current { font-size: 26px; }
  .price-original { font-size: 12px; }
  .info-grid { grid-template-columns: 1fr; }
  .commission-page { padding: 10px 8px; }
  .modal-header h3 { font-size: 14px; }
}

/* ============================================================
   📢 公告按钮 & 滑出面板（列表+展开详情版）
   ============================================================ */

.nav-announcement-btn {
  position: relative;
  background: none;
  border: none;
  color: #666;
  font-size: 18px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  transition: all 0.2s;
  margin-right: 4px;
}
.nav-announcement-btn:hover { background: #f0f0f0; color: var(--primary); }
.nav-announcement-btn.active { background: #e8f0fe; color: var(--primary); }

.nav-announcement-badge {
  position: absolute;
  top: 2px; right: 2px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  min-width: 16px; height: 16px;
  line-height: 16px;
  text-align: center;
  border-radius: 8px;
  padding: 0 4px;
  font-weight: 600;
}

/* 移动端菜单公告 */
.mobile-menu-announcement {
  display: flex; align-items: center;
  padding: 14px 20px; color: #444; font-size: 15px; position: relative;
}
.mobile-menu-announcement:hover, .mobile-menu-announcement:active { background: #f5f5f5; color: var(--primary); }
.menu-badge {
  background: var(--danger); color: #fff;
  font-size: 11px; padding: 1px 6px; border-radius: 10px; margin-left: 8px;
}

/* 遮罩 */
.announcement-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.3); z-index: 998;
}

/* 面板 */
.announcement-panel {
  position: fixed; top: 0; right: -380px;
  width: 380px; max-width: 90vw;
  height: 100vh;
  background: #fff; z-index: 999;
  box-shadow: -4px 0 20px rgba(0,0,0,0.12);
  transition: right 0.3s ease;
  display: flex; flex-direction: column;
}
.announcement-panel.open { right: 0; }

.announcement-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid #eee;
  background: #fafafa; flex-shrink: 0;
}
.announcement-panel-header h3 {
  margin: 0; font-size: 16px; color: #333;
}
.panel-close-btn {
  background: none; border: none; font-size: 18px;
  color: #999; cursor: pointer; padding: 4px 8px; border-radius: 6px;
}
.panel-close-btn:hover { background: #e0e0e0; color: #333; }

.announcement-panel-body {
  flex: 1; overflow-y: auto; padding: 8px 12px;
}

/* ========== 列表项 ========== */
.ann-list-item {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 10px;
  margin-bottom: 8px;
  transition: all 0.2s;
  cursor: pointer;
  overflow: hidden;
}
.ann-list-item:hover { border-color: #ddd; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.ann-list-item.pinned { border-left: 3px solid var(--danger); }
.ann-list-item.read { opacity: 0.7; }
.ann-list-item.expanded { border-color: var(--primary); box-shadow: 0 2px 8px rgba(59,130,246,0.1); }

.ann-list-row {
  display: flex; align-items: center; gap: 6px;
  padding: 12px 14px; min-height: 48px;
}

/* 未读红点 */
.ann-unread-dot {
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  flex-shrink: 0;
  animation: ann-pulse 2s infinite;
}
@keyframes ann-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.15); }
}

/* 类型标签 */
.ann-type-badge {
  font-size: 11px; padding: 2px 7px; border-radius: 4px; font-weight: 500; flex-shrink: 0;
}
.ann-type-badge.policy   { background: #fee2e2; color: #dc2626; }
.ann-type-badge.notice   { background: #dbeafe; color: #2563eb; }
.ann-type-badge.maintenance { background: #fef3c7; color: #d97706; }
.ann-type-badge.other    { background: #f3f4f6; color: #6b7280; }

/* 置顶图标 */
.ann-pin-icon { color: var(--danger); font-size: 10px; flex-shrink: 0; }

/* 标题 */
.ann-list-title {
  flex: 1;
  font-size: 14px; font-weight: 500; color: #333;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0;
}
.ann-list-item.read .ann-list-title { color: #888; font-weight: 400; }

/* 时间 */
.ann-list-time {
  font-size: 11px; color: #bbb; flex-shrink: 0;
}

/* 展开箭头 */
.ann-expand-icon {
  font-size: 10px; color: #ccc; flex-shrink: 0;
  transition: transform 0.25s ease;
}
.ann-expand-icon.rotated { transform: rotate(90deg); color: var(--primary); }

/* ========== 展开详情 ========== */
.ann-detail {
  border-top: 1px solid #f0f0f0;
  background: #fafbfc;
}
.ann-detail-content {
  padding: 14px 16px 8px;
  font-size: 13.5px; color: #444; line-height: 1.75;
}
.ann-detail-content p { margin: 4px 0; }
.ann-detail-content ul { padding-left: 18px; margin: 4px 0; }
.ann-detail-content li { margin: 2px 0; }

.ann-detail-actions {
  display: flex; justify-content: flex-end;
  padding: 8px 16px 14px;
}

.ann-read-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 16px;
  background: var(--primary); color: #fff;
  border: none; border-radius: 6px;
  font-size: 13px; cursor: pointer;
  transition: all 0.2s;
}
.ann-read-btn:hover { background: #2563eb; transform: translateY(-1px); }
.ann-read-btn:active { transform: translateY(0); }

.ann-read-status {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; color: #22c55e; font-weight: 500;
}

/* 展开动画 */
.ann-slide-enter-active { animation: ann-slide-down 0.25s ease; }
.ann-slide-leave-active { animation: ann-slide-up 0.2s ease; }
@keyframes ann-slide-down {
  from { opacity: 0; max-height: 0; } to { opacity: 1; max-height: 500px; }
}
@keyframes ann-slide-up {
  from { opacity: 1; max-height: 500px; } to { opacity: 0; max-height: 0; }
}

/* 空状态 */
.announcement-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 200px; color: #bbb;
}
.announcement-empty i { font-size: 40px; margin-bottom: 12px; }
.announcement-empty p { margin: 0; font-size: 14px; }
