/* =========================================
   Asolica 公共样式 - 全局基础 + Header & Footer
   所有页面共享，统一风格
   ========================================= */

/* ===== 全局基础重置 & 移动端适配 ===== */
*, *::before, *::after {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}
html {
  height: 100%;
  height: 100dvh;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  min-height: 100%;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
/* PWA standalone 模式下给header留足状态栏空间 */
@media all and (display-mode: standalone) {
  .site-header {
    padding-top: env(safe-area-inset-top, 0px);
    height: calc(64px + env(safe-area-inset-top, 0px));
  }
  body {
    padding-top: 0;
  }
}
@media all and (display-mode: standalone) and (max-width: 768px) {
  .site-header {
    height: calc(60px + env(safe-area-inset-top, 0px));
  }
}
/* 移动端滚动优化 */
@supports (-webkit-overflow-scrolling: touch) {
  body { -webkit-overflow-scrolling: touch; }
}
img, svg { max-width: 100%; height: auto; }
button, a { -webkit-user-select: none; user-select: none; }
input, textarea { -webkit-user-select: text; user-select: text; font-size: 16px; }

/* ===== Scroll Progress ===== */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--primary, #2563EB) 0%, #60A5FA 50%, var(--accent, #F97316) 100%);
  z-index: 2000;
  transition: width 0.1s ease-out;
}

/* ===== Header ===== */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 48px;
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(20px) saturate(1.8);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  border-bottom: 1px solid rgba(226,232,240,0.6);
  transition: box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1), background 0.35s;
}
.site-header.scrolled {
  box-shadow: 0 1px 8px rgba(15,23,42,0.06);
  background: rgba(255,255,255,0.88);
}
.header-logo {
  display: flex; align-items: center; gap: 11px;
  color: #0F172A;
  text-decoration: none;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.header-logo:hover { transform: scale(1.03); }
.brand-icon {
  width: 30px; height: 30px; flex-shrink: 0;
  color: #0F172A;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.header-logo:hover .brand-icon { transform: rotate(12deg) scale(1.05); }
.brand-name {
  font-size: 17px; font-weight: 800;
  color: #0F172A; letter-spacing: -0.4px;
}

.header-nav {
  display: flex; align-items: center; gap: 32px;
}
.header-nav a {
  font-size: 13px; font-weight: 600;
  color: #64748B;
  text-decoration: none;
  transition: color 0.2s;
  position: relative;
}
.header-nav a:hover { color: #0F172A; }
.header-nav a.active { color: var(--primary, #2563EB); }
.header-nav a::after {
  content: '';
  position: absolute; bottom: -4px; left: 0; right: 0;
  height: 2px; border-radius: 1px;
  background: var(--primary, #2563EB);
  transform: scaleX(0);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.header-nav a:hover::after,
.header-nav a.active::after { transform: scaleX(1); }

.header-cta { display: flex; align-items: center; gap: 10px; }
.header-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-weight: 600; font-size: 13px; white-space: nowrap;
  text-decoration: none; font-family: inherit;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer; border: none;
}
.header-btn-github {
  padding: 8px 16px; border-radius: 9999px;
  background: #0F172A; color: #fff;
}
.header-btn-github:hover {
  background: #1E293B;
  transform: translateY(-1.5px);
}
.header-btn-github svg { width: 15px; height: 15px; }

/* ===== Language Toggle ===== */
.lang-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 12px; border-radius: 9999px;
  background: rgba(15,23,42,0.06);
  color: #0F172A;
  border: 1.5px solid transparent;
  font-family: inherit;
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.lang-btn:hover {
  background: rgba(37,99,235,0.08);
  border-color: rgba(37,99,235,0.2);
  color: var(--primary, #2563EB);
}
.lang-icon { width: 15px; height: 15px; }
.lang-text { letter-spacing: 0.3px; }

/* ===== Footer ===== */
.site-footer {
  position: relative;
  background: #0F172A;
  color: #fff;
  padding: 48px;
  text-align: center;
  z-index: 1;
}
.footer-brand {
  display: flex; align-items: center; justify-content: center; gap: 11px;
  margin-bottom: 16px;
  color: #fff;
  text-decoration: none;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.footer-brand:hover { transform: scale(1.03); }
.footer-brand .brand-icon {
  width: 26px; height: 26px;
  color: #fff;
}
.footer-brand:hover .brand-icon { transform: rotate(12deg) scale(1.05); }
.footer-brand-name {
  font-size: 15px; font-weight: 800;
  color: #fff; letter-spacing: -0.3px;
}
.footer-brand-sep {
  color: rgba(255,255,255,0.2);
  margin: 0 4px; font-weight: 300;
}
.footer-brand-tag {
  font-size: 13px; font-weight: 400;
  color: rgba(255,255,255,0.5);
}
.footer-copy {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
}
.footer-links {
  margin-bottom: 16px;
  font-size: 13px;
}
.footer-links a {
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  transition: color 0.2s ease, text-decoration 0.2s ease;
}
.footer-links a:hover {
  color: #fff;
  text-decoration: underline;
}

/* ===== Back to Top ===== */
.back-to-top {
  position: fixed;
  bottom: 32px; right: 32px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--primary, #2563EB);
  color: #fff;
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(37,99,235,0.35);
  opacity: 0; visibility: hidden;
  transform: translateY(12px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 99;
}
.back-to-top.visible {
  opacity: 1; visibility: visible;
  transform: translateY(0);
}
.back-to-top:hover {
  background: #1D4ED8;
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(37,99,235,0.45);
}
.back-to-top svg { width: 18px; height: 18px; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .site-header { padding: 0 20px; height: 60px; }
  .header-nav { gap: 16px; }
  .header-nav a { font-size: 12px; }
  .header-cta .header-btn-github { display: none; }
  .lang-btn { padding: 6px 10px; font-size: 11px; }
  .lang-icon { width: 13px; height: 13px; }
  .site-footer { padding: 36px 20px; }
  .back-to-top { bottom: 20px; right: 20px; width: 40px; height: 40px; }
}

@media (max-width: 640px) {
  .header-nav { gap: 12px; }
  .header-nav a { font-size: 11px; }
  .brand-name { font-size: 15px; }
  .brand-icon { width: 26px; height: 26px; }
  .lang-btn .lang-icon { margin-right: 0; }
}

@media (max-width: 520px) {
  .brand-name { display: none; }
  .lang-text { display: none; }
  .lang-btn { padding: 0; width: 32px; height: 32px; justify-content: center; border-radius: 50%; }
  .site-header { padding: 0 12px; }
  .header-nav { gap: 10px; }
}

