:root {
  --brand-primary: #6364f1;
  --brand-primary-dark: #4f46e5;
  --brand-accent: #f43f5e;
  --brand-bg: #f8f9ff;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--brand-bg);
}

.text-gradient {
  background: linear-gradient(90deg, #6364f1 0%, #8b5cf6 50%, #f43f5e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* Navbar */
.app-navbar {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(99, 100, 241, 0.12);
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
  color: #fff;
  font-size: 1rem;
}

.brand-icon-sm {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
  color: #fff;
  font-size: 0.8rem;
}

/* Hero */
.hero {
  background:
    radial-gradient(60% 60% at 80% 10%, rgba(99, 100, 241, 0.12) 0%, transparent 60%),
    radial-gradient(50% 50% at 10% 90%, rgba(244, 63, 94, 0.08) 0%, transparent 60%),
    var(--brand-bg);
}

.stats .stat-item {
  display: flex;
  flex-direction: column;
}

.stats .stat-num {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--brand-primary-dark);
  line-height: 1.1;
}

.stats .stat-label {
  font-size: 0.8rem;
  color: var(--bs-secondary-color);
}

.hero-preview {
  border-radius: 1.25rem;
  overflow: hidden;
}

.hero-preview .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.preview-title {
  font-weight: 700;
  margin-bottom: 0.9rem;
  color: var(--bs-body-color);
}

.preview-list li {
  padding: 0.5rem 0;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.08);
  font-size: 0.9rem;
}

.preview-list li:last-child {
  border-bottom: none;
}

/* Feature cards */
.feature-card {
  border-radius: 1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 0.75rem 1.5rem rgba(99, 100, 241, 0.12) !important;
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}

/* Form panel */
.sticky-form {
  top: 90px;
}

.style-checkbox-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.style-checkbox-grid .btn {
  font-size: 0.82rem;
  padding: 0.45rem 0.5rem;
  text-align: left;
}

.style-checkbox-grid .btn.active {
  border-color: var(--brand-primary);
}

/* Result area */
.card-header-tabs .nav-link {
  font-size: 0.92rem;
}

.card-header-tabs .nav-link.active {
  font-weight: 600;
}

.empty-state .empty-icon {
  font-size: 3.2rem;
  color: #c7c9f8;
}

/* Title list */
.title-item {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 0.75rem;
  padding: 0.85rem 1rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.title-item:hover {
  border-color: var(--brand-primary);
  box-shadow: 0 0.25rem 0.75rem rgba(99, 100, 241, 0.1);
}

.title-item .title-text {
  font-weight: 500;
  line-height: 1.5;
}

.title-item .score-ring {
  min-width: 52px;
  text-align: center;
}

.score-ring .score-num {
  font-weight: 800;
  font-size: 1.1rem;
}

.score-ring .score-num.text-success { color: #198754; }
.score-ring .score-num.text-warning { color: #fd7e14; }
.score-ring .score-num.text-danger { color: #dc3545; }

.title-item .title-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.title-item .tag {
  font-size: 0.72rem;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  background: rgba(99, 100, 241, 0.08);
  color: var(--brand-primary-dark);
}

.title-item .tag.tag-hot {
  background: rgba(244, 63, 94, 0.08);
  color: var(--brand-accent);
}

/* Outline */
.outline-card {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 0.75rem;
  margin-bottom: 1rem;
}

.outline-card .outline-head {
  border-bottom: 1px dashed rgba(0, 0, 0, 0.08);
}

.outline-chapter {
  border-left: 3px solid var(--brand-primary);
  background: rgba(99, 100, 241, 0.04);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
}

.outline-chapter .chapter-title {
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.outline-chapter .chapter-desc {
  color: var(--bs-secondary-color);
  font-size: 0.88rem;
}

.outline-chapter .chapter-bullets {
  margin-top: 0.4rem;
  padding-left: 1.2rem;
}

.outline-chapter .chapter-bullets li {
  font-size: 0.85rem;
  color: var(--bs-secondary-color);
  margin-bottom: 0.15rem;
}

.meta-desc-box {
  background: rgba(25, 135, 84, 0.06);
  border: 1px solid rgba(25, 135, 84, 0.2);
  border-radius: 0.75rem;
  padding: 0.9rem 1rem;
  font-size: 0.9rem;
  color: #14532d;
}

/* SEO panel */
.seo-card {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 0.75rem;
  padding: 1rem 1.1rem;
}

.seo-kw-item {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
}

.seo-kw-item .kw-type {
  font-size: 0.7rem;
  padding: 0.1rem 0.45rem;
  border-radius: 20px;
  background: rgba(99, 100, 241, 0.1);
  color: var(--brand-primary-dark);
}

.suggestion-item {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 0.55rem 0;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.07);
  font-size: 0.92rem;
}

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

.suggestion-item .s-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(244, 63, 94, 0.1);
  color: var(--brand-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}

.suggestion-item.ok .s-icon {
  background: rgba(25, 135, 84, 0.12);
  color: #198754;
}

/* Steps */
.step-card {
  background: #fff;
  border-radius: 1rem;
  height: 100%;
  box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.04);
}

.step-num {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
  color: #fff;
  font-size: 1.4rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-footer {
  background: #fff;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.btn-primary {
  --bs-btn-bg: var(--brand-primary);
  --bs-btn-border-color: var(--brand-primary);
  --bs-btn-hover-bg: var(--brand-primary-dark);
  --bs-btn-hover-border-color: var(--brand-primary-dark);
  --bs-btn-active-bg: var(--brand-primary-dark);
  --bs-btn-active-border-color: var(--brand-primary-dark);
  --bs-btn-focus-shadow-rgb: 99, 100, 241;
}

.text-primary {
  --bs-text-opacity: 1;
  color: var(--brand-primary) !important;
}

/* Dark mode support */
[data-bs-theme="dark"] body {
  background: #141419;
}

@media (max-width: 992px) {
  .sticky-form {
    position: static !important;
  }
}

@media (max-width: 576px) {
  .style-checkbox-grid {
    grid-template-columns: 1fr;
  }
}
