/* ========================================================================== */
/* 全局设计变量与基础样式                                                      */
/* ========================================================================== */

:root {
  --ink: #18322c;
  --muted: #687b76;
  --line: #dfe8e4;
  --line-strong: #cad8d3;
  --paper: #ffffff;
  --canvas: #f3f7f5;
  --brand: #157a62;
  --brand-dark: #0e5e4b;
  --brand-soft: #e5f4ef;
  --warning: #a46113;
  --warning-soft: #fff5df;
  --danger: #b43b3b;
  --danger-soft: #fff0ef;
  --shadow: 0 18px 50px rgba(27, 61, 52, 0.08);
  --radius-lg: 20px;
  --radius-md: 12px;
  --row-height: 38px;
}

* {
  box-sizing: border-box;
}

/* 部分选择器显式设置了 display，统一规则可确保 hidden 属性始终真正隐藏元素。 */
[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 0%, rgba(101, 186, 156, 0.13), transparent 30rem),
    var(--canvas);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/*
 * 页面首帧使用独立的全屏启动层。它在主模块执行前即可出现，因此查询参数或
 * config.js 默认文件都不会导致空状态闪现；动画保持轻量且无需图片资源。
 */
.startup-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 11px;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% 42%, rgba(80, 190, 151, 0.2), transparent 28%),
    linear-gradient(145deg, #f9fcfb 0%, #edf7f3 52%, #f8fbfa 100%);
  overflow: hidden;
  isolation: isolate;
}

.is-startup-loading .startup-loader {
  display: flex;
}

.startup-loader::before,
.startup-loader::after {
  position: absolute;
  z-index: -1;
  width: 38vw;
  height: 38vw;
  min-width: 280px;
  min-height: 280px;
  border-radius: 50%;
  content: "";
  filter: blur(3px);
  background: radial-gradient(circle, rgba(21, 122, 98, 0.09), transparent 68%);
  animation: startup-float 5s ease-in-out infinite alternate;
}

.startup-loader::before {
  top: -18vw;
  left: -12vw;
}

.startup-loader::after {
  right: -14vw;
  bottom: -20vw;
  animation-delay: -2.5s;
}

.startup-loader-visual {
  width: 88px;
  height: 88px;
  position: relative;
  display: grid;
  place-items: center;
}

.startup-loader-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: url("../../favicon.svg") center / contain no-repeat;
  box-shadow: 0 12px 30px rgba(21, 122, 98, 0.28);
  animation: startup-pulse 1.8s ease-in-out infinite;
}

.startup-orbit {
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(21, 122, 98, 0.2);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: startup-spin 1.35s linear infinite;
}

.startup-orbit::after {
  width: 7px;
  height: 7px;
  position: absolute;
  top: 5px;
  right: 11px;
  border-radius: 50%;
  content: "";
  background: #28aa83;
  box-shadow: 0 0 12px rgba(40, 170, 131, 0.8);
}

.startup-orbit-two {
  inset: 13px;
  border-color: rgba(21, 122, 98, 0.12);
  border-bottom-color: #71c4a7;
  animation-direction: reverse;
  animation-duration: 1.8s;
}

.startup-loader > strong {
  font-size: 15px;
  letter-spacing: 0.04em;
}

.startup-loader > span:not(.startup-loading-bar) {
  max-width: min(80vw, 520px);
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.startup-loading-bar {
  width: 150px;
  height: 3px;
  margin-top: 4px;
  position: relative;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(21, 122, 98, 0.12);
}

.startup-loading-bar i {
  width: 45%;
  height: 100%;
  position: absolute;
  left: -45%;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, #20a47f, transparent);
  animation: startup-slide 1.1s ease-in-out infinite;
}

@keyframes startup-spin {
  to { transform: rotate(360deg); }
}

@keyframes startup-pulse {
  50% { transform: scale(1.06); box-shadow: 0 15px 34px rgba(21, 122, 98, 0.36); }
}

@keyframes startup-slide {
  to { left: 100%; }
}

@keyframes startup-float {
  to { transform: translate3d(3vw, 2vw, 0) scale(1.08); }
}

button,
input,
select {
  font: inherit;
}

button,
label,
select {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
