/* ═════════════════════════════════════════════════════════════════════════════
   懒人编辑器 - 个人中心样式
   ═════════════════════════════════════════════════════════════════════════════ */

:root {
  --primary: #07c160;
  --primary-dark: #06ad56;
  --primary-light: #e8f5e9;
  --secondary: #1a1a2e;
  --accent: #6366f1;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --border-color: #e2e8f0;
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --transition-fast: all 0.15s ease;
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text-primary);
  line-height: 1.6;
  background: var(--bg-secondary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ═════════════════════════════════════════════════════════════════════════════
   导航栏
   ═════════════════════════════════════════════════════════════════════════════ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 700;
}

.logo-icon {
  font-size: 24px;
}

.logo-text {
  color: var(--text-primary);
}

.nav-links {
  display: flex;
  gap: 32px;
}

.nav-link {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition-fast);
  padding: 8px 0;
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
  border-radius: 1px;
}

/* 用户菜单 */
.user-menu {
  position: relative;
}

.user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
}

.user-btn:hover {
  background: var(--bg-tertiary);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
}

.dropdown-arrow {
  font-size: 10px;
  color: var(--text-muted);
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: var(--transition-fast);
  overflow: hidden;
}

.user-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-dropdown a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.user-dropdown a:hover {
  background: var(--bg-tertiary);
  color: var(--primary);
}

.dropdown-divider {
  height: 1px;
  background: var(--border-color);
  margin: 4px 0;
}

/* ═════════════════════════════════════════════════════════════════════════════
   主内容
   ═════════════════════════════════════════════════════════════════════════════ */
.profile-main {
  flex: 1;
  padding: 32px 24px;
}

.profile-container {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
}

/* ═════════════════════════════════════════════════════════════════════════════
   左侧栏
   ═════════════════════════════════════════════════════════════════════════════ */
.profile-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.user-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.user-card-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #34d399);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  margin: 0 auto 12px;
}

.user-card-name {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.user-card-email {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.user-card-stats {
  display: flex;
  gap: 4px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.user-card-stats .stat {
  flex: 1;
  text-align: center;
}

.stat-num {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
}

/* 侧边导航 */
.sidebar-nav {
  background: white;
  border-radius: var(--radius-lg);
  padding: 8px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
}

.sidebar-nav-item:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.sidebar-nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

/* ═════════════════════════════════════════════════════════════════════════════
   右侧内容
   ═════════════════════════════════════════════════════════════════════════════ */
.profile-content {
  min-width: 0;
}

.workspace-guide {
  background: linear-gradient(135deg, #0f172a 0%, #111827 100%);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(15, 23, 42, 0.08);
  padding: 24px 28px;
  margin-bottom: 20px;
  color: #f8fafc;
}

.workspace-guide-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.workspace-guide-head h2 {
  font-size: 22px;
  margin-bottom: 6px;
}

.workspace-guide-head p {
  color: rgba(248, 250, 252, 0.72);
  font-size: 14px;
}

.workspace-guide-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.guide-task-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 18px;
}

.guide-task-card.is-done {
  background: rgba(7, 193, 96, 0.12);
  border-color: rgba(7, 193, 96, 0.24);
}

.guide-task-card.is-focus {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.24);
}

.guide-task-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.1);
}

.guide-task-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
}

.guide-task-desc {
  color: rgba(248, 250, 252, 0.76);
  font-size: 13px;
  min-height: 40px;
}

.guide-task-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

.tab-panel {
  display: none;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.tab-panel.active {
  display: block;
}

.panel-header {
  padding: 24px 28px 0;
}

.panel-header h2 {
  font-size: 18px;
  font-weight: 700;
}

.panel-header p {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

.panel-body {
  padding: 20px 28px 28px;
}

/* ═════════════════════════════════════════════════════════════════════════════
   表单
   ═════════════════════════════════════════════════════════════════════════════ */
.profile-form {
  margin-top: 8px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-primary);
  transition: var(--transition-fast);
  outline: none;
  font-family: inherit;
}

.form-group input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.1);
}

.form-group input:disabled {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  cursor: not-allowed;
}

.form-hint {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-actions {
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
  margin-top: 8px;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-ghost {
  background: none;
  border: none;
}

.btn-outline {
  background: white;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ═════════════════════════════════════════════════════════════════════════════
   公众号列表
   ═════════════════════════════════════════════════════════════════════════════ */
.accounts-list {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.account-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.account-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.account-info {
  flex: 1;
  min-width: 0;
}

.account-name {
  font-size: 15px;
  font-weight: 600;
}

.account-type {
  font-size: 12px;
  color: var(--text-muted);
}

.account-status {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  background: var(--primary-light);
  color: var(--primary);
}

.accounts-empty {
  text-align: center;
  padding: 40px 20px;
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.accounts-empty p {
  font-size: 15px;
  color: var(--text-secondary);
}

.empty-hint {
  font-size: 13px !important;
  color: var(--text-muted) !important;
  margin-top: 8px;
  margin-bottom: 20px;
}

/* ═════════════════════════════════════════════════════════════════════════════
   订阅信息
   ═════════════════════════════════════════════════════════════════════════════ */
.subscription-card {
  background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-md);
  padding: 24px;
  margin-top: 8px;
}

.sub-current {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.sub-badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: var(--primary);
  color: white;
}

.sub-badge.free {
  background: var(--text-muted);
}

.sub-badge.basic {
  background: #3b82f6;
}

.sub-badge.pro {
  background: #8b5cf6;
}

.sub-badge.enterprise {
  background: #f59e0b;
}

.sub-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--primary);
}

.sub-status.expired {
  color: #fa5151;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

/* 三维度配额仪表盘 */
.quota-dashboard {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.quota-dim-card {
  background: white;
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid var(--border-color);
  transition: box-shadow 0.2s;
}

.quota-dim-card:hover {
  box-shadow: var(--shadow-sm);
}

.dim-icon {
  font-size: 24px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.dim-info {
  flex: 1;
  min-width: 0;
}

.dim-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.dim-numbers {
  display: flex;
  align-items: baseline;
  gap: 2px;
  margin-bottom: 6px;
}

.dim-used {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.dim-sep {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 1px;
}

.dim-max {
  font-size: 14px;
  color: var(--text-muted);
}

.dim-unit {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: 4px;
}

.dim-bar {
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}

.dim-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #34d399);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.dim-bar-fill.warning {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.dim-bar-fill.danger {
  background: linear-gradient(90deg, #ef4444, #f87171);
}

.dim-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin: 0;
}

.sub-quota-info {
  background: white;
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 16px;
}

.quota-used {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 8px;
}

.quota-num {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
}

.quota-text {
  font-size: 14px;
  color: var(--text-muted);
}

.quota-bar {
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.quota-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #34d399);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.quota-bar-fill.warning {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.quota-bar-fill.danger {
  background: linear-gradient(90deg, #ef4444, #f87171);
}

.quota-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
}

.sub-actions {
  display: flex;
  gap: 12px;
}

.btn-upgrade {
  background: linear-gradient(135deg, var(--primary), #34d399);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.btn-upgrade:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* 套餐列表 */
.plans-section {
  margin-top: 32px;
}

.plans-section h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.plan-card {
  background: white;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: var(--transition);
  position: relative;
}

.plan-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.plan-card.current {
  border-color: var(--primary);
  background: linear-gradient(to bottom, rgba(7, 193, 96, 0.05), white);
}

.plan-card.current::before {
  content: '当前套餐';
  position: absolute;
  top: -10px;
  right: 16px;
  background: var(--primary);
  color: white;
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 10px;
}

.plan-card.popular {
  border-color: #8b5cf6;
}

.plan-card.popular::after {
  content: '推荐';
  position: absolute;
  top: -10px;
  left: 16px;
  background: #8b5cf6;
  color: white;
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 10px;
}

.plan-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.plan-price {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.plan-price span {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-muted);
}

.plan-quota {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.plan-features {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
}

.plan-features li {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 6px 0;
  padding-left: 20px;
  position: relative;
}

.plan-features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: 700;
}

.plan-btn {
  width: 100%;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.plan-btn.current {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  cursor: default;
}

.plan-btn.upgrade {
  background: var(--primary);
  color: white;
  border: none;
}

.plan-btn.upgrade:hover {
  background: var(--primary-dark);
}

.plan-btn.buy {
  background: white;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.plan-btn.buy:hover {
  background: var(--primary-light);
}

.plans-loading {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}

/* 动态订阅卡片样式 */
.subscription-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.subscription-plan {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sub-expires {
  font-size: 13px;
  color: var(--text-muted);
}

.quota-display {
  background: white;
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 16px;
}

.quota-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.quota-progress {
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.quota-numbers {
  font-size: 14px;
  color: var(--text-secondary);
}

.quota-numbers span:first-child {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
}

.plans-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
}

/* 支付弹窗 */
.pay-modal {
  max-width: 420px;
}

.pay-qrcode {
  text-align: center;
  padding: 20px;
}

.pay-qrcode img {
  width: 200px;
  height: 200px;
  margin-bottom: 16px;
}

.pay-amount {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}

.pay-hint {
  font-size: 13px;
  color: var(--text-muted);
}

/* ═════════════════════════════════════════════════════════════════════════════
   API Key 管理面板头部
   ═════════════════════════════════════════════════════════════════════════════ */
.apikey-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 28px 0;
  gap: 20px;
}

.apikey-header-left h2 {
  font-size: 18px;
  font-weight: 700;
}

.apikey-header-left p {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

.apikey-header-right {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-shrink: 0;
}

.apikey-header-right input {
  width: 200px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 14px;
}

.apikey-header-right input:focus {
  outline: none;
  border-color: var(--primary);
}

/* API Key 列表 */
.apikey-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.apikey-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 20px;
  padding: 16px 20px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.apikey-info {
  min-width: 0;
}

.apikey-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.apikey-key {
  font-size: 12px;
  color: var(--text-muted);
  font-family: 'Courier New', monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.apikey-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.apikey-stats {
  display: flex;
  gap: 24px;
  flex-shrink: 0;
}

.apikey-stat {
  text-align: center;
}

.apikey-stat-num {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}

.apikey-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.apikey-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* API Key 空状态 */
.apikey-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.apikey-empty .empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.apikey-empty p {
  margin: 0;
  font-size: 15px;
}

.apikey-empty .empty-hint {
  font-size: 13px;
  margin-top: 8px;
}

/* API Key 响应式 */
@media (max-width: 768px) {
  .apikey-panel-header {
    flex-direction: column;
    align-items: stretch;
  }

  .apikey-header-right {
    flex-direction: column;
  }

  .apikey-header-right input {
    width: 100%;
  }

  .apikey-item {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .apikey-stats {
    justify-content: flex-start;
    padding: 12px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
  }

  .apikey-actions {
    justify-content: flex-end;
  }
}

.btn-copy {
  background: var(--primary);
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-copy:hover {
  background: var(--primary-dark);
}

/* 公众号卡片操作按钮 */
.account-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.btn-delete-account {
  background: none;
  color: #fa5151;
  border: 1px solid #fa5151;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-delete-account:hover {
  background: #fff1f0;
}

/* 弹窗样式 */
.modal-overlay {
  background: none;
  color: #fa5151;
  border: 1px solid #fa5151;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-delete:hover {
  background: #fff1f0;
}

/* ═════════════════════════════════════════════════════════════════════════════
   页脚
   ═════════════════════════════════════════════════════════════════════════════ */
.footer {
  text-align: center;
  padding: 20px;
  font-size: 13px;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  background: white;
}

/* ═════════════════════════════════════════════════════════════════════════════
   公众号管理头部
   ═════════════════════════════════════════════════════════════════════════════ */
.accounts-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 0;
}

.accounts-header-left h2 {
  margin-bottom: 4px;
}

/* ═════════════════════════════════════════════════════════════════════════════
   公众号卡片操作按钮
   ═════════════════════════════════════════════════════════════════════════════ */
.account-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.btn-delete-account {
  background: none;
  color: #fa5151;
  border: 1px solid #fa5151;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-delete-account:hover {
  background: #fff1f0;
}

/* ═════════════════════════════════════════════════════════════════════════════
   弹窗样式
   ═════════════════════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal-content {
  background: white;
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
  animation: modalSlideIn 0.3s ease;
}

.modal-small {
  max-width: 360px;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: var(--transition);
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
}

/* 授权弹窗内容 */
.auth-loading {
  text-align: center;
  padding: 40px 20px;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary);
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.auth-loading p {
  color: var(--text-secondary);
  font-size: 14px;
}

.auth-content {
  text-align: center;
}

.auth-tip {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.auth-qrcode {
  background: #f8fafc;
  padding: 20px;
  border-radius: var(--radius-md);
  display: inline-block;
}

.auth-qrcode img,
.auth-qrcode #qrcodeContainer img {
  width: 200px;
  height: 200px;
  display: block;
}

.auth-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 16px;
}

.auth-error {
  text-align: center;
  padding: 20px;
}

.error-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.auth-error p {
  color: var(--text-secondary);
  margin-bottom: 16px;
}

/* 删除弹窗 */
.delete-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 8px;
  margin-bottom: 20px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.btn-danger {
  background: #fa5151;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-danger:hover {
  background: #e04848;
}

/* ═════════════════════════════════════════════════════════════════════════════
   Toast 提示
   ═════════════════════════════════════════════════════════════════════════════ */
.toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  color: white;
  z-index: 3000;
  animation: toastSlideIn 0.3s ease;
  white-space: nowrap;
}

.toast-success { background: #07c160; }
.toast-error { background: #fa5151; }
.toast-info { background: #576b95; }

.toast.toast-out {
  animation: toastSlideOut 0.3s ease forwards;
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes toastSlideOut {
  from { opacity: 1; transform: translateX(-50%) translateY(0); }
  to { opacity: 0; transform: translateX(-50%) translateY(-20px); }
}

/* ═════════════════════════════════════════════════════════════════════════════
   响应式
   ═════════════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .workspace-guide {
    padding: 20px;
  }

  .workspace-guide-head {
    flex-direction: column;
    align-items: stretch;
  }

  .workspace-guide-grid {
    grid-template-columns: 1fr;
  }

  .profile-container {
    grid-template-columns: 1fr;
  }

  .nav-links {
    display: none;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .compare-table {
    font-size: 12px;
  }

  .compare-table th,
  .compare-table td {
    padding: 8px;
  }

  /* 三维度配额仪表盘响应式 */
  .quota-dashboard {
    grid-template-columns: 1fr;
  }
}

/* ═════════════════════════════════════════════════════════════════════════════
   我的模板样式
   ═════════════════════════════════════════════════════════════════════════════ */

/* 模板配额徽章 */
.template-quota {
  margin-top: 8px;
}

.quota-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  background: var(--bg-tertiary);
  border-radius: 16px;
  font-size: 13px;
  color: var(--text-secondary);
}

.quota-badge strong {
  color: var(--primary);
}

/* 模板网格 */
.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  padding: 20px 0;
}

/* 模板卡片 */
.template-card {
  background: white;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  overflow: hidden;
  transition: var(--transition);
}

.template-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.template-preview {
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.template-preview-icon {
  font-size: 48px;
  opacity: 0.8;
}

.template-info {
  padding: 16px;
}

.template-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.template-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-meta {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.template-category,
.template-source {
  font-size: 11px;
  padding: 2px 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  color: var(--text-secondary);
}

.template-actions {
  display: flex;
  gap: 8px;
}

.template-actions .btn-edit {
  flex: 1;
  padding: 8px 12px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
}

.template-actions .btn-edit:hover {
  background: var(--primary-dark);
}

.template-actions .btn-delete {
  padding: 8px 12px;
  background: white;
  color: #fa5151;
  border: 1px solid #fa5151;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
}

.template-actions .btn-delete:hover {
  background: #fff1f0;
}

/* 模板空状态 */
.templates-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.templates-empty .empty-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.templates-empty p {
  margin: 0;
  font-size: 15px;
}

.templates-empty .empty-hint {
  font-size: 13px;
  margin-top: 8px;
  margin-bottom: 16px;
}

/* 模板编辑弹窗 */
.modal-large {
  max-width: 700px;
}

.modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
}

.modal-footer .btn {
  min-width: 100px;
}

/* CSS 编辑器 */
#tplStyles {
  font-family: 'Courier New', Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: #1e1e1e;
  color: #d4d4d4;
}

/* 模板表单 */
#templateForm .form-group {
  margin-bottom: 16px;
}

#templateForm select {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: white;
}

#templateForm select:focus {
  outline: none;
  border-color: var(--primary);
}

/* 模板列表响应式 */
@media (max-width: 768px) {
  .templates-grid {
    grid-template-columns: 1fr;
  }

  .apikey-panel-header {
    flex-direction: column;
    align-items: stretch;
  }

  .apikey-header-right {
    flex-direction: column;
  }

  .apikey-header-right input {
    width: 100%;
  }

  .modal-large {
    max-width: 100%;
    margin: 16px;
  }
}
