:root {
      --bg-page: #F5F5F7;
      --bg-card: #FFFFFF;
      --text-primary: #1D1D1F;
      --text-secondary: #6E6E73;
      --text-tertiary: #86868B;
      --accent-blue: #0071E3;
      --accent-blue-hover: #0077ED;
      --status-green: #34C759;
      --status-red: #FF3B30;
      --status-orange: #FF9500;
      --status-indigo: #5856D6;
      --ease-apple: cubic-bezier(0.25, 0.1, 0.25, 1);
    }

    * {
      box-sizing: border-box;
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
    }

    body {
      margin: 0;
      background-color: var(--bg-page);
      color: var(--text-primary);
      font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
      overflow-x: hidden;
    }

    .tabular-nums {
      font-variant-numeric: tabular-nums;
    }

    /* Apple 卡片规范 */
    .apple-card {
      background: var(--bg-card);
      border-radius: 18px;
      border: 1px solid rgba(0, 0, 0, 0.05);
      box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.02);
      transition: transform 0.28s var(--ease-apple), box-shadow 0.28s var(--ease-apple), border-color 0.28s var(--ease-apple);
    }

    .apple-card-interactive {
      cursor: pointer;
    }

    .apple-card-interactive:hover {
      transform: translateY(-2px);
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06), 0 2px 6px rgba(0, 0, 0, 0.03);
      border-color: rgba(0, 113, 227, 0.18);
    }

    .apple-card-interactive:active {
      transform: translateY(0px) scale(0.99);
    }

    /* 吸顶毛玻璃导航 */
    .glass-nav {
      background: rgba(251, 251, 253, 0.82);
      backdrop-filter: saturate(180%) blur(20px);
      -webkit-backdrop-filter: saturate(180%) blur(20px);
      border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    }

    /* Apple 分段控制器 */
    .segmented-control {
      display: inline-flex;
      position: relative;
      background: rgba(118, 118, 128, 0.12);
      padding: 3px;
      border-radius: 10px;
      user-select: none;
    }

    .segmented-btn {
      position: relative;
      z-index: 2;
      padding: 5px 14px;
      font-size: 13px;
      font-weight: 500;
      color: var(--text-secondary);
      border-radius: 8px;
      transition: color 0.22s var(--ease-apple), background-color 0.22s var(--ease-apple), box-shadow 0.22s var(--ease-apple);
      cursor: pointer;
      white-space: nowrap;
      border: none;
      background: transparent;
    }

    .segmented-btn.active {
      color: var(--text-primary);
      background: #FFFFFF;
      box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    }

    /* 训练中脉冲动画 */
    @keyframes pulse-ring {
      0% { transform: scale(0.85); opacity: 0.9; }
      70% { transform: scale(1.7); opacity: 0; }
      100% { transform: scale(1.7); opacity: 0; }
    }

    .pulse-dot {
      position: relative;
      display: inline-flex;
      width: 8px;
      height: 8px;
    }

    .pulse-dot::before {
      content: "";
      position: absolute;
      inset: 0;
      border-radius: 9999px;
      background: currentColor;
      animation: pulse-ring 1.8s var(--ease-apple) infinite;
    }

    .pulse-dot::after {
      content: "";
      position: relative;
      width: 8px;
      height: 8px;
      border-radius: 9999px;
      background: currentColor;
    }

    /* 详情抽屉动效 */
    .drawer-backdrop {
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.3s var(--ease-apple);
    }

    .drawer-backdrop.open {
      opacity: 1;
      pointer-events: auto;
    }

    .drawer-panel {
      transform: translateX(100%);
      transition: transform 0.36s var(--ease-apple);
    }

    .drawer-panel.open {
      transform: translateX(0);
    }

    /* 表格行悬停 */
    .table-row-hover {
      transition: background-color 0.18s var(--ease-apple);
    }

    .table-row-hover:hover {
      background-color: rgba(0, 113, 227, 0.035);
    }

    /* 自定义柔和滚动条 */
    ::-webkit-scrollbar {
      width: 6px;
      height: 6px;
    }

    ::-webkit-scrollbar-track {
      background: transparent;
    }

    ::-webkit-scrollbar-thumb {
      background: rgba(0, 0, 0, 0.14);
      border-radius: 9999px;
    }

    ::-webkit-scrollbar-thumb:hover {
      background: rgba(0, 0, 0, 0.25);
    }

    /* 隐藏移动端导航滚动条 */
    .no-scrollbar::-webkit-scrollbar {
      display: none;
    }
    .no-scrollbar {
      -ms-overflow-style: none;
      scrollbar-width: none;
    }

    /* 渐入动画 */
    @keyframes fadeSlideUp {
      from { opacity: 0; transform: translateY(6px); }
      to { opacity: 1; transform: translateY(0); }
    }

    .view-enter {
      animation: fadeSlideUp 0.28s var(--ease-apple) forwards;
    }

    /* 登录页氛围光晕与卡片 */
    .login-bg {
      background-color: #F5F5F7;
      background-image:
        radial-gradient(at 18% 15%, rgba(0, 113, 227, 0.08) 0px, transparent 52%),
        radial-gradient(at 84% 82%, rgba(88, 86, 214, 0.075) 0px, transparent 50%);
    }

    .login-card {
      background: rgba(255, 255, 255, 0.94);
      backdrop-filter: saturate(180%) blur(24px);
      -webkit-backdrop-filter: saturate(180%) blur(24px);
      border-radius: 24px;
      border: 1px solid rgba(0, 0, 0, 0.06);
      box-shadow: 0 20px 48px rgba(0, 0, 0, 0.06), 0 2px 8px rgba(0, 0, 0, 0.025);
    }

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

    .apple-spinner {
      width: 15px;
      height: 15px;
      border: 2px solid rgba(255, 255, 255, 0.35);
      border-top-color: #FFFFFF;
      border-radius: 9999px;
      animation: spin 0.7s linear infinite;
    }

[hidden] { display: none !important; }
button:focus-visible, [tabindex]:focus-visible { outline: 2px solid #0071e3; outline-offset: 3px; }
.brand-icon { object-fit: contain; flex: none; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }

.sync-pill { padding: .4rem .65rem; border: 1px solid #dedee5; border-radius: 999px; font-size: .75rem; color: #5b5b61; background: white; cursor: pointer; }
.sync-pill.sync-error { color: #8c4a00; border-color: #f2bf87; background: #fff7eb; }
