/* ==========================================================================
   app.css — TOUCH APP · Material Design 3 (Material You)
   动态色板：浅色/深色随系统 prefers-color-scheme；品牌主色取自 TOUCH LOGO
   ========================================================================== */

/* ---------- MD3 Tokens ---------- */
:root {
  --md-sys-shape-l: 28px;
  --md-sys-shape-m: 16px;
  --md-sys-shape-s: 10px;
}
:root {
  /* light scheme */
  --primary: #B3002D;
  --on-primary: #FFFFFF;
  --primary-c: #FFD9DC;
  --secondary-c: #F3EDF1;
  --tertiary: #145AF2;
  --tertiary-c: #DCE7FF;
  --surface: #F7F8FC;
  --surface-c: #FFFFFF;
  --surface-c-2: #F0F1F7;
  --on-surface: #1B1B1F;
  --on-surface-v: #46464F;
  --outline: #C8C5D0;
  --outline-v: #79767F;
  --bar: rgba(255,255,255,.92);
  --tabs: rgba(255,255,255,.94);
  --scrim: rgba(0,0,0,.38);
  --elev-1: 0 1px 3px rgba(0,0,0,.10), 0 1px 2px rgba(0,0,0,.08);
  --elev-2: 0 4px 14px rgba(0,0,0,.12);
  --elev-3: 0 10px 30px rgba(0,0,0,.18);
  --grad: linear-gradient(135deg, #B3002D 0%, #E8442E 55%, #F59E1B 120%);
  --ok: #1E8E3E; --err: #C5221F;
}
:root[data-dark="1"] {
  /* dark scheme */
  --primary: #FFB2B8;
  --on-primary: #680014;
  --primary-c: #7A0020;
  --secondary-c: #4A4450;
  --tertiary: #ADC6FF;
  --tertiary-c: #23408F;
  --surface: #121218;
  --surface-c: #1D1D23;
  --surface-c-2: #26262E;
  --on-surface: #E5E1E8;
  --on-surface-v: #C8C4CE;
  --outline: #48454E;
  --outline-v: #938F99;
  --bar: rgba(18,18,24,.92);
  --tabs: rgba(24,24,30,.94);
  --scrim: rgba(0,0,0,.55);
  --elev-1: 0 1px 3px rgba(0,0,0,.5);
  --elev-2: 0 4px 14px rgba(0,0,0,.55);
  --elev-3: 0 10px 30px rgba(0,0,0,.6);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { height: 100%; }
body {
  margin: 0; min-height: 100%;
  font-family: "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--surface); color: var(--on-surface);
  transition: background .25s, color .25s;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; }
img { max-width: 100%; }

/* ---------- Splash ---------- */
.splash {
  position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px;
  background: #070B16; color: #fff; transition: opacity .45s, visibility .45s;
}
.splash.is-off { opacity: 0; visibility: hidden; }
.splash img { border-radius: 22px; }
.splash__name { font-size: 30px; font-weight: 800; letter-spacing: .22em; }
.splash__sub { font-size: 10px; letter-spacing: .38em; opacity: .55; }

/* ---------- Top app bar ---------- */
.bar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(8px + env(safe-area-inset-top)) 14px 8px;
  background: var(--bar); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--outline) 34%, transparent);
}
.bar__lead { display: flex; align-items: center; gap: 10px; min-width: 0; }
.bar__logo { border-radius: 9px; flex: none; }
.bar__tt { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.bar__name { font-size: 17px; font-weight: 800; letter-spacing: .18em; }
.bar__slogan { font-size: 10.5px; color: var(--on-surface-v); letter-spacing: .04em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* MD3 chip */
.chip {
  border: 1px solid var(--outline); background: transparent; color: var(--on-surface);
  height: 34px; padding: 0 14px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px; flex: none;
  transition: background .18s;
}
.chip:active { background: var(--surface-c-2); }

/* ---------- View ---------- */
.view { padding: 16px 14px calc(96px + env(safe-area-inset-bottom)); outline: none; max-width: 560px; margin: 0 auto; }

/* ---------- Bottom navigation (MD3) ---------- */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px 4px calc(8px + env(safe-area-inset-bottom));
  background: var(--tabs); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid color-mix(in srgb, var(--outline) 30%, transparent);
}
.tab {
  appearance: none; border: 0; background: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 0 2px;
  color: var(--on-surface-v);
}
.tab__ic {
  width: 56px; height: 30px; border-radius: 999px; display: grid; place-items: center;
  transition: background .2s, color .2s; color: inherit;
}
.tab__ic svg { width: 21px; height: 21px; display: block; }
.tab__lb { font-size: 10.5px; font-weight: 600; letter-spacing: .02em; }
.tab.is-on .tab__ic { background: var(--primary-c); color: var(--primary); }
.tab.is-on { color: var(--on-surface); }
.tab.is-on .tab__lb { font-weight: 800; }

/* ---------- MD3 Card ---------- */
.card {
  background: var(--surface-c); border-radius: var(--md-sys-shape-m);
  box-shadow: var(--elev-1); overflow: hidden; margin-top: 14px;
  transition: transform .16s, box-shadow .16s;
}
.card:active { transform: scale(.985); }
.card--hero { background: #070B16; color: #fff; border-radius: var(--md-sys-shape-l); position: relative; }
.card--hero img.hv { width: 100%; height: 190px; object-fit: cover; opacity: .68; display: block; }
.card--hero .hv-grad { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(7,11,22,.10) 30%, rgba(7,11,22,.86) 100%); }
.card--hero .hv-body { position: absolute; left: 20px; right: 20px; bottom: 18px; }
.card--hero h1 { margin: 6px 0 0; font-size: 23px; line-height: 1.32; font-weight: 800; }
.card--hero .hv-kicker { font-size: 10.5px; letter-spacing: .3em; color: #FFC9A3; font-weight: 700; }
.card--hero .hv-sub { margin: 8px 0 0; font-size: 12.5px; line-height: 1.7; color: rgba(255,255,255,.82); }

.sec-t { display: flex; align-items: baseline; justify-content: space-between; margin: 26px 2px 0; }
.sec-t h2 { margin: 0; font-size: 16.5px; font-weight: 800; }
.sec-t a, .sec-t button.link { font-size: 12px; color: var(--tertiary); background: none; border: 0; cursor: pointer; font-weight: 600; text-decoration: none; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.stat { background: var(--surface-c); border-radius: var(--md-sys-shape-m); box-shadow: var(--elev-1); padding: 13px 10px 11px; text-align: center; }
.stat b { display: block; font-size: 19px; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat span { display: block; margin-top: 4px; font-size: 10px; line-height: 1.45; color: var(--on-surface-v); }

/* horizontal solution rail */
.rail { display: flex; gap: 12px; overflow-x: auto; padding: 12px 2px 6px; margin: 0 -14px; padding-left: 14px; padding-right: 14px; scroll-snap-type: x mandatory; }
.rail::-webkit-scrollbar { display: none; }
.rail .sol { flex: 0 0 168px; scroll-snap-align: start; }
.sol { background: var(--surface-c); border-radius: var(--md-sys-shape-m); box-shadow: var(--elev-1); overflow: hidden; cursor: pointer; }
.sol img { width: 100%; height: 92px; object-fit: cover; display: block; }
.sol .sol-b { padding: 10px 12px 12px; }
.sol .sol-n { font-size: 10px; font-weight: 800; color: var(--primary); letter-spacing: .12em; }
.sol h3 { margin: 3px 0 0; font-size: 14px; font-weight: 700; }
.sol p { margin: 5px 0 0; font-size: 11px; line-height: 1.55; color: var(--on-surface-v);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* chips row (filter) */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 14px 2px 4px; margin: 0 -14px; padding-left: 14px; padding-right: 14px; }
.chips::-webkit-scrollbar { display: none; }
.fchip {
  flex: none; height: 34px; padding: 0 15px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  border: 1px solid var(--outline); background: transparent; color: var(--on-surface-v); cursor: pointer;
}
.fchip.is-on { background: var(--secondary-c); border-color: transparent; color: var(--on-surface); box-shadow: var(--elev-1); }

/* product / job card */
.pcard { display: flex; gap: 13px; padding: 13px; cursor: pointer; }
.pcard .ph { width: 88px; height: 88px; border-radius: var(--md-sys-shape-s); background: linear-gradient(135deg, #101828, #2A3A5C); flex: none; display: grid; place-items: center; overflow: hidden; }
.pcard .ph img { width: 100%; height: 100%; object-fit: cover; }
.pcard .ph svg { width: 30px; height: 30px; color: rgba(255,255,255,.65); }
.pcard .p-b { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.pcard h3 { margin: 0; font-size: 14.5px; font-weight: 700; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard .p-s { margin: 4px 0 0; font-size: 11.5px; line-height: 1.55; color: var(--on-surface-v);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard .p-f { margin-top: auto; padding-top: 6px; display: flex; align-items: center; justify-content: space-between; }
.pcard .price { font-size: 13.5px; font-weight: 800; color: var(--primary); }
.tag { font-size: 10px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--tertiary-c); color: var(--tertiary); letter-spacing: .04em; }
.tag--open { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }

/* list rows (me tab) */
.rows { background: var(--surface-c); border-radius: var(--md-sys-shape-m); box-shadow: var(--elev-1); margin-top: 14px; overflow: hidden; }
.row { display: flex; align-items: center; gap: 13px; width: 100%; padding: 15px 16px; background: none; border: 0; cursor: pointer; text-align: left; color: var(--on-surface); text-decoration: none; font-size: 14px; font-weight: 600; }
.row + .row { border-top: 1px solid color-mix(in srgb, var(--outline) 26%, transparent); }
.row:active { background: var(--surface-c-2); }
.row .r-ic { width: 36px; height: 36px; border-radius: 999px; display: grid; place-items: center; background: var(--secondary-c); color: var(--primary); flex: none; }
.row .r-ic svg { width: 18px; height: 18px; }
.row .r-x { margin-left: auto; color: var(--outline-v); font-size: 16px; }
.r-sub { display: block; font-size: 11px; font-weight: 400; color: var(--on-surface-v); margin-top: 2px; }
.row .r-sub { margin-top: 2px; }

/* MD3 buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 46px; padding: 0 22px;
  border-radius: 999px; font-size: 14px; font-weight: 700; cursor: pointer; border: 0; text-decoration: none;
  transition: box-shadow .18s, transform .12s; }
.btn:active { transform: scale(.97); }
.btn--fill { background: var(--grad); color: #fff; box-shadow: var(--elev-1); }
.btn--tonal { background: var(--secondary-c); color: var(--on-surface); }
.btn--out { background: transparent; border: 1px solid var(--outline); color: var(--primary); }
.btn--block { width: 100%; }

/* segmented (language) */
.seg { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--surface-c-2); border-radius: 999px; padding: 4px; gap: 2px; margin-top: 10px; }
.seg button { height: 38px; border: 0; border-radius: 999px; background: none; color: var(--on-surface-v); font-size: 12.5px; font-weight: 700; cursor: pointer; }
.seg button.is-on { background: var(--surface-c); color: var(--on-surface); box-shadow: var(--elev-1); }

/* ---------- Bottom sheet ---------- */
.sheet-host { position: fixed; inset: 0; z-index: 50; }
.sheet-scrim { position: absolute; inset: 0; background: var(--scrim); opacity: 0; transition: opacity .28s; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; background: var(--surface-c);
  border-radius: var(--md-sys-shape-l) var(--md-sys-shape-l) 0 0; box-shadow: var(--elev-3);
  max-height: 86vh; max-width: 560px; margin: 0 auto; transform: translateY(100%); transition: transform .32s cubic-bezier(.2,0,0,1);
  display: flex; flex-direction: column; padding-bottom: env(safe-area-inset-bottom); }
.sheet-host.is-open .sheet-scrim { opacity: 1; }
.sheet-host.is-open .sheet { transform: translateY(0); }
.sheet__grip { width: 34px; height: 4px; border-radius: 999px; background: var(--outline); margin: 10px auto 4px; flex: none; }
.sheet__body { overflow-y: auto; padding: 10px 20px 24px; }
.sheet__body h2 { margin: 4px 0 0; font-size: 18px; line-height: 1.4; font-weight: 800; }
.sheet__body .price { margin-top: 8px; font-size: 16px; font-weight: 800; color: var(--primary); }
.sheet__body p { margin: 12px 0 0; font-size: 13.5px; line-height: 1.85; color: var(--on-surface-v); white-space: pre-line; }
.sheet__body .kv { margin-top: 14px; border-top: 1px solid color-mix(in srgb, var(--outline) 30%, transparent); }
.sheet__body .kv div { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px solid color-mix(in srgb, var(--outline) 22%, transparent); font-size: 12.5px; }
.sheet__body .kv b { color: var(--on-surface); font-weight: 600; text-align: right; }
.sheet__body .kv span { color: var(--on-surface-v); flex: none; }
.sheet__body .s-acts { display: flex; gap: 10px; margin-top: 20px; }
.sheet__body .s-acts .btn { flex: 1; }
.sheet__media { height: 180px; border-radius: var(--md-sys-shape-m); overflow: hidden; background: linear-gradient(135deg, #101828, #2A3A5C); margin-bottom: 14px; display: grid; place-items: center; }
.sheet__media img { width: 100%; height: 100%; object-fit: cover; }
.sheet__media svg { width: 44px; height: 44px; color: rgba(255,255,255,.6); }
/* 产品详情：多图相册（主图完整展示 + 缩略图切换） */
/* 主图：宽度固定撑满、高度按图片比例自动撑开，不裁切不变形 */
.sheet__media.pm-main { height: auto; place-items: stretch; padding: 10px 10px 14px; }
.pm-main img { width: 100%; height: auto; object-fit: contain; padding: 0; }
.pm-count { position: absolute; right: 10px; bottom: 10px; background: rgba(0,0,0,.55); color: #fff;
  font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 999px; pointer-events: none; }
.pm-main { position: relative; }
.pm-thumbs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(64px, 1fr); gap: 8px;
  overflow-x: auto; margin: -6px 0 14px; padding: 2px; -webkit-overflow-scrolling: touch; }
.pm-t { height: 58px; border: 2px solid transparent; border-radius: 12px; padding: 3px; cursor: pointer;
  background: linear-gradient(135deg, #101828, #2A3A5C); overflow: hidden; flex: none; }
.pm-t img { width: 100%; height: 100%; object-fit: contain; }
.pm-t.is-on { border-color: var(--primary); }
.pm-morebtn { display: block; width: 100%; margin-top: 12px; padding: 10px; font-size: 12.5px;
  background: transparent; border: 1px solid var(--outline); border-radius: 999px;
  color: var(--on-surface); cursor: pointer; }

/* 产品详情：视频展示（与主站行为一致：自动播放+静音+循环，可手动控制） */
.pm-video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000;
  border-radius: var(--md-sys-shape-m); margin: -6px 0 14px; object-fit: contain; }

.pm-video-wrap { margin-bottom: 14px; }

.pm-video-wrap .pm-video { margin: 0; }

/* toast */
.toast { position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(16px);
  background: #323247; color: #fff; font-size: 13px; padding: 11px 20px; border-radius: 999px; box-shadow: var(--elev-2);
  z-index: 70; opacity: 0; transition: opacity .25s, transform .25s; max-width: 86vw; text-align: center; }
.toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* loading skeleton */
.skel { height: 108px; border-radius: var(--md-sys-shape-m); margin-top: 14px;
  background: linear-gradient(100deg, var(--surface-c-2) 40%, color-mix(in srgb, var(--outline) 22%, var(--surface-c-2)) 50%, var(--surface-c-2) 60%);
  background-size: 240% 100%; animation: sh 1.15s infinite; }
@keyframes sh { from { background-position: 130% 0; } to { background-position: -40% 0; } }

.empty { text-align: center; padding: 44px 20px; color: var(--on-surface-v); font-size: 13px; }
.empty .e-ic { font-size: 34px; }

/* culture banner in jobs */
.jb-ban { border-radius: var(--md-sys-shape-l); overflow: hidden; position: relative; margin-top: 14px; background: #070B16; color: #fff; }
.jb-ban img { width: 100%; height: 150px; object-fit: cover; opacity: .62; display: block; }
.jb-ban .b-body { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; padding: 0 20px;
  background: linear-gradient(90deg, rgba(7,11,22,.72) 20%, rgba(7,11,22,.16)); }
.jb-ban b { font-size: 17px; }
.jb-ban span { font-size: 11.5px; margin-top: 5px; color: rgba(255,255,255,.8); }

@media (min-width: 640px) { .view { padding-top: 22px; } }
