/* ===== 现代清新 · 粉彩极光风 ===== */
:root {
  --pink: #FF8FAB;
  --pink-deep: #FB6F92;
  --pink-soft: #FFE5EC;
  --mint: #8FE3CF;
  --mint-deep: #2E9E82;
  --mint-soft: #E3FAF4;
  --lavender: #B9C6FF;
  --lavender-deep: #7C8FF0;
  --peach: #FFD6BA;
  --text: #4A4458;
  --text-light: #9A92AC;
  --card-bg: rgba(255, 255, 255, 0.82);
  --shadow-sm: 0 2px 10px rgba(120, 100, 150, 0.06);
  --shadow-md: 0 8px 30px rgba(120, 100, 150, 0.10);
  --shadow-lg: 0 16px 48px rgba(251, 111, 146, 0.16);
  --radius: 24px;
  --radius-sm: 16px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "PingFang SC", "HarmonyOS Sans SC", "Yuanti SC", "YouYuan", "Microsoft YaHei", sans-serif;
  background: #FDFBFC;
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--pink-soft); color: var(--pink-deep); }

/* ---- 极光渐变背景 ---- */
.aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: linear-gradient(180deg, #FDFBFC 0%, #FFF7F9 55%, #F6F7FF 100%);
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  animation: drift 18s ease-in-out infinite alternate;
}
.blob-pink     { width: 46vw; height: 46vw; background: #FFD3E0; top: -12%; left: -8%; }
.blob-mint     { width: 36vw; height: 36vw; background: #C8F4E9; top: 30%; right: -10%; animation-delay: -5s; }
.blob-lavender { width: 40vw; height: 40vw; background: #DCE3FF; bottom: -15%; left: 20%; animation-delay: -9s; }
.blob-peach    { width: 26vw; height: 26vw; background: #FFE8D6; top: 55%; left: -6%; animation-delay: -13s; }

@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(4vw, -3vh) scale(1.12); }
}

/* ---- 毛玻璃导航 ---- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(18px) saturate(1.6);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  background: rgba(255, 255, 255, 0.62);
  border-bottom: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 1px 0 rgba(120, 100, 150, 0.05);
}
.nav-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 0.7rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.nav-logo {
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--text);
  white-space: nowrap;
}
.tabs {
  display: flex;
  gap: 0.3rem;
  background: rgba(243, 240, 250, 0.85);
  padding: 0.3rem;
  border-radius: 999px;
}
.tab {
  border: none;
  background: transparent;
  color: var(--text-light);
  padding: 0.45rem 1.05rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s var(--ease);
  white-space: nowrap;
}
.tab:hover { color: var(--pink-deep); }
.tab.active {
  background: #fff;
  color: var(--pink-deep);
  box-shadow: var(--shadow-sm);
}

/* ---- Hero ---- */
.hero {
  text-align: center;
  padding: 3.2rem 1.5rem 2rem;
  max-width: 760px;
  margin: 0 auto;
}
.hero-badge {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--pink-deep);
  background: var(--card-bg);
  border: 1px solid rgba(251, 111, 146, 0.22);
  padding: 0.35rem 1rem;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  animation: fadeUp 0.7s var(--ease) both;
}
.hero-title {
  margin-top: 1.1rem;
  font-size: clamp(1.9rem, 6vw, 2.9rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--text);
  animation: fadeUp 0.7s 0.1s var(--ease) both;
}
.gradient-text {
  background: linear-gradient(120deg, var(--pink) 10%, var(--lavender-deep) 60%, var(--mint-deep) 110%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-sub {
  margin-top: 0.8rem;
  color: var(--text-light);
  font-size: 0.98rem;
  line-height: 1.8;
  animation: fadeUp 0.7s 0.2s var(--ease) both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- 主体 ---- */
main {
  max-width: 760px;
  margin: 0 auto;
  padding: 0.6rem 1.2rem 3.5rem;
}
.tab-page { display: none; }
.tab-page.active { display: block; animation: fadeUp 0.45s var(--ease); }

/* ---- 卡片 ---- */
.card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius);
  padding: 1.35rem 1.45rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 1.1rem;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.card-list .card { animation: fadeUp 0.5s var(--ease) both; }
.card-list .card:nth-child(2) { animation-delay: 0.05s; }
.card-list .card:nth-child(3) { animation-delay: 0.1s; }
.card-list .card:nth-child(4) { animation-delay: 0.15s; }
.card-list .card:nth-child(n+5) { animation-delay: 0.2s; }

.card-list:empty::after {
  content: "这里还空空的呢，来发第一条吧 🐣";
  display: block;
  text-align: center;
  color: var(--text-light);
  padding: 3rem 0;
  font-size: 0.95rem;
}

/* ---- 问题卡片 ---- */
.q-meta {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.7rem;
  flex-wrap: wrap;
}
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  background: linear-gradient(135deg, var(--pink-soft), #F0EBFF);
  border: 2px solid #fff;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}
.q-nickname { font-weight: 700; color: var(--text); font-size: 0.95rem; }
.q-time { font-size: 0.78rem; color: var(--text-light); }
.q-meta .badge { margin-left: auto; }

.badge {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.22rem 0.7rem;
  border-radius: 999px;
  white-space: nowrap;
}
.badge-pending  { background: var(--mint-soft); color: var(--mint-deep); }
.badge-answered {
  background: linear-gradient(135deg, var(--pink), var(--pink-deep));
  color: #fff;
  box-shadow: 0 3px 10px rgba(251, 111, 146, 0.35);
}

.q-content {
  line-height: 1.85;
  font-size: 0.96rem;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere; /* 长链接等无空格串强制换行，防裁剪 */
  padding-left: 2.55rem;
}

.q-answer {
  margin-top: 1rem;
  margin-left: 2.55rem;
  position: relative;
  background: linear-gradient(135deg, #FFF3F7 0%, #F4F2FF 100%);
  border-radius: var(--radius-sm);
  padding: 1rem 1.15rem;
  overflow: hidden;
}
.q-answer::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--pink), var(--lavender-deep));
  border-radius: 4px 0 0 4px;
}
.q-answer .answer-label {
  font-weight: 700;
  color: var(--pink-deep);
  font-size: 0.86rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.q-answer p {
  margin-top: 0.45rem;
  line-height: 1.8;
  font-size: 0.93rem;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* ---- 按钮 ---- */
.btn {
  position: relative;
  border: none;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  padding: 0.62rem 1.5rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.3s var(--ease);
  overflow: hidden;
}
.btn-primary {
  background: linear-gradient(135deg, var(--pink) 0%, var(--pink-deep) 100%);
  color: #fff;
  box-shadow: 0 6px 18px rgba(251, 111, 146, 0.38);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(251, 111, 146, 0.48);
}
.btn-primary:active { transform: translateY(0) scale(0.97); }

.btn-shine {
  position: absolute;
  top: 0; left: -80%;
  width: 50%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.55), transparent);
  animation: shine 3.2s ease-in-out infinite;
}
@keyframes shine {
  0%, 60% { left: -80%; }
  100% { left: 130%; }
}

.btn-ghost {
  background: transparent;
  color: var(--text-light);
  border: 1.5px solid #EAE4F0;
}
.btn-ghost:hover { border-color: var(--pink); color: var(--pink-deep); }

.btn-small { padding: 0.36rem 1rem; font-size: 0.83rem; }
.btn-danger { background: #FFEBEB; color: #E06565; }
.btn-danger:hover { background: #FFDADA; }
.btn-mint { background: var(--mint-soft); color: var(--mint-deep); }
.btn-mint:hover { background: #D2F5EB; }
.btn-block { width: 100%; }

.btn-ask {
  display: block;
  margin: 0.4rem auto 1.6rem;
  font-size: 1.02rem;
  padding: 0.8rem 2.4rem;
}

/* ---- 表单 ---- */
input, textarea {
  width: 100%;
  border: 1.5px solid #F0E8F2;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1.05rem;
  font-family: inherit;
  font-size: 0.94rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.9);
  margin-bottom: 0.75rem;
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s;
}
input::placeholder, textarea::placeholder { color: #C6BED4; }
input:focus, textarea:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 4px rgba(255, 143, 171, 0.14);
}
textarea { resize: vertical; }

.form-actions { display: flex; gap: 0.7rem; justify-content: flex-end; flex-wrap: wrap; }
.hint { color: var(--text-light); font-size: 0.88rem; margin-bottom: 0.9rem; }
.error { color: #E06565; font-size: 0.85rem; min-height: 1.2em; margin-top: 0.4rem; }
.hidden { display: none !important; }

/* ---- 弹窗 ---- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(74, 68, 88, 0.32);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
  animation: fadeIn 0.25s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
  width: 100%;
  max-width: 480px;
  animation: popIn 0.4s var(--ease);
}
.modal-card h2 { margin-bottom: 1.1rem; color: var(--text); font-size: 1.15rem; }

@keyframes popIn {
  from { opacity: 0; transform: scale(0.92) translateY(14px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ---- 资源 ---- */
.resource-category {
  margin: 1.6rem 0 0.9rem;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.resource-category::after {
  content: "";
  flex: 1;
  height: 1.5px;
  background: linear-gradient(90deg, rgba(251,111,146,0.35), transparent);
  border-radius: 2px;
}

.resource-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1.15rem 1.3rem;
}
.resource-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  background: linear-gradient(135deg, var(--pink-soft), #EDE9FF);
}
.resource-info { flex: 1; min-width: 0; }
.resource-title { font-weight: 700; margin-bottom: 0.25rem; font-size: 0.97rem; }
.resource-desc {
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.6;
}
.resource-link {
  flex-shrink: 0;
  text-decoration: none;
  background: linear-gradient(135deg, var(--lavender) 0%, var(--lavender-deep) 100%);
  color: #fff;
  padding: 0.5rem 1.15rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(124, 143, 240, 0.32);
  transition: all 0.3s var(--ease);
}
.resource-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(124, 143, 240, 0.45);
}

/* ---- 管理页 ---- */
.admin-login-card { max-width: 400px; margin: 1.5rem auto; text-align: center; padding: 2rem 1.8rem; }
.login-icon {
  width: 62px;
  height: 62px;
  margin: 0 auto 1rem;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  background: linear-gradient(135deg, var(--pink-soft), #EDE9FF);
  box-shadow: var(--shadow-sm);
}
.admin-login-card h2 { color: var(--text); margin-bottom: 0.35rem; font-size: 1.15rem; }
.admin-login-card .btn-block { margin-top: 0.2rem; }

.section-title { font-size: 1.1rem; font-weight: 800; margin-bottom: 1rem; color: var(--text); }
.admin-section { margin-bottom: 2.2rem; }

.admin-q-actions { display: flex; gap: 0.5rem; margin-top: 0.9rem; flex-wrap: wrap; padding-left: 2.55rem; }
.answer-editor { margin-top: 0.9rem; margin-left: 2.55rem; }

.resource-actions { display: flex; gap: 0.45rem; flex-shrink: 0; }
.resource-form { background: linear-gradient(135deg, rgba(255,243,247,0.9), rgba(244,242,255,0.9)); }

/* ---- Toast ---- */
.toast {
  position: fixed;
  bottom: 2.2rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(74, 68, 88, 0.92);
  backdrop-filter: blur(10px);
  color: #fff;
  padding: 0.72rem 1.7rem;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 600;
  z-index: 200;
  animation: toastIn 0.35s var(--ease);
  box-shadow: 0 10px 30px rgba(74, 68, 88, 0.3);
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 14px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ---- 页脚 ---- */
.site-footer {
  text-align: center;
  color: var(--text-light);
  font-size: 0.84rem;
  padding: 1rem 1rem 2.4rem;
}
.footer-dot { margin: 0 0.5rem; opacity: 0.5; }

/* ---- 滚动条 ---- */
::-webkit-scrollbar { width: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--pink-soft), #E3DCF5);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: var(--pink); }

/* ---- 搜索与筛选 ---- */
.qa-toolbar {
  margin-bottom: 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.search-box {
  position: relative;
}
.search-box .search-icon {
  position: absolute;
  left: 1.05rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.95rem;
  opacity: 0.6;
  pointer-events: none;
}
.search-box input {
  margin-bottom: 0;
  padding-left: 2.6rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
}
.filter-chips {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}
.chip {
  border: 1.5px solid transparent;
  background: rgba(255, 255, 255, 0.75);
  color: var(--text-light);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0.35rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.25s var(--ease);
}
.chip:hover { color: var(--pink-deep); border-color: var(--pink-soft); }
.chip.active {
  background: var(--pink-soft);
  color: var(--pink-deep);
  border-color: rgba(251, 111, 146, 0.3);
}

mark {
  background: linear-gradient(transparent 55%, rgba(255, 183, 197, 0.65) 55%);
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}

.empty-card { text-align: center; color: var(--text-light); padding: 2.2rem 1rem; }

/* ---- 附件 ---- */
.att-images {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.7rem;
}
.att-img-wrap { position: relative; }
.att-img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 14px;
  border: 2px solid #fff;
  box-shadow: var(--shadow-sm);
  cursor: zoom-in;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.att-img:hover { transform: scale(1.05); box-shadow: var(--shadow-md); }

.att-file { margin-top: 0.55rem; display: flex; align-items: center; gap: 0.4rem; }
.att-file-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  text-decoration: none;
  color: var(--lavender-deep);
  background: rgba(255, 255, 255, 0.75);
  border: 1.5px solid #E8E4F5;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 600;
  max-width: 100%;
  overflow: hidden;
  transition: all 0.25s var(--ease);
}
.att-file-link:hover { border-color: var(--lavender); transform: translateY(-1px); }
.att-size { color: var(--text-light); font-weight: 400; font-size: 0.76rem; white-space: nowrap; }

.att-del {
  border: none;
  background: rgba(224, 101, 101, 0.9);
  color: #fff;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.2s;
}
.att-img-wrap .att-del { position: absolute; top: -6px; right: -6px; }
.att-del:hover { transform: scale(1.15); }

/* ---- 回答编辑器的文件选择 ---- */
.file-picker {
  display: block;
  border: 1.5px dashed #E8D8E8;
  border-radius: var(--radius-sm);
  padding: 0.7rem 1rem;
  text-align: center;
  color: var(--text-light);
  font-size: 0.86rem;
  cursor: pointer;
  margin-bottom: 0.6rem;
  transition: all 0.25s;
  background: rgba(255, 255, 255, 0.6);
}
.file-picker:hover { border-color: var(--pink); color: var(--pink-deep); }
.file-picker .file-input { display: none; }
.file-preview { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.5rem; }
.file-tag {
  font-size: 0.78rem;
  background: var(--pink-soft);
  color: var(--pink-deep);
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-tag i { font-style: normal; opacity: 0.7; }

/* ---- 图片灯箱 ---- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(40, 34, 50, 0.82);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  cursor: zoom-out;
  animation: fadeIn 0.25s;
  padding: 1.5rem;
}
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--radius-sm);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  animation: popIn 0.35s var(--ease);
}

/* ---- 移动端 ---- */
@media (max-width: 600px) {
  .nav-inner { flex-direction: column; gap: 0.55rem; padding: 0.65rem 0.8rem; }
  .nav-logo { font-size: 0.95rem; }
  .tabs { width: 100%; justify-content: center; }
  .tab { flex: 1; text-align: center; padding: 0.45rem 0.4rem; font-size: 0.82rem; }
  .hero { padding: 2.2rem 1.2rem 1.4rem; }
  main { padding: 0.4rem 0.8rem 3rem; }
  .card { padding: 1.05rem 1rem; border-radius: 18px; }
  .q-meta { gap: 0.5rem; }
  /* 去掉桌面端的头像对齐缩进，但回答框要保留内边距，否则会顶到左侧渐变条 */
  .q-content { padding-left: 0; }
  .q-answer { margin-left: 0; padding: 0.85rem 0.9rem 0.85rem 1rem; }
  .admin-q-actions { padding-left: 0; }
  .answer-editor { margin-left: 0; }
  .modal-card { max-height: 88vh; overflow-y: auto; }
  .toast { max-width: 88vw; text-align: center; }
  .att-img { width: 84px; height: 84px; }
  .att-file-link { word-break: break-all; }
  .resource-card { flex-wrap: wrap; }
  .resource-link { width: 100%; text-align: center; }
  .blob { filter: blur(60px); opacity: 0.45; }
}

/* ---- 减少动画偏好 ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
