:root {
  --bg: #fff7fb;
  --bg-card: #ffffff;
  --bg-preview: #fff9fd;
  --border-soft: rgba(255, 182, 193, 0.4);
  --primary: #ff6b9c;
  --primary-soft: rgba(255, 107, 156, 0.18);
  --primary-dark: #e45487;
  --accent: #ffd166;
  --text-main: #3c243b;
  --text-soft: #86627e;
  --shadow-soft: 0 18px 45px rgba(255, 107, 156, 0.22);
  --touch-min: 44px;
  --safe-top: env(safe-area-inset-top, 0);
  --safe-bottom: env(safe-area-inset-bottom, 0);
  --safe-left: env(safe-area-inset-left, 0);
  --safe-right: env(safe-area-inset-right, 0);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: radial-gradient(circle at top left, #ffeaf1 0, #fff7fb 40%, #fdfdfd 100%);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

.app-root {
  max-width: 1120px;
  margin: 0 auto;
  /* 移动端优先：安全区域内边距、更大触控区 */
  padding: 12px var(--safe-left) 24px var(--safe-right);
  padding-top: calc(16px + var(--safe-top));
  padding-bottom: calc(24px + var(--safe-bottom));
}

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

.app-title {
  display: flex;
  align-items: center;
  gap: 14px;
}

.app-title-icon {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 20%, #ffeef5 0, #ffb3cd 40%, #ff89aa 100%);
  box-shadow: 0 10px 28px rgba(255, 107, 156, 0.5);
  font-size: 24px;
}

.app-title h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0.05em;
}

.app-title p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-soft);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-info .username {
  font-size: 14px;
  color: var(--text-main);
  font-weight: 500;
}

.btn-login {
  padding: 8px 20px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-login:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-logout {
  padding: 6px 16px;
  background: rgba(255, 107, 156, 0.15);
  color: var(--primary);
  border: 1px solid rgba(255, 107, 156, 0.3);
  border-radius: 16px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-logout:hover {
  background: rgba(255, 107, 156, 0.25);
  transform: translateY(-1px);
}

.app-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.editor-card {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 22px 22px 24px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(255, 182, 193, 0.45);
  position: relative;
  overflow: hidden;
}

.editor-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 0 0, rgba(255, 209, 220, 0.8), transparent 60%),
    radial-gradient(circle at 100% 100%, rgba(196, 181, 253, 0.35), transparent 55%);
  opacity: 0.18;
  pointer-events: none;
}

.editor-card > * {
  position: relative;
  z-index: 1;
}

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

.editor-header h2 {
  margin: 0;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.editor-tag {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 107, 156, 0.35);
  color: var(--text-soft);
}

/* 移动端优先：单列，预览在上 */
.editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.editor-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 移动端单列，桌面端双列 */
.form-row.two-col {
  flex-direction: column;
  gap: 10px;
}

.form-field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 13px;
  color: var(--text-soft);
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}

.field-hint {
  font-size: 11px;
  color: #b37f9a;
}

.text-input,
.textarea-input,
.select-input {
  border-radius: 12px;
  border: 1px solid rgba(255, 182, 193, 0.55);
  padding: 12px 14px;
  min-height: var(--touch-min);
  font-size: 16px;
  font-family: inherit;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.95);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}

.textarea-input {
  resize: vertical;
  min-height: 140px;
  padding: 14px 16px;
}

/* 避免 iOS 缩放 */
@supports (-webkit-touch-callout: none) {
  .text-input,
  .textarea-input,
  .select-input {
    font-size: max(16px, 1em);
  }
}

.text-input:focus,
.textarea-input:focus,
.select-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px rgba(255, 107, 156, 0.4);
  transform: translateY(-1px);
  background: #ffffff;
}

.select-input {
  cursor: pointer;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.btn {
  position: relative;
  border-radius: 999px;
  border: none;
  padding: 12px 20px;
  min-height: var(--touch-min);
  font-size: 15px;
  cursor: pointer;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.08s ease, box-shadow 0.12s ease, filter 0.12s ease,
    background 0.12s ease, border-color 0.12s ease;
  white-space: nowrap;
  touch-action: manipulation;
}

.btn.primary {
  background: linear-gradient(135deg, #ff88b4, #ff6b9c);
  color: #fff;
  box-shadow: 0 10px 22px rgba(255, 107, 156, 0.38);
}

.btn.secondary {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 107, 156, 0.4);
  color: var(--primary-dark);
}

.btn.link-btn {
  background: transparent;
  border: 1px solid rgba(255, 182, 193, 0.6);
  color: var(--text-soft);
  text-decoration: none;
}

/* 加载动画样式 */
.loading-overlay {
  position: fixed;
  inset: 0;
  inset: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 107, 156, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-text {
  margin-top: 16px;
  color: white;
  font-size: 14px;
  font-weight: 500;
}

.share-dialog-overlay {
  position: fixed;
  inset: 0;
  inset: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 16px;
  overflow-y: auto;
}

.share-dialog {
  width: 100%;
  max-width: 420px;
  background: #fffdfb;
  border-radius: 20px;
  border: 1px solid rgba(255, 182, 193, 0.7);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
  padding: 18px;
  font-size: 14px;
  margin: auto;
}

.share-dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.share-title {
  font-weight: 600;
  color: var(--text-main);
}

.share-close {
  border: none;
  background: transparent;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  color: var(--text-soft);
}

.share-dialog-body {
  color: var(--text-soft);
}

.share-desc {
  margin: 0 0 10px;
  font-size: 12px;
}

.share-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}

.share-label {
  font-size: 12px;
  color: var(--text-main);
}

.share-input-row {
  display: flex;
  gap: 6px;
}

.share-input {
  flex: 1;
  min-width: 0;
  border-radius: 10px;
  border: 1px solid rgba(255, 182, 193, 0.8);
  padding: 10px 12px;
  font-size: 14px;
  min-height: var(--touch-min);
}

.share-copy {
  border-radius: 999px;
  border: none;
  padding: 10px 16px;
  min-height: var(--touch-min);
  font-size: 14px;
  cursor: pointer;
  background: linear-gradient(135deg, #ff88b4, #ff6b9c);
  color: #fff;
  touch-action: manipulation;
}

.share-tip {
  margin: 4px 0 0;
  font-size: 11px;
}

.share-saved {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(76, 175, 80, 0.12);
  color: #2e7d32;
  font-size: 13px;
}

.share-warning {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 152, 0, 0.12);
  color: #e65100;
  font-size: 13px;
}

.share-warning a {
  color: #e65100;
  text-decoration: underline;
  cursor: pointer;
}

.share-warning a:hover {
  color: #bf360c;
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

.btn:active {
  transform: translateY(0);
  box-shadow: none;
  filter: brightness(0.97);
}

.small-tip {
  margin: 6px 0 0;
  font-size: 11px;
  color: #b37f9a;
  line-height: 1.5;
}

.preview-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.preview-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-soft);
}

.preview-icon {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 182, 193, 0.7);
}

.preview-card {
  border-radius: 16px;
  border: 1px solid var(--border-soft);
  background: var(--bg-preview);
  padding: 16px 16px 18px;
  box-shadow: 0 10px 26px rgba(255, 107, 156, 0.28);
  position: relative;
  overflow: hidden;
}

.preview-card::before,
.preview-card::after {
  content: "";
  position: absolute;
  width: 90px;
  height: 90px;
  border-radius: 30px;
  border: 2px dashed rgba(255, 255, 255, 0.75);
  opacity: 0.4;
  pointer-events: none;
}

.preview-card::before {
  top: -38px;
  right: -32px;
}

.preview-card::after {
  bottom: -40px;
  left: -35px;
}

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

.preview-meta-line {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-soft);
  margin-bottom: 4px;
}

.preview-tag {
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 182, 193, 0.8);
}

.preview-paper {
  background: #fffdfb;
  border-radius: 14px;
  padding: 14px 16px 16px;
  border: 1px solid rgba(219, 208, 255, 0.8);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.9);
}

.preview-paper-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 11px;
  color: #b37f9a;
}

.preview-love-icon {
  font-size: 16px;
}

.preview-title-main {
  font-size: 14px;
  margin-bottom: 6px;
}

.preview-body {
  font-size: 13px;
  line-height: 1.8;
  white-space: pre-wrap;
  color: #5e3a4f;
}

.preview-footer {
  margin-top: 12px;
  font-size: 12px;
  color: #7c516d;
  display: flex;
  justify-content: space-between;
}

.app-footer {
  margin-top: 16px;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--text-soft);
  justify-content: center;
}

#footerCustomHTML {
  width: 100%;
  text-align: center;
  padding: 8px 0;
  border-top: 1px solid rgba(255, 182, 193, 0.3);
  margin-top: 8px;
}

#footerCustomHTML p {
  margin: 4px 0;
  font-size: 12px;
  color: var(--text-soft);
}

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

.seo-section {
  margin-top: 24px;
  padding: 20px 18px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 182, 193, 0.45);
}

.seo-intro h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.seo-intro p {
  margin: 4px 0;
  font-size: 13px;
  color: var(--text-soft);
}

.seo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.seo-card {
  border-radius: 14px;
  padding: 12px 12px 13px;
  background: #fff9fd;
  border: 1px solid rgba(255, 182, 193, 0.4);
  box-shadow: 0 8px 20px rgba(255, 107, 156, 0.12);
  font-size: 12px;
  color: var(--text-soft);
}

.seo-card h3 {
  margin: 0 0 6px;
  font-size: 14px;
  color: var(--text-main);
}

.seo-card ul,
.seo-card ol {
  margin: 4px 0 0;
  padding-left: 18px;
}

.seo-card li {
  margin: 2px 0;
}

.seo-card code {
  font-size: 11px;
  background: rgba(0, 0, 0, 0.03);
  padding: 1px 4px;
  border-radius: 4px;
}

/* 平板及以上：双列布局 */
@media (min-width: 768px) {
  .app-root {
    padding: 24px 20px 40px;
  }

  .editor-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 20px;
  }

  .form-row.two-col {
    flex-direction: row;
  }

  .preview-wrapper {
    order: 0;
  }

  .editor-form {
    order: 0;
  }
}

/* 桌面端：更大内边距 */
@media (min-width: 1024px) {
  .app-root {
    padding: 32px 24px 48px;
  }
}

/* 移动端：预览在上、按钮全宽、SEO 单列 */
@media (max-width: 767px) {
  .preview-wrapper {
    order: -1;
  }

  .app-header {
    margin-bottom: 20px;
  }

  .app-title-icon {
    width: 40px;
    height: 40px;
    font-size: 22px;
  }

  .app-title h1 {
    font-size: 20px;
  }

  .editor-card {
    padding: 18px;
  }

  .button-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .btn {
    width: 100%;
  }

  .seo-section {
    padding: 16px;
    margin-top: 20px;
  }

  .seo-intro h2 {
    font-size: 16px;
  }
}

/* SEO 网格：移动单列，平板 2 列，桌面 3 列 */
@media (max-width: 767px) {
  .seo-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

@media (min-width: 768px) {
  .seo-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 历史情书面板样式 */
.history-panel {
  margin-top: 20px;
  background: rgba(255, 249, 253, 0.8);
  border-radius: 16px;
  border: 1px solid rgba(255, 182, 193, 0.4);
  padding: 16px;
  animation: slideDown 0.3s ease-out;
}

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

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 182, 193, 0.3);
}

.history-header h3 {
  margin: 0;
  font-size: 16px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-icon {
  background: transparent;
  border: none;
  font-size: 24px;
  color: var(--text-soft);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: all 0.15s ease;
  min-width: 36px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  background: rgba(255, 107, 156, 0.1);
  color: var(--primary);
}

.history-list {
  display: grid;
  gap: 12px;
  max-height: 500px;
  overflow-y: auto;
}

.history-item {
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid rgba(255, 182, 193, 0.3);
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  transition: all 0.15s ease;
}

.history-item:hover {
  border-color: rgba(255, 107, 156, 0.5);
  box-shadow: 0 4px 12px rgba(255, 107, 156, 0.15);
  transform: translateY(-2px);
}

.history-item-info {
  flex: 1;
  min-width: 0;
}

.history-item-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  margin: 0 0 4px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-item-meta {
  font-size: 12px;
  color: var(--text-soft);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-item-meta span {
  margin-right: 12px;
}

.history-item-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.history-action-btn {
  background: transparent;
  border: 1px solid rgba(255, 182, 193, 0.5);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  color: var(--text-soft);
  cursor: pointer;
  transition: all 0.15s ease;
  min-width: 32px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.history-action-btn:hover {
  background: rgba(255, 249, 253, 0.9);
  border-color: rgba(255, 107, 156, 0.5);
  color: var(--primary);
}

.history-action-btn.edit {
  border-color: rgba(255, 107, 156, 0.4);
}

.history-action-btn.edit:hover {
  background: rgba(255, 107, 156, 0.1);
}

.history-action-btn.delete {
  border-color: rgba(255, 100, 100, 0.4);
}

.history-action-btn.delete:hover {
  background: rgba(255, 100, 100, 0.1);
  border-color: rgba(255, 100, 100, 0.6);
  color: #ff6464;
}

.history-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-soft);
  font-size: 14px;
}

.history-empty .icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.loading {
  text-align: center;
  padding: 20px;
  color: var(--text-soft);
  font-size: 14px;
}

/* 第三方按钮样式 */
.btn.tertiary {
  background: transparent;
  border: 1px solid rgba(255, 182, 193, 0.6);
  color: var(--text-soft);
}

.btn.tertiary:hover {
  background: rgba(255, 249, 253, 0.9);
  border-color: rgba(255, 107, 156, 0.5);
  color: var(--primary);
}

@media (max-width: 640px) {
  .history-panel {
    margin-top: 16px;
    padding: 12px;
  }

  .history-item {
    padding: 12px;
    flex-direction: column;
  }

  .history-item-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

/* 认证弹窗样式 */
.auth-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.auth-modal-content {
  position: relative;
  background: var(--bg-card);
  border-radius: 20px;
  border: 1px solid var(--border-soft);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  padding: 24px;
  max-width: 420px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.auth-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-soft);
}

.auth-modal-header h3 {
  margin: 0;
  font-size: 18px;
  color: var(--text-main);
}

.auth-modal-body {
  min-height: 200px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-form .form-row {
  margin-bottom: 0;
}

.auth-form .btn {
  margin-top: 8px;
}

.auth-switch {
  margin: 8px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--text-soft);
}

.auth-switch a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.auth-switch a:hover {
  text-decoration: underline;
}

/* 用户信息显示 */
.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(255, 249, 253, 0.8);
  border-radius: 12px;
  border: 1px solid rgba(255, 182, 193, 0.3);
  font-size: 13px;
  color: var(--text-soft);
}

.user-info .user-name {
  font-weight: 600;
  color: var(--text-main);
}

.user-info .logout-btn {
  color: var(--primary);
  cursor: pointer;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s ease;
}

.user-info .logout-btn:hover {
  background: rgba(255, 107, 156, 0.1);
}

@media (max-width: 640px) {
  .auth-modal-content {
    padding: 20px;
    width: 95%;
  }

  .user-info {
    font-size: 12px;
    padding: 6px 10px;
  }
}



@media (min-width: 1024px) {
  .seo-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}



/* ========================================
   SEO 内容扩展样式
   ======================================== */

/* SEO 区块容器 */
.seo-section-block {
  margin-top: 24px;
  padding: 20px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 182, 193, 0.35);
}

.seo-section-block h3 {
  margin: 0 0 12px;
  font-size: 17px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.seo-section-block > p {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.7;
}

/* 情书类型网格 */
.letter-types-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.letter-type-card {
  background: #fff9fd;
  border-radius: 12px;
  padding: 16px;
  border: 1px solid rgba(255, 182, 193, 0.35);
  transition: all 0.2s ease;
}

.letter-type-card:hover {
  border-color: rgba(255, 107, 156, 0.5);
  box-shadow: 0 6px 16px rgba(255, 107, 156, 0.15);
  transform: translateY(-2px);
}

.letter-type-card h4 {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--text-main);
  font-weight: 600;
}

.letter-type-card p {
  margin: 0;
  font-size: 12px;
  color: var(--text-soft);
  line-height: 1.7;
}

/* 写作技巧列表 */
.writing-tips-list {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.tip-item {
  display: flex;
  gap: 14px;
  background: #fff9fd;
  border-radius: 12px;
  padding: 16px;
  border: 1px solid rgba(255, 182, 193, 0.3);
}

.tip-number {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 600;
}

.tip-content h4 {
  margin: 0 0 6px;
  font-size: 14px;
  color: var(--text-main);
  font-weight: 600;
}

.tip-content p {
  margin: 0;
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.7;
}

/* 情书模板 */
.letter-templates {
  display: grid;
  gap: 20px;
  margin-top: 16px;
}

.template-card {
  background: linear-gradient(135deg, #fff9fd 0%, #ffeef5 100%);
  border-radius: 14px;
  padding: 20px;
  border: 1px solid rgba(255, 182, 193, 0.4);
  box-shadow: 0 4px 12px rgba(255, 107, 156, 0.1);
}

.template-card h4 {
  margin: 0 0 12px;
  font-size: 15px;
  color: var(--text-main);
  font-weight: 600;
  padding-bottom: 10px;
  border-bottom: 2px solid rgba(255, 182, 193, 0.3);
}

.template-content {
  background: white;
  border-radius: 10px;
  padding: 16px;
  border: 1px solid rgba(255, 182, 193, 0.25);
  font-family: 'Noto Serif SC', serif;
  line-height: 1.8;
}

.template-content p {
  margin: 8px 0;
  font-size: 13px;
  color: var(--text-main);
}

/* 表白情话网格 */
.quotes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.quote-item {
  background: linear-gradient(135deg, #fff9fd 0%, white 100%);
  border-radius: 12px;
  padding: 16px;
  border: 1px solid rgba(255, 182, 193, 0.35);
  text-align: center;
  transition: all 0.2s ease;
}

.quote-item:hover {
  border-color: var(--primary);
  box-shadow: 0 6px 16px rgba(255, 107, 156, 0.2);
  transform: translateY(-3px);
}

.quote-item p {
  margin: 0;
  font-size: 13px;
  color: var(--text-main);
  font-style: italic;
  line-height: 1.7;
}

/* FAQ 列表 */
.faq-list {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.faq-item {
  background: #fff9fd;
  border-radius: 12px;
  padding: 16px 18px;
  border: 1px solid rgba(255, 182, 193, 0.3);
}

.faq-item h4 {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--text-main);
  font-weight: 600;
}

.faq-item p {
  margin: 0;
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.7;
}

/* 功能列表 */
.feature-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding-left: 0;
}

.feature-list li {
  margin: 0;
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.8;
  padding-left: 0;
}

.feature-list strong {
  color: var(--primary);
  font-weight: 600;
}

/* 关于区块 */
.about-block {
  background: linear-gradient(135deg, #ffeef5 0%, #fff9fd 100%);
  border-color: rgba(255, 182, 193, 0.5);
}

.about-block p {
  font-size: 14px;
}

/* SEO 内容响应式设计 */
@media (max-width: 767px) {
  .letter-types-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .letter-templates {
    gap: 16px;
  }

  .template-card {
    padding: 16px;
  }

  .template-content {
    padding: 14px;
  }

  .quotes-grid {
    grid-template-columns: 1fr;
  }

  .tip-item {
    flex-direction: row;
  }

  .seo-section-block {
    padding: 16px;
    margin-top: 20px;
  }

  .seo-section-block h3 {
    font-size: 16px;
  }
}

@media (min-width: 768px) {
  .letter-types-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .quotes-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .letter-types-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .quotes-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ========================================
   预览模态框样式
   ======================================== */
.preview-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.preview-modal-content {
  position: relative;
  background: var(--bg-card);
  border-radius: 20px;
  border: 1px solid var(--border-soft);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  padding: 24px;
  max-width: 900px;
  width: 95%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modalFadeIn 0.3s ease-out;
}

.preview-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-soft);
  flex-shrink: 0;
}

.preview-modal-header h3 {
  margin: 0;
  font-size: 18px;
  color: var(--text-main);
}

.preview-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  border-radius: 12px;
  background: #ffffff;
}

/* 预览模态框内的内容重置样式 */
.preview-modal-body .letter-page {
  margin: 0;
  padding: 40px;
  max-width: 100%;
}

/* 移动端适配 */
@media (max-width: 640px) {
  .preview-modal-content {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    padding: 16px;
  }

  .preview-modal-header {
    padding-bottom: 8px;
    margin-bottom: 12px;
  }

  .preview-modal-header h3 {
    font-size: 16px;
  }

  .preview-modal-body .letter-page {
    padding: 20px;
  }
}
