/* Lingomere São Paulo S25 design tokens — light default, dark via prefers-color-scheme */
:root {
  --ink: #0F1B2D;
  --paper: #FAFBFC;
  --surface: #FFFFFF;
  --navy: #0A2540;
  --blue: #0066FF;
  --gold: #C9A227;
  --muted: #475569;
  --line: #E5E9EF;
  --success: #0F766E;

  --fs-12: 0.75rem;
  --fs-14: 0.875rem;
  --fs-16: 1rem;
  --fs-20: 1.25rem;
  --fs-26: 1.75rem;
  --fs-34: 2.5rem;
  --fs-48: 3.5rem;

  --lh-tight: 1.1;
  --lh-body: 1.75;

  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-12: 48px;
  --sp-16: 64px;
  --sp-24: 96px;

  --r-4: 6px;
  --r-8: 10px;
  --r-12: 16px;
  --r-full: 999px;

  --maxw: 1200px;
  --prose: 68ch;
  --gutter: 40px;

  --font-sans: "Inter", "Noto Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ff-head: "Inter", "Noto Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Semantic color tokens (used by site.css) */
  --fc-primary: var(--ink);
  --fc-secondary: var(--muted);
  --fc-accent: var(--blue);
  --fc-muted: var(--muted);

  /* Extended font sizes */
  --fs-11: 0.6875rem;
  --fs-13: 0.8125rem;
  --fs-15: 0.9375rem;
  --fs-22: 1.375rem;
  --fs-24: 1.5rem;

  /* Extended spacing */
  --sp-5: 20px;

  /* Font weights */
  --fw-normal: 400;
  --fw-bold: 700;

  --ease: cubic-bezier(.2, .6, .2, 1);
  --dur: 180ms;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #E8ECF0;
    --paper: #0E1720;
    --surface: #16232F;
    --navy: #9FC3E0;
    --blue: #6B9EFF;
    --gold: #E0C76B;
    --muted: #A9B4BF;
    --line: #2C3A47;
    --success: #7FC3A8;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { color-scheme: light dark; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family:var(--font-sans), sans-serif;
  font-size: var(--fs-16);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  line-height: var(--lh-tight);
  font-weight: 800;
  letter-spacing: -0.025em;
  margin: 0 0 var(--sp-4);
}

h1 { font-size: clamp(var(--fs-34), 5vw, var(--fs-48)); }
h2 { font-size: var(--fs-26); }
h3 { font-size: var(--fs-20); }

p { margin: 0 0 var(--sp-4); max-width: var(--prose); color: var(--muted); }

a { color: var(--blue); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 50px; padding: 0 var(--sp-6);
  border-radius: var(--r-8); border: 1px solid transparent;
  font: 600 var(--fs-16)/1 var(--font-sans);
  cursor: pointer; text-decoration: none;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.btn-primary { background: var(--blue); color: #FFFFFF; }
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-secondary { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-secondary:hover { background: color-mix(in srgb, var(--navy) 8%, transparent); }
.btn:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-12);
  padding: var(--sp-6);
  box-shadow: 0 1px 3px rgba(15, 27, 45, 0.06);
  transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.card:hover { border-color: var(--muted); box-shadow: 0 4px 12px rgba(15, 27, 45, 0.1); transform: translateY(-2px); }

.tag {
  display: inline-flex; align-items: center;
  padding: var(--sp-1) var(--sp-3);
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  font-size: var(--fs-12);
  color: var(--muted);
}

.section { padding: var(--sp-24) 0; }
@media (max-width: 767px) { .section { padding: var(--sp-16) 0; } }

.grid { display: grid; gap: var(--sp-6); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 1023px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767px) {
  :root { --gutter: 20px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .btn { width: 100%; min-height: 54px; }
}

table { width: 100%; border-collapse: collapse; }
th, td { padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--line); text-align: left; }
@media (max-width: 767px) {
  .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-scroll table { min-width: 640px; }
}

img { max-width: 100%; height: auto; display: block; border-radius: var(--r-12); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Page type classes */
.tpl-home .hero { min-height: 70vh; display: flex; align-items: center; }
.tpl-detail .hero { background: var(--navy); color: #FFFFFF; }
.tpl-service .hero { background: var(--navy); color: #FFFFFF; }
.tpl-about .hero { background: var(--navy); color: #FFFFFF; }
.tpl-price .hero { background: var(--navy); color: #FFFFFF; }
.tpl-guide .hero { background: var(--navy); color: #FFFFFF; }
.tpl-trust .hero { background: var(--navy); color: #FFFFFF; }
.tpl-industry .hero { background: var(--navy); color: #FFFFFF; }
.tpl-category .hero { background: var(--navy); color: #FFFFFF; }
.tpl-ocr .hero { background: var(--navy); color: #FFFFFF; }

.tpl-detail .hero h1,
.tpl-service .hero h1,
.tpl-about .hero h1,
.tpl-price .hero h1,
.tpl-guide .hero h1,
.tpl-trust .hero h1,
.tpl-industry .hero h1,
.tpl-category .hero h1,
.tpl-ocr .hero h1 { color: #FFFFFF; }

.tpl-detail .hero p,
.tpl-service .hero p,
.tpl-about .hero p,
.tpl-price .hero p,
.tpl-guide .hero p,
.tpl-trust .hero p,
.tpl-industry .hero p,
.tpl-category .hero p,
.tpl-ocr .hero p { color: rgba(255,255,255,0.85); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}


/* ===== 移动端兼容性补丁 ===== */
@media (max-width: 767px) {
  /* P4 字号：强制最小 16px */
  body, p, span, a, li, td, th, label, div, h1, h2, h3, h4, h5, h6,
  nav a, header a, footer a, .nav-links a, .nav a, .menu a,
  .site-header a, .m-hdr a, .main-header a {
    font-size: 16px !important;
  }
  h1 { font-size: 24px !important; }
  h2 { font-size: 20px !important; }
  h3 { font-size: 18px !important; }
  input, select, textarea, button {
    font-size: 16px !important;
  }
  /* P3 触控目标 */
  a, button, input, select, textarea, [role="button"], .btn,
  .nav-toggle, .menu-toggle, .mobile-menu-toggle, .float,
  .chat, .cookie-bar, .back-to-top, .whatsapp-float, .lx-chat,
  .m-chat, .live-chat, .skip-link {
    min-width: 44px !important;
    min-height: 44px !important;
    padding: 10px 16px !important;
  }
  /* P9 浮层：降低 z-index */
  #cookieBanner, .cookie-bar, .m-cookie, #s28CookieBanner,
  .cookie-consent, .cookie-banner {
    z-index: 999 !important;
    max-height: 40vh !important;
    overflow-y: auto !important;
  }
  #lingoFloatLeft, .float-r, .whatsapp-float, .wa-float,
  .back-to-top, .float-chat, .chat-widget {
    z-index: 998 !important;
    width: 48px !important;
    height: 48px !important;
  }
  /* P12 hero 窄列修复 */
  .m-hero, .hero, .hero-premium, .subhero-premium, .page-head {
    display: block !important;
  }
  .m-hero .wrap, .hero .wrap {
    width: 100% !important;
    max-width: 100% !important;
  }
  /* P2 横向溢出 */
  
  img, table, .table-scroll {
    max-width: 100% !important;
  }
}


/* ===== 移动端兼容性补丁（最终版） ===== */
@media (max-width: 767px) {
  html { -webkit-text-size-adjust: 100%; }
  body, p, span, a, li, td, th, label, div, h1, h2, h3, h4, h5, h6,
  nav a, header a, footer a, .nav-links a, .nav a, .menu a,
  .site-header a, .m-hdr a, .main-header a, .skip-link {
    font-size: 16px !important;
  }
  h1 { font-size: 24px !important; }
  h2 { font-size: 20px !important; }
  h3 { font-size: 18px !important; }
  input, select, textarea, button { font-size: 16px !important; }
  a, button, input, select, textarea, [role="button"], .btn,
  .nav-toggle, .menu-toggle, .mobile-menu-toggle, .float,
  .chat, .cookie-bar, .back-to-top, .whatsapp-float, .lx-chat,
  .m-chat, .live-chat, .skip-link {
    min-width: 44px !important;
    min-height: 44px !important;
    padding: 10px 16px !important;
  }
  #cookieBanner, .cookie-bar, .m-cookie, #s28CookieBanner,
  .cookie-consent, .cookie-banner {
    z-index: 999 !important;
    max-height: 40vh !important;
    overflow-y: auto !important;
  }
  #lingoFloatLeft, .float-r, .whatsapp-float, .wa-float,
  .back-to-top, .float-chat, .chat-widget {
    z-index: 998 !important;
    width: 48px !important;
    height: 48px !important;
  }
  .m-hero, .hero, .hero-premium, .subhero-premium, .page-head {
    display: block !important;
  }
  .m-hero .wrap, .hero .wrap { width: 100% !important; max-width: 100% !important; }
  
  img, table, .table-scroll { max-width: 100% !important; }
}


/* ===== 移动端字号修复（覆盖 polish） ===== */
@media (max-width: 767px) {
  body, body * {
    font-size: 16px !important;
  }
  h1, h2, h3, h4, h5, h6 {
    font-size: 16px !important;
  }
  h1 { font-size: 24px !important; }
  h2 { font-size: 20px !important; }
  h3 { font-size: 18px !important; }
}
/* UI-PATCH-20261111-A2A3A6 reduced-motion */
@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}
/* UI-PATCH-20261111-A2A3A6 focus-visible */
:focus-visible{outline:2px solid #1d4ed8;outline-offset:2px}
:focus{outline:2px solid #1d4ed8;outline-offset:2px}
