/* Blue Archive Theme for Flarum - WinUI 风格 */

/* ========== 图标和装饰变量 ========== */
:root {
  --vp-icon-copy: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' height='20' width='20' stroke='rgba(128,128,128,1)' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M9 5H7a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-2M9 5a2 2 0 0 0 2 2h2a2 2 0 0 0 2-2M9 5a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2'/%3E%3C/svg%3E");
  --vp-icon-copied: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' height='20' width='20' stroke='rgba(128,128,128,1)' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M9 5H7a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-2M9 5a2 2 0 0 0 2 2h2a2 2 0 0 0 2-2M9 5a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2m-6 9 2 2 4-4'/%3E%3C/svg%3E");
  
  /* 点赞图标 - Blue Archive 风格 */
  --like-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1024 1024' width='64' height='64'%3E%3Cpath d='M125.231701 863.127056l140.471288 0 0-421.36577-140.471288 0L125.231701 863.127056zM897.74397 476.896504c0-38.601156-31.578206-70.211085-70.206992-70.211085l-221.224474 0 35.07689-161.53093 0-10.547217c0-14.068414-6.996344-28.084639-13.991666-38.60525l-38.676881-35.131125-231.718479 231.746108c-14.040784 10.547217-21.089317 28.080545-21.089317 49.14428l0 351.155708c0 38.601156 31.632441 70.210062 70.260204 70.210062l316.024583 0c28.080545 0 52.668547-17.541515 63.215764-42.153052l105.337093-249.282506c3.497661-6.995321 3.497661-17.539468 3.497661-24.583908l0-70.211085L897.74397 476.896504C897.74397 480.420771 897.74397 476.896504 897.74397 476.896504' fill='%23466398'/%3E%3C/svg%3E");
  --like-icon-active: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1024 1024' width='64' height='64'%3E%3Cpath d='M125.231701 863.127056l140.471288 0 0-421.36577-140.471288 0L125.231701 863.127056zM897.74397 476.896504c0-38.601156-31.578206-70.211085-70.206992-70.211085l-221.224474 0 35.07689-161.53093 0-10.547217c0-14.068414-6.996344-28.084639-13.991666-38.60525l-38.676881-35.131125-231.718479 231.746108c-14.040784 10.547217-21.089317 28.080545-21.089317 49.14428l0 351.155708c0 38.601156 31.632441 70.210062 70.260204 70.210062l316.024583 0c28.080545 0 52.668547-17.541515 63.215764-42.153052l105.337093-249.282506c3.497661-6.995321 3.497661-17.539468 3.497661-24.583908l0-70.211085L897.74397 476.896504C897.74397 480.420771 897.74397 476.896504 897.74397 476.896504' fill='%23128afa'/%3E%3C/svg%3E");
}

/* ========== CSS 变量系统 ========== */
:root {
  --transition-time: 0.3s;
  --transition-curve: cubic-bezier(0.4, 0, 0.2, 1);
  
  /* WinUI 风格圆角 */
  --border-radius-sm: 4px;
  --border-radius-md: 8px;
  --border-radius-lg: 12px;
  --border-radius-xl: 16px;
  
  /* 浅色主题配色 - 保留蔚蓝档案风格 */
  --btn-hover: #33495d;
  --btn-background: #425c8b;
  --color-blue: #128afa;
  --font-color-gold: #ffe401;
  --font-color-grey: #4c5866;
  --icon-color: #466398;
  --blur-val: blur(15px);
  --general-background-color: #eaeff5;
  --foreground-color: white;
  --blue-shadow-color: 40, 135, 200;
  --wave-color1: rgba(234, 239, 245, 0.8);
  --wave-color2: rgba(234, 239, 245, 0.5);
  --pot-border-left: #c7e4f6;
  --dot: rgba(0, 0, 0, 0.2);
  --dot-active: #128afa;
  --infobox-background-initial: rgba(255, 255, 255, 0.1);
  --infobox-background-final: rgba(255, 255, 255, 0.5);
  --triangle-background: repeating-linear-gradient(
      60deg,
      rgba(190, 242, 255, 0.3),
      transparent 35px
    ),
    repeating-linear-gradient(180deg, transparent, rgba(108, 230, 255, 0.3) 30px),
    repeating-linear-gradient(120deg, rgba(16, 179, 215, 0.3), transparent 46px);
  --img-brightness: brightness(100%);
  --welcome-text-color: var(--foreground-color);
  --welcome-text-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
  --info-box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  --post-InnerBanner-color: white;
  --infobox-border-color: white;
  --downarrow-color: white;
  --content-opacity: 0.25;
}

/* ========== 暗色主题 ========== */
html[data-theme="dark"],
body.dark-theme,
.App-dark {
  --btn-hover: #797995;
  --btn-background: #5c5c76bf;
  --color-blue: #705781;
  --font-color-gold: #cfc6ff;
  --font-color-grey: #c8c8dc;
  --icon-color: #9d7cd8;
  --blur-val: blur(8px);
  --general-background-color: #0f0f16;
  --foreground-color: #1f1f2c;
  --blue-shadow-color: 147, 113, 207;
  --wave-color1: rgba(30, 30, 50, 0.604);
  --wave-color2: rgba(21, 21, 28, 0.384);
  --pot-border-left: rgba(135, 112, 210, 0.687);
  --dot: rgba(150, 149, 149, 0.2);
  --dot-active: #624398;
  --infobox-background-initial: rgba(32, 27, 38, 0.6);
  --infobox-background-final: rgba(32, 29, 42, 0.9);
  --triangle-background: repeating-linear-gradient(
      60deg,
      rgba(158, 124, 216, 0.15),
      transparent 35px
    ),
    repeating-linear-gradient(180deg, transparent, rgba(157, 124, 216, 0.08) 30px),
    repeating-linear-gradient(120deg, rgba(157, 124, 216, 0.08), transparent 46px);
  --img-brightness: brightness(80%);
  --welcome-text-color: #dcdce2;
  --welcome-text-shadow: 0 0 5px rgba(79, 45, 138, 0.4);
  --info-box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  --post-InnerBanner-color: #d9ddecef;
  --infobox-border-color: #2c2c39b5;
  --downarrow-color: rgba(255, 255, 255, 0.597);
  --content-opacity: 0.1;
}

/* ========== 全局样式 ========== */
body {
  background-color: var(--general-background-color) !important;
  background-image: url('assets/background.svg') !important;
  background-size: cover !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-attachment: fixed !important;
  color: var(--font-color-grey) !important;
  font-family: "Blueaka", sans-serif !important;
  font-weight: 400 !important;
  transition: background-image 0.5s, background-color 0.5s !important;
}

/* 加粗元素使用 Blueaka Bold */
b, strong, h1, h2, h3, h4, h5, h6, .bold-text {
  font-weight: 700 !important;
}

/* 暗色背景 */
html[data-theme="dark"] body,
body.dark-theme {
  background-image: url('assets/background_dark.svg') !important;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-thumb {
  border-radius: var(--border-radius-sm);
  background: var(--color-blue);
  cursor: pointer;
}

/* ========== 头部/英雄区域 - WinUI 风格 ========== */
header.Hero,
.DiscussionHero {
  background: linear-gradient(0.25turn, transparent, var(--foreground-color) 25%),
    var(--triangle-background) !important;
  backdrop-filter: var(--blur-val) !important;
  box-shadow: var(--info-box-shadow) !important;
  border-radius: 0 0 var(--border-radius-xl) var(--border-radius-xl) !important;
  border-bottom: 1px solid rgba(var(--blue-shadow-color), 0.3) !important;
  border-left: 1px solid rgba(var(--blue-shadow-color), 0.15) !important;
  border-right: 1px solid rgba(var(--blue-shadow-color), 0.15) !important;
}

.DiscussionHero--colored,
.DiscussionHero--colored a {
  color: var(--font-color-grey) !important;
}

/* ========== 讨论列表 - WinUI 风格 ========== */
.IndexPage .DiscussionListItem,
.UserPage .DiscussionListItem,
li.item-nav {
  background-color: var(--foreground-color) !important;
  border-radius: var(--border-radius-lg) !important;
  border-left: 4px solid var(--pot-border-left) !important;
  box-shadow: var(--info-box-shadow) !important;
  transition: all 0.3s ease !important;
  margin: 8px auto !important;
  padding: 12px 16px !important;
  border: 1px solid rgba(var(--blue-shadow-color), 0.15) !important;
}

.IndexPage .DiscussionListItem:hover,
.UserPage .DiscussionListItem:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(var(--blue-shadow-color), 0.15) !important;
}

/* ========== 帖子内容 - WinUI 风格 ========== */
.Post-body {
  background-color: var(--foreground-color) !important;
  border-radius: var(--border-radius-lg) !important;
  border: 1px solid rgba(var(--blue-shadow-color), 0.15) !important;
  box-shadow: var(--info-box-shadow) !important;
  padding: 20px !important;
  font-size: 14px !important;
  line-height: 26px !important;
  transition: all 0.3s ease !important;
  /* 添加网格背景 */
  background-image: linear-gradient(90deg, rgba(159, 219, 252, 0.1) 3%, transparent 0),
    linear-gradient(1turn, rgba(159, 219, 252, 0.1) 3%, transparent 0) !important;
  background-size: 20px 20px !important;
  background-position: 50% !important;
}

html[data-theme="dark"] .Post-body,
body.dark-theme .Post-body {
  background-image: linear-gradient(90deg, rgba(207, 198, 255, 0.08) 3%, transparent 0),
    linear-gradient(1turn, rgba(207, 198, 255, 0.08) 3%, transparent 0) !important;
}

/* ========== 卡片和小部件 - WinUI 风格 ========== */
.card,
.AfruxWidgets-Widget,
.AfruxWidgets-Widget.Afrux-ForumStatsWidgetWidget {
  background-color: var(--foreground-color) !important;
  border-radius: var(--border-radius-lg) !important;
  box-shadow: var(--info-box-shadow) !important;
  backdrop-filter: var(--blur-val) !important;
  border: 1px solid rgba(var(--blue-shadow-color), 0.15) !important;
}

/* ========== 头像 - WinUI 风格 ========== */
.Avatar {
  border: 2px solid var(--pot-border-left) !important;
  border-radius: 50% !important;
  box-shadow: 0 2px 8px rgba(var(--blue-shadow-color), 0.2) !important;
  filter: var(--img-brightness) !important;
  transition: transform 0.5s ease, box-shadow 0.3s ease, filter 0.5s !important;
}

.Avatar:hover {
  transform: scale(1.05) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
}

/* ========== 标签 - WinUI 风格 ========== */
.TagTiles > li {
  background-color: var(--foreground-color) !important;
  border-radius: var(--border-radius-md) !important;
  box-shadow: var(--info-box-shadow) !important;
  border-left: 4px solid var(--pot-border-left) !important;
  border: 1px solid rgba(var(--blue-shadow-color), 0.15) !important;
}

/* ========== 侧边导航 - WinUI 风格 ========== */
.sideNav > ul {
  background-color: var(--foreground-color) !important;
  border-radius: var(--border-radius-lg) !important;
  box-shadow: var(--info-box-shadow) !important;
  backdrop-filter: var(--blur-val) !important;
  border: 1px solid rgba(var(--blue-shadow-color), 0.15) !important;
}

/* ========== 按钮 - WinUI 风格 ========== */
.Button {
  border-radius: var(--border-radius-md) !important;
  transition: all 0.2s ease !important;
}

.Button:hover {
  background-color: var(--btn-hover) !important;
  color: var(--font-color-gold) !important;
  transform: translateY(-1px);
}

/* ========== 链接 ========== */
a {
  color: var(--color-blue) !important;
  transition: color 0.2s, opacity 0.2s !important;
  text-decoration: none !important;
  border-bottom: 1px solid transparent !important;
}

a:hover {
  color: var(--btn-hover) !important;
  border-bottom-color: var(--color-blue) !important;
}

/* ========== 点赞按钮 - 新图标 ========== */
.Post-action--like .Button::before,
.Post-action--like svg,
.Post-action--like [class*="icon"],
.likeButton::before,
.likeButton svg {
  content: '' !important;
  background-image: var(--like-icon) !important;
  background-size: contain !important;
  background-repeat: no-repeat !important;
  width: 20px !important;
  height: 20px !important;
  display: inline-block !important;
  vertical-align: middle !important;
  transition: all 0.2s ease !important;
}

.Post-action--like.active .Button::before,
.Post-action--like.active svg,
.Post-action--like.active [class*="icon"],
.likeButton.active::before,
.likeButton.active svg {
  background-image: var(--like-icon-active) !important;
}

.Post-action--like .Button svg,
.likeButton svg {
  display: none !important;
}

/* ========== 内容排版样式 - WinUI 风格 ========== */

/* 标题 */
.Post-body h1,
.Post-body h2,
.Post-body h3,
.Post-body h4,
.Post-body h5,
.Post-body h6 {
  color: var(--font-color-grey) !important;
  font-weight: 600 !important;
}

.Post-body h1 {
  font-size: 26px !important;
  line-height: 36px !important;
}

.Post-body h2 {
  font-size: 22px !important;
  line-height: 30px !important;
  margin-top: 20px !important;
  padding-top: 12px !important;
  border-top: 1px dashed var(--pot-border-left) !important;
}

.Post-body h3 {
  font-size: 18px !important;
  line-height: 26px !important;
  margin-top: 16px !important;
}

/* 段落 */
.Post-body p {
  margin: 12px 0 !important;
}

/* 引用块 - WinUI 风格 */
.Post-body blockquote {
  margin: 12px 0 !important;
  border-left: 3px solid #5cd3ff !important;
  padding-left: 14px !important;
  padding-right: 14px !important;
  padding-top: 8px !important;
  padding-bottom: 8px !important;
  background-color: rgba(92, 211, 255, 0.1) !important;
  border-radius: var(--border-radius-md) !important;
}

html[data-theme="dark"] .Post-body blockquote,
body.dark-theme .Post-body blockquote {
  background-color: rgba(157, 124, 216, 0.1) !important;
  border-left: 3px solid #9d7cd8 !important;
}

/* 代码块 - WinUI 风格 */
.Post-body pre,
.Post-body code {
  background-color: rgba(0, 0, 0, 0.05) !important;
  border-radius: var(--border-radius-sm) !important;
  font-family: monospace !important;
}

html[data-theme="dark"] .Post-body pre,
html[data-theme="dark"] .Post-body code,
body.dark-theme .Post-body pre,
body.dark-theme .Post-body code {
  background-color: rgba(0, 0, 0, 0.2) !important;
}

.Post-body pre {
  padding: 14px !important;
  overflow-x: auto !important;
  border-radius: var(--border-radius-md) !important;
  border: 1px solid rgba(var(--blue-shadow-color), 0.2) !important;
}

.Post-body code {
  padding: 2px 6px !important;
  font-size: 0.9em !important;
}

/* 列表 */
.Post-body ul,
.Post-body ol {
  padding-left: 1.5rem !important;
  margin: 12px 0 !important;
}

.Post-body li {
  margin: 6px 0 !important;
}

/* 表格 - WinUI 风格 */
.Post-body table {
  width: 100% !important;
  border-collapse: collapse !important;
  border: 1px solid rgba(var(--blue-shadow-color), 0.2) !important;
  border-radius: var(--border-radius-md) !important;
  overflow: hidden !important;
  margin: 12px 0 !important;
}

.Post-body th,
.Post-body td {
  padding: 10px !important;
  text-align: left !important;
  border-bottom: 1px solid rgba(var(--blue-shadow-color), 0.15) !important;
}

.Post-body th {
  background-color: rgba(92, 211, 255, 0.1) !important;
  color: var(--btn-hover) !important;
  font-weight: 600 !important;
}

html[data-theme="dark"] .Post-body th,
body.dark-theme .Post-body th {
  background-color: rgba(157, 124, 216, 0.1) !important;
  color: #e0e0e6 !important;
}

.Post-body td {
  background-color: rgba(255, 255, 255, 0.4) !important;
}

html[data-theme="dark"] .Post-body td,
body.dark-theme .Post-body td {
  background-color: rgba(31, 31, 44, 0.5) !important;
  color: #c8c8dc !important;
}

/* 水平分割线 */
.Post-body hr {
  border: 0 !important;
  border-top: 1px dashed var(--pot-border-left) !important;
  margin: 20px 0 !important;
}

/* 图片 - WinUI 风格 */
.Post-body img {
  max-width: 100% !important;
  border-radius: var(--border-radius-md) !important;
  filter: var(--img-brightness) !important;
  transition: filter 0.5s, transform 0.2s !important;
  box-shadow: 0 2px 12px rgba(var(--blue-shadow-color), 0.15) !important;
}

.Post-body img:hover {
  transform: scale(1.02) !important;
}

/* ========== 帖子流 - WinUI 风格 ========== */
.PostStream-item {
  border-bottom: 1px dashed var(--pot-border-left) !important;
  padding: 12px 0 !important;
}

/* ========== 响应式设计 - 移动设备 ========== */
@media (max-width: 768px) {
  .IndexPage .DiscussionListItem,
  .UserPage .DiscussionListItem,
  li.item-nav {
    border-radius: var(--border-radius-md) !important;
    border-left-width: 3px !important;
    margin: 6px !important;
    padding: 10px 14px !important;
  }
  
  .Post-body {
    padding: 14px !important;
    border-radius: var(--border-radius-md) !important;
  }
  
  header.Hero,
  .DiscussionHero {
    border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg) !important;
  }
  
  .TagTiles > li {
    border-radius: var(--border-radius-sm) !important;
    margin: 6px !important;
  }
}

@media (max-width: 992px) {
  .DiscussionListItem-content {
    margin: 6px !important;
    border-radius: var(--border-radius-md) !important;
  }
}

@media (min-width: 1200px) {
  .sideNav > ul {
    border-radius: var(--border-radius-md) !important;
  }
}

/* ========== Blue Archive + WinUI 主题签名 ========== */
/* Blue Archive WinUI Theme for Flarum by VanillaNahida */
