/* 中文 AI 工具集 - 全局样式 */

:root {
  --color-bg: #fafaf7;
  --color-fg: #1a1a1a;
  --color-primary: #d4a373;
  --color-primary-dark: #b8865a;
  --color-secondary: #6b705c;
  --color-muted: #6c757d;
  --color-border: #e9ecef;
  --color-card: #ffffff;
  --color-card-hover: #fdfbf7;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --radius: 8px;
  --radius-sm: 6px;
  --max-width: 1100px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: var(--color-bg);
  color: var(--color-fg);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}

/* Header */
.site-header {
  background: var(--color-card);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.logo {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-fg);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.main-nav {
  display: flex;
  gap: 24px;
}

.main-nav a {
  color: var(--color-muted);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--color-primary-dark);
  border-bottom-color: var(--color-primary);
}

.main-nav a.disabled {
  color: #adb5bd;
  cursor: not-allowed;
}

/* Main */
.main-content {
  flex: 1;
  padding: 40px 20px;
}

/* Hero */
.hero {
  text-align: center;
  margin-bottom: 48px;
  padding: 32px 0;
}

.hero h1 {
  font-size: 2.2rem;
  margin-bottom: 12px;
  letter-spacing: 0.02em;
}

.hero .subtitle {
  font-size: 1.15rem;
  color: var(--color-secondary);
  margin-bottom: 16px;
}

.hero .description {
  color: var(--color-muted);
  max-width: 600px;
  margin: 0 auto;
}

/* Tools Grid */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 60px;
}

.tool-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 24px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  position: relative;
}

.tool-card:hover,
.tool-card.active {
  background: var(--color-card-hover);
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.tool-card .tool-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.tool-card h2 {
  font-size: 1.15rem;
  margin-bottom: 8px;
}

.tool-card p {
  color: var(--color-muted);
  font-size: 0.9rem;
  flex-grow: 1;
}

.badge {
  display: inline-block;
  margin-top: 12px;
  padding: 3px 10px;
  font-size: 0.75rem;
  border-radius: 12px;
  background: rgba(212, 163, 115, 0.15);
  color: var(--color-primary-dark);
  align-self: flex-start;
}

.badge.soon {
  background: #f1f3f5;
  color: var(--color-muted);
}

/* Features */
.features {
  background: var(--color-card);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 60px;
}

.features h2 {
  margin-bottom: 24px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}

.feature h3 {
  font-size: 1rem;
  margin-bottom: 8px;
  color: var(--color-primary-dark);
}

.feature p {
  color: var(--color-muted);
  font-size: 0.9rem;
}

/* Footer */
.site-footer {
  background: var(--color-card);
  border-top: 1px solid var(--color-border);
  padding: 20px 0;
  text-align: center;
  color: var(--color-muted);
  font-size: 0.85rem;
}

.site-footer a {
  color: var(--color-primary-dark);
  text-decoration: none;
}

/* Tool Page */
.tool-page {
  padding-top: 24px;
}

.breadcrumb {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-bottom: 16px;
}

.breadcrumb a {
  color: var(--color-primary-dark);
  text-decoration: none;
}

.tool-page h1 {
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.tool-desc {
  color: var(--color-muted);
  margin-bottom: 24px;
}

/* Search Section */
.search-section {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 32px;
}

.search-box {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.search-box input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

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

.search-box button {
  padding: 12px 24px;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}

.search-box button:hover {
  background: var(--color-primary-dark);
}

.search-suggestions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--color-muted);
}

.tag-btn {
  background: #f1f3f5;
  border: none;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.85rem;
  color: var(--color-secondary);
  cursor: pointer;
  transition: background 0.2s;
}

.tag-btn:hover {
  background: #e9ecef;
}

/* Result Section */
.result-section {
  margin-bottom: 40px;
}

.result-content {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 32px;
  margin: 16px 0;
}

.result-content .poem-title {
  font-size: 1.5rem;
  margin-bottom: 8px;
  color: var(--color-fg);
}

.result-content .poem-meta {
  color: var(--color-muted);
  font-size: 0.95rem;
  margin-bottom: 20px;
}

.result-content .poem-content {
  font-size: 1.25rem;
  line-height: 2;
  margin: 20px 0;
  padding: 16px;
  background: #fdfbf7;
  border-left: 3px solid var(--color-primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.result-content .section-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 24px 0 12px;
  color: var(--color-secondary);
}

.result-content .annotations {
  list-style: none;
}

.result-content .annotations li {
  padding: 6px 0;
  border-bottom: 1px dashed var(--color-border);
  font-size: 0.95rem;
}

.result-content .annotations li:last-child {
  border-bottom: none;
}

.result-content .annotation-word {
  font-weight: 600;
  color: var(--color-primary-dark);
  margin-right: 8px;
}

.result-content .imagery-tags,
.result-content .theme-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.result-content .tag {
  background: rgba(212, 163, 115, 0.15);
  color: var(--color-primary-dark);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.85rem;
}

.result-content .background {
  color: var(--color-muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

.result-content .related-poems {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.result-content .related-poem {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  color: inherit;
  display: block;
}

.result-content .related-poem:hover {
  border-color: var(--color-primary);
  background: #fdfbf7;
}

.result-content .related-poem .title {
  font-weight: 600;
  margin-bottom: 4px;
}

.result-content .related-poem .author {
  font-size: 0.85rem;
  color: var(--color-muted);
}

.result-content .related-poem .content {
  font-size: 0.9rem;
  margin-top: 8px;
  color: var(--color-secondary);
}

/* Ad Slots */
.ad-slot {
  min-height: 90px;
  margin: 16px 0;
  border: 1px dashed #dee2e6;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #adb5bd;
  font-size: 0.85rem;
  background: #f8f9fa;
}

.ad-slot.ad-top,
.ad-slot.ad-footer {
  min-height: 90px;
}

.ad-slot.ad-mid,
.ad-slot.ad-bottom {
  min-height: 250px;
}

/* Poems List */
.poems-list-section {
  margin-bottom: 40px;
}

.poems-list-section h2 {
  margin-bottom: 8px;
}

.section-desc {
  color: var(--color-muted);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.poems-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.poem-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.poem-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

.poem-card .title {
  font-weight: 600;
  margin-bottom: 4px;
}

.poem-card .meta {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-bottom: 8px;
}

.poem-card .content {
  font-size: 0.9rem;
  color: var(--color-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* FAQ */
.faq-section {
  margin-bottom: 40px;
}

.faq-section h2 {
  margin-bottom: 20px;
}

.faq-item {
  border-bottom: 1px solid var(--color-border);
  padding: 16px 0;
}

.faq-item h3 {
  font-size: 1rem;
  margin-bottom: 8px;
  color: var(--color-fg);
}

.faq-item p {
  color: var(--color-muted);
  font-size: 0.95rem;
}

/* Loading */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--color-muted);
}

.loading::after {
  content: '';
  display: block;
  width: 24px;
  height: 24px;
  margin: 12px auto 0;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

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

/* Responsive */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 1.75rem;
  }

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

  .search-box {
    flex-direction: column;
  }

  .search-box button {
    width: 100%;
  }

  .main-nav {
    gap: 12px;
  }

  .main-nav a {
    font-size: 0.85rem;
  }

  .ad-slot.ad-mid,
  .ad-slot.ad-bottom {
    min-height: 200px;
  }
}
