/* ============================================================
   Tiiiair Brand Website - Global Styles
   Style: white background base, alternating white/light-gray sections, tech-green accent
   Fonts: DouyinSansBold (headings) + HarmonyOS Sans SC (body)
   ============================================================ */

@font-face {
    font-family: "Tiiiair Douyin";
    src: url("../fonts/DouyinSansBold.otf") format("opentype");
    font-weight: 700 900; font-style: normal; font-display: swap;
}
@font-face {
    font-family: "Tiiiair Sans";
    src: url("../fonts/HarmonyOS_Sans_SC_Regular.ttf") format("truetype");
    font-weight: 400; font-style: normal; font-display: swap;
}

/* ---------- Design tokens ---------- */
:root {
    /* Colors - light scheme */
    --c-bg:        #ffffff;     /* main background white */
    --c-bg-alt:    #f5f6f8;     /* secondary background light gray (alternating sections) */
    --c-bg-card:   #ffffff;     /* card background white */
    --c-text:      #1a1d22;     /* primary text near-black */
    --c-text-mute: #8a8f96;     /* secondary text mid-gray */
    --c-text-soft: #555b63;     /* soft text dark gray */
    --c-accent:    #2d7d6e;     /* accent tech green */
    --c-accent-2:  #2d7d6e;     /* secondary accent */
    --c-line:      #e4e7eb;     /* divider light gray */
    --c-white:     #ffffff;
    --c-dark:      #1a1d22;     /* dark (for Hero/Footer) */

    /* Fonts */
    --font-head: "Tiiiair Douyin", "HarmonyOS Sans SC", "PingFang SC", sans-serif;
    --font-body: "Tiiiair Sans", "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;

    /* Sizes */
    --maxw: 1440px;
    --pad-x: clamp(20px, 4vw, 80px);
    --radius: 14px;
    --radius-lg: 24px;
    --shadow: 0 12px 40px rgba(0,0,0,.08);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    padding-top: 80px;
    margin: 0;
    background: var(--c-bg);
    color: var(--c-text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; transition: color .2s; }
a:hover { color: var(--c-accent-2); }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-family: var(--font-head);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -.01em;
}
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; cursor: pointer; }

/* ---------- Generic containers ---------- */
.container {
    width: 100%;
    max-width: var(--maxw);
    margin-left: auto;
    margin-right: auto;
    padding-left: 80px;
    padding-left: var(--pad-x);
    padding-right: 80px;
    padding-right: var(--pad-x);
}

/* ---------- Inner page banner ---------- */
.page-banner {
    position: relative;
    min-height: 440px;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, rgba(10,10,10,.7), rgba(10,10,10,.5)),
                var(--page-banner-img, none) center/cover no-repeat;
    background-color: var(--c-bg-alt);
    border-bottom: 1px solid var(--c-line);
}
.page-banner .container { position: relative; z-index: 2; }
.page-banner h1 {
    font-size: 54px;
    font-size: clamp(32px, 4vw, 54px);
    color: var(--c-white);
}
.page-banner .breadcrumb {
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--c-text-mute);
    letter-spacing: .05em;
}
.page-banner .breadcrumb a:hover { color: var(--c-accent-2); }
.page-banner .lead {
    margin-top: 16px;
    max-width: 680px;
    color: rgba(255,255,255,.65);
    font-size: 18px;
    font-size: clamp(15px, 1.3vw, 18px);
    text-shadow: 0 2px 8px rgba(0,0,0,.3);
}

/* ---------- Section generics ---------- */
.section { padding: 64px 0; padding: clamp(40px, 4vw, 64px) 0; }
.section--alt { background: var(--c-bg-alt); }
.section--tight { padding: 36px 0; padding: clamp(24px, 2.5vw, 36px) 0; }

.section-head { margin-bottom: 32px; margin-bottom: clamp(20px, 2.5vw, 32px); }
.section-head--center { text-align: center; }
.section-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: var(--c-accent-2);
    font-family: var(--font-head);
    font-size: 13px;
    letter-spacing: .18em;
    text-transform: uppercase;
}
.section-eyebrow::before {
    content: "";
    width: 28px; height: 2px;
    background: var(--c-accent);
}
.section-head h2 {
    font-size: 48px;
    font-size: clamp(28px, 3.6vw, 48px);
}
.section-head p {
    margin-top: 16px;
    max-width: 640px;
    color: var(--c-text-soft);
    font-size: 17px;
    font-size: clamp(15px, 1.2vw, 17px);
}
.section-head--center p { margin-left: auto; margin-right: auto; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 50px;
    padding: 0 28px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-family: var(--font-head);
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    transition: all .25s;
    white-space: nowrap;
}
.btn--solid {
    background: var(--c-accent);
    border-color: var(--c-accent);
    color: var(--c-white);
}
.btn--solid:hover { background: var(--c-accent-2); border-color: var(--c-accent-2); color: var(--c-white); transform: translateY(-2px); }
.btn--outline {
    border-color: var(--c-line);
    color: var(--c-text);
    background: transparent;
}
.btn--outline:hover { border-color: var(--c-accent); color: var(--c-accent-2); }
.btn--ghost {
    border-color: var(--c-line);
    color: var(--c-text);
    background: rgba(255,255,255,.15);
    backdrop-filter: blur(4px);
}
.btn--ghost:hover { border-color: var(--c-white); color: var(--c-white); }
.btn--sm { height: 40px; padding: 0 20px; font-size: 13px; }
.btn--lg { height: 56px; padding: 0 34px; font-size: 16px; }

/* ---------- Stats ---------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}
.stat-item {
    padding: 28px 20px;
    padding: clamp(20px, 2vw, 28px) 20px;
    background: var(--c-bg-card);
    border: 1px solid var(--c-line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
    transition: border-color .25s, transform .25s;
}
.stat-item:hover { border-color: var(--c-accent); transform: translateY(-4px); }
.stat-num {
    font-family: var(--font-head);
    font-size: 44px;
    font-size: clamp(28px, 3vw, 44px);
    font-weight: 900;
    color: var(--c-accent-2);
    line-height: 1;
}
.stat-label {
    margin-top: 8px;
    color: var(--c-text-mute);
    font-size: 14px;
}

/* ---------- Cards ---------- */
.card {
    padding: 28px;
    padding: clamp(20px, 2vw, 28px);
    background: var(--c-bg-card);
    border: 1px solid var(--c-line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: border-color .25s, transform .25s;
    height: 100%;
}
.card:hover { border-color: rgba(45,125,110,.5); transform: translateY(-3px); }
.card-icon {
    width: 44px; height: 44px;
    object-fit: contain;
    margin-bottom: 14px;
}
.card h3 {
    font-size: 20px;
    margin-bottom: 10px;
}
.card p { color: var(--c-text-soft); font-size: 15px; margin: 0; }
.card-num {
    font-family: var(--font-head);
    font-size: 34px;
    font-size: clamp(24px, 2.2vw, 34px);
    color: var(--c-accent-2);
    display: block;
    margin-bottom: 14px;
}

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--c-line); }
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}
th, td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid var(--c-line);
}
th {
    background: var(--c-bg-card);
    color: var(--c-text);
    font-family: var(--font-head);
    font-weight: 700;
    white-space: nowrap;
}
td { color: var(--c-text-soft); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(45,125,110,.06); }

/* ============================================================
   Navigation header
   ============================================================ */
.site-header {
    position: fixed;
    top: 0; right: 0; bottom: auto; left: 0;
    z-index: 100;
    height: 80px;
    background: rgba(15,17,20,.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,.08);
    transition: height .3s, background .3s;
}
.site-header.is-scrolled {
    height: 64px;
    background: rgba(15,17,20,.98);
}
.header-inner {
    width: 100%;
    max-width: var(--maxw);
    height: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 80px;
    padding-left: var(--pad-x);
    padding-right: 80px;
    padding-right: var(--pad-x);
    display: flex;
    align-items: center;
    gap: 32px;
}
.site-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-head);
    font-weight: 900;
    font-size: 24px;
    color: #fff;
    flex-shrink: 0;
}
.site-logo img { max-height: 36px; width: auto; }
.site-logo .logo-text { letter-spacing: .02em; }

.main-nav {
    margin-left: auto;
    display: flex;
    align-items: center;
}
.main-nav ul {
    display: flex;
    align-items: center;
    gap: 30px;
    gap: clamp(16px, 1.8vw, 30px);
}
.main-nav a {
    display: block;
    padding: 8px 0;
    color: rgba(255,255,255,.75);
    font-size: 15px;
    font-weight: 500;
    position: relative;
}
.main-nav a:hover, .main-nav li.active a { color: #fff; }
.main-nav a::after {
    content: "";
    position: absolute;
    left: 0; bottom: 0;
    width: 0; height: 2px;
    background: #fff;
    transition: width .25s;
}
.main-nav a:hover::after, .main-nav li.active a::after { width: 100%; }

/* Dropdown menu */
.main-nav .has-dropdown { position: relative; }
.main-nav .has-dropdown > a::before {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -16px;
    height: 16px;
}
.main-nav .dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    min-width: 220px;
    padding: 12px;
    background: rgba(15,17,20,.98);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: var(--radius);
    box-shadow: 0 20px 50px rgba(0,0,0,.4);
    backdrop-filter: blur(12px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s, transform .25s, visibility .25s;
    z-index: 110;
}
.main-nav .has-dropdown:hover .dropdown,
.main-nav .has-dropdown:focus-within .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}
.main-nav .dropdown li { width: 100%; }
.main-nav .dropdown li a {
    display: block;
    padding: 12px 16px;
    color: rgba(255,255,255,.75);
    font-size: 14px;
    border-radius: 8px;
    transition: background .2s, color .2s;
}
.main-nav .dropdown li a::after { display: none; }
.main-nav .dropdown li a:hover {
    background: rgba(255,255,255,.08);
    color: #fff;
}

.header-cta { margin-left: 16px; }

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 42px; height: 42px;
    margin-left: auto;
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 50%;
    background: transparent;
}
.nav-toggle span {
    width: 18px; height: 2px;
    margin-left: auto;
    margin-right: auto;
    background: #fff;
    border-radius: 2px;
    transition: all .3s;
}

/* ============================================================
   Footer (dark background, contrasts with white pages)
   ============================================================ */
.site-footer {
    background: #1a1d22;
    color: #b8bdc4;
    padding: 80px 0 30px;
    padding: clamp(50px, 5vw, 80px) 0 30px;
}
.footer-top {
    display: grid;
    grid-template-columns: 2.5fr 1fr 1fr 1.2fr 1fr;
    gap: 24px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255,255,255,.1);
}
.footer-qr { text-align: center; }
.footer-qr__img { width: 110px; height: 110px; border-radius: 8px; margin: 8px auto 0; display: block; }
.footer-qr__text { margin-top: 10px; font-size: 13px; color: rgba(255,255,255,.85); }
.footer-brand .site-logo { margin-bottom: 20px; color: #fff; white-space: nowrap; }
.footer-brand .site-logo .logo-text { white-space: nowrap; }
.footer-brand p {
    color: #8a8f96;
    font-size: 15px;
    max-width: 320px;
}
.footer-slogan {
    margin-top: 20px;
    font-family: var(--font-head);
    font-size: 22px;
    color: #fff;
}
.footer-col h4 {
    font-size: 16px;
    margin-bottom: 18px;
    color: #fff;
}
.footer-col ul li { margin-bottom: 10px; }
.footer-col a {
    color: var(--c-text-mute);
    font-size: 14px;
}
.footer-col a:hover { color: var(--c-accent-2); }

.footer-contact li {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    color: var(--c-text-mute);
    font-size: 14px;
}
.footer-contact li strong { color: var(--c-text-soft); min-width: 50px; display: inline-block; }

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 24px;
    color: var(--c-text-mute);
    font-size: 13px;
}
.footer-bottom a { color: var(--c-text-mute); }
.footer-bottom a:hover { color: var(--c-accent-2); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1080px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-top {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }
    /* Tablet: brand area spans 2 columns on top, remaining 4 columns in 2x2 grid */
    .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
    body { padding-top: 64px; }
    .site-header { height: 64px; }
    .header-inner { gap: 12px; }
    .nav-toggle { display: flex; flex-shrink: 0; }
    /* Mobile: logo shrinks, keeps logo + wordmark with balanced proportions */
    .site-logo { font-size: 15px; gap: 5px; min-width: 0; flex-shrink: 1; }
    .site-logo img { max-height: 22px; }
    .site-logo .logo-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    /* Shrink slightly after scrolling */
    .site-header.is-scrolled .site-logo { font-size: 13px; }
    .site-header.is-scrolled .site-logo img { max-height: 20px; }
    .main-nav {
        position: fixed;
        top: 64px; right: 14px; bottom: auto; left: 14px;
        display: none;
        flex-direction: column;
        align-items: stretch;
        padding: 20px;
        background: rgba(15,17,20,.98);
        border: 1px solid rgba(255,255,255,.1);
        border-radius: var(--radius);
        backdrop-filter: blur(20px);
        max-height: calc(100vh - 78px);
        overflow-y: auto;
    }
    .main-nav.is-open { display: flex; }
    .main-nav ul { flex-direction: column; gap: 4px; }
    .main-nav a { padding: 12px 0; font-size: 16px; border-bottom: 1px solid var(--c-line); }
    .main-nav a::after { display: none; }
    .header-cta { margin: 8px 0 0; }
    .header-cta .btn { width: 100%; }
}
@media (max-width: 640px) {
    :root { --pad-x: 20px; }
    body { padding-top: 56px; }
    .site-header { height: 56px; }
    .stats-grid { grid-template-columns: 1fr; }
    .footer-top { grid-template-columns: 1fr; gap: 28px; }
    .footer-brand { grid-column: auto; }
    .footer-qr { text-align: center; }
    .footer-qr__img { margin-left: auto; margin-right: auto; }
    .footer-bottom { flex-direction: column; text-align: center; }
    .page-banner { min-height: 220px; }
    /* Small phones: harmonize logo icon and wordmark */
    .site-logo { font-size: 13px; gap: 4px; }
    .site-logo img { max-height: 20px; }
    .site-header.is-scrolled .site-logo { font-size: 12px; }
    .site-header.is-scrolled .site-logo img { max-height: 18px; }
    .main-nav { top: 56px; right: 14px; bottom: auto; left: 14px; }
}

/* ============================================================
   Brand mark icon (follows text height)
   Usage: <img class="brand-mark" src="...ico.png" alt="">
   ============================================================ */
.brand-mark {
    display: inline-block !important;
    height: 1em !important;
    width: auto !important;
    max-width: none !important;
    margin-left: 0.3em;
    vertical-align: -0.15em;
    opacity: .92;
    pointer-events: none;
    user-select: none;
    object-fit: contain;
}
/* Use inverted icon on white background (light text) scenarios */
.brand-mark--light { filter: brightness(0) invert(1); }
/* Fine-tune icon alignment inside buttons */
/* Icon inside flex button: does not break flex flow, centers with text */
.btn .brand-mark,
a .brand-mark {
    flex: 0 0 auto;
    align-self: center;
    margin-left: 0.3em;
    margin-top: 0;
    vertical-align: baseline;
    position: relative;
    top: 0;
}
/* Icon alignment for plain <a> links (e.g. accordion CTA / view details) */
a:not(.btn) .brand-mark {
    vertical-align: -0.15em;
}

/* ============================================================
   老内核回退:flex 容器间距(Chrome 72 / Android9 电视等 flex gap 不生效)
   header.php 的检测脚本实测 flex gap 是否生效,失效时给 <html> 加
   no-flex-gap,下面用相邻兄弟 margin 还原间距;现代浏览器永不带该类,
   本块完全不生效。grid 容器的 gap 在老内核仍可用,不在此列。
   ============================================================ */
/* 间距位于伪元素/文本节点之间的容器,>*+* 覆盖不到,单独处理 */
html.no-flex-gap .section-eyebrow::before{margin-right:8px}
html.no-flex-gap .footer-contact li strong{margin-right:10px}
html.no-flex-gap .faq-q::after,
html.no-flex-gap .story-q::after{margin-left:16px}
/* 双轴可换行参数行 */
html.no-flex-gap .acc-item__params>*{margin-right:22px;margin-bottom:10px}
html.no-flex-gap .product-card__params>*{margin-right:16px;margin-bottom:8px}
/* 全宽行向不变的容器 */
html.no-flex-gap .btn>*+*,
html.no-flex-gap .acc-item__cta>*+*,
html.no-flex-gap .coming-soon>*+*{margin-left:8px}
html.no-flex-gap .slider-dots>*+*,
html.no-flex-gap .site-logo>*+*{margin-left:10px}
html.no-flex-gap .filter-tabs>*+*,
html.no-flex-gap .home-news__list li a>*+*{margin-left:12px}
html.no-flex-gap .product-actions>*+*{margin-left:14px}
html.no-flex-gap .contact-info-item>*+*,
html.no-flex-gap .trust-mini>*+*,
html.no-flex-gap .wp-block-cover .wp-block-buttons>*+*{margin-left:16px}
/* 窄屏会折叠成列的容器:margin-left 仅桌面生效(列块由 WP 核心在 <=781px 堆叠) */
@media (min-width:901px){
  html.no-flex-gap .main-nav ul>*+*{margin-left:30px}
  html.no-flex-gap .header-inner>.header-cta{margin-left:48px}
}
@media (min-width:782px){
  html.no-flex-gap .tiiiair-product .wp-block-columns>*+*{margin-left:72px}
}
@media (min-width:769px){
  html.no-flex-gap .product-accordion>*+*,
  html.no-flex-gap .sleep-tech-accordion>*+*{margin-left:16px}
}
@media (min-width:641px){
  html.no-flex-gap .hero-actions>*+*{margin-left:16px}
  html.no-flex-gap .product-hero__actions>*+*{margin-left:14px}
  html.no-flex-gap .footer-bottom>*+*{margin-left:12px}
}
/* 折叠为列向时:相邻子项上边距 */
html.no-flex-gap .nav-toggle>*+*{margin-top:5px}
@media (max-width:900px){
  html.no-flex-gap .main-nav ul>*+*{margin-top:4px}
}
@media (max-width:768px){
  html.no-flex-gap .product-accordion>*+*,
  html.no-flex-gap .sleep-tech-accordion>*+*{margin-top:14px}
}
@media (max-width:640px){
  html.no-flex-gap .hero-actions>*+*{margin-top:16px}
  html.no-flex-gap .product-hero__actions>*+*{margin-top:14px}
  html.no-flex-gap .footer-bottom>*+*{margin-top:12px}
}
