/* ============================================================
 * 驭风 · 石塘风电场机组智慧运维平台 —— 全局样式 v3
 * 设计语言：视频背景更清晰 + 液态玻璃 + 响应式字号（比例协调）
 * 微调提示：品牌色 / 遮罩 / 玻璃质感 / 圆角，改本文件顶部变量即可
 * ============================================================ */

:root {
  --bg: #050508;
  --bg-soft: #0b0b10;
  --text: #ffffff;
  --muted: #b8c4d2;           /* 次级文字（玻璃上可读） */
  --faint: #8391a3;
  --line: rgba(255, 255, 255, 0.22);
  --line-soft: rgba(255, 255, 255, 0.12);
  --accent: #38bdf8;          /* 驭风品牌色：晴空蓝 */
  --accent-2: #2dd4bf;        /* 辅助色：青绿 */

  /* ---- 液态玻璃核心（改这里 = 全局玻璃质感） ---- */
  --glass-bg: linear-gradient(150deg, rgba(255,255,255,0.16) 0%, rgba(255,255,255,0.07) 45%, rgba(255,255,255,0.03) 100%);
  --glass-bg-hover: linear-gradient(150deg, rgba(255,255,255,0.25) 0%, rgba(255,255,255,0.11) 45%, rgba(255,255,255,0.05) 100%);
  --glass-border: rgba(255,255,255,0.25);
  --glass-border-hover: rgba(176,220,255,0.75);
  --glass-inner: inset 0 1px 0 rgba(255,255,255,0.34), inset 0 -30px 60px rgba(255,255,255,0.03);
  --glass-blur: blur(28px) saturate(190%);
  --glass-shadow: 0 22px 56px rgba(0,0,0,0.40);

  /* 选中态（液态玻璃发光） */
  --on-bg: linear-gradient(150deg, rgba(56,189,248,0.32) 0%, rgba(56,189,248,0.14) 50%, rgba(56,189,248,0.06) 100%);
  --on-border: rgba(125,211,252,0.9);
  --on-shadow: inset 0 1px 0 rgba(255,255,255,0.38), inset 0 -14px 26px rgba(56,189,248,0.10), 0 0 22px rgba(56,189,248,0.32);

  /* ---- 响应式字号系统（随窗口平滑缩放，保持比例协调） ---- */
  --fs-hero: clamp(40px, 7vw, 86px);
  --fs-h2: clamp(16px, 1.7vw, 20px);
  --fs-title: clamp(14.5px, 1.25vw, 17px);
  --fs-body: clamp(13.5px, 1.05vw, 15px);
  --fs-small: clamp(11.5px, 0.92vw, 13px);

  --radius: clamp(14px, 1.6vw, 18px);
  --radius-lg: clamp(20px, 2.4vw, 28px);
  --card-grad: var(--glass-bg);        /* 兼容旧引用 */
  --btn-solid: linear-gradient(180deg, #ffffff 0%, #e8e8ec 48%, #cfcfd4 100%);
  --shadow: 0 22px 56px rgba(0,0,0,0.40);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

html, body {
  background: #000 !important;
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
               "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: var(--fs-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100%;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ---------- 细节打磨：滚动条 / 选中文字 / 焦点 ---------- */
::selection { background: rgba(56,189,248,0.38); color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.16);
  border-radius: 999px;
  border: 2.5px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(125,211,252,0.45); background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }
:focus-visible { outline: 2px solid rgba(125,211,252,0.7); outline-offset: 2px; }

/* ============================================================
 * 全屏视频背景（每个页面 body 开头放置，z-index:0）
 * 遮罩深浅：<div class="bg-veil" style="--veil:0.3"></div> 按页面微调
 * v3：整体更通透，视频更清晰
 * ============================================================ */
.bg-video {
  position: fixed; inset: 0; z-index: 0;
  overflow: hidden;
  background: #000;
}
.bg-video video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  filter: saturate(1.08) contrast(1.02) brightness(0.90) blur(1.2px);   /* 高光粒子柔化：降亮 + 微模糊磨掉锐利边缘 */
  opacity: 0;
  animation: video-fadein 1.8s ease 0.15s forwards;
}
@keyframes video-fadein { to { opacity: 1; } }
.bg-veil {
  position: absolute; inset: 0;
  background:
    radial-gradient(1200px 640px at 50% 12%, rgba(56,189,248,0.10), transparent 62%),
    linear-gradient(180deg, rgba(5,5,8,calc(var(--veil, 0.30) * 1.35)) 0%,
                            rgba(5,5,8,var(--veil, 0.30)) 46%,
                            rgba(5,5,8,calc(var(--veil, 0.30) * 1.55)) 100%);
}
/* 粒子特效层：浮在遮罩之上、内容之下（z-index:1 且 DOM 在 .page 之前），
   品牌蓝光点缓慢上浮 + 呼吸闪烁，pointer-events 穿透不挡交互 */
.fx-particles {
  position: fixed; inset: 0; z-index: 1;
  pointer-events: none;
}

/* ============================================================
 * 通用容器 —— 全屏撑满 + 上滑进屏过渡
 * ============================================================ */
.page {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: clamp(18px, 2.6vw, 46px) clamp(16px, 3.2vw, 56px) clamp(24px, 3vw, 48px);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  animation: page-enter 1s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes page-enter {
  from { opacity: 0; transform: translateY(7vh) scale(0.998); }
  to   { opacity: 1; transform: none; }
}

/* ---------- 顶部导航（液态玻璃条） ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: clamp(10px, 1.1vw, 15px) clamp(14px, 1.8vw, 24px);
  margin-bottom: clamp(14px, 1.8vw, 24px);
  border-radius: clamp(16px, 1.8vw, 22px);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-inner), 0 14px 34px rgba(0,0,0,0.28);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: clamp(18px, 1.7vw, 22px);
  font-weight: 650;
  letter-spacing: -0.02em;
  color: #fff;
  text-shadow: 0 1px 12px rgba(56,189,248,0.25);
}
.logo .mark { width: clamp(27px, 2.3vw, 32px); height: clamp(27px, 2.3vw, 32px); filter: drop-shadow(0 2px 10px rgba(56,189,248,0.4)); }
/* 公司 logo（白色线条图，微提亮保证在玻璃条上清晰） */
.brand-logo {
  width: clamp(40px, 3.6vw, 48px);
  height: auto;
  filter: brightness(1.15) drop-shadow(0 1px 8px rgba(0,0,0,0.45));
  opacity: 0.97;
}
.topbar .brand-name {
  font-size: clamp(15px, 1.5vw, 17px);
  font-weight: 700;
  color: #eef5fc;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 8px rgba(0,0,0,0.4);
  white-space: nowrap;
}
.topbar .side { display: flex; align-items: center; gap: 10px; }
/* 顶部栏三区布局：左=公司 / 中=驭风（绝对居中）/ 右=管理后台 */
.topbar .side-left { flex: 1; justify-content: flex-start; min-width: 0; }
.topbar .side-right { flex: 1; justify-content: flex-end; }
.logo { flex-shrink: 0; }

/* 返回按钮（玻璃 pill） */
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: clamp(36px, 3.1vw, 42px);
  padding: 0 clamp(13px, 1.5vw, 19px);
  border-radius: clamp(12px, 1.4vw, 15px);
  font-size: var(--fs-small);
  font-weight: 500;
  color: #eef2f7;
  background: linear-gradient(150deg, rgba(255,255,255,0.13), rgba(255,255,255,0.04) 55%, rgba(255,255,255,0.02));
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-inner);
  backdrop-filter: blur(18px) saturate(170%);
  -webkit-backdrop-filter: blur(18px) saturate(170%);
  cursor: pointer;
  transition: border-color .25s, background .25s, box-shadow .25s, transform .2s;
}
.btn-back:hover {
  border-color: var(--glass-border-hover);
  background: var(--glass-bg-hover);
  box-shadow: var(--glass-inner), 0 0 22px rgba(56,189,248,0.25);
  transform: translateY(-1px);
}

/* ---------- 玻璃卡片（液态玻璃） ---------- */
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-inner), var(--glass-shadow);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  transition: border-color .3s, box-shadow .3s, background .3s, transform .3s;
}
.glass:hover {
  border-color: var(--glass-border-hover);
  box-shadow: var(--glass-inner), var(--glass-shadow), 0 0 26px rgba(56,189,248,0.10);
}

/* ---------- 徽章（液态玻璃胶囊） ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: clamp(8px, 0.8vw, 10px) clamp(13px, 1.5vw, 19px);
  border-radius: 999px;
  font-size: var(--fs-small);
  font-weight: 500;
  letter-spacing: 0.03em;
  color: #eef4fb;
  background: linear-gradient(120deg, rgba(56,189,248,0.22), rgba(45,212,191,0.13) 55%, rgba(255,255,255,0.07));
  border: 1px solid rgba(125,211,252,0.5);
  box-shadow: var(--glass-inner), 0 10px 30px rgba(0,0,0,0.30);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
}

/* ---------- 按钮（液体玻璃） ---------- */
.btn {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: clamp(40px, 3.5vw, 46px);
  padding: 0 clamp(15px, 1.6vw, 21px);
  border-radius: clamp(12px, 1.4vw, 15px);
  font-size: var(--fs-body);
  font-weight: 550;
  letter-spacing: -0.01em;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background .35s, border-color .35s, box-shadow .35s, color .35s, filter .35s, transform .2s;
}
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 22%, rgba(255,255,255,0.42) 48%, transparent 74%);
  transform: translateX(-130%);
  transition: transform .65s ease;
  z-index: 1;
  pointer-events: none;
}
.btn:hover::after { transform: translateX(130%); }
.btn:hover { transform: translateY(-1px); }

.btn-solid {
  background: var(--btn-solid);
  color: #0b0b10;
  border: 1px solid rgba(255,255,255,0.92);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.98), 0 12px 30px rgba(0,0,0,0.35);
}
.btn-solid:hover {
  box-shadow: inset 0 1px 0 #fff, 0 0 26px rgba(56,189,248,0.4), 0 12px 30px rgba(255,255,255,0.12);
}

.btn-ghost {
  background: linear-gradient(150deg, rgba(255,255,255,0.13), rgba(255,255,255,0.04) 50%, rgba(255,255,255,0.02));
  color: #fff;
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-inner);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
}
.btn-ghost:hover {
  border-color: rgba(170,215,255,0.8);
  background: var(--glass-bg-hover);
  box-shadow: var(--glass-inner), 0 0 24px rgba(56,189,248,0.3);
}

/* ---------- 表单（磨砂玻璃） ---------- */
input, textarea, select {
  font-family: inherit;
  font-size: var(--fs-body);
  color: var(--text);
  background: linear-gradient(150deg, rgba(255,255,255,0.10), rgba(255,255,255,0.04));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: clamp(10px, 1vw, 13px) clamp(12px, 1.2vw, 16px);
  outline: none;
  box-shadow: var(--glass-inner);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  transition: border-color .25s, background .25s, box-shadow .25s;
}
input:focus, textarea:focus, select:focus {
  border-color: rgba(125,211,252,0.75);
  background: rgba(255,255,255,0.11);
  box-shadow: var(--glass-inner), 0 0 18px rgba(56,189,248,0.24);
}
::placeholder { color: rgba(184,196,210,0.65); }

/* ---------- 入场动效（内容错峰浮现） ---------- */
.appear { opacity: 1; animation-duration: 0.9s; animation-fill-mode: both;
          animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1); animation-delay: var(--d, 0.05s); }
@keyframes in-soft  { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes in-scale { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: none; } }
@keyframes in-pop   { 0% { opacity: 0; transform: scale(0.9); } 70% { transform: scale(1.02); } 100% { opacity: 1; transform: none; } }
.appear--soft  { animation-name: in-soft; }
.appear--scale { animation-name: in-scale; }
.appear--pop   { animation-name: in-pop; }

/* ---------- 通用工具 ---------- */
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.flex { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }

.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  body { font-size: var(--fs-body); }
  .page { padding: 14px 14px 26px; }
  .topbar { border-radius: 16px; }
  .glass { border-radius: 20px; }
  /* 窄屏：仅隐藏公司名称文字，保留 logo，避免挤压驭风居中 */
  .topbar .brand-name { display: none; }
  .topbar .brand-logo { width: clamp(34px, 5vw, 42px); }
  .topbar .side { gap: 8px; }
}
@media (max-width: 560px) {
  .topbar { gap: 8px; padding: 8px 10px; }
  .topbar .side-left { flex: 0 0 auto; }
  .topbar .side-right { flex: 0 0 auto; }
}
/* ---------- 手机窄屏强化（375~480px） ---------- */
@media (max-width: 480px) {
  .page { padding: 10px 10px 22px; }
  .topbar { border-radius: 14px; gap: 6px; padding: 7px 9px; margin-bottom: 10px; }
  .topbar .brand-logo { width: 30px; }
  .btn-back { height: 34px; padding: 0 11px; font-size: 11.5px; }
  .brand-name { display: none; }
  .hero { padding: 34px 0 26px; }
  .entries { flex-direction: column; align-items: stretch; }
  .entry { flex: auto; width: 100%; min-height: 0; padding: 14px 16px; }
  .entry .ico { width: 40px; height: 40px; }
  .glass { border-radius: 18px; }
  .btn { height: 40px; font-size: 13.5px; }
  input, textarea, select { font-size: 16px; }   /* 防 iOS 聚焦放大 */
  .badge { padding: 7px 12px; font-size: 11px; }
  .stats { gap: 14px; padding: 14px 6px 6px; }
  .stat b { font-size: 19px; }
  .footnote { font-size: 11px; }
}
/* ---------- 移动端性能降级（平板/手机，视口 ≤900px） ----------
 * 手机 GPU 有限：关掉全屏视频（换静态渐变背景）、减轻玻璃模糊、缩短动画。
 * 桌面（>900px）保持完整视觉效果不受影响。 */
@media (max-width: 900px) {
  .bg-video video { display: none; }   /* 视频是最大卡顿源：移动端不播 */
  .bg-video {
    background:
      radial-gradient(1000px 560px at 50% 16%, rgba(56,189,248,0.16), transparent 62%),
      radial-gradient(760px 460px at 88% 86%, rgba(45,212,191,0.10), transparent 62%),
      linear-gradient(180deg, #0a1522 0%, #050508 52%, #070a13 100%);
  }
  .bg-veil { opacity: 0.72; }
  :root { --glass-blur: blur(12px) saturate(150%); }
  /* 顶部栏避开手机刘海/状态栏安全区，保证可点击 */
  .topbar { margin-top: env(safe-area-inset-top); }
  .page { animation-duration: .5s; }
  .appear { animation-duration: .35s !important; }
  .on-breathe { animation-duration: 1.8s; }
  /* 移动端彻底关闭 backdrop-filter（GPU 实时模糊=最大性能杀手）：
     玻璃质感由渐变/高光/边框承担，视觉效果基本不变，速度大幅提升 */
  .page, .page *, .glass, .glass *, .topbar, .topbar *, .chat-wrap, .chat-wrap *,
  .feed-card, .feed-card *, .admin-panel, .admin-panel *, .hist-overlay, .hist-overlay * {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .appear { opacity: 1 !important; transform: none !important; }
}
