/* ===== 文件：common.css ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: #333;
  background-color: #fff;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  max-width: 100vw;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.3s ease;
}

a:hover {
  color: #165DFF;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  cursor: pointer;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: inherit;
  transition: all 0.3s ease;
}

input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
  outline: none;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 12px 16px;
  width: 100%;
  transition: border-color 0.3s ease;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #165DFF;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.btn {
  display: inline-block;
  padding: 12px 32px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  outline: none;
}

.btn-primary {
  background-color: #165DFF;
  color: #fff;
}

.btn-primary:hover {
  background-color: #4080ff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(22, 93, 255, 0.3);
}

.btn-secondary {
  background-color: #fff;
  color: #165DFF;
  border: 1px solid #165DFF;
}

.btn-secondary:hover {
  background-color: #f0f5ff;
  transform: translateY(-1px);
}

@media (hover: none) {
  .btn-primary:hover {
    transform: none;
  }
  .btn-secondary:hover {
    transform: none;
  }
}

.btn-link {
  background: none;
  border: none;
  color: #86909c;
  cursor: pointer;
  padding: 6px 12px;
  font-size: 13px;
}

.btn-link:hover {
  color: #165DFF;
  background: none;
  transform: none;
}

.user-greeting {
  color: #333;
  margin-right: 12px;
  font-size: 14px;
  font-weight: 500;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-large {
  padding: 14px 40px;
  font-size: 16px;
}

.btn-small {
  padding: 8px 20px;
  font-size: 13px;
}

.btn-block {
  display: block;
  width: 100%;
}

.btn-disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

.card {
  background: #fff;
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  -webkit-overflow-scrolling: touch;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: #fff;
  border-radius: 12px;
  padding: 32px;
  max-width: 480px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: #333;
  color: #fff;
  padding: 14px 28px;
  border-radius: 6px;
  z-index: 10000;
  transition: transform 0.3s ease;
  white-space: nowrap;
  max-width: 90vw;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.toast-success {
  background: #00B42A;
}

.toast-error {
  background: #F53F3F;
}

.toast-warning {
  background: #FF7D00;
}

.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.fade-in {
  animation: fadeIn 0.6s ease forwards;
}

.fade-in-element {
  opacity: 0;
  transform: translateY(30px);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: #fff;
  z-index: 1000;
  border-bottom: 1px solid #f2f3f5;
  transition: box-shadow 0.3s ease;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

.site-header.scrolled {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: justify;
  -ms-flex-pack: justify;
  justify-content: space-between;
  position: relative;
  z-index: 10;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 600;
  color: #165DFF;
}

.header-logo svg {
  width: 32px;
  height: 32px;
}

.header-logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.logo-main {
  font-size: 18px;
  font-weight: 700;
  color: #165DFF;
}

.logo-sub {
  margin-top: 4px;
  font-size: 11px;
  color: #86909c;
  font-weight: normal;
}

.header-nav {
  display: flex;
  gap: 32px;
  list-style: none;
}

.header-nav a {
  color: #4e5969;
  font-size: 14px;
  font-weight: 500;
  position: relative;
  padding: 4px 0;
}

.header-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: #165DFF;
  transition: width 0.3s ease;
}

.header-nav a:hover {
  color: #165DFF;
}

.header-nav a:hover::after {
  width: 100%;
}

.header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  position: relative;
  z-index: 1000;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 12px;
  position: relative;
  z-index: 1001;
  -webkit-tap-highlight-color: rgba(22, 93, 255, 0.1);
  touch-action: manipulation;
  min-width: 44px;
  min-height: 44px;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.mobile-menu-btn svg {
  width: 24px;
  height: 24px;
  fill: #333;
  pointer-events: none;
}

.site-footer {
  background: #f7f8fa;
  padding: 48px 0 24px;
  margin-top: 80px;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
  margin-bottom: 32px;
}

.footer-section h4 {
  font-size: 15px;
  font-weight: 600;
  color: #1d2129;
  margin-bottom: 16px;
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: 10px;
}

.footer-section a {
  color: #86909c;
  font-size: 13px;
}

.footer-section a:hover {
  color: #165DFF;
}

.footer-highlight-link {
  color: #165DFF !important;
  font-weight: 600;
  position: relative;
  display: inline-block;
  padding-right: 22px;
}

.footer-highlight-link::before {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, #165DFF, #4080ff);
  border-radius: 1px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.footer-highlight-link:hover::before {
  transform: scaleX(1);
}

.footer-highlight-link::after {
  content: '👈';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  line-height: 1;
  animation: finger-point 1.5s ease-in-out infinite;
}

@keyframes finger-point {
  0%, 100% {
    transform: translateY(-50%) translateX(0);
  }
  50% {
    transform: translateY(-50%) translateX(-3px);
  }
}

.footer-highlight-link:hover {
  color: #4080ff !important;
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 0;
  border-top: 1px solid #e5e5e5;
  text-align: center;
  color: #86909c;
  font-size: 13px;
}

.back-to-top {
  position: fixed;
  right: 32px;
  bottom: 40px;
  width: 44px;
  height: 44px;
  background: #fff;
  border: 1px solid #e5e6eb;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
  z-index: 999;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-transform: translateZ(0);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: #165DFF;
  border-color: #165DFF;
  box-shadow: 0 6px 20px rgba(22, 93, 255, 0.3);
}

.back-to-top:hover svg {
  fill: #fff;
}

.back-to-top svg {
  fill: #4e5969;
  transition: fill 0.3s ease;
}

.floating-trial-btn {
  position: fixed;
  right: 32px;
  bottom: 100px;
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-transform: translateZ(0);
}

.floating-trial-btn.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.floating-trial-btn .btn-small {
  padding: 10px 20px;
  font-size: 14px;
  box-shadow: 0 4px 16px rgba(22, 93, 255, 0.3);
}

@media (max-width: 1024px) {
  .header-nav {
    gap: 20px;
  }

  .header-actions .btn {
    padding: 8px 16px;
    font-size: 13px;
  }
}

@media (max-width: 768px) {
  .site-header {
    height: 56px;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
  }

  .header-inner {
    padding: 0 16px;
    position: relative;
    z-index: 10;
  }

  .header-logo img {
    width: 32px;
    height: 32px;
  }

  .logo-main {
    font-size: 16px;
  }

  .logo-sub {
    display: none;
  }

  .header-nav {
    display: none !important;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: #fff;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    padding: 8px 16px;
    gap: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-height: calc(100vh - 56px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 999;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
  }

  .header-nav.active {
    display: -webkit-box !important;
    display: -ms-flexbox !important;
    display: flex !important;
  }

  .header-nav li {
    list-style: none;
  }

  .header-nav a {
    padding: 12px 0;
    border-bottom: 1px solid #f2f3f5;
    font-size: 15px;
  }

  .header-nav a::after {
    display: none;
  }

  .header-nav a.active {
    color: #165DFF;
    font-weight: 600;
  }

  .header-actions {
    gap: 8px;
  }

  .header-actions .btn {
    padding: 6px 12px;
    font-size: 12px;
  }

  .user-greeting {
    max-width: 72px;
    font-size: 12px;
    margin-right: 4px;
  }

  .mobile-menu-btn {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    position: relative;
    z-index: 1001;
    margin-left: 8px;
  }

  .mobile-menu-btn.active svg {
    fill: #165DFF;
  }
  
  .mobile-menu-btn:active {
    background: rgba(22, 93, 255, 0.05);
    border-radius: 4px;
  }

  .btn-large {
    padding: 12px 28px;
    font-size: 15px;
  }

  .card {
    padding: 20px;
  }

  .container {
    padding: 0 16px;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .floating-trial-btn {
    right: 16px;
    bottom: 80px;
    bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  }

  .back-to-top {
    right: 16px;
    bottom: 32px;
    bottom: calc(32px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 480px) {
  .header-actions #actions-guest .btn-secondary {
    display: none;
  }

  .header-actions #actions-guest .btn-primary {
    padding: 6px 14px;
    font-size: 12px;
  }

  .header-actions #actions-user .btn-link {
    display: none;
  }

  .header-actions #actions-user .btn-primary {
    padding: 6px 14px;
    font-size: 12px;
  }
}

@media screen and (-webkit-min-device-pixel-ratio: 0) {
  .site-header {
    -webkit-transform: translateZ(0);
  }
  
  .trust-stats {
    -webkit-transform: translateZ(0);
  }
  
  .trust-stat-item {
    -webkit-backface-visibility: hidden;
    -webkit-transform: translateZ(0);
  }
}

@supports (-webkit-touch-callout: none) {
  .site-header {
    position: -webkit-sticky;
    position: sticky;
  }
  
  body {
    -webkit-overflow-scrolling: touch;
  }
}