:root {
  --brand: #146c94;
  --brand-dark: #102a43;
  --accent: #e56b36;
  --ink: #18202a;
  --muted: #667085;
  --soft: #f4f8fb;
}

body {
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  padding-top: 66px;
}

.homepage-game-canvas {
  background: transparent;
  height: 100vh;
  inset: 0;
  pointer-events: none;
  position: fixed;
  width: 100vw;
  z-index: 9999;
}

.btn-primary {
  --bs-btn-bg: var(--brand);
  --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: #0f5879;
  --bs-btn-hover-border-color: #0f5879;
}

.navbar-brand {
  color: var(--brand-dark);
}

.hero-section {
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.78), rgba(236, 248, 252, 0.42)),
    url("/static/img/hero-ai-chinese-team-light.png") center/cover;
  color: var(--brand-dark);
  min-height: calc(100vh - 66px);
  padding: 7rem 0 4rem;
}

.eyebrow {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-section .eyebrow {
  color: var(--accent);
}

.hero-copy {
  color: #415466;
  font-size: 1.05rem;
  max-width: 680px;
}

.hero-panel {
  backdrop-filter: blur(14px);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(20, 108, 148, 0.16);
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(16, 42, 67, 0.1);
  padding: 1.4rem;
}

.metric-row {
  border-bottom: 1px solid rgba(20, 108, 148, 0.14);
  display: grid;
  gap: 0.5rem;
  padding-bottom: 1.2rem;
}

.metric-row span,
.metric-grid span {
  color: var(--muted);
  display: block;
  font-size: 0.9rem;
}

.metric-row strong {
  color: var(--brand-dark);
  font-size: 1.1rem;
}

.metric-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, 1fr);
  padding-top: 1.2rem;
}

.metric-grid strong {
  color: var(--brand);
  display: block;
  font-size: 1.55rem;
}

.section-pad {
  padding: 5rem 0;
}

.section-heading {
  margin-bottom: 2rem;
}

.section-heading h2,
.contact-section h2 {
  color: var(--brand-dark);
  font-size: 2.1rem;
  font-weight: 800;
}

.service-card,
.case-card,
.contact-box {
  background: #fff;
  border: 1px solid #e5eaf0;
  border-radius: 8px;
  padding: 1.5rem;
}

.service-card i {
  align-items: center;
  background: var(--soft);
  border-radius: 8px;
  color: var(--brand);
  display: inline-flex;
  font-size: 1.55rem;
  height: 3rem;
  justify-content: center;
  margin-bottom: 1.25rem;
  width: 3rem;
}

.service-card h3,
.case-card h3 {
  color: var(--brand-dark);
  font-size: 1.15rem;
  font-weight: 800;
}

.service-card p,
.case-card p,
.contact-section p {
  color: var(--muted);
  line-height: 1.75;
}

.case-band {
  background: var(--soft);
}

.case-outcome {
  border-top: 1px solid #e5eaf0;
  margin: 1.25rem 0 0;
  padding-top: 1rem;
}

.case-outcome strong {
  color: var(--brand-dark);
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}

.news-section {
  background: #fff;
}

.news-category-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.news-category {
  border: 1px solid #e5eaf0;
  border-radius: 8px;
  overflow: hidden;
}

.news-category-title {
  align-items: center;
  background: #f8fafc;
  border-bottom: 1px solid #e5eaf0;
  display: flex;
  justify-content: space-between;
  padding: 1rem 1.2rem;
}

.news-category-title h3 {
  color: var(--brand-dark);
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0;
}

.news-category-title a {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
}

.news-category-title a:hover {
  color: var(--brand);
}

.news-list {
  display: grid;
}

.news-item {
  border-bottom: 1px solid #eef2f6;
  padding: 1rem 1.2rem;
}

.news-item:last-child {
  border-bottom: 0;
}

.news-item a {
  color: var(--brand-dark);
  display: block;
  font-weight: 800;
  line-height: 1.45;
  text-decoration: none;
}

.news-item a:hover {
  color: var(--brand);
}

.news-item p {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.65;
  margin: 0.45rem 0 0.7rem;
}

.news-item div {
  color: #8a98a8;
  display: flex;
  font-size: 0.82rem;
  gap: 0.75rem;
}

.news-list-page,
.news-detail-page {
  background: #f8fafc;
  min-height: calc(100vh - 66px);
  padding: 3.5rem 0;
}

.news-list-header {
  margin: 0 auto 1.25rem;
  max-width: 54rem;
}

.news-list-header h1 {
  color: var(--brand-dark);
  font-size: clamp(1.8rem, 3vw, 2.45rem);
  font-weight: 800;
  margin-bottom: 0.35rem;
}

.news-list-header span {
  color: var(--muted);
}

.news-list-panel {
  background: #fff;
  border: 1px solid #e5eaf0;
  border-radius: 8px;
  margin: 0 auto;
  max-width: 54rem;
  overflow: hidden;
}

.news-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin: 1.25rem auto 0;
  max-width: 54rem;
}

.news-detail-layout {
  align-items: start;
  display: grid;
  gap: 1.25rem;
  grid-template-columns: minmax(0, 1fr) 20rem;
}

.news-detail {
  background: #fff;
  border: 1px solid #e5eaf0;
  border-radius: 8px;
  padding: 2rem;
}

.news-sidebar {
  display: grid;
  gap: 1rem;
  position: sticky;
  top: 5rem;
}

.news-sidebar-section {
  background: #fff;
  border: 1px solid #e5eaf0;
  border-radius: 8px;
  overflow: hidden;
}

.news-sidebar-title {
  align-items: center;
  background: #f8fafc;
  border-bottom: 1px solid #e5eaf0;
  display: flex;
  justify-content: space-between;
  padding: 0.85rem 1rem;
}

.news-sidebar-title h2 {
  color: var(--brand-dark);
  font-size: 1rem;
  font-weight: 800;
  margin: 0;
}

.news-sidebar-title a {
  color: var(--brand);
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
}

.news-sidebar-list {
  display: grid;
}

.news-sidebar-list a {
  border-bottom: 1px solid #eef2f6;
  color: #344054;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.5;
  padding: 0.8rem 1rem;
  text-decoration: none;
}

.news-sidebar-list a:last-child {
  border-bottom: 0;
}

.news-sidebar-list a:hover {
  color: var(--brand);
}

.news-detail-meta,
.news-detail-source {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.news-detail-meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.news-detail-meta span {
  background: rgba(229, 107, 54, 0.12);
  border-radius: 999px;
  color: var(--accent);
  font-weight: 800;
  padding: 0.28rem 0.7rem;
}

.news-detail h1 {
  color: var(--brand-dark);
  font-size: clamp(1.8rem, 3vw, 2.55rem);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 1rem;
}

.news-detail-source {
  border-bottom: 1px solid #e5eaf0;
  color: var(--muted);
  justify-content: space-between;
  padding-bottom: 1.25rem;
}

.news-detail-source a {
  color: var(--brand);
  font-weight: 800;
  text-decoration: none;
}

.news-detail-body {
  color: #344054;
  font-size: 1.05rem;
  line-height: 1.9;
  padding-top: 1.5rem;
}

.news-detail-body div {
  margin-bottom: 1rem;
  white-space: pre-line;
}

.news-detail-body p {
  margin-bottom: 1rem;
}

.case-card span {
  background: rgba(229, 107, 54, 0.12);
  border-radius: 999px;
  color: var(--accent);
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 1rem;
  padding: 0.25rem 0.7rem;
}

.contact-section {
  background: #fff;
}

.contact-box {
  display: grid;
  gap: 0.9rem;
}

.contact-box p {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  margin: 0;
}

.contact-box i {
  color: var(--brand);
  font-size: 1.1rem;
}

footer {
  color: var(--muted);
}

.icp-link {
  color: var(--muted);
  text-decoration: none;
}

.icp-link:hover {
  color: var(--brand);
}

.chat-widget {
  bottom: 1.25rem;
  position: fixed;
  right: 1.25rem;
  z-index: 1080;
}

.chat-avatar {
  align-items: center;
  background: #fff;
  border: 3px solid rgba(20, 108, 148, 0.18);
  border-radius: 999px;
  box-shadow: 0 16px 40px rgba(16, 42, 67, 0.22);
  color: var(--brand);
  display: flex;
  height: 4.25rem;
  justify-content: center;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  width: 4.25rem;
}

.chat-avatar:hover {
  box-shadow: 0 18px 45px rgba(16, 42, 67, 0.28);
  transform: translateY(-2px);
}

.chat-avatar img {
  border-radius: 999px;
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.chat-avatar span {
  background: #24b47e;
  border: 2px solid #fff;
  border-radius: 999px;
  bottom: 0.35rem;
  height: 0.8rem;
  position: absolute;
  right: 0.35rem;
  width: 0.8rem;
}

.chat-panel {
  background: #fff;
  border: 1px solid #dde6ef;
  border-radius: 8px;
  bottom: 5.25rem;
  box-shadow: 0 22px 60px rgba(16, 42, 67, 0.2);
  display: none;
  max-height: min(38rem, calc(100vh - 7rem));
  overflow: hidden;
  position: absolute;
  right: 0;
  width: min(23rem, calc(100vw - 2.5rem));
}

.chat-widget.is-open .chat-panel {
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.chat-panel-header {
  align-items: center;
  background: var(--brand-dark);
  color: #fff;
  display: flex;
  justify-content: space-between;
  padding: 1rem;
}

.chat-panel-header strong,
.chat-panel-header small {
  display: block;
}

.chat-panel-header small {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.78rem;
  margin-top: 0.2rem;
}

.chat-panel-header button {
  align-items: center;
  background: rgba(255, 255, 255, 0.12);
  border: 0;
  border-radius: 8px;
  color: #fff;
  display: inline-flex;
  height: 2rem;
  justify-content: center;
  width: 2rem;
}

.chat-messages {
  background: #f7fafc;
  display: grid;
  gap: 0.75rem;
  overflow-y: auto;
  padding: 1rem;
}

.chat-message {
  display: flex;
}

.chat-message p {
  border-radius: 8px;
  line-height: 1.6;
  margin: 0;
  max-width: 84%;
  padding: 0.7rem 0.85rem;
  word-break: break-word;
}

.chat-message.assistant {
  justify-content: flex-start;
}

.chat-message.assistant p {
  background: #fff;
  border: 1px solid #e5eaf0;
  color: var(--ink);
}

.chat-message.user {
  justify-content: flex-end;
}

.chat-message.user p {
  background: var(--brand);
  color: #fff;
}

.chat-form {
  background: #fff;
  border-top: 1px solid #e5eaf0;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr auto;
  padding: 0.85rem;
}

.chat-form textarea {
  border: 1px solid #d5dde8;
  border-radius: 8px;
  line-height: 1.45;
  max-height: 7rem;
  min-height: 2.75rem;
  padding: 0.6rem 0.7rem;
  resize: vertical;
}

.chat-form textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 0.2rem rgba(20, 108, 148, 0.16);
  outline: 0;
}

.chat-form button {
  align-self: end;
  height: 2.75rem;
  width: 2.75rem;
}

.chat-form button[disabled] {
  opacity: 0.7;
}

@media (max-width: 767.98px) {
  .hero-section {
    min-height: auto;
    padding: 4.5rem 0 3rem;
  }

  .hero-section .display-4 {
    font-size: 2.45rem;
  }

  .section-pad {
    padding: 3.5rem 0;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .news-category-grid {
    grid-template-columns: 1fr;
  }

  .chat-widget {
    bottom: 1rem;
    right: 1rem;
  }

  .chat-panel {
    bottom: 5rem;
  }
}

.admin-auth-body,
.admin-body {
  background: #f5f7fa;
  padding-top: 0;
}

.admin-auth {
  align-items: center;
  display: flex;
  min-height: 100vh;
  padding: 1.25rem;
}

.admin-auth-panel {
  background: #fff;
  border: 1px solid #dde5ee;
  border-radius: 8px;
  box-shadow: 0 20px 55px rgba(16, 42, 67, 0.12);
  margin: 0 auto;
  max-width: 25rem;
  padding: 2rem;
  width: 100%;
}

.admin-auth-brand,
.admin-logo,
.admin-userbar,
.admin-sidebar a,
.admin-stat {
  align-items: center;
  display: flex;
}

.admin-auth-brand {
  gap: 0.8rem;
  margin-bottom: 1.75rem;
}

.admin-auth-brand i,
.admin-logo i {
  color: var(--brand);
  font-size: 1.45rem;
}

.admin-auth-brand strong {
  color: var(--brand-dark);
  display: block;
  font-size: 1.1rem;
}

.admin-auth-brand span {
  color: var(--muted);
  font-size: 0.82rem;
}

.admin-auth-panel h1,
.admin-page-title h1 {
  color: var(--brand-dark);
  font-size: 1.65rem;
  font-weight: 800;
}

.admin-form,
.admin-edit-form {
  display: grid;
  gap: 1rem;
}

.admin-form label span {
  color: #344054;
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}

.admin-topbar {
  align-items: center;
  background: #fff;
  border-bottom: 1px solid #dde5ee;
  display: flex;
  height: 4rem;
  justify-content: space-between;
  padding: 0 1.5rem;
}

.admin-logo {
  color: var(--brand-dark);
  font-weight: 800;
  gap: 0.55rem;
  text-decoration: none;
}

.admin-userbar {
  color: var(--muted);
  gap: 0.75rem;
}

.admin-shell {
  display: grid;
  grid-template-columns: 15rem 1fr;
  min-height: calc(100vh - 4rem);
}

.admin-sidebar {
  background: #fff;
  border-right: 1px solid #dde5ee;
  padding: 1rem;
}

.admin-sidebar a {
  border-radius: 8px;
  color: #344054;
  font-weight: 700;
  gap: 0.65rem;
  margin-bottom: 0.35rem;
  padding: 0.75rem 0.85rem;
  text-decoration: none;
}

.admin-sidebar a.active,
.admin-sidebar a:hover {
  background: #eaf4f8;
  color: var(--brand);
}

.admin-content {
  padding: 1.75rem;
}

.admin-page-title {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.admin-page-title p {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
  margin: 0 0 0.2rem;
  text-transform: uppercase;
}

.admin-stat-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-stat,
.admin-table-wrap,
.admin-edit-form {
  background: #fff;
  border: 1px solid #dde5ee;
  border-radius: 8px;
}

.admin-stat {
  gap: 1rem;
  padding: 1.2rem;
}

.admin-stat i {
  align-items: center;
  background: #eaf4f8;
  border-radius: 8px;
  color: var(--brand);
  display: inline-flex;
  font-size: 1.25rem;
  height: 3rem;
  justify-content: center;
  width: 3rem;
}

.admin-stat span {
  color: var(--muted);
  display: block;
  font-size: 0.88rem;
}

.admin-stat strong {
  color: var(--brand-dark);
  font-size: 1.35rem;
}

.admin-table-wrap {
  overflow-x: auto;
  padding: 0.5rem;
}

.admin-table {
  margin: 0;
}

.admin-permission-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.admin-permission-tags span {
  background: #eef2f6;
  border-radius: 999px;
  color: #344054;
  font-size: 0.78rem;
  padding: 0.25rem 0.55rem;
}

.admin-chat-last {
  max-width: 22rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-chat-panel {
  background: #f8fafc;
  border: 1px solid #dde5ee;
  border-radius: 8px;
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
}

.admin-chat-message {
  display: grid;
  gap: 0.35rem;
  max-width: min(42rem, 86%);
}

.admin-chat-message.assistant {
  justify-self: start;
}

.admin-chat-message.user {
  justify-self: end;
}

.admin-chat-message div {
  align-items: center;
  color: #8a98a8;
  display: flex;
  font-size: 0.82rem;
  gap: 0.6rem;
}

.admin-chat-message.user div {
  justify-content: flex-end;
}

.admin-chat-message p {
  border: 1px solid #e5eaf0;
  border-radius: 8px;
  line-height: 1.7;
  margin: 0;
  padding: 0.75rem 0.9rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.admin-chat-message.assistant p {
  background: #fff;
  color: var(--ink);
}

.admin-chat-message.user p {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.admin-edit-form {
  padding: 1.25rem;
}

.admin-permission-box {
  border-top: 1px solid #e5eaf0;
  margin-top: 0.25rem;
  padding-top: 1rem;
}

.admin-permission-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-permission-grid .form-check {
  background: #f8fafc;
  border: 1px solid #e5eaf0;
  border-radius: 8px;
  margin: 0;
  padding: 0.8rem 0.8rem 0.8rem 2.35rem;
}

.admin-form-actions {
  display: flex;
  gap: 0.75rem;
}

@media (max-width: 900px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    border-bottom: 1px solid #dde5ee;
    border-right: 0;
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
  }

  .admin-sidebar a {
    white-space: nowrap;
  }

  .admin-stat-grid,
  .admin-permission-grid {
    grid-template-columns: 1fr;
  }

  .news-detail-layout {
    grid-template-columns: 1fr;
  }

  .news-sidebar {
    position: static;
  }
}
