/* ==========================================================
   PhoenixHome 主页样式 · 参考 PhoenixAI ver 2.0 主页设计风格
   （搜索 + 卡片工具墙，暖色二次元创作平台风）
   ========================================================== */

:root {
  color-scheme: dark;
  --bg: #18151e;
  --bg-soft: #211c28;
  --card: #25212d;
  --card-2: #302936;
  --border: #ffffff12;
  --border-strong: #ffffff24;
  --text: #f7f0f4;
  --text-dim: #bdb0c0;
  --text-faint: #a294a6;
  --accent: #ff817c;
  --accent-2: #e7799f;
  --grad-primary: linear-gradient(120deg, #ef7365, #e3658e);
  --grad-phoenix: linear-gradient(135deg, #ff8a3d 0%, #ff5c5c 55%, #c04bff 100%);
  --soft-accent: #ef736518;
  --ink-accent: #ffaaa0;
  --shadow-1: 0 12px 36px #0c081620;
  --radius: 16px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

html.theme-light {
  color-scheme: light;
  --bg: #fcf9f7;
  --bg-soft: #fffdfb;
  --card: #fff;
  --card-2: #f5eeee;
  --border: #6c425415;
  --border-strong: #6c42542e;
  --text: #372d3e;
  --text-dim: #827382;
  --text-faint: #948393;
  --accent: #d85e59;
  --accent-2: #ba6291;
  --grad-primary: linear-gradient(120deg, #ed7562, #dc6381);
  --soft-accent: #f7e6e3;
  --ink-accent: #ba5556;
  --shadow-1: 0 12px 36px #7950600b;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  background-image: radial-gradient(#a5809410 0.7px, transparent 0.7px);
  background-size: 7px 7px;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background 0.3s ease, color 0.3s ease;
}
::selection { background: rgba(239, 115, 101, 0.35); }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img, svg { display: block; }
[hidden] { display: none !important; }
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

/* ---------- 布局骨架 ---------- */
.app { position: relative; z-index: 1; min-height: 100vh; }

/* ---------- 品牌 ---------- */
.brand { display: flex; align-items: center; gap: 8px; }
.brand__logo { display: grid; place-items: center; }
.brand__logo img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 3px 8px #e3658e33);
}
.brand__name { font-size: 18px; font-weight: 800; letter-spacing: -0.6px; white-space: nowrap; }
.brand__name em { font-style: normal; color: var(--ink-accent); }

/* ---------- 主内容 ---------- */
.main { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 36px;
  min-height: 72px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
  transition: background 0.3s ease;
}
.top-nav { display: flex; align-items: center; gap: 26px; }
.top-nav a, .top-nav button { font-size: 13px; color: var(--text-dim); transition: color 0.15s; white-space: nowrap; }
.top-nav a:hover, .top-nav button:hover { color: var(--text); }
.top-nav a:first-child { color: var(--ink-accent); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.theme-select {
  font: inherit;
  font-size: 12px;
  color: var(--text-dim);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 10px;
  cursor: pointer;
  max-width: 112px;
}

.btn-signin {
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: var(--grad-primary);
  box-shadow: 0 4px 10px #dd63821b;
  transition: box-shadow 0.2s, transform 0.15s, filter 0.2s;
}
.btn-signin:hover { box-shadow: 0 6px 20px #dd63823d; transform: translateY(-1px); filter: brightness(1.05); }

/* ---------- 内容容器 ---------- */
.content { width: 100%; max-width: 1410px; margin: 0 auto; padding: 0 38px 32px; flex: 1; }

/* ---------- 搜索区（页面焦点） ---------- */
.hero { text-align: left; padding: 8px 0 0; scroll-margin-top: 90px; }

.workspace-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 2px 14px;
}
.workspace-heading h1 {
  font-size: clamp(20px, 2.2vw, 26px);
  font-weight: 750;
  letter-spacing: -0.5px;
  line-height: 1.3;
}
.workspace-heading > span { font-size: 9px; letter-spacing: 1.5px; color: var(--text-faint); white-space: nowrap; }
.workspace-heading > span > span { color: var(--accent); padding-left: 9px; }

.web-search {
  display: block;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px 18px;
  box-shadow: var(--shadow-1);
  scroll-margin-top: 95px;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.3s ease;
}
.web-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--soft-accent); }
.web-search__bar { display: flex; align-items: center; gap: 12px; }
.web-search__logo { width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0; overflow: hidden; }
.web-search__logo img { width: 100%; height: 100%; object-fit: contain; }
#web-search-input {
  flex: 1;
  min-width: 0;
  height: 42px;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14.5px;
}
#web-search-input::placeholder { color: var(--text-faint); }
.select-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 12px;
  padding: 7px 9px;
  flex-shrink: 0;
}
.select-pill__key { font-size: 10px; font-weight: 700; color: var(--accent); }
.select-pill select {
  appearance: none;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
  max-width: 90px;
}
.select-pill select option { background: var(--card-2); color: var(--text); }
.web-search__bar .btn-primary { flex-shrink: 0; }

/* ---------- 按钮 ---------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--grad-primary);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 10px;
  box-shadow: 0 4px 10px #dd63821b;
  transition: box-shadow 0.2s, transform 0.15s, filter 0.2s;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px #dd63823d; filter: brightness(1.05); }
.btn-primary .ico { width: 15px; height: 15px; fill: currentColor; }
.btn-primary:active { transform: translateY(0) scale(0.97); }

/* ---------- 工具区块 ---------- */
.tool-section { display: flex; flex-direction: column; gap: 14px; padding-top: 28px; scroll-margin-top: 72px; }
.tool-section .section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 2px; }
.tool-section .section-head h2 {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.tool-section .section-head h2::before { content: "✦"; font-size: 13px; color: var(--accent); }
.tool-section .section-head span {
  margin-left: auto;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-accent);
  background: var(--soft-accent);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}

.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.tool-card {
  text-align: left;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 108px;
  padding: 18px;
  background: linear-gradient(135deg, var(--soft-accent), transparent 65%), var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  transition: transform 0.22s, border-color 0.22s, box-shadow 0.22s;
}
.tool-card::after {
  content: "";
  position: absolute;
  top: -10%;
  bottom: -10%;
  left: -80%;
  width: 56%;
  background: linear-gradient(105deg, transparent, #ffffff14, transparent);
  transform: skewX(-18deg);
  transition: left 0.65s ease;
  pointer-events: none;
}
.tool-card:hover::after { left: 125%; }
.tool-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 12px 34px #0c08162e;
}
.tool-card:active { transform: translateY(-1px) scale(0.995); }
.tool-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-size: 17px;
  font-weight: 800;
  color: var(--accent);
  flex-shrink: 0;
  overflow: hidden;
  transform: rotate(-4deg);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.tool-card:hover .tool-icon { transform: rotate(0) scale(1.08); }
.tool-icon img { width: 100%; height: 100%; object-fit: contain; padding: 5px; }
.tool-main { min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.tool-main strong { font-size: 15px; line-height: 1.3; transition: color 0.2s; }
.tool-card:hover .tool-main strong { color: var(--ink-accent); }
.tool-main span { font-size: 11px; color: var(--text-dim); line-height: 1.8; }

/* 加载 / 提示卡片 */
.loading-card, .notice-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  color: var(--text-dim);
  font-size: 13px;
  box-shadow: var(--shadow-1);
}
.loading-card { display: flex; align-items: center; gap: 10px; }
.loading-card::before {
  content: "";
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
.notice-card { color: var(--ink-accent); background: var(--soft-accent); border-color: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 页脚 ---------- */
.footer { margin-top: 40px; border-top: 1px solid var(--border); padding-top: 28px; }
.footer__grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) repeat(2, minmax(100px, 160px));
  column-gap: clamp(24px, 4vw, 56px);
  row-gap: 28px;
  align-items: start;
}
.footer__brand { min-width: 0; }
.footer__brand-row { display: flex; align-items: center; gap: 16px; min-height: 40px; margin-bottom: 12px; }
.footer__brand .brand { flex-shrink: 0; }
.footer__brand .brand__name { font-size: 17px; }
.footer__brand .brand__logo img { width: 26px; height: 26px; }
.footer__mascot {
  width: 44px;
  height: 40px;
  object-fit: contain;
  object-position: center bottom;
  flex-shrink: 0;
  filter: drop-shadow(0 5px 10px #db77751a);
}
.footer__slogan { font-size: 14px; font-weight: 600; line-height: 22px; margin-bottom: 8px; }
.footer__desc { font-size: 12.5px; color: var(--text-faint); line-height: 1.7; max-width: 300px; }
.footer__col { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; margin-top: -10px; }
.footer__col h4 {
  display: flex;
  align-items: center;
  min-height: 40px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.footer__col a, .footer__col span { line-height: 22px; overflow-wrap: anywhere; font-size: 13px; color: var(--text-dim); transition: color 0.15s; }
.footer__col a:hover { color: var(--text); }
.footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  margin-top: 28px;
  padding: 18px 0 0;
  line-height: 1.7;
  font-size: 12px;
  color: var(--text-faint);
}
.footer__bottom .dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  margin-right: 6px;
}

/* ---------- 入场动画 ---------- */
.fade-up { animation: fadeUp 0.45s cubic-bezier(0.25, 0.75, 0.3, 1) both; }
.anchor { scroll-margin-top: 84px; }
.tool-section { animation: fadeUp 0.45s ease both; animation-delay: var(--sd, 0ms); }
.tool-card { animation: fadeUp 0.45s cubic-bezier(0.25, 0.75, 0.3, 1) both; animation-delay: var(--d, 0ms); }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- 响应式 ---------- */
@media (max-width: 1180px) {
  .content { padding-left: 24px; padding-right: 24px; }
}
@media (max-width: 900px) {
  .footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer__brand { grid-column: 1 / -1; }
  .footer__col { margin-top: 0; }
  .footer__col h4 { min-height: auto; }
  .topbar { padding: 0 22px; min-height: 62px; }
  .content { padding: 0 22px 26px; }
  .hero { padding-top: 6px; }
}
@media (max-width: 640px) {
  .content { padding: 0 15px 24px; }
  .topbar { flex-wrap: wrap; padding: 10px 15px 0; min-height: 0; }
  .brand__name { font-size: 16px; }
  .theme-select { display: none; }
  .btn-signin { padding: 8px 14px; font-size: 12px; }
  .top-nav { order: 3; width: 100%; gap: 16px; padding: 10px 0; overflow-x: auto; scrollbar-width: none; }
  .top-nav::-webkit-scrollbar { display: none; }
  .workspace-heading { margin: 0 0 12px; }
  .workspace-heading h1 { font-size: 18px; }
  .workspace-heading > span { display: none; }
  .web-search { padding: 12px; }
  .web-search__bar { flex-wrap: wrap; row-gap: 9px; }
  .web-search__logo { display: none; }
  #web-search-input { flex: 1 1 100%; height: 38px; padding: 0 2px; }
  .web-search__bar .select-pill { margin-right: auto; }
  .web-search__bar .btn-primary { margin-left: 0; }
  .tool-grid { grid-template-columns: 1fr; gap: 10px; }
  .tool-card { min-height: 96px; padding: 15px; }
  .tool-section .section-head h2 { font-size: 17px; }
  .footer { margin-top: 32px; padding-top: 24px; }
  .footer__grid { column-gap: 16px; row-gap: 24px; }
  .footer__col a, .footer__col span { font-size: 12px; }
  .footer__bottom { flex-direction: column; align-items: flex-start; gap: 6px; margin-top: 24px; font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* 开发中入口的轻提示 */
.toast {
  position: fixed;
  left: 50%;
  bottom: max(28px, env(safe-area-inset-bottom));
  z-index: 100;
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 14px 22px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--bg-soft);
  color: var(--text);
  box-shadow: 0 8px 32px #0003;
  font-size: 14px;
  line-height: 1.6;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 8px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
