/* ============================================================
   soft.css — 翼騰軟體王 全站玻璃態薄荷綠主題覆蓋層
   適用於 TOOLCMS / Xiuno / lecmS 同構架
   掛載方式：在 header.inc.htm 的 bootstrap-bbs.css 之後引用
   ============================================================ */

:root {
  --mint: #5BCFC5;          /* 薄荷綠主色 */
  --mint-soft: #E8F8F7;     /* 淺薄荷綠 */
  --teal: #2C7A7B;          /* 深青 */
  --ink: #0F1F2E;           /* 主文字 */
  --muted: #5C747F;         /* 次要文字（霧灰藍） */
  --glass-bg: rgba(255, 255, 255, 0.60);
  --glass-bg-strong: rgba(255, 255, 255, 0.66);
  --glass-stroke: rgba(255, 255, 255, 0.50);
  --glass-blur: blur(18px);
  --glass-shadow: 0 8px 24px rgba(36, 45, 44, 0.12);
}

/* ---------- 漸層氣泡背景 ---------- */
html, body {
  background: linear-gradient(160deg, #F8FDFC 0%, #FFFFFF 45%, #FCFDF8 100%) !important;
  background-repeat: no-repeat !important;
  background-size: 100% 100% !important;
  background-attachment: fixed;
  position: relative;
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1200px 1200px at 8% -8%, rgba(91, 207, 197, 0.16), transparent 70%),
    radial-gradient(1000px 1000px at 92% 8%, rgba(107, 138, 255, 0.10), transparent 70%),
    radial-gradient(1100px 1100px at 85% 105%, rgba(242, 201, 76, 0.08), transparent 70%);
  background-repeat: no-repeat;
  background-size: cover;
}

/* ---------- 頂部導航玻璃態 ---------- */
.navbar.navbar-dark.bg-dark {
  background: var(--glass-bg) !important;
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-stroke);
  box-shadow: 0 4px 24px rgba(36, 45, 44, 0.06);
}
.navbar-dark .navbar-brand,
.navbar-dark .navbar-nav .nav-link {
  color: var(--ink) !important;
}
.navbar-dark .navbar-nav .nav-link:hover {
  color: var(--teal) !important;
}

/* ---------- 品牌 LOGO ---------- */
.brand-logo {
  display: inline-flex !important;
  align-items: center;
  gap: 10px;
  padding: 0 !important;
  margin-right: 1rem;
}
.brand-logo .brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--mint);
  color: #fff;
  font-family: "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", "Helvetica Neue", Arial, sans-serif;
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 4px 12px rgba(91, 207, 197, 0.32);
}
.brand-logo .brand-name {
  font-family: "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", "Helvetica Neue", Arial, sans-serif;
  font-size: 1.375rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
  color: var(--ink);
  white-space: nowrap;
}
.brand-logo:hover .brand-name {
  color: var(--teal);
}
@media (max-width: 991px) {
  .brand-logo .brand-name {
    font-size: 1.1rem;
  }
  .brand-logo .brand-mark {
    width: 34px;
    height: 34px;
    font-size: 18px;
  }
}

/* ---------- 通用卡片玻璃態 ---------- */
.card,
.card-threadlist,
.card-site-info,
.threadlist .thread {
  background: var(--glass-bg) !important;
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-stroke) !important;
  box-shadow: var(--glass-shadow), inset 0 1px 2px rgba(255, 255, 255, 0.5) !important;
  border-radius: 24px !important;
}
.card > .card-header {
  background: transparent !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.45) !important;
  color: var(--ink) !important;
}

/* 側邊欄小卡：設計稿 Sidebar Info / Stats 的內層玻璃卡 */
.card-site-info {
  background: rgba(255, 255, 255, 0.50) !important;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.40) !important;
  box-shadow: 0 4px 16px rgba(36, 45, 44, 0.06), inset 0 1px 2px rgba(255, 255, 255, 0.40) !important;
  border-radius: 16px !important;
}

/* ---------- 文章列表項間距 ---------- */
.card-threadlist > .card-body {
  padding: 16px !important;
}
.threadlist .thread {
  margin-bottom: 10px !important;
  padding: 14px 18px !important;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.threadlist .thread:last-child {
  margin-bottom: 0 !important;
}
.threadlist .thread:hover {
  background: var(--glass-bg-strong) !important;
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(36, 45, 44, 0.14);
}

/* ---------- 主按鈕 ---------- */
.btn-primary {
  background-color: var(--mint) !important;
  border-color: var(--mint) !important;
  color: #fff !important;
  border-radius: 50px !important;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(91, 207, 197, 0.4);
}
.btn-block { border-radius: 14px !important; }

/* ---------- 麵包屑 ---------- */
.breadcrumb {
  background: rgba(255, 255, 255, 0.6) !important;
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-stroke) !important;
  border-radius: 14px !important;
}
.breadcrumb-item,
.breadcrumb-item a { color: var(--muted) !important; }
.breadcrumb-item.active { color: var(--teal) !important; }

/* ---------- 分頁 ---------- */
.pagination .page-link {
  background: var(--glass-bg) !important;
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-stroke) !important;
  color: var(--teal) !important;
  border-radius: 12px !important;
  margin: 0 3px;
}
.pagination .page-item.active .page-link {
  background: var(--mint) !important;
  border-color: var(--mint) !important;
  color: #fff !important;
}

/* ---------- 表單 ---------- */
.form-control {
  background: rgba(255, 255, 255, 0.7) !important;
  border: 1px solid var(--glass-stroke) !important;
  border-radius: 12px !important;
  color: var(--ink) !important;
}
.form-control:focus {
  border-color: var(--mint) !important;
  box-shadow: 0 0 0 3px rgba(91, 207, 197, 0.18) !important;
}

/* ---------- 下拉選單 ---------- */
.dropdown-menu {
  background: var(--glass-bg-strong) !important;
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-stroke) !important;
  border-radius: 16px !important;
  box-shadow: var(--glass-shadow) !important;
}
.dropdown-item { color: var(--ink) !important; }
.dropdown-item:hover { background: rgba(91, 207, 197, 0.14) !important; }

/* ---------- 頁尾深青玻璃態 ---------- */
footer#footer.bg-dark {
  background: rgba(10, 46, 46, 0.82) !important;
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  color: #d8edec !important;
  border-top: 1px solid rgba(255, 255, 255, 0.18) !important;
}
footer#footer.bg-dark a,
footer#footer.bg-dark .text-muted { color: #a8c8c6 !important; }

/* ---------- 內文連結 ---------- */
a { color: var(--teal); }
a:hover { color: var(--mint); }

/* ============================================================
   首頁設計稿專用元件
   ============================================================ */

/* ---------- Hero 橫幅 ---------- */
.soft-hero {
  position: relative;
  border-radius: 32px;
  overflow: hidden;
  padding: 64px 24px;
  text-align: center;
  color: #fff;
  background: linear-gradient(135deg, #5BCFC5 0%, #2C7A7B 100%);
  box-shadow: 0 20px 60px rgba(44, 122, 123, 0.25);
}
.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
}
.hero-title {
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 16px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.12);
}
.hero-subtitle {
  font-size: 1.05rem;
  opacity: 0.92;
  margin-bottom: 28px;
}
.hero-search {
  display: flex;
  max-width: 560px;
  margin: 0 auto 22px;
  background: #fff;
  border-radius: 50px;
  padding: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.hero-search .form-control {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 50px 0 0 50px !important;
  padding-left: 20px !important;
}
.hero-search .btn-primary {
  border-radius: 50px !important;
  padding: 10px 28px !important;
}
.hero-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.hero-tag {
  display: inline-block;
  padding: 7px 18px;
  background: rgba(255,255,255,0.22);
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 50px;
  color: #fff !important;
  font-size: 0.85rem;
  text-decoration: none;
  transition: background .15s ease;
}
.hero-tag:hover {
  background: rgba(255,255,255,0.35);
  color: #fff !important;
}

/* ---------- 區塊標題 ---------- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}
.view-all {
  font-size: 0.9rem;
  color: var(--teal) !important;
  text-decoration: none;
}
.view-all:hover {
  color: var(--mint) !important;
}

/* ---------- AdSense 占位 ---------- */
.adsense-slot {
  padding: 32px 20px !important;
}

/* ---------- 精選推薦卡片 ---------- */
.app-card {
  background: rgba(255,255,255,0.78) !important;
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: 24px;
  padding: 18px;
  box-shadow: 0 8px 24px rgba(36,45,44,0.08);
  transition: transform .15s ease, box-shadow .15s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.app-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 36px rgba(36,45,44,0.14);
}

/* 精選推薦：4 個推薦卡片收進單一玻璃框後，內部卡片改為透明底，讓外框成為唯一容器 */
.card.itit .app-card {
  background: transparent !important;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border: none;
  box-shadow: none;
  padding: 0;
  transform: none;
}
.card.itit .app-card:hover {
  background: rgba(255, 255, 255, 0.40) !important;
  box-shadow: none;
  transform: none;
}
.app-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.app-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  color: var(--teal);
  flex-shrink: 0;
}
.app-card-info {
  min-width: 0;
}
.app-name {
  font-weight: 700;
  color: var(--ink);
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-version {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.85rem;
}
.app-category {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--teal);
  background: rgba(91,207,197,0.12);
  padding: 3px 10px;
  border-radius: 50px;
  margin-top: 4px;
}
.app-desc {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 14px;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.app-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}
.app-downloads {
  font-size: 0.8rem;
  color: var(--muted);
}

/* ---------- 熱門下載排行 ---------- */
.rank-item,
.new-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}
.rank-item:last-child,
.new-item:last-child {
  border-bottom: none;
}
.rank-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--mint);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.rank-item:nth-child(1) .rank-num { background: #FFB800; }
.rank-item:nth-child(2) .rank-num { background: #A0A0A0; }
.rank-item:nth-child(3) .rank-num { background: #CD7F32; }
.rank-icon,
.new-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  font-size: 0.9rem;
}
.rank-info,
.new-info {
  min-width: 0;
  flex-grow: 1;
}
.rank-name,
.new-name {
  font-weight: 700;
  color: var(--ink);
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rank-version,
.new-version {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.8rem;
}
.rank-meta,
.new-meta {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 2px;
}

/* ---------- 分類頁（論壇列表）排行 ---------- */
.forum-rank-body {
  padding: 8px 24px 16px;
}
.forum-rank-list .rank-item {
  padding: 16px 0;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  cursor: pointer;
}
.forum-rank-list .rank-item:last-child {
  border-bottom: none;
}
.forum-rank-list .rank-item:hover {
  background: rgba(255,255,255,0.35);
  border-radius: 12px;
  margin: 0 -12px;
  padding-left: 12px;
  padding-right: 12px;
}
.forum-rank-list .rank-item input[name="modtid"] {
  margin-top: 0;
  margin-right: 8px;
}
.forum-rank-list .rank-name a {
  color: var(--ink);
  text-decoration: none;
}
.forum-rank-list .rank-name a:hover {
  color: var(--teal);
}

/* ---------- 最新上架 ---------- */
.badge-new {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 50px;
  background: var(--mint);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* ---------- 側邊欄 ---------- */
.category-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.category-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--muted) !important;
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
}
/* 設計稿 Sidebar 第一個分類項為高亮態：淺薄荷底 + 深青字 */
.category-item:first-child {
  background: #F5FAFA;
  color: var(--teal) !important;
}
.category-item:hover {
  background: rgba(91,207,197,0.12);
  color: var(--teal) !important;
}
.category-item:first-child:hover {
  background: #F5FAFA;
  color: var(--teal) !important;
}
.category-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  opacity: 0.85;
}
.announcement-list {
  font-size: 0.85rem;
  color: var(--muted);
  padding-left: 0;
  list-style: none;
}
.announcement-list li {
  position: relative;
  padding-left: 16px;
  margin-bottom: 10px;
}
.announcement-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--mint);
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px 12px;
}
.stat-item {
  text-align: center;
}
.stat-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--teal);
  line-height: 1.2;
}
.stat-label {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 4px;
}

/* ---------- 頁尾 ---------- */
.footer-brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
}
.footer-desc {
  font-size: 0.85rem;
  color: #a8c8c6;
  line-height: 1.7;
  max-width: 280px;
}
.footer-links h6 {
  font-size: 0.95rem;
  color: #fff;
  margin-bottom: 14px;
  font-weight: 600;
}
.footer-links ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer-links li {
  margin-bottom: 8px;
}
.footer-links a {
  color: #a8c8c6;
  font-size: 0.85rem;
  text-decoration: none;
}
.footer-links a:hover {
  color: #fff;
}
.footer-divider {
  border-top: 1px solid rgba(255,255,255,0.12);
  margin: 24px 0 16px;
}
.footer-copyright {
  font-size: 0.8rem;
  color: #8fb0ae;
}
.footer-friend-links {
  font-size: 0.8rem;
  color: #8fb0ae;
}
.footer-friend-links a {
  display: inline-block;
  color: #a8c8c6;
  text-decoration: none;
  margin-left: 16px;
  transition: color .15s ease;
}
.footer-friend-links a:hover {
  color: #fff;
}
.footer-friend-links a:first-child {
  margin-left: 0;
}
@media (max-width: 767px) {
  .footer-friend-links {
    text-align: left !important;
  }
  .footer-friend-links a {
    margin-left: 0;
    margin-right: 14px;
    margin-bottom: 6px;
  }
}

/* ---------- 帖子頁右欄對齊修復 ---------- */
/* 因 html,body 為 flex 列布局（把頁腳頂到底部），.row 內 .aside 預設被 align-items:stretch
   拉成與主內容等高的空白長框，造成右欄「固定死 / 錯位」的觀感。改為頂部對齊、不拉伸。 */
#body > .container > .row > .aside {
  align-self: flex-start;
}
/* 防止主內容區超寬元素（圖片 / 表格 / 代碼塊）撐破栅格、擠壓右欄 */
#body > .container > .row > .main {
  min-width: 0;
}
/* 帖子正文媒體自適應，避免橫向溢出 */
.message img,
.message video,
.message iframe,
.message embed,
.message object {
  max-width: 100%;
  height: auto;
}
.message pre {
  max-width: 100%;
  overflow-x: auto;
}

/* ---------- 響應式：小屏略減模糊以保性能 ---------- */
@media (max-width: 768px) {
  :root { --glass-blur: blur(12px); }
  .card, .card-threadlist, .card-site-info, .threadlist .thread { border-radius: 18px !important; }
  .soft-hero { padding: 44px 18px; border-radius: 24px; }
  .hero-title { font-size: 1.65rem; }
  .hero-subtitle { font-size: 0.9rem; }
  .hero-search { border-radius: 20px; }
  .hero-search .form-control { border-radius: 20px 0 0 20px !important; }
  .section-title { font-size: 1.25rem; }
  .app-card { padding: 14px; }
  .app-icon { width: 40px; height: 40px; font-size: 0.9rem; }
  .rank-item, .new-item { gap: 10px; padding: 12px 0; }
  .rank-icon, .new-icon { width: 36px; height: 36px; }
  .forum-rank-body { padding: 4px 16px 12px; }
  .forum-rank-list .rank-item { padding: 12px 0; }
  .forum-rank-list .rank-item:hover { margin: 0 -8px; padding-left: 8px; padding-right: 8px; }
}
