/* ========================================
   CSS Variables & Base Styles - 护眼清新版
   ======================================== */
:root {
  --primary-blue: #4f8cff;
  --primary-cyan: #00b4d8;
  --primary-purple: #7c3aed;
  --primary-green: #059669;
  --primary-teal: #0d9488;
  
  --bg-main: #f0f7f4;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fcfb;
  --bg-header: rgba(255, 255, 255, 0.95);
  --bg-section: rgba(255, 255, 255, 0.8);
  --bg-input: #f5faf7;
  
  --text-primary: #1a3a2f;
  --text-secondary: #4a6b5d;
  --text-muted: #7a9b8d;
  
  --border-color: #d4e5dc;
  --border-light: #e8f3ed;
  
  --success: #059669;
  --success-bg: rgba(5, 150, 105, 0.1);
  --warning: #d97706;
  --warning-bg: rgba(217, 119, 6, 0.1);
  --danger: #dc2626;
  --danger-bg: rgba(220, 38, 38, 0.1);
  
  --accent-gradient: linear-gradient(135deg, #e0f2e9, #d4e8f7);
  --card-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  --card-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.1);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
}

/* 背景装饰 */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(ellipse at 20% 20%, rgba(5, 150, 105, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(79, 140, 255, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(13, 148, 136, 0.05) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}

/* ========================================
   Top Bar
   ======================================== */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: var(--bg-header);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  font-size: 28px;
}

.brand-text {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 16px;
}

.sync-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.sync-btn:hover {
  background: var(--primary-cyan);
  border-color: var(--primary-cyan);
  color: #fff;
}

.sync-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.sync-btn-alt {
  border-color: rgba(34, 211, 238, 0.45);
  color: var(--primary-cyan, #22d3ee);
}

.btn-muted-sm {
  border-color: rgba(100, 116, 139, 0.35);
  color: var(--text-secondary, #64748b);
}

.btn-danger-sm {
  border-color: rgba(239, 68, 68, 0.45);
  color: #dc2626;
}

.version-badge {
  background: linear-gradient(135deg, var(--primary-green), var(--primary-teal));
  color: white;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3);
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 2s infinite;
  box-shadow: 0 0 8px rgba(5, 150, 105, 0.5);
}
.status-dot.sync-idle {
  background: var(--text-muted);
  box-shadow: 0 0 8px rgba(122, 155, 141, 0.5);
  animation: none;
}
.status-dot.syncing {
  background: var(--primary-cyan);
  box-shadow: 0 0 8px rgba(0, 180, 216, 0.6);
  animation: pulse 1s infinite;
}
.status-dot.sync-success {
  background: var(--success);
  box-shadow: 0 0 8px rgba(5, 150, 105, 0.5);
  animation: none;
}
.status-dot.sync-error {
  background: var(--danger);
  box-shadow: 0 0 8px rgba(220, 38, 38, 0.6);
  animation: none;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.9); }
}

.status-text {
  font-size: 13px;
  color: var(--text-muted);
}

/* ========================================
   Page Layout
   ======================================== */
.page {
  display: none;
  padding-top: 64px;
  min-height: 100vh;
}

.page.active {
  display: block;
}

.page-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  position: sticky;
  top: 64px;
  z-index: 50;
  border-left: 4px solid var(--accent, var(--primary-blue));
  box-shadow: var(--card-shadow);
}

.back-btn {
  background: var(--bg-section);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 10px 18px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
}

.back-btn:hover {
  background: var(--primary-green);
  color: white;
  border-color: var(--primary-green);
  transform: translateX(-2px);
}

.back-icon {
  font-size: 18px;
}

.page-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
}

.page-icon {
  font-size: 24px;
}

.page-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 24px;
}

/* ========================================
   Hero Section
   ======================================== */
.hero-section {
  position: relative;
  padding: 60px 24px 50px;
  text-align: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--accent-gradient);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-title {
  font-size: clamp(26px, 5vw, 42px);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  margin-bottom: 14px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.hero-subtitle {
  font-size: 16px;
  color: var(--text-muted);
  letter-spacing: 3px;
  margin-bottom: 36px;
}

.hero-stats {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 48px;
  flex-wrap: wrap;
  background: var(--bg-card);
  padding: 24px 48px;
  border-radius: var(--radius-xl);
  box-shadow: var(--card-shadow);
  display: inline-flex;
}

.stat-item {
  text-align: center;
}

.stat-num {
  display: block;
  font-size: 34px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary-green), var(--primary-teal));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.stat-divider {
  width: 1px;
  height: 36px;
  background: var(--border-color);
}

/* ========================================
   Cards Grid
   ======================================== */
.cards-section {
  padding: 0 24px 50px;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  max-width: 1100px;
  margin: 0 auto;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 28px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  box-shadow: var(--card-shadow);
}

.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--card-shadow-hover);
  border-color: var(--card-color, var(--primary-blue));
}

.card-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--card-color, var(--primary-blue)), transparent);
  opacity: 0;
  transition: var(--transition);
}

.feature-card:hover .card-glow {
  opacity: 1;
}

.feature-card[data-color="blue"] { --card-color: var(--primary-blue); }
.feature-card[data-color="cyan"] { --card-color: var(--primary-cyan); }
.feature-card[data-color="purple"] { --card-color: var(--primary-purple); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.card-icon-wrap {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, var(--card-color), rgba(255,255,255,0.9));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.card-icon {
  font-size: 26px;
}

.card-tag {
  background: var(--bg-section);
  color: var(--text-muted);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border-color);
}

.card-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.card-desc {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 18px;
  line-height: 1.7;
}

.card-features {
  list-style: none;
  margin-bottom: 20px;
}

.card-features li {
  color: var(--text-muted);
  font-size: 13px;
  padding: 5px 0;
  padding-left: 18px;
  position: relative;
}

.card-features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--card-color, var(--primary-green));
  font-weight: bold;
}

.card-footer {
  border-top: 1px solid var(--border-light);
  padding-top: 18px;
}

.card-link {
  color: var(--card-color, var(--primary-blue));
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.arrow {
  transition: transform 0.3s;
}

.feature-card:hover .arrow {
  transform: translateX(4px);
}

/* ========================================
   Home Footer
   ======================================== */
.home-footer {
  text-align: center;
  padding: 36px 24px;
  color: var(--text-muted);
  font-size: 13px;
  border-top: 1px solid var(--border-light);
  background: var(--bg-card);
}

/* ========================================
   Rule Sections
   ======================================== */
.rule-section {
  margin-bottom: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--card-shadow);
}

.section-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: var(--bg-section);
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: var(--transition);
}

.section-header:hover {
  background: linear-gradient(135deg, rgba(5, 150, 105, 0.05), rgba(79, 140, 255, 0.05));
}

.section-num {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--primary-green), var(--primary-teal));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: white;
  box-shadow: 0 3px 10px rgba(5, 150, 105, 0.3);
}

.section-title-wrap {
  flex: 1;
}

.section-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.section-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.collapse-icon {
  font-size: 12px;
  color: var(--text-muted);
  transition: transform 0.3s;
}

.section-header.collapsed .collapse-icon {
  transform: rotate(-90deg);
}

.section-content {
  padding: 24px;
}

.section-content.collapsed {
  display: none;
}

.section-content.no-padding {
  padding: 0;
}

/* ========================================
   Info Cards
   ======================================== */
.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.content-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.info-card {
  background: var(--bg-section);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
}

.info-card:hover {
  box-shadow: var(--card-shadow);
}

.info-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
}

.info-tag {
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: white;
}

.info-tag.pdf { background: #ef4444; }
.info-tag.ppt { background: #f59e0b; }
.info-tag.word { background: #3b82f6; }

.info-card-header h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.info-card-body {
  padding: 20px;
}

/* ========================================
   Rule Items
   ======================================== */
.rule-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.rule-item:last-child {
  margin-bottom: 0;
}

.rule-step {
  width: 26px;
  height: 26px;
  background: var(--primary-green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
}

.rule-item.highlight .rule-step {
  background: var(--danger);
}

.rule-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.rule-text strong {
  color: var(--text-primary);
}

/* ========================================
   Process Steps
   ======================================== */
.process-steps {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.process-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.step-num {
  width: 30px;
  height: 30px;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.process-step.success .step-num {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.step-text {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.process-arrow {
  color: var(--text-muted);
  font-size: 16px;
}

/* ========================================
   Naming Card
   ======================================== */
.naming-card .info-card-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.naming-example {
  background: var(--success-bg);
  border: 1px solid rgba(5, 150, 105, 0.2);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.naming-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.naming-format {
  font-size: 13px;
  color: var(--primary-green);
  font-weight: 500;
  word-break: break-all;
}

.naming-note {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.note-icon {
  font-size: 16px;
}

/* ========================================
   Pricing Box
   ======================================== */
.pricing-box {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--warning-bg);
  border: 1px solid rgba(217, 119, 6, 0.2);
  border-radius: var(--radius-md);
  padding: 20px 24px;
}

.pricing-icon {
  font-size: 36px;
}

.pricing-content {
  flex: 1;
}

.pricing-content h4 {
  font-size: 16px;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.pricing-content p {
  font-size: 14px;
  color: var(--text-secondary);
}

.pricing-link {
  background: var(--warning);
  color: white;
  padding: 12px 22px;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.3);
}

.pricing-link:hover {
  background: #b45309;
  transform: translateY(-2px);
}

/* ========================================
   Album Naming
   ======================================== */
.album-naming {
  margin-bottom: 24px;
}

.naming-hero {
  display: flex;
  align-items: center;
  gap: 20px;
  background: linear-gradient(135deg, var(--success-bg), rgba(79, 140, 255, 0.05));
  border: 1px solid rgba(5, 150, 105, 0.2);
  border-radius: var(--radius-md);
  padding: 24px;
}

.naming-icon {
  font-size: 44px;
}

.naming-info h4 {
  font-size: 16px;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.naming-format-large {
  font-size: 15px;
  color: var(--primary-green);
  font-weight: 500;
  background: var(--bg-card);
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  word-break: break-all;
  border: 1px solid var(--border-light);
}

/* ========================================
   Catalog & Intro
   ======================================== */
.catalog-item {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.catalog-item:last-child {
  margin-bottom: 0;
}

.catalog-num {
  width: 30px;
  height: 30px;
  background: linear-gradient(135deg, var(--primary-cyan), var(--primary-teal));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
}

.catalog-content strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.catalog-content p {
  font-size: 13px;
  color: var(--text-secondary);
}

.intro-template {
  background: var(--bg-section);
  border-radius: var(--radius-sm);
  padding: 18px;
  border: 1px solid var(--border-light);
}

.intro-text {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-secondary);
}

.highlight-text {
  color: var(--danger);
  font-weight: 600;
}

/* ========================================
   Cover Rules
   ======================================== */
.cover-rules {
  margin-bottom: 24px;
}

.cover-rules h4 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.cover-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.cover-option {
  display: flex;
  gap: 16px;
  background: var(--bg-section);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.option-num {
  width: 30px;
  height: 30px;
  background: var(--primary-green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
}

.option-content strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.option-content p {
  font-size: 13px;
  color: var(--text-secondary);
}

.option-content em {
  color: var(--text-muted);
  font-style: normal;
}

/* ========================================
   Warning Box
   ======================================== */
.warning-box {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: var(--danger-bg);
  border: 1px solid rgba(220, 38, 38, 0.2);
  border-radius: var(--radius-md);
  padding: 20px;
}

.warning-icon {
  font-size: 24px;
}

.warning-content strong {
  display: block;
  margin-bottom: 4px;
  color: var(--danger);
}

.warning-content p {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ========================================
   Special Cards
   ======================================== */
.special-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.special-card {
  background: var(--bg-section);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
}

.special-card:hover {
  box-shadow: var(--card-shadow);
}

.special-card.special-wide {
  grid-column: 1 / -1;
}

.sc-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
}

.sc-num {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--primary-purple), #9333ea);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: white;
}

.sc-header h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.sc-body {
  padding: 20px;
}

.sc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.sc-row:last-child {
  margin-bottom: 0;
}

.sc-row.single {
  justify-content: center;
}

.sc-label {
  font-size: 13px;
  color: var(--text-muted);
}

.sc-action {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.sc-action.green {
  background: var(--success-bg);
  color: var(--success);
}

.sc-action.blue {
  background: rgba(79, 140, 255, 0.1);
  color: var(--primary-blue);
}

.sc-action.red {
  background: var(--danger-bg);
  color: var(--danger);
}

.sc-code {
  background: var(--bg-card);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-family: monospace;
  border: 1px solid var(--border-color);
}

.sc-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}

.sc-detail {
  text-align: center;
  padding: 16px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}

.sd-label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.sc-detail code {
  font-size: 12px;
  background: var(--bg-section);
  padding: 4px 10px;
  border-radius: 4px;
}

.price-zero {
  color: var(--danger);
  font-weight: 600;
}

.tag-combo {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.tag {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.tag.orange {
  background: var(--warning-bg);
  color: var(--warning);
}

.tag.red {
  background: var(--danger-bg);
  color: var(--danger);
}

/* ========================================
   Query Filters
   ======================================== */
.query-filters {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

.fl-icon {
  font-size: 16px;
}

.filter-input-wrap {
  display: flex;
  gap: 12px;
  position: relative;
}

.filter-input,
.filter-select {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  transition: var(--transition);
}

.filter-input:focus,
.filter-select:focus {
  outline: none;
  border-color: var(--primary-cyan);
  box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.1);
}

.filter-input::placeholder {
  color: var(--text-muted);
}

.btn-search {
  background: linear-gradient(135deg, var(--primary-cyan), var(--primary-teal));
  color: white;
  border: none;
  padding: 12px 22px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(0, 180, 216, 0.3);
}

.btn-search:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 180, 216, 0.4);
}

.btn-add-sm {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-add-sm:hover {
  background: var(--primary-green);
  border-color: var(--primary-green);
  color: white;
}

.count-badge {
  background: linear-gradient(135deg, var(--primary-cyan), var(--primary-teal));
  color: white;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  margin-left: auto;
  box-shadow: 0 3px 10px rgba(0, 180, 216, 0.3);
}

.btn-add {
  background: linear-gradient(135deg, var(--primary-cyan), var(--primary-teal));
  color: white;
  border: none;
  padding: 11px 22px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(0, 180, 216, 0.3);
}

.btn-add:hover {
  transform: translateY(-2px);
}

/* ========================================
   Provider List
   ======================================== */
.provider-list {
  display: flex;
  flex-direction: column;
}

.provider-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-light);
  transition: var(--transition);
}

.provider-item:last-child {
  border-bottom: none;
}

.provider-item:hover {
  background: var(--bg-section);
}

.provider-avatar {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--primary-cyan), var(--primary-green));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  color: white;
}

.provider-info {
  flex: 1;
}

.provider-name {
  font-weight: 600;
  margin-bottom: 2px;
  color: var(--text-primary);
}

.provider-meta {
  font-size: 13px;
  color: var(--text-muted);
}

.provider-actions {
  display: flex;
  gap: 8px;
}

.provider-actions button {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
}

.provider-actions button:hover {
  background: var(--primary-blue);
  border-color: var(--primary-blue);
  color: white;
}

/* ========================================
   Filter Section Title
   ======================================== */
.filter-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
}

.filter-section-title.mt-20 {
  margin-top: 28px;
}

.query-filters.rule-inputs {
  background: rgba(79, 140, 255, 0.05);
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}

.query-filters.rule-inputs .filter-label {
  color: var(--primary-blue);
}

.save-rule-btn-wrap {
  margin-top: 20px;
  text-align: center;
}

.btn-save-rule {
  background: linear-gradient(135deg, var(--primary-blue), #3b82f6);
  color: white;
  border: none;
  padding: 12px 32px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(79, 140, 255, 0.3);
}

.btn-save-rule:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(79, 140, 255, 0.4);
}

.btn-edit-rule {
  background: linear-gradient(135deg, var(--primary-cyan), var(--primary-teal));
  color: white;
  border: none;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  margin-left: auto;
}

.rule-display-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.rule-edit-content {
  background: var(--bg-section);
  padding: 16px;
  border-radius: var(--radius-md);
  margin-top: 16px;
}

.rule-input {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
}

.rule-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.rule-item .label {
  width: 80px;
  color: var(--text-muted);
  font-size: 13px;
}

.rule-item .value {
  flex: 1;
  color: var(--text-primary);
  font-size: 14px;
}

.rule-btn-wrap {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 16px;
}

.btn-reset {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
  margin-left: 8px;
}

.btn-reset:hover {
  background: var(--danger-bg);
  border-color: var(--danger);
  color: var(--danger);
}

/* ========================================
   Custom Rule Box
   ======================================== */
.custom-rule-box {
  background: linear-gradient(135deg, var(--success-bg), rgba(79, 140, 255, 0.08));
  border: 1px solid rgba(5, 150, 105, 0.3);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 24px;
}

.match-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: linear-gradient(135deg, var(--success-bg), rgba(79, 140, 255, 0.08));
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-primary);
}

.match-hint .match-icon {
  font-size: 18px;
}

.match-hint .match-text {
  flex: 1;
}

.match-hint .match-text strong {
  color: var(--primary-teal);
}

.match-hint .match-count {
  color: var(--text-muted);
  font-size: 12px;
}

.custom-rule-box h4 {
  font-size: 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
}

.custom-rule-content {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* ========================================
   AI Section
   ======================================== */
.ai-hero {
  text-align: center;
  padding: 40px 24px;
  margin-bottom: 32px;
}

.ai-icon-wrap {
  position: relative;
  width: 90px;
  height: 90px;
  margin: 0 auto 24px;
}

.ai-main-icon {
  font-size: 52px;
  position: relative;
  z-index: 1;
}

.ai-pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  background: var(--primary-purple);
  border-radius: 50%;
  opacity: 0.2;
  animation: ai-pulse 2s infinite;
}

@keyframes ai-pulse {
  0% { transform: translate(-50%, -50%) scale(1); opacity: 0.2; }
  100% { transform: translate(-50%, -50%) scale(1.6); opacity: 0; }
}

.ai-hero h2 {
  font-size: 24px;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.ai-hero p {
  color: var(--text-secondary);
  font-size: 15px;
}

.ai-search-box {
  max-width: 680px;
  margin: 0 auto 32px;
}

.ai-input-wrap {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.ai-input {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  font-size: 16px;
  transition: var(--transition);
  box-shadow: var(--card-shadow);
}

.ai-input:focus {
  outline: none;
  border-color: var(--primary-purple);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1), var(--card-shadow);
}

.ai-input::placeholder {
  color: var(--text-muted);
}

.ai-btn {
  background: linear-gradient(135deg, var(--primary-purple), #9333ea);
  color: white;
  border: none;
  padding: 16px 32px;
  border-radius: var(--radius-lg);
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: var(--transition);
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.3);
}

.ai-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4);
}

.ai-suggestions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.suggestion-label {
  font-size: 13px;
  color: var(--text-muted);
}

.suggestion-tag {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.suggestion-tag:hover {
  background: var(--primary-purple);
  border-color: var(--primary-purple);
  color: white;
}

/* ========================================
   AI Result
   ======================================== */
.ai-result {
  max-width: 780px;
  margin: 0 auto;
}

.ai-result-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  animation: fadeIn 0.3s ease;
  box-shadow: var(--card-shadow);
  min-width: 0;
}

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

.ai-result-header {
  padding: 20px 24px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.08), rgba(147, 51, 234, 0.05));
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
}

.ai-result-icon {
  font-size: 26px;
  flex-shrink: 0;
  line-height: 1.2;
}

.ai-result-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 0;
  flex: 1;
  line-height: 1.45;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: pre-wrap;
}

.ai-result-body {
  padding: 24px;
  min-width: 0;
}

.ai-result-section {
  margin-bottom: 20px;
  min-width: 0;
}

.ai-result-section:last-child {
  margin-bottom: 0;
}

.ai-result-section h5 {
  font-size: 14px;
  color: var(--primary-purple);
  margin-bottom: 10px;
  font-weight: 600;
  word-break: break-word;
  overflow-wrap: break-word;
}

.ai-result-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 14px;
  min-width: 0;
}

.ai-result-row:last-child {
  margin-bottom: 0;
}

.ai-result-label {
  flex-shrink: 0;
  min-width: 5em;
  max-width: 40%;
  font-weight: 600;
  color: var(--text-muted);
}

.ai-result-label::after {
  content: '：';
}

.ai-result-value {
  flex: 1 1 0;
  min-width: 0;
  color: var(--text-secondary);
  line-height: 1.65;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: pre-wrap;
}

.ai-result-empty-msg {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: pre-wrap;
}

.ai-result-html {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  word-break: break-word;
  overflow-wrap: break-word;
  min-width: 0;
}

.ai-result-html ul,
.ai-result-html ol {
  padding-left: 1.25em;
}

.ai-result-section p,
.ai-result-section ul {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: pre-wrap;
}

.ai-result-section ul {
  padding-left: 20px;
}

.ai-result-section li {
  margin-bottom: 6px;
}

/* ========================================
   Modal
   ======================================== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
}

.modal-box {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 460px;
  animation: modalIn 0.3s ease;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

@keyframes modalIn {
  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: 22px 26px;
  border-bottom: 1px solid var(--border-light);
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close {
  background: var(--bg-section);
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  transition: var(--transition);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: var(--danger-bg);
  color: var(--danger);
}

.modal-body {
  padding: 26px;
  max-height: 60vh;
  overflow-y: auto;
}

.form-group {
  margin-bottom: 22px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-group .form-hint {
  font-weight: 400;
  font-size: 12px;
  color: var(--text-muted);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 13px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-cyan);
}

.form-group textarea {
  min-height: 72px;
  resize: vertical;
}

.modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding: 20px 26px;
  border-top: 1px solid var(--border-light);
}

.btn-cancel {
  background: var(--bg-section);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 11px 24px;
  border-radius: var(--radius-md);
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-cancel:hover {
  background: var(--bg-card-hover);
}

.btn-save {
  background: linear-gradient(135deg, var(--primary-blue), #3b82f6);
  border: none;
  color: white;
  padding: 11px 26px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(79, 140, 255, 0.3);
}

.btn-save:hover {
  transform: translateY(-2px);
}

/* ========================================
   Toast
   ======================================== */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--success);
  color: var(--text-primary);
  padding: 16px 26px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 2000;
  animation: toastIn 0.4s ease;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.toast-icon {
  width: 26px;
  height: 26px;
  background: var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: white;
}

/* ========================================
   Empty State
   ======================================== */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 52px;
  display: block;
  margin-bottom: 16px;
}

.empty-state p {
  font-size: 14px;
}

/* ========================================
   通用规则卡片布局 (新设计)
   ======================================== */
.rules-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.rule-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  overflow: hidden;
  transition: var(--transition);
}

.rule-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.rule-card-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.rule-card-header .icon {
  font-size: 22px;
}

.rule-card-header .title {
  font-size: 17px;
  font-weight: 700;
  color: white;
}

.rule-card.material .rule-card-header {
  background: linear-gradient(135deg, #667eea, #764ba2);
}

.rule-card.album .rule-card-header {
  background: linear-gradient(135deg, #f093fb, #f5576c);
}

.rule-card.special .rule-card-header {
  background: linear-gradient(135deg, #4facfe, #00f2fe);
}

.rule-card.special2 .rule-card-header {
  background: linear-gradient(135deg, #43e97b, #38f9d7);
}

.rule-card.special3 .rule-card-header {
  background: linear-gradient(135deg, #fa709a, #fee140);
}

.rule-card-body {
  padding: 18px 20px;
}

.rule-block {
  margin-bottom: 16px;
}

.rule-block:last-child {
  margin-bottom: 0;
}

.rule-block-title {
  font-size: 13px;
  font-weight: 700;
  color: #909399;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.rule-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 14px;
  color: #303133;
  line-height: 1.7;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-pdf {
  background: #fef0f0;
  color: #f56c6c;
}

.badge-ppt {
  background: #fdf6ec;
  color: #e6a23c;
}

.badge-word {
  background: #f0f9eb;
  color: #67c23a;
}

.badge-blue {
  background: #ecf5ff;
  color: #409EFF;
}

.badge-warn {
  background: #fff3cd;
  color: #856404;
}

.badge-red {
  background: #fef0f0;
  color: #f56c6c;
}

.tag-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  margin-right: 6px;
}

.tag-green {
  background: #f0f9eb;
  color: #67c23a;
  border: 1px solid #b3e19d;
}

.tag-orange {
  background: #fdf6ec;
  color: #e6a23c;
  border: 1px solid #f5dab1;
}

.tag-red {
  background: #fef0f0;
  color: #f56c6c;
  border: 1px solid #fbc4c4;
}

.tag-blue {
  background: #ecf5ff;
  color: #409EFF;
  border: 1px solid #b3d8ff;
}

.tag-purple {
  background: #f3e8ff;
  color: #7c3aed;
  border: 1px solid #d8b4fe;
}

.divider {
  border: none;
  border-top: 1px solid #f0f0f0;
  margin: 12px 0;
}

.rule-link {
  color: #409EFF;
  text-decoration: none;
  font-weight: 600;
}

.rule-link:hover {
  text-decoration: underline;
}

.rule-note-box {
  margin-top: 10px;
  background: #fff7e6;
  border: 1px solid #ffd591;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
  color: #d46b08;
  line-height: 1.6;
}

.rule-intro-tpl {
  background: #f8f9fa;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: #555;
}

.special-item {
  background: #f8f9fa;
  border-left: 3px solid #409EFF;
  border-radius: 0 6px 6px 0;
  padding: 10px 14px;
  margin-bottom: 10px;
  font-size: 14px;
  color: #303133;
  line-height: 1.7;
}

.special-item:last-child {
  margin-bottom: 0;
}

.special-item.warn {
  border-left-color: #e6a23c;
}

.special-item.danger {
  border-left-color: #f56c6c;
}

.special-item.success {
  border-left-color: #67c23a;
}

.special-item.purple {
  border-left-color: #7c3aed;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
  .topbar-inner {
    padding: 0 16px;
  }
  
  .brand-text {
    font-size: 16px;
  }
  
  .hero-section {
    padding: 48px 16px 36px;
  }
  
  .hero-title {
    font-size: 26px;
  }
  
  .hero-stats {
    padding: 20px 32px;
    gap: 32px;
  }
  
  .stat-num {
    font-size: 28px;
  }
  
  .cards-section {
    padding: 0 16px 36px;
  }
  
  .cards-grid {
    grid-template-columns: 1fr;
  }
  
  .page-header {
    padding: 16px;
    flex-wrap: wrap;
  }
  
  .page-title {
    font-size: 18px;
  }
  
  .page-content {
    padding: 16px;
  }
  
  .content-grid,
  .content-grid-2,
  .special-cards,
  .rules-grid {
    grid-template-columns: 1fr;
  }
  
  .pricing-box {
    flex-direction: column;
    text-align: center;
  }
  
  .ai-input-wrap {
    flex-direction: column;
  }
  
  .ai-btn {
    justify-content: center;
  }
  
  .modal-box {
    max-width: 100%;
    margin: 0;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
  }
}

/* ========================================
   Search Dropdown
   ======================================== */
.search-dropdown {
  position: absolute;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: var(--card-shadow-hover);
  max-height: 300px;
  overflow-y: auto;
  z-index: 100;
  margin-top: 4px;
}

.dropdown-item {
  padding: 10px 16px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-light);
}

.dropdown-item:last-child {
  border-bottom: none;
}

.dropdown-item:hover {
  background: var(--bg-card-hover);
  color: var(--primary-cyan);
}

/* ========================================
   规则卡片
   ======================================== */
.rule-result-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-top: 20px;
  width: 100%;
}

.custom-rule-display {
  margin-top: 20px;
  width: 100%;
}

.rule-result-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.rule-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: var(--transition);
  min-width: 0;
}

.rule-card:hover {
  box-shadow: var(--card-shadow-hover);
}

.rule-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px;
  background: var(--bg-section);
  border-bottom: 1px solid var(--border-light);
}

.rule-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 0;
  flex: 1;
  line-height: 1.45;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: pre-wrap;
}

.rule-card-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.rule-edit-btn {
  background: var(--primary-cyan);
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
}

.rule-edit-btn:hover {
  background: var(--primary-teal);
}

.rule-delete-btn {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(220, 38, 38, 0.2);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
}

.rule-delete-btn:hover {
  background: var(--danger);
  color: white;
}

.rule-card-body {
  padding: 16px;
}

.rule-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 14px;
  min-width: 0;
}

.rule-row:last-child {
  margin-bottom: 0;
}

.rule-label {
  color: var(--text-muted);
  min-width: 60px;
  flex-shrink: 0;
}

.rule-value {
  color: var(--text-primary);
  flex: 1 1 0;
  min-width: 0;
  line-height: 1.5;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: pre-wrap;
}

/* ========================================
   匹配提示
   ======================================== */
.match-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: var(--success-bg);
  border: 1px solid rgba(5, 150, 105, 0.3);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.match-icon {
  font-size: 18px;
}

.match-text {
  flex: 1;
}

.match-text strong {
  color: var(--primary-teal);
}

.match-count {
  color: var(--text-muted);
  font-size: 12px;
}

/* ========================================
   规则编辑弹窗
   ======================================== */
.rule-card-edit {
  background: var(--bg-card);
  border: 2px solid var(--primary-cyan);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--card-shadow-hover);
}

.rule-card-edit .rule-card-header {
  background: var(--primary-cyan);
  color: white;
}

.rule-card-edit .rule-card-title {
  color: white;
  min-width: 0;
  flex: 1;
  word-break: break-word;
  overflow-wrap: break-word;
  line-height: 1.45;
}

.rule-card-edit .rule-card-actions {
  color: white;
}

.rule-input {
  width: 100%;
  min-width: 0;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 8px;
}

.rule-input:focus {
  outline: none;
  border-color: var(--primary-cyan);
}

.rule-save-btn {
  background: var(--primary-green);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  cursor: pointer;
  margin-top: 8px;
}

.rule-save-btn:hover {
  background: var(--primary-teal);
}
