/* ===== 基础重置 ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0f1221;
  --bg-soft: #171a2e;
  --card-bg: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.1);
  --text: #eef0ff;
  --text-dim: #a5a9c8;
  --accent: #8b5cf6;
  --accent-2: #22d3ee;
  --accent-3: #f472b6;
  --radius: 20px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(1200px 700px at 15% -10%, #1d1b3b 0%, var(--bg) 55%);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ===== 背景漂浮圆 ===== */
.bg-blobs {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
}

.blob-1 {
  width: 420px;
  height: 420px;
  background: var(--accent);
  top: -120px;
  right: -80px;
  animation: float 14s ease-in-out infinite alternate;
}

.blob-2 {
  width: 360px;
  height: 360px;
  background: var(--accent-2);
  bottom: -140px;
  left: -100px;
  animation: float 18s ease-in-out infinite alternate-reverse;
}

.blob-3 {
  width: 220px;
  height: 220px;
  background: var(--accent-3);
  top: 55%;
  left: 60%;
  animation: float 22s ease-in-out infinite alternate;
}

@keyframes float {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(40px, -30px) scale(1.15); }
}

/* ===== 主容器 ===== */
.container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 640px;
}

/* ===== 头部 ===== */
.site-header {
  text-align: center;
  margin-bottom: 28px;
}

.logo {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  font-size: 30px;
  color: var(--text);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.4), rgba(34, 211, 238, 0.4));
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  animation: logo-spin 8s linear infinite;
}

@keyframes logo-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.site-header h1 {
  font-size: 30px;
  letter-spacing: 2px;
  background: linear-gradient(90deg, #c4b5fd, #67e8f9, #f9a8d4);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  margin-top: 8px;
  color: var(--text-dim);
  font-size: 15px;
}

/* ===== 筛选区 ===== */
.filters {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.tab {
  padding: 7px 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card-bg);
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}

.tab:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.28);
  transform: translateY(-2px);
}

.tab.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 18px rgba(139, 92, 246, 0.4);
}

.search-box input {
  width: 100%;
  padding: 12px 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card-bg);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.search-box input::placeholder {
  color: rgba(165, 169, 200, 0.6);
}

.search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.18);
}

/* ===== 灵感卡片 ===== */
.inspiration-card {
  position: relative;
  min-height: 220px;
  padding: 28px 26px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.inspiration-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.12), rgba(34, 211, 238, 0.12));
  pointer-events: none;
  z-index: 0;
}

.card-meta,
.inspiration-body,
.inspiration-tag {
  position: relative;
  z-index: 1;
}

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

.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge {
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 1px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.icon-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.25s ease;
}

.icon-btn:hover {
  color: var(--text);
  border-color: var(--accent-2);
  transform: scale(1.1);
}

.icon-btn.copied {
  color: #4ade80;
  border-color: #4ade80;
}

.icon-btn.active {
  color: #fbbf24;
  border-color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
}

.inspiration-text {
  font-size: 19px;
  line-height: 1.75;
  letter-spacing: 0.5px;
  color: var(--text);
  transition: opacity 0.2s ease;
}

.inspiration-tag {
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-dim);
}

/* ===== 图片内容 ===== */
.image-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.inspiration-img {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  display: block;
}

.image-caption {
  font-size: 15px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}

/* ===== 卡片出场动画 ===== */
.card-in {
  animation: cardIn 0.45s cubic-bezier(0.2, 0.8, 0.3, 1);
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ===== Toast 提示 ===== */
.toast {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%) translateY(6px);
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 2;
}

.toast[data-type="ok"] {
  background: rgba(74, 222, 128, 0.15);
  border: 1px solid rgba(74, 222, 128, 0.4);
  color: #4ade80;
}

.toast[data-type="warn"] {
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid rgba(251, 191, 36, 0.4);
  color: #fbbf24;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== 操作按钮 ===== */
.actions {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

.primary-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 36px;
  border: none;
  border-radius: 999px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 1px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(139, 92, 246, 0.45);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.primary-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 14px 38px rgba(139, 92, 246, 0.6);
}

.primary-btn:active {
  transform: translateY(0) scale(0.96);
}

.primary-btn.jolted .btn-icon {
  animation: jolt 0.4s ease;
}

@keyframes jolt {
  0%   { transform: rotate(0deg) scale(1); }
  30%  { transform: rotate(-18deg) scale(1.25); }
  60%  { transform: rotate(14deg) scale(1.15); }
  100% { transform: rotate(0deg) scale(1); }
}

/* ===== 面板（历史 / 收藏） ===== */
.panel {
  margin-top: 26px;
}

.panel-title {
  font-size: 15px;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.history-list,
.fav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.history-item:hover {
  border-color: rgba(34, 211, 238, 0.5);
  transform: translateX(3px);
}

.history-badge,
.fav-badge {
  flex-shrink: 0;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.history-text,
.fav-text {
  font-size: 14px;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fav-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color 0.2s ease;
}

.fav-item:hover {
  border-color: rgba(251, 191, 36, 0.5);
}

.fav-load {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  padding: 0;
}

.fav-remove {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fav-remove:hover {
  color: #f87171;
  background: rgba(248, 113, 113, 0.15);
}

.panel-empty {
  font-size: 13px;
  color: rgba(165, 169, 200, 0.6);
}

/* ===== 底部 ===== */
.site-footer {
  margin-top: 28px;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
}

/* ===== 响应式 ===== */
@media (max-width: 520px) {
  .site-header h1 { font-size: 25px; }
  .inspiration-text { font-size: 17px; }
  .primary-btn { padding: 13px 28px; font-size: 15px; }
  .tab { padding: 6px 14px; font-size: 13px; }
  .inspiration-img { max-height: 240px; }
}
