/* ─────────────────────────────────────────────────────────────
 * 站点级静态共享样式 — 部署到 /shared-styles/base.css
 * 由各子项目的 index.html 通过 <link rel="stylesheet"> 引用，
 * 不参与 Tailwind 编译，所有 7 个子站共用同一份。
 * ───────────────────────────────────────────────────────────── */

/* ── 本地 Web 字体 (Manrope, /fonts 位于站点根) ── */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url('/fonts/manrope-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url('/fonts/manrope-latin-ext-400-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url('/fonts/manrope-latin-500-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url('/fonts/manrope-latin-ext-500-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url('/fonts/manrope-latin-700-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url('/fonts/manrope-latin-ext-700-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ── 数字输入控件去除原生 spinner ── */
input[type='number']::-webkit-outer-spin-button,
input[type='number']::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type='number'] {
  -moz-appearance: textfield;
}

/* ── 自定义滚动条 ── */
.custom-scrollbar::-webkit-scrollbar { width: 6px; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
.custom-scrollbar::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.15);
}
.dark .custom-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
}

/* ── 玻璃拟态面板 ── */
.panel {
  position: relative;
  border: 1px solid var(--color-panel-border);
  border-radius: var(--radius-xl);
  background: var(--color-surface);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 8px 32px rgba(0, 0, 0, 0.06);
  overflow: clip;
  transition: box-shadow 0.3s ease;
}
.panel:hover {
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 12px 40px rgba(0, 0, 0, 0.1);
}
.dark .panel {
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.2),
    0 8px 32px rgba(0, 0, 0, 0.3);
}

/* ── 现代输入框（圆角矩形，默认形态）── */
.field {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--color-border-strong);
  border-radius: 8px;
  background: var(--color-input);
  color: var(--color-foreground);
  font: inherit;
  font-size: 0.8125rem;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}
.field:focus-visible {
  outline: none;
  border-color: var(--color-foreground-faint);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
}
.field::placeholder {
  color: var(--color-foreground-faint);
}

/* ── 复选框 ── */
input[type='checkbox'] {
  accent-color: var(--color-accent);
}

/* ── 按钮系统（--_ 局部变量 + 主题切换）── */
.btn {
  --_line: #d5d0c4;
  --_text: #212420;
  --_surface: #ffffff;
  --_accent: #2f6d67;
  --_accent-soft: #bde8e2;
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid color-mix(in srgb, var(--_line) 80%, var(--_text) 20%);
  border-radius: 999px;
  background: var(--_surface);
  color: var(--_text);
  padding: 9px 16px;
  font: 700 0.9rem/1 "Manrope", "Noto Sans SC", sans-serif;
  cursor: pointer;
  outline: none;
  transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease;
}
.btn:hover,
.btn:focus-visible { transform: translateY(-1px); border-color: var(--_accent); }
.btn--accent {
  border-color: #4A9EF5;
  background: #4A9EF5;
  color: #fff;
}
.btn--accent:hover {
  border-color: #3A8BE0;
  background: #3A8BE0;
  color: #fff;
}
.btn--tab-active {
  border-color: #2f6d67;
  background: #2f6d67;
  color: #fff;
}
.btn--tab-active:hover {
  border-color: #245550;
  background: #245550;
  color: #fff;
}
.btn:active { transform: translateY(0); }
.btn:disabled {
  cursor: not-allowed; opacity: 0.56; transform: none;
  border-color: color-mix(in srgb, var(--_line) 90%, var(--_text) 10%);
}
.dark .btn {
  --_line: #2a373d;
  --_text: #e8efeb;
  --_surface: #1b2429;
  --_accent: #63b7ae;
  --_accent-soft: rgba(89, 220, 201, 0.42);
}

/* ── 所有按钮使用 pointer 光标 ── */
button, [role="button"], [role="menuitem"] {
  cursor: pointer;
}

/* ── Radix 下拉动画 ── */
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-6px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes alert-pop {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}
.animate-in { animation: slideDown 200ms cubic-bezier(0.16, 1, 0.3, 1); }
.fade-in { animation-name: slideDown; }
.slide-in-from-top-2 { animation-name: slideDown; }

/* ── 移动端按钮内边距 ── */
@media (max-width: 640px) {
  .btn {
    padding: 9px 13px;
  }
}

/* ── 移动端输入框/面板溢出修复 ── */
@media (max-width: 640px) {
  .field,
  input[type='datetime-local'] {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .field {
    -webkit-appearance: none;
  }
  .panel {
    overflow: hidden;
    max-width: 100vw;
    box-sizing: border-box;
  }
}
