/*
 * DanmuAI 官网 — 组件样式
 * 卡片、按钮、FAQ、截图画廊、AI 服务商 chips
 */

/* ─── 图标系统 ─── */
.ui-icon {
  display: inline-block;
  width: 1.15em;
  height: 1.15em;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  vertical-align: -0.18em;
}

.ui-icon-lg {
  width: 1.5rem;
  height: 1.5rem;
}

/* ─── 卡片 ─── */
.warm-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-warm);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.warm-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-warm-hover);
}

/* ─── 按钮 ─── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  border: none;
  border-radius: 0.85rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.3s, box-shadow 0.3s, transform 0.15s;
}

.btn-primary:hover {
  background: var(--color-primary-hover);
  box-shadow: var(--shadow-btn);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  background: transparent;
  color: var(--color-primary-hover);
  font-weight: 700;
  font-size: 1rem;
  border: 2px solid var(--color-primary);
  border-radius: 0.85rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.btn-outline:hover {
  background: var(--color-primary);
  color: #fff;
}

/* ─── 主题切换按钮 ─── */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--color-surface);
  cursor: pointer;
  color: var(--color-text);
  transition: border-color 0.2s, color 0.2s;
}

.theme-toggle:hover {
  border-color: var(--color-primary);
  color: var(--color-primary-hover);
}

.theme-toggle svg {
  width: 1.125rem;
  height: 1.125rem;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }

/* ─── 功能卡片 ─── */
.feature-icon-wrap {
  width: 3rem;
  height: 3rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  flex-shrink: 0;
}

.feature-icon-wrap svg {
  width: 1.5rem;
  height: 1.5rem;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.feature-icon-peach {
  background-color: var(--color-secondary);
  color: var(--color-primary-hover);
}

.feature-icon-yellow {
  background-color: var(--color-accent);
  color: #d97706;
}

[data-theme="dark"] .feature-icon-yellow {
  color: #fbbf24;
}

.feature-title {
  font-weight: 700;
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

.feature-desc {
  font-size: 0.9rem;
  color: var(--color-text-dim);
  line-height: 1.6;
}

/* ─── 截图画廊 ─── */
.gallery-tabs {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.gallery-tab {
  padding: 0.5rem 1.25rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--color-surface);
  color: var(--color-text-dim);
  cursor: pointer;
  transition: all 0.2s;
}

.gallery-tab:hover {
  border-color: var(--color-primary);
  color: var(--color-primary-hover);
}

.gallery-tab.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

/* Laptop frame */
.laptop-frame {
  max-width: 52rem;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-warm-hover);
  background: var(--color-surface);
  border: 1px solid var(--border);
}

.laptop-titlebar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--color-bg-subtle);
  border-bottom: 1px solid var(--border);
}

.laptop-dot {
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 9999px;
}

.laptop-dot-red { background: #ef4444; }
.laptop-dot-yellow { background: #f59e0b; }
.laptop-dot-green { background: #22c55e; }

.laptop-titlebar-text {
  font-size: 0.75rem;
  color: var(--color-text-dim);
  margin-left: 0.5rem;
}

.laptop-screen {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.laptop-placeholder {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--color-text-dim);
  text-align: center;
  padding: 2rem;
}

.laptop-placeholder.active {
  display: flex;
}

.laptop-placeholder-inner {
  max-width: 20rem;
}

.laptop-placeholder-inner svg {
  width: 3rem;
  height: 3rem;
  stroke: var(--color-primary);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  margin: 0 auto 1rem;
  display: block;
}

/* ─── AI 服务商 chips ─── */
.provider-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.provider-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  border: 1px solid var(--border);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: default;
}

.provider-chip:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-warm);
}

.chip-peach {
  background-color: var(--color-secondary);
  color: var(--color-primary-hover);
}

.chip-yellow {
  background-color: var(--color-accent);
  color: #92400e;
}

[data-theme="dark"] .chip-yellow {
  color: #fbbf24;
}

.chip-mode {
  font-size: 0.7rem;
  font-weight: 400;
  opacity: 0.7;
}

/* ─── 下载区 ─── */
.download-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  max-width: 56rem;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .download-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.req-list {
  list-style: none;
  padding: 0;
}

.req-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.6rem 0;
  font-size: 0.9rem;
  color: var(--color-text);
}

.req-list li svg {
  width: 1.25rem;
  height: 1.25rem;
  stroke: #22c55e;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.req-list li svg.icon-warn {
  stroke: #f59e0b;
}

.download-steps {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}

.download-step {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: var(--color-text);
}

.download-step-num {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 9999px;
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ─── 隐私卡片 ─── */
.privacy-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  background-color: var(--color-secondary);
  color: var(--color-primary-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.privacy-icon svg {
  width: 1.25rem;
  height: 1.25rem;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

/* ─── FAQ 手风琴 ─── */
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  margin-bottom: 0.75rem;
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.faq-item:hover {
  box-shadow: var(--shadow-warm);
}

.faq-item summary {
  padding: 1.15rem 1.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--color-text);
  transition: color 0.2s;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: '';
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  transition: transform 0.2s;
}

.faq-item[open] summary::after {
  transform: rotate(180deg);
}

.faq-item summary:hover {
  color: var(--color-primary-hover);
}

.faq-answer {
  padding: 0 1.5rem 1.15rem;
  font-size: 0.9rem;
  color: var(--color-text-dim);
  line-height: 1.7;
}

.faq-answer p {
  margin-bottom: 0.5rem;
}

.faq-answer p:last-child {
  margin-bottom: 0;
}
