/* ============================================
   QY Corporate Info Page — Neumorphism Design
   新拟物派设计系统 + 背景图支持 + 可配置透明度
   ============================================ */

/* === Reset & Base === */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #e0e5ec;
  --bg-card: #e0e5ec;
  --shadow-dark: #b8bcc2;
  --shadow-light: #ffffff;
  --text-primary: #2d3748;
  --text-secondary: #4a5568;
  --text-muted: #718096;
  --accent: #6366f1;
  --accent-soft: #a5b4fc;
  --radius-xl: 12px;
  --radius-2xl: 16px;
  --radius-full: 50%;
  --transition: all 0.2s ease;
  --max-width: 1200px;
  --banner-height: 68px;
  --shadow-sm: 4px 4px 8px var(--shadow-dark), -4px -4px 8px var(--shadow-light);
  --shadow-md: 6px 6px 12px var(--shadow-dark), -6px -6px 12px var(--shadow-light);
  --shadow-lg: 8px 8px 16px var(--shadow-dark), -8px -8px 16px var(--shadow-light);
  --shadow-xl: 12px 12px 24px var(--shadow-dark), -12px -12px 24px var(--shadow-light);
  --shadow-inset-sm: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
  --shadow-inset-md: inset 6px 6px 12px var(--shadow-dark), inset -6px -6px 12px var(--shadow-light);
  /* 可配置参数（由 Workers 环境变量注入覆盖） */
  --module-opacity: 0.85;
  --bg-overlay-opacity: 0.3;
  --bg-blur: 8px;
  /* 半透明背景（统一引用 module-opacity，确保 BgOpacity 变量全局生效） */
  --bg-glass: rgba(224, 229, 236, var(--module-opacity));
  --bg-glass-light: rgba(224, 229, 236, calc(var(--module-opacity) * 0.6));
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: "Segoe UI", Roboto, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text-secondary);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* === Background Image Support === */
body.has-bg-image {
  background-image: url("../information/Background.png");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
}

/* 背景图明暗遮罩层 */
body.has-bg-image::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, var(--bg-overlay-opacity));
  z-index: -1;
  pointer-events: none;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* === Banner === */
.banner {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: blur(var(--bg-blur));
  -webkit-backdrop-filter: blur(var(--bg-blur));
  height: var(--banner-height);
}

.banner-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 8px 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.banner-left {
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 0;
}

.banner-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.banner-brand img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  border-radius: var(--radius-xl);
  background: var(--bg-glass-light);
  padding: 4px;
  box-shadow: var(--shadow-sm);
}

.banner-brand span {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

.banner-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.banner-nav a {
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-xl);
  background: var(--bg-glass);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  white-space: nowrap;
}

.banner-nav a:hover {
  box-shadow: 4px 4px 8px var(--shadow-dark), -4px -4px 8px var(--shadow-light);
  color: var(--accent);
}

.banner-nav a:active {
  box-shadow: var(--shadow-inset-sm);
}

.banner-right {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.btn-contact {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: none;
  background: var(--bg-glass);
  cursor: pointer;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  color: var(--text-secondary);
}

.btn-contact:hover {
  color: var(--accent);
  box-shadow: 4px 4px 8px var(--shadow-dark), -4px -4px 8px var(--shadow-light);
}

.btn-contact:active {
  box-shadow: var(--shadow-inset-sm);
}

.btn-contact svg {
  width: 20px;
  height: 20px;
}

/* === Modal === */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(160, 170, 185, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay.active {
  display: flex;
}

.modal-box {
  background: var(--bg);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 420px;
  overflow: hidden;
  animation: modalIn 0.25s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 0;
}

.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--bg);
  cursor: pointer;
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.modal-close:hover {
  color: var(--text-primary);
  box-shadow: 4px 4px 8px var(--shadow-dark), -4px -4px 8px var(--shadow-light);
}

.modal-close:active {
  box-shadow: var(--shadow-inset-sm);
}

.modal-close svg {
  width: 16px;
  height: 16px;
}

.modal-body {
  padding: 24px 28px 28px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--bg);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-inset-sm);
  margin-bottom: 12px;
}

.contact-item:last-child {
  margin-bottom: 0;
}

.contact-item svg {
  width: 22px;
  height: 22px;
  color: var(--accent);
  flex-shrink: 0;
}

.contact-item .label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.contact-item .value {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-all;
}

/* === Main Content === */
.main-content {
  flex: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 24px;
  width: 100%;
}

/* === Scroll-to-Social Button === */
.scroll-social-wrap {
  text-align: center;
  margin-bottom: 28px;
}

.btn-scroll-social {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-glass);
  backdrop-filter: blur(var(--bg-blur));
  -webkit-backdrop-filter: blur(var(--bg-blur));
  border: none;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: var(--transition);
}

.btn-scroll-social:hover {
  box-shadow: var(--shadow-sm);
  color: var(--accent);
}

.btn-scroll-social:active {
  box-shadow: var(--shadow-inset-sm);
}

.btn-scroll-social svg {
  width: 18px;
  height: 18px;
  transition: transform 0.2s ease;
}

.btn-scroll-social:hover svg {
  transform: translateY(2px);
}

/* === Markdown Section (Core.md / Footer.md) === */
.markdown-section {
  background: var(--bg-glass);
  backdrop-filter: blur(var(--bg-blur));
  -webkit-backdrop-filter: blur(var(--bg-blur));
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-lg);
  padding: 32px 36px;
  margin-bottom: 28px;
}

.markdown-section h1 {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-bottom: 14px;
  position: relative;
}

.markdown-section h1::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 48px;
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
}

.markdown-section h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 24px;
  margin-bottom: 12px;
}

.markdown-section h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 20px;
  margin-bottom: 10px;
}

.markdown-section h4,
.markdown-section h5,
.markdown-section h6 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 16px;
  margin-bottom: 8px;
}

.markdown-section p {
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.8;
  max-width: 70ch;
}

.markdown-section ul,
.markdown-section ol {
  padding-left: 24px;
  margin-bottom: 14px;
}

.markdown-section li {
  color: var(--text-secondary);
  margin-bottom: 6px;
  line-height: 1.7;
}

.markdown-section li.task-item {
  list-style: none;
  margin-left: -20px;
}

.markdown-section li.task-item input[type="checkbox"] {
  margin-right: 8px;
  accent-color: var(--accent);
}

.markdown-section strong {
  color: var(--text-primary);
  font-weight: 600;
}

.markdown-section del {
  color: var(--text-muted);
}

.markdown-section hr {
  border: none;
  height: 2px;
  border-radius: 1px;
  background: var(--shadow-dark);
  margin: 28px 0;
  opacity: 0.3;
}

.markdown-section a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.markdown-section a:hover {
  opacity: 0.8;
}

.markdown-section code {
  background: var(--bg-glass-light);
  box-shadow: var(--shadow-inset-sm);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.875em;
  font-family: "Cascadia Code", "Fira Code", "Consolas", monospace;
}

/* Markdown: Images */
.markdown-section .md-img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  margin: 16px 0;
}

/* Markdown: Fenced Code Block */
.markdown-section .md-code-block {
  background: #2d3748;
  color: #e2e8f0;
  padding: 20px 24px;
  border-radius: var(--radius-xl);
  overflow-x: auto;
  margin: 16px 0;
  font-size: 0.8125rem;
  line-height: 1.7;
  box-shadow: var(--shadow-inset-md);
}

.markdown-section .md-code-block code {
  background: none;
  box-shadow: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
  font-family: "Cascadia Code", "Fira Code", "Consolas", monospace;
}

/* Markdown: Blockquote */
.markdown-section blockquote {
  border-left: 4px solid var(--accent);
  padding: 12px 20px;
  margin: 16px 0;
  background: rgba(99, 102, 241, 0.06);
  border-radius: 0 var(--radius-xl) var(--radius-xl) 0;
  color: var(--text-secondary);
  font-style: italic;
}

/* Markdown: Table */
.markdown-section .md-table-wrap {
  overflow-x: auto;
  margin: 16px 0;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}

.markdown-section .md-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.markdown-section .md-table th,
.markdown-section .md-table td {
  padding: 10px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(184, 188, 194, 0.4);
}

.markdown-section .md-table th {
  background: rgba(99, 102, 241, 0.08);
  font-weight: 600;
  color: var(--text-primary);
}

.markdown-section .md-table td {
  color: var(--text-secondary);
}

.markdown-section .md-table tr:last-child td {
  border-bottom: none;
}

/* === Link Grid Sections (Social Media / Enterprise) === */
.link-section {
  background: var(--bg-glass);
  backdrop-filter: blur(var(--bg-blur));
  -webkit-backdrop-filter: blur(var(--bg-blur));
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-lg);
  padding: 28px 32px;
  margin-bottom: 28px;
  scroll-margin-top: calc(var(--banner-height) + 16px);
}

.link-section-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 24px;
  padding-bottom: 14px;
  position: relative;
}

.link-section-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 36px;
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

.link-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px 18px;
  border-radius: var(--radius-2xl);
  background: var(--bg-glass);
  backdrop-filter: blur(calc(var(--bg-blur) * 0.5));
  -webkit-backdrop-filter: blur(calc(var(--bg-blur) * 0.5));
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  cursor: pointer;
  text-decoration: none;
}

.link-card:hover {
  box-shadow: 4px 4px 8px var(--shadow-dark), -4px -4px 8px var(--shadow-light);
}

.link-card:active {
  box-shadow: var(--shadow-inset-sm);
}

.link-card img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: var(--radius-xl);
  background: var(--bg-glass-light);
  padding: 6px;
  box-shadow: var(--shadow-sm);
}

.link-card span {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  text-align: center;
  line-height: 1.4;
}

/* === Footer === */
.site-footer {
  background: var(--bg-glass);
  backdrop-filter: blur(var(--bg-blur));
  -webkit-backdrop-filter: blur(var(--bg-blur));
  margin-top: auto;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px;
}

.footer-content {
  padding: 16px 0;
}

.footer-content h1,
.footer-content h2,
.footer-content h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.footer-content p {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  line-height: 1.6;
}

.footer-content a {
  color: var(--accent);
  text-decoration: underline;
}

/* === Loading & Error States === */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.loading::before {
  content: "";
  width: 22px;
  height: 22px;
  border: 2px solid var(--shadow-dark);
  border-top-color: var(--accent);
  border-radius: var(--radius-full);
  margin-right: 10px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.load-error {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* === Mobile Menu Toggle === */
.mobile-menu-btn {
  display: none;
  width: 42px;
  height: 42px;
  border: none;
  background: var(--bg-glass);
  cursor: pointer;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  color: var(--text-secondary);
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.mobile-menu-btn:active {
  box-shadow: var(--shadow-inset-sm);
}

.mobile-menu-btn svg {
  width: 20px;
  height: 20px;
}

/* === Responsive === */
@media (max-width: 768px) {
  :root {
    --banner-height: 60px;
  }

  .banner-inner {
    padding: 6px 16px;
  }

  .banner-left {
    gap: 12px;
  }

  .banner-brand span {
    font-size: 1rem;
  }

  .banner-nav {
    display: none;
    position: absolute;
    top: var(--banner-height);
    left: 8px;
    right: 8px;
    background: var(--bg-glass);
    backdrop-filter: blur(var(--bg-blur));
    -webkit-backdrop-filter: blur(var(--bg-blur));
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-lg);
    flex-direction: column;
    padding: 12px;
    gap: 6px;
    z-index: 99;
  }

  .banner-nav.open {
    display: flex;
  }

  .banner-nav a {
    padding: 12px 16px;
    width: 100%;
    text-align: center;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .main-content {
    padding: 20px 16px;
  }

  .markdown-section {
    padding: 24px 20px;
  }

  .markdown-section h1 {
    font-size: 1.375rem;
  }

  .link-section {
    padding: 22px 20px;
  }

  .link-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
  }

  .link-card {
    padding: 18px 14px;
  }

  .link-card img {
    width: 44px;
    height: 44px;
  }

  .btn-scroll-social {
    padding: 10px 22px;
    font-size: 0.875rem;
  }
}

@media (max-width: 480px) {
  .link-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .link-card {
    padding: 16px 10px;
  }

  .link-card img {
    width: 40px;
    height: 40px;
  }

  .link-card span {
    font-size: 0.8125rem;
  }

  .modal-box {
    max-width: 100%;
  }
}

/* === Accessibility: Reduced Motion === */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html {
    scroll-behavior: auto;
  }
}
