:root {
  --ink: #1a2332; --sub: #5c6b80; --line: #e3e7ee; --wash: #f6f7f9;
  --bg: #fdfdfc; --accent: #b91c1c;
  --samsung: #1428a0; --sk: #e60027; --micron: #0e7490; --kioxia: #f08300; --cxmt: #7c3aed; --ymtc: #15803d;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
  background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.7;
}

/* ===== header ===== */
header {
  position: sticky; top: 0; z-index: 50; background: rgba(253,253,252,0.95); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); padding: 0 22px;
  display: flex; align-items: center; gap: 18px; height: 58px;
}
header .logo { font-weight: 800; font-size: 16px; letter-spacing: 0.02em; white-space: nowrap; }
header .logo span { color: var(--accent); }
nav.tabs { display: flex; gap: 4px; flex: 1; }
nav.tabs a {
  padding: 7px 14px; border-radius: 8px; text-decoration: none; color: var(--sub);
  font-size: 14px; font-weight: 600; white-space: nowrap;
}
nav.tabs a:hover { background: var(--wash); }
nav.tabs a.active { background: var(--ink); color: #fff; }
.weekly-btn {
  border: 1px solid #f2c94c; background: #fbf6e9; color: #7a5c14; font-weight: 700;
  border-radius: 8px; padding: 6px 12px; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.weekly-btn:hover { background: #f7edd2; }

main { max-width: 1280px; margin: 0 auto; padding: 22px; }

/* ===== generic ===== */
.view-title { font-size: 22px; font-weight: 800; margin: 6px 0 2px; }
.view-sub { color: var(--sub); font-size: 13.5px; margin-bottom: 16px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; border: 1px solid var(--line); background: #fff; cursor: pointer;
}
.chip:hover { border-color: var(--ink); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; background: var(--wash); color: var(--sub); }
.tag.hot { background: #fef2f2; color: var(--accent); }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px;
  transition: box-shadow .15s, transform .15s;
}
.clickable { cursor: pointer; }
.clickable:hover { box-shadow: 0 4px 16px rgba(26,35,50,.09); transform: translateY(-2px); }

/* ===== map view ===== */
.map-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.map-toolbar .switch { display: flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.map-toolbar .switch button {
  border: none; background: #fff; padding: 7px 16px; font-size: 13.5px; font-weight: 700; cursor: pointer; color: var(--sub);
}
.map-toolbar .switch button.on { background: var(--ink); color: #fff; }
.maker-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.map-wrap { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px; }
.map-wrap > svg { width: 100%; height: auto; display: block; }
.site-dot { cursor: pointer; pointer-events: bounding-box; }
.site-dot circle.core { transition: r .12s; }
.site-dot:hover circle.core { stroke: var(--ink); stroke-width: 2.5; }
.site-dot text { pointer-events: none; }
@keyframes pulse { 0% { opacity: .8; transform: scale(1); } 70% { opacity: 0; transform: scale(2.1); } 100% { opacity: 0; } }
.pulse { transform-origin: center; transform-box: fill-box; animation: pulse 2s ease-out infinite; }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; opacity: 0; } }
.map-legend { display: flex; gap: 16px; flex-wrap: wrap; padding: 10px 8px 2px; color: var(--sub); font-size: 12.5px; }
.map-legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }

/* ===== flow view ===== */
.flow-block { margin-bottom: 30px; }
.flow-head { font-size: 17px; font-weight: 800; margin-bottom: 2px; }
.flow-desc { color: var(--sub); font-size: 13px; margin-bottom: 12px; }
.flow-line { display: flex; align-items: stretch; gap: 0; overflow-x: auto; padding-bottom: 8px; }
.station {
  min-width: 168px; flex: 1; border: 2px solid var(--line); border-radius: 12px; padding: 12px 14px;
  background: #fff; cursor: pointer; transition: box-shadow .15s, border-color .15s;
}
.station:hover { border-color: var(--ink); box-shadow: 0 4px 14px rgba(26,35,50,.10); }
.station .st-label { font-weight: 800; font-size: 14px; }
.station .st-note { color: var(--sub); font-size: 12px; margin-top: 4px; }
.flow-arrow { align-self: center; padding: 0 6px; color: #94a3b8; font-size: 18px; flex: 0 0 auto; }

/* ===== equipment view ===== */
.equip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.equip-card .eq-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.equip-card .eq-icon { font-size: 26px; }
.equip-card h3 { margin: 0; font-size: 16.5px; }
.equip-card .eq-one { color: var(--sub); font-size: 13px; }
.equip-card .eq-meta { margin-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }

.equip-detail .back { color: var(--sub); text-decoration: none; font-size: 13.5px; }
.equip-detail .back:hover { color: var(--accent); }
.eq-hero { display: flex; align-items: center; gap: 14px; margin: 10px 0 4px; }
.eq-hero .eq-icon { font-size: 40px; }
.eq-hero h2 { margin: 0; font-size: 24px; }
.eq-section { margin-top: 22px; }
.eq-section h3 { font-size: 16px; margin: 0 0 10px; padding-left: 10px; border-left: 4px solid var(--accent); }
.schematic-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; }
.schematic {
  border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fff;
}
.schematic svg { width: 100%; height: auto; display: block; }
.schematic .placeholder { color: #b6c2d2; text-align: center; padding: 60px 0; font-size: 13px; }
.player-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.player-mini { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; background: #fff; cursor: pointer; }
.player-mini:hover { border-color: var(--ink); }
.player-mini b { font-size: 14px; }
.player-mini .pm-note { color: var(--sub); font-size: 12.5px; }

/* ===== players view ===== */
.tier-block { margin-bottom: 22px; }
.tier-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.tier-head h3 { margin: 0; font-size: 17px; }
.tier-head .tn { color: var(--sub); font-size: 12.5px; }
.tier-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.player-card { border-left-width: 4px; border-left-style: solid; }
.player-card h4 { margin: 0 0 2px; font-size: 15px; }
.player-card .pc-focus { color: var(--sub); font-size: 12.5px; }
.maker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; margin-bottom: 26px; }
.maker-card { border-top: 4px solid; }
.maker-card h3 { margin: 0 0 2px; }
.maker-card .mk-tag { font-size: 12.5px; color: var(--sub); font-style: italic; }
.maker-card ul { margin: 8px 0 0; padding-left: 18px; font-size: 13px; color: #33405a; }
.maker-card li { margin: 3px 0; }

/* ===== drawer ===== */
#overlay {
  position: fixed; inset: 0; background: rgba(20,28,44,.35); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 1500;
}
#overlay.show { opacity: 1; pointer-events: auto; }
#drawer {
  position: fixed; top: 0; right: -560px; width: min(540px, 94vw); height: 100vh; background: #fff;
  box-shadow: -8px 0 30px rgba(20,28,44,.18); z-index: 1600; transition: right .25s ease;
  display: flex; flex-direction: column;
}
#drawer.open { right: 0; }
#drawer .dr-head {
  padding: 16px 22px 12px; border-bottom: 1px solid var(--line);
  display: flex; align-items: flex-start; gap: 12px;
}
#drawer .dr-head h2 { margin: 0; font-size: 19px; flex: 1; line-height: 1.4; }
#drawer .dr-close {
  border: none; background: var(--wash); border-radius: 8px; width: 32px; height: 32px;
  font-size: 16px; cursor: pointer; color: var(--sub);
}
#drawer .dr-close:hover { background: var(--line); }
#drawer .dr-body { padding: 16px 22px 40px; overflow-y: auto; flex: 1; }
.dr-role { font-size: 14px; color: #33405a; background: var(--wash); border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; }
.proj { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin: 8px 0; }
.proj b { font-size: 14px; }
.proj .p-detail { font-size: 13px; color: #33405a; margin-top: 2px; }
.dr-sec { font-size: 13px; font-weight: 800; color: var(--sub); letter-spacing: .08em; margin: 18px 0 8px; }
.dr-body ul { margin: 6px 0; padding-left: 18px; font-size: 13.5px; }
.dr-body li { margin: 4px 0; }
.equip-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.go-btn {
  display: inline-block; margin-top: 14px; background: var(--ink); color: #fff; border: none;
  padding: 9px 18px; border-radius: 9px; font-size: 13.5px; font-weight: 700; cursor: pointer; text-decoration: none;
}
.go-btn:hover { background: #33405a; }
.weekly-item { border-left: 3px solid var(--line); padding: 6px 12px; margin: 10px 0; }
.weekly-item.hot { border-left-color: var(--accent); background: #fef7f7; border-radius: 0 8px 8px 0; }
.weekly-item .w-d { font-weight: 800; font-size: 12.5px; color: var(--sub); }
.weekly-item .w-what { font-size: 13.5px; margin: 2px 0; }
.weekly-item .w-v { font-size: 12px; color: var(--accent); font-weight: 600; }

/* ===== 卫星地图 & 统计条 ===== */
.stat-strip { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 14px; }
.stat {
  background: linear-gradient(180deg, #fff, #f6f7f9); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 16px; text-align: center; min-width: 92px;
}
.stat b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.stat span { font-size: 11.5px; color: var(--sub); }
.map-wrap.sat { padding: 0; overflow: hidden; position: relative; z-index: 0; isolation: isolate; }
#satmap { height: 640px; border-radius: 12px; }
#satmap .leaflet-tooltip { font-weight: 700; font-size: 12.5px; }
.sat-img { width: 100%; border-radius: 10px; border: 1px solid var(--line); margin: 6px 0 2px; display: block; }
.chip.ext { text-decoration: none; color: #1d4ed8; }
.hint { font-size: 12px; color: #9aa6b5; margin: 8px 0 0; }

/* ===== 3D 结构 ===== */
.m3d-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(440px, 1fr)); gap: 18px; }
.m3d-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.m3d-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.m3d-head b { font-size: 16px; }
.scene {
  position: relative; height: 430px; border-radius: 12px; overflow: hidden; cursor: grab; touch-action: none;
  background: radial-gradient(ellipse at 50% 28%, #24324a 0%, #101a2c 60%, #0a1120 100%);
}
.scene:active { cursor: grabbing; }
.stage {
  position: absolute; left: 50%; top: 58%; width: 0; height: 0;
  transform-style: preserve-3d; transform: rotateX(62deg) rotateZ(-38deg);
}
.layer3d {
  position: absolute; left: 0; top: 0; border-radius: 10px; cursor: pointer;
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.22), 0 0 18px rgba(0,0,0,.35);
  transition: transform .3s ease, filter .15s;
}
.layer3d:hover { filter: brightness(1.25); }
.layer3d.sel { filter: brightness(1.35); box-shadow: inset 0 0 0 2.5px #fbbf24, 0 0 22px rgba(251,191,36,.5); }
.rod { position: absolute; left: 0; top: 0; transform-style: preserve-3d; pointer-events: none; }
.rod > div {
  position: absolute; bottom: 0; left: -2.5px; width: 5px; transform-origin: bottom center;
  background: linear-gradient(#fde68a, #d97706); opacity: .92; border-radius: 3px;
}
.rod > div:first-child { transform: rotateX(-90deg); }
.rod > div:last-child { transform: rotateX(-90deg) rotateY(90deg); }
.m3d-ctrl { display: flex; align-items: center; gap: 14px; margin-top: 12px; flex-wrap: wrap; }
.m3d-ctrl label { font-size: 13px; font-weight: 700; color: var(--sub); display: flex; align-items: center; gap: 8px; }
.m3d-ctrl input[type="range"] { width: 140px; accent-color: var(--accent); }
.m3d-info { flex: 1; min-width: 220px; font-size: 12.5px; color: #33405a; background: var(--wash); border-radius: 8px; padding: 8px 12px; }
.m3d-links { margin-top: 18px; font-size: 13.5px; color: var(--sub); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

footer { max-width: 1280px; margin: 30px auto 40px; padding: 0 22px; color: #9aa6b5; font-size: 12px; border-top: 1px solid var(--line); padding-top: 14px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 720px) {
  header { padding: 0 10px; gap: 8px; height: auto; flex-wrap: wrap; padding-bottom: 8px; padding-top: 8px; }
  main { padding: 12px; }
}
