/* ==========================================================================
   极点授权与商业门户 · 全端现代响应式设计系统 (PC / Tablet / Mobile)
   ========================================================================== */

:root {
  --bg-page: #09090b;
  --bg-surface: rgba(24, 24, 27, 0.78);
  --bg-surface-hover: rgba(39, 39, 42, 0.9);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.5);
  --text-primary: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 8px;
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, monospace;
}

/* 浅色模式自动适配（如果主题切换为亮色） */
:root[data-color-mode="light"] {
  --bg-page: #f8fafc;
  --bg-surface: rgba(255, 255, 255, 0.88);
  --bg-surface-hover: #ffffff;
  --border-subtle: rgba(15, 23, 42, 0.08);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --shadow-card: 0 10px 25px -5px rgba(15, 23, 42, 0.06);
}

/* 1. 全局基础与滚动条美化 */
*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-page) !important;
  color: var(--text-primary) !important;
  font-family: var(--font-sans) !important;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* 等宽字体强制应用于授权码、卡密、版本号、价格 */
code, pre, .license-key, .token-text, .price, .version-tag, input[name="id"], input[name="token"] {
  font-family: var(--font-mono) !important;
  font-variant-numeric: tabular-nums;
}

/* 2. 首屏加载动画高级感改造 */
#app .loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  font-size: 15px;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  background: radial-gradient(circle at 50% 40%, rgba(99, 102, 241, 0.12), transparent 60%);
}

/* 3. 顶部导航栏毛玻璃悬浮质感 */
.sf-nav, .navbar, .topbar, .site-header {
  position: sticky !important;
  top: 0;
  z-index: 90;
  background: var(--bg-surface) !important;
  backdrop-filter: blur(16px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(16px) saturate(180%) !important;
  border-bottom: 1px solid var(--border-subtle) !important;
}

/* 4. 卡片与模块容器高级感重塑 */
.card, .panel, .box, .module-card, .product-card, .license-card, .post-item {
  background: var(--bg-surface) !important;
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-card) !important;
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.22s ease, background 0.22s ease !important;
}

.card:hover, .product-card:hover, .license-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-focus) !important;
  background: var(--bg-surface-hover) !important;
}

/* 5. 按钮与输入框统一现代交互 */
button, .btn, a.button, input[type="submit"] {
  border-radius: var(--radius-sm) !important;
  font-weight: 500 !important;
  transition: all 0.18s ease !important;
  cursor: pointer;
}

button.primary, .btn-primary {
  background: var(--accent) !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35) !important;
}

button.primary:hover, .btn-primary:hover {
  background: var(--accent-hover) !important;
  transform: translateY(-1px);
}

button:active, .btn:active {
  transform: scale(0.97) !important;
}

input, select, textarea {
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: var(--radius-sm) !important;
  color: var(--text-primary) !important;
  padding: 10px 14px !important;
  font-size: 14px !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

input:focus, select:focus, textarea:focus {
  outline: none !important;
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18) !important;
}

/* 6. 表格防溢出容器（解决后台授权列表在手机端撑破屏幕的问题） */
table {
  width: 100%;
  border-collapse: collapse;
}
.table-wrap, .admin-table, .license-table {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ==========================================================================
   三端精准响应式适配断点 (Desktop / Tablet / Mobile)
   ========================================================================== */

/* 【电脑大屏 Desktop：>= 1025px】 */
@media (min-width: 1025px) {
  .container, .main-wrap, .content-area {
    max-width: 1240px !important;
    margin: 0 auto !important;
    padding-left: 32px !important;
    padding-right: 32px !important;
  }
  .grid, .cards-grid, .product-list {
    display: grid !important;
    grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)) !important;
    gap: 24px !important;
  }
}

/* 【平板端 Tablet (iPad 竖屏/横屏)：641px ~ 1024px】 */
@media (min-width: 641px) and (max-width: 1024px) {
  .container, .main-wrap, .content-area {
    max-width: 100% !important;
    padding-left: 24px !important;
    padding-right: 24px !important;
  }
  /* 平板端强制双列黄金比例，避免三列太挤、单列太宽 */
  .grid, .cards-grid, .product-list {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 18px !important;
  }
  .card, .panel {
    padding: 20px !important;
  }
}

/* 【手机端 Mobile：<= 640px】 */
@media (max-width: 640px) {
  .container, .main-wrap, .content-area {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
  /* 手机端强制单列全宽卡片，触控区域最大化 */
  .grid, .cards-grid, .product-list {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
  .card, .panel, .box {
    padding: 16px !important;
    border-radius: 14px !important;
  }
  .hero-title {
    font-size: 24px !important;
    line-height: 1.3 !important;
  }
  h2 {
    font-size: 19px !important;
  }
  /* 手机端表单按钮全宽显示，方便单手拇指点击 */
  form button[type="submit"], .action-bar > .btn {
    width: 100% !important;
    margin-bottom: 8px !important;
    padding: 12px 16px !important;
    font-size: 15px !important;
  }
  /* 防止 iOS Safari 点击输入框时页面自动放大 */
  input, select, textarea {
    font-size: 16px !important;
  }
  /* 弹窗在手机端改为底部抽屉式卡片，体验极佳 */
  .modal-content, .dialog-box {
    width: 94% !important;
    max-width: 94% !important;
    margin: 16px auto !important;
    border-radius: 18px !important;
    padding: 20px 16px !important;
  }
}
/* Keyboard navigation and motion preferences apply across both themes. */
:where(button, a, summary, [tabindex]):focus-visible {
 outline: 3px solid var(--accent) !important;
 outline-offset: 3px;
}
button:disabled { cursor: wait; opacity: .6; }
.modal .modal-close { width: 36px !important; height: 36px; padding: 0 !important; }
.card h3, .panel p, .license-key { overflow-wrap: anywhere; }
@media (prefers-reduced-motion: reduce) {
 *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
