/* ==========================================================
   全站统一设计系统 - 科技蓝主题
   Design System v2.0 - Tech Blue Theme
   ========================================================== */

:root {
  /* ----- 主色板 ----- */
  --ys-primary-50:  #e6f0ff;
  --ys-primary-100: #b3d1ff;
  --ys-primary-200: #80b3ff;
  --ys-primary-300: #4d94ff;
  --ys-primary-400: #1a75ff;
  --ys-primary-500: #0066ff;   /* 主色 */
  --ys-primary-600: #0052cc;
  --ys-primary-700: #003d99;
  --ys-primary-800: #002966;
  --ys-primary-900: #001433;

  /* ----- 辅助色 ----- */
  --ys-success: #00b578;
  --ys-success-bg: #e6f7f1;
  --ys-warning: #ff8f1f;
  --ys-warning-bg: #fff4e6;
  --ys-danger:  #f53f3f;
  --ys-danger-bg: #ffeded;
  --ys-info:    #909399;
  --ys-info-bg: #f4f4f5;

  /* ----- 中性色 ----- */
  --ys-text-primary:   #1d2129;
  --ys-text-regular:   #4e5969;
  --ys-text-secondary: #86909c;
  --ys-text-placeholder: #c9cdd4;
  --ys-text-disabled:  #c9cdd4;

  --ys-border-1: #e5e6eb;
  --ys-border-2: #f2f3f5;
  --ys-border-3: #f7f8fa;

  --ys-bg-page:   #f5f7fa;
  --ys-bg-card:   #ffffff;
  --ys-bg-soft:   #f7f8fa;
  --ys-bg-hover:  #f2f3f5;

  /* ----- 圆角 ----- */
  --ys-radius-sm: 6px;
  --ys-radius:    10px;
  --ys-radius-lg: 16px;
  --ys-radius-xl: 24px;
  --ys-radius-pill: 999px;

  /* ----- 阴影 ----- */
  --ys-shadow-sm: 0 1px 2px rgba(0, 16, 64, 0.04);
  --ys-shadow:    0 4px 12px rgba(0, 16, 64, 0.06);
  --ys-shadow-lg: 0 10px 30px rgba(0, 16, 64, 0.08);
  --ys-shadow-blue: 0 6px 20px rgba(0, 102, 255, 0.25);

  /* ----- 渐变 ----- */
  --ys-grad-primary: linear-gradient(135deg, #0066ff 0%, #4d94ff 100%);
  --ys-grad-blue:    linear-gradient(135deg, #1e88ff 0%, #00b4ff 100%);
  --ys-grad-night:   linear-gradient(135deg, #0f1a3a 0%, #1e3a8a 100%);
  --ys-grad-card:    linear-gradient(180deg, #ffffff 0%, #f7faff 100%);

  /* ----- 尺寸 ----- */
  --ys-header-h: 56px;
  --ys-tabbar-h: 56px;
  --ys-content-max: 1200px;

  /* ----- 动效 ----- */
  --ys-trans-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --ys-trans:      0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --ys-trans-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================
   全局基础重置
   ========================================================== */
html, body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", Roboto, "Helvetica Neue",
               Arial, sans-serif;
  color: var(--ys-text-regular);
  background-color: var(--ys-bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
}

a {
  color: var(--ys-primary-500);
  text-decoration: none;
  transition: color var(--ys-trans-fast);
}
a:hover { color: var(--ys-primary-400); }

::selection {
  background: var(--ys-primary-100);
  color: var(--ys-primary-700);
}

/* 滚动条美化 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #d4d6d9;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: #b3b6bb; }

/* ==========================================================
   通用原子类
   ========================================================== */

/* 文字 */
.ys-text-primary   { color: var(--ys-primary-500) !important; }
.ys-text-success   { color: var(--ys-success) !important; }
.ys-text-warning   { color: var(--ys-warning) !important; }
.ys-text-danger    { color: var(--ys-danger)  !important; }
.ys-text-secondary { color: var(--ys-text-secondary) !important; }
.ys-text-bold      { font-weight: 600 !important; }
.ys-text-center    { text-align: center !important; }
.ys-text-truncate  {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 背景 */
.ys-bg-card  { background: var(--ys-bg-card)  !important; }
.ys-bg-page  { background: var(--ys-bg-page)  !important; }
.ys-bg-soft  { background: var(--ys-bg-soft)  !important; }
.ys-bg-grad  { background: var(--ys-grad-primary) !important; color: #fff; }
.ys-bg-blue  { background: var(--ys-grad-blue) !important; color: #fff; }
.ys-bg-night { background: var(--ys-grad-night) !important; color: #fff; }

/* 间距 */
.ys-mt-1 { margin-top: 8px  !important; }
.ys-mt-2 { margin-top: 16px !important; }
.ys-mt-3 { margin-top: 24px !important; }
.ys-mt-4 { margin-top: 32px !important; }
.ys-mb-1 { margin-bottom: 8px  !important; }
.ys-mb-2 { margin-bottom: 16px !important; }
.ys-mb-3 { margin-bottom: 24px !important; }
.ys-mb-4 { margin-bottom: 32px !important; }

/* 弹性布局 */
.ys-flex { display: flex; }
.ys-flex-center { display: flex; align-items: center; justify-content: center; }
.ys-flex-between { display: flex; align-items: center; justify-content: space-between; }
.ys-flex-1 { flex: 1; min-width: 0; }
.ys-gap-1 { gap: 8px; }
.ys-gap-2 { gap: 16px; }

/* ==========================================================
   通用组件 - 卡片
   ========================================================== */
.ys-card {
  background: var(--ys-bg-card);
  border-radius: var(--ys-radius);
  box-shadow: var(--ys-shadow);
  padding: 20px;
  transition: box-shadow var(--ys-trans), transform var(--ys-trans);
}
.ys-card:hover {
  box-shadow: var(--ys-shadow-lg);
}
.ys-card-flat {
  background: var(--ys-bg-card);
  border-radius: var(--ys-radius);
  padding: 20px;
}
.ys-card-grad {
  background: var(--ys-grad-card);
  border: 1px solid var(--ys-border-2);
  border-radius: var(--ys-radius-lg);
  padding: 24px;
}
.ys-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--ys-border-2);
}
.ys-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--ys-text-primary);
  margin: 0;
}
.ys-card-title i {
  color: var(--ys-primary-500);
  margin-right: 6px;
}

/* ==========================================================
   通用组件 - 按钮
   ========================================================== */
.ys-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  border: 1px solid transparent;
  border-radius: var(--ys-radius-sm);
  cursor: pointer;
  user-select: none;
  background: var(--ys-bg-card);
  color: var(--ys-text-regular);
  transition: all var(--ys-trans);
  white-space: nowrap;
}
.ys-btn:hover  { transform: translateY(-1px); }
.ys-btn:active { transform: translateY(0); }
.ys-btn:disabled,
.ys-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.ys-btn-primary {
  background: var(--ys-grad-primary);
  color: #fff;
  box-shadow: var(--ys-shadow-blue);
}
.ys-btn-primary:hover  { color: #fff; box-shadow: 0 8px 22px rgba(0,102,255,0.35); }

.ys-btn-success { background: var(--ys-success); color: #fff; }
.ys-btn-warning { background: var(--ys-warning); color: #fff; }
.ys-btn-danger  { background: var(--ys-danger);  color: #fff; }

.ys-btn-outline {
  background: transparent;
  border-color: var(--ys-primary-500);
  color: var(--ys-primary-500);
}
.ys-btn-outline:hover {
  background: var(--ys-primary-50);
  color: var(--ys-primary-600);
}

.ys-btn-ghost {
  background: var(--ys-bg-soft);
  color: var(--ys-text-regular);
  border-color: var(--ys-border-1);
}
.ys-btn-ghost:hover {
  background: var(--ys-bg-hover);
  color: var(--ys-text-primary);
}

.ys-btn-lg { padding: 12px 24px; font-size: 16px; border-radius: var(--ys-radius); }
.ys-btn-sm { padding: 4px 12px; font-size: 12px; }
.ys-btn-block { width: 100%; }

/* ==========================================================
   通用组件 - 表单
   ========================================================== */
.ys-form-item { margin-bottom: 18px; }
.ys-form-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ys-text-primary);
}
.ys-form-label .required { color: var(--ys-danger); margin-right: 3px; }

.ys-input,
.ys-form-control {
  width: 100%;
  height: 40px;
  padding: 0 14px;
  font-size: 14px;
  color: var(--ys-text-primary);
  background: var(--ys-bg-card);
  border: 1px solid var(--ys-border-1);
  border-radius: var(--ys-radius-sm);
  outline: none;
  transition: border-color var(--ys-trans-fast), box-shadow var(--ys-trans-fast);
  box-sizing: border-box;
}
.ys-input:focus,
.ys-form-control:focus {
  border-color: var(--ys-primary-500);
  box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.12);
}
.ys-input::placeholder { color: var(--ys-text-placeholder); }

textarea.ys-input,
textarea.ys-form-control { min-height: 90px; padding: 10px 14px; height: auto; }

.ys-input-group {
  position: relative;
  display: flex;
  align-items: center;
}
.ys-input-group .ys-input { padding-left: 38px; }
.ys-input-group > i {
  position: absolute;
  left: 12px;
  color: var(--ys-text-secondary);
  pointer-events: none;
}

.ys-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23999' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 32px !important;
}

/* ==========================================================
   通用组件 - 导航条 (PC端)
   ========================================================== */
.ys-navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--ys-header-h);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--ys-border-2);
}
.ys-navbar-inner {
  max-width: var(--ys-content-max);
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ys-navbar-logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--ys-text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.ys-navbar-logo i {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--ys-grad-blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ys-navbar-menu {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.ys-navbar-menu a {
  display: inline-block;
  padding: 8px 14px;
  color: var(--ys-text-regular);
  border-radius: var(--ys-radius-sm);
  font-weight: 500;
  transition: all var(--ys-trans-fast);
}
.ys-navbar-menu a:hover { background: var(--ys-primary-50); color: var(--ys-primary-500); }
.ys-navbar-menu a.active { color: var(--ys-primary-500); background: var(--ys-primary-50); }

/* ==========================================================
   通用组件 - 底部 TabBar (移动端)
   ========================================================== */
.ys-tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: calc(var(--ys-tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border-top: 1px solid var(--ys-border-2);
  display: flex;
}
.ys-tabbar a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--ys-text-secondary);
  font-size: 11px;
  transition: color var(--ys-trans-fast);
}
.ys-tabbar a i { font-size: 20px; }
.ys-tabbar a.active { color: var(--ys-primary-500); }

/* ==========================================================
   通用组件 - 统计卡片
   ========================================================== */
.ys-stat-card {
  background: var(--ys-bg-card);
  border-radius: var(--ys-radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--ys-shadow-sm);
  transition: all var(--ys-trans);
  border: 1px solid var(--ys-border-2);
}
.ys-stat-card:hover {
  box-shadow: var(--ys-shadow);
  transform: translateY(-2px);
}
.ys-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--ys-radius);
  background: var(--ys-primary-50);
  color: var(--ys-primary-500);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.ys-stat-icon.success { background: var(--ys-success-bg); color: var(--ys-success); }
.ys-stat-icon.warning { background: var(--ys-warning-bg); color: var(--ys-warning); }
.ys-stat-icon.danger  { background: var(--ys-danger-bg);  color: var(--ys-danger); }

.ys-stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--ys-text-primary);
  line-height: 1.2;
}
.ys-stat-label {
  font-size: 12px;
  color: var(--ys-text-secondary);
  margin-top: 2px;
}

/* ==========================================================
   通用组件 - 标签/徽标
   ========================================================== */
.ys-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  font-size: 12px;
  border-radius: var(--ys-radius-pill);
  background: var(--ys-bg-soft);
  color: var(--ys-text-regular);
  line-height: 1.6;
}
.ys-tag-primary { background: var(--ys-primary-50);  color: var(--ys-primary-500); }
.ys-tag-success { background: var(--ys-success-bg);  color: var(--ys-success); }
.ys-tag-warning { background: var(--ys-warning-bg);  color: var(--ys-warning); }
.ys-tag-danger  { background: var(--ys-danger-bg);   color: var(--ys-danger); }

.ys-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 11px;
  border-radius: var(--ys-radius-pill);
  background: var(--ys-danger);
  color: #fff;
  line-height: 1;
}

/* ==========================================================
   通用组件 - 表格
   ========================================================== */
.ys-table {
  width: 100%;
  background: var(--ys-bg-card);
  border-radius: var(--ys-radius);
  overflow: hidden;
  border-collapse: separate;
  border-spacing: 0;
}
.ys-table th,
.ys-table td {
  padding: 12px 16px;
  text-align: left;
  font-size: 14px;
  border-bottom: 1px solid var(--ys-border-2);
}
.ys-table th {
  background: var(--ys-bg-soft);
  color: var(--ys-text-secondary);
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.ys-table tr:last-child td { border-bottom: none; }
.ys-table tr:hover td { background: var(--ys-bg-soft); }

/* ==========================================================
   通用组件 - 提示/警告框
   ========================================================== */
.ys-alert {
  padding: 12px 16px;
  border-radius: var(--ys-radius);
  background: var(--ys-primary-50);
  color: var(--ys-primary-700);
  border-left: 3px solid var(--ys-primary-500);
  font-size: 13px;
  line-height: 1.7;
}
.ys-alert-success { background: var(--ys-success-bg); color: var(--ys-success); border-left-color: var(--ys-success); }
.ys-alert-warning { background: var(--ys-warning-bg); color: var(--ys-warning); border-left-color: var(--ys-warning); }
.ys-alert-danger  { background: var(--ys-danger-bg);  color: var(--ys-danger);  border-left-color: var(--ys-danger); }
.ys-alert-info    { background: var(--ys-info-bg);    color: var(--ys-info);    border-left-color: var(--ys-info); }

/* ==========================================================
   通用组件 - 头像
   ========================================================== */
.ys-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--ys-grad-blue);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  overflow: hidden;
  flex-shrink: 0;
}
.ys-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ys-avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.ys-avatar-lg { width: 56px; height: 56px; font-size: 18px; }
.ys-avatar-xl { width: 80px; height: 80px; font-size: 28px; }

/* ==========================================================
   通用组件 - 空状态
   ========================================================== */
.ys-empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--ys-text-secondary);
}
.ys-empty i {
  font-size: 48px;
  color: var(--ys-text-placeholder);
  margin-bottom: 12px;
  display: block;
}

/* ==========================================================
   通用组件 - 列表
   ========================================================== */
.ys-list {
  background: var(--ys-bg-card);
  border-radius: var(--ys-radius);
  overflow: hidden;
}
.ys-list-item {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--ys-border-2);
  transition: background var(--ys-trans-fast);
  cursor: pointer;
}
.ys-list-item:last-child { border-bottom: none; }
.ys-list-item:hover { background: var(--ys-bg-soft); }
.ys-list-item .icon {
  width: 36px;
  height: 36px;
  border-radius: var(--ys-radius-sm);
  background: var(--ys-primary-50);
  color: var(--ys-primary-500);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  flex-shrink: 0;
}
.ys-list-item .body { flex: 1; min-width: 0; }
.ys-list-item .title { font-size: 14px; color: var(--ys-text-primary); font-weight: 500; }
.ys-list-item .desc  { font-size: 12px; color: var(--ys-text-secondary); margin-top: 2px; }
.ys-list-item .arrow { color: var(--ys-text-placeholder); }

/* ==========================================================
   通用组件 - 渐变按钮组(主行动按钮)
   ========================================================== */
.ys-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 48px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: var(--ys-grad-blue);
  border: none;
  border-radius: var(--ys-radius);
  cursor: pointer;
  box-shadow: var(--ys-shadow-blue);
  transition: all var(--ys-trans);
}
.ys-cta:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0,102,255,0.35); }
.ys-cta:active { transform: translateY(0); }

/* ==========================================================
   全局页面容器
   ========================================================== */
.ys-container {
  max-width: var(--ys-content-max);
  margin: 0 auto;
  padding: 24px;
}
.ys-container-sm { max-width: 800px; }
.ys-container-xs { max-width: 480px; }

.ys-page-header {
  background: var(--ys-grad-night);
  color: #fff;
  padding: 32px 24px;
  border-radius: var(--ys-radius-lg);
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.ys-page-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(0, 180, 255, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(0, 102, 255, 0.3) 0%, transparent 50%);
  pointer-events: none;
}
.ys-page-header > * { position: relative; }
.ys-page-header h1 {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 700;
}
.ys-page-header p {
  margin: 0;
  opacity: 0.85;
  font-size: 14px;
}

/* ==========================================================
   表单页签/选项卡
   ========================================================== */
.ys-tabs {
  display: flex;
  border-bottom: 1px solid var(--ys-border-1);
  margin-bottom: 20px;
  gap: 4px;
  flex-wrap: wrap;
}
.ys-tabs a {
  padding: 10px 18px;
  color: var(--ys-text-regular);
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all var(--ys-trans-fast);
  cursor: pointer;
}
.ys-tabs a:hover { color: var(--ys-primary-500); }
.ys-tabs a.active {
  color: var(--ys-primary-500);
  border-bottom-color: var(--ys-primary-500);
}

/* ==========================================================
   响应式微调
   ========================================================== */
@media (max-width: 768px) {
  .ys-container { padding: 16px; }
  .ys-card { padding: 16px; }
  .ys-page-header { padding: 24px 20px; border-radius: var(--ys-radius); }
  .ys-page-header h1 { font-size: 20px; }
  .ys-table th, .ys-table td { padding: 10px 12px; font-size: 13px; }
}

/* 动画 */
@keyframes ys-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ys-fade-in { animation: ys-fade-in var(--ys-trans) ease both; }

@keyframes ys-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 102, 255, 0.5); }
  50%      { box-shadow: 0 0 0 12px rgba(0, 102, 255, 0); }
}
.ys-pulse { animation: ys-pulse 2s infinite; }

@keyframes ys-shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
