/* ============================================================
   通信+ 代理商产品中心 - 样式表
   ============================================================ */

: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-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; }
.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); }

/* ========== 筛选栏 ========== */
.filter-bar {
  background: #fff; padding: 20px 24px; border-bottom: 1px solid var(--border-color);
}
.filter-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.filter-row:last-child { margin-bottom: 0; }
.filter-label { font-weight: 600; color: var(--text-secondary); font-size: 14px; white-space: nowrap; }

/* 品牌筛选按钮 */
.brand-btn {
  display: inline-flex; align-items: center; gap: 4px; padding: 6px 14px;
  border: 2px solid; border-radius: 20px; background: transparent; cursor: pointer;
  font-size: 13px; font-weight: 600; transition: all 0.2s;
}
.brand-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* 套餐筛选按钮 */
.pkg-btn {
  padding: 6px 14px; border: 1px solid var(--border-color); border-radius: 20px;
  background: #fff; cursor: pointer; font-size: 13px; transition: all 0.2s;
}
.pkg-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pkg-icon { font-size: 12px; }

/* 搜索 */
.search-row { margin-top: 8px; }
.search-row input {
  flex: 1; padding: 10px 16px; border: 1px solid var(--border-color); border-radius: 20px;
  font-size: 14px; outline: none;
}
.search-row input:focus { border-color: var(--primary); }
.btn-search {
  padding: 10px 18px; background: var(--primary); color: #fff; border: none; border-radius: 50%;
  cursor: pointer; margin-left: -44px; position: relative;
}

/* 筛选提示 */
.filter-hint { font-size: 12px; color: var(--text-secondary); font-style: italic; }

/* ========== 产品网格 ========== */
.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;
}

.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); }
.card-brand-tag {
  position: absolute; top: 14px; left: 14px; z-index: 2;
  padding: 4px 12px; border-radius: 8px; color: #fff; font-size: 11px; font-weight: 700;
  letter-spacing: 0.5px; backdrop-filter: blur(8px);
}
.card-img {
  height: 150px; display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.product-card:hover .card-img img { transform: scale(1.05); }
.img-placeholder-text {
  font-size: 56px; font-weight: 900; opacity: 0.2; color: #fff;
  text-shadow: 0 2px 10px rgba(0,0,0,0.15);
}
.card-body { padding: 18px 20px 20px; }
.card-title { 
  font-size: 16px; font-weight: 700; margin-bottom: 8px; line-height: 1.4; 
  color: var(--text-primary); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-tags { margin-bottom: 12px; }
.tag { display: inline-block; padding: 3px 10px; background: #f0f9ff; color: #0369a1; border-radius: 6px; font-size: 11px; font-weight: 600; }
.pkg-tag { background: linear-gradient(135deg, #fdf4ff, #fae8ff); color: #c026d3; }

/* 价格区块 — 绝对主角 */
.card-price-block {
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  border-radius: 10px; padding: 14px 16px; margin-bottom: 14px;
  display: flex; flex-direction: column; gap: 6px;
}
.price-big { 
  font-size: 26px; font-weight: 900; color: var(--primary); 
  letter-spacing: -0.5px; line-height: 1.1;
}
.commission-inline { 
  font-size: 13px; font-weight: 600; color: var(--success); 
  display: flex; align-items: center; gap: 4px;
}
.commission-inline i { font-size: 11px; }

/* 操作按钮 — 主按钮满宽 + 复制图标按钮 */
.card-actions { display: flex; gap: 10px; align-items: center; }
.btn-detail-primary {
  flex: 1; padding: 11px 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: 20px 0 0; color: var(--text-secondary); }
.card-locked-content i { font-size: 32px; color: var(--text-secondary); margin-bottom: 8px; display: block; }
.card-locked-content p { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.card-locked-content small { font-size: 11px; }

/* 分页 */
.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;
}

.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; }
.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; }

/* ========== 响应式 ========== */
@media (max-width: 768px) {
  .top-nav { padding: 0 12px; height: 56px; }
  .nav-brand .brand-text { display: none; }
  .nav-tabs a { padding: 6px 12px; font-size: 13px; }
  .nav-user .user-phone { display: none; }
  .products-grid { grid-template-columns: 1fr; }
  .filter-row { gap: 6px; }
  .brand-btn, .pkg-btn, .tag-filter-btn { padding: 5px 10px; font-size: 12px; }
  .role-stats { flex-direction: column; gap: 12px; }
  .estimate-cards { grid-template-columns: 1fr; }
  .detail-hero { padding: 28px 16px; }
  .detail-hero h1 { font-size: 22px; }
  .hero-price { font-size: 28px; }
  .info-grid { grid-template-columns: 1fr 1fr; }
  .features-list { grid-template-columns: 1fr; }
}
