/**
 * 用友生态资源中心 - 基础样式规范、变量与通用组件
 */

:root {
  --yy-primary: #e60012;
  --yy-primary-hover: #cc0010;
  --yy-primary-light: #fef2f2;
  --yy-primary-border: #fecaca;
  --yy-slate-900: #0f172a;
  --yy-slate-800: #1e293b;
  --yy-slate-700: #334155;
  --yy-slate-600: #475569;
  --yy-slate-500: #64748b;
  --yy-slate-400: #94a3b8;
  --yy-slate-300: #cbd5e1;
  --yy-slate-200: #e2e8f0;
  --yy-slate-100: #f1f5f9;
  --yy-slate-50: #f8fafc;
  --yy-success: #10b981;
  --yy-success-bg: #ecfdf5;
  --yy-success-border: #a7f3d0;
  --yy-blue: #2563eb;
  --yy-blue-bg: #eff6ff;
  --yy-blue-border: #bfdbfe;
  --yy-radius-sm: 4px;
  --yy-radius-md: 8px;
  --yy-radius-lg: 12px;
  --yy-radius-full: 9999px;
  --yy-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --yy-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --yy-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --yy-font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --yy-font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--yy-font-sans);
  background-color: var(--yy-slate-50);
  color: var(--yy-slate-800);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

/* 通用按钮 */
.yy-btn-action {
  background: var(--yy-slate-100);
  border: 1px solid var(--yy-slate-200);
  color: var(--yy-slate-700);
  padding: 6px 12px;
  border-radius: var(--yy-radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.2;
}

.yy-btn-action:hover {
  background: var(--yy-slate-200);
  color: var(--yy-slate-900);
}

.yy-btn-action.primary {
  background: var(--yy-primary);
  border-color: var(--yy-primary);
  color: #ffffff;
}

.yy-btn-action.primary:hover {
  background: var(--yy-primary-hover);
}

/* ================= 页面切换顶部进度条与沉稳入场动效 ================= */
.yy-page-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--yy-primary), #ff4d4f);
  z-index: 99999;
  width: 0%;
  transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
  box-shadow: 0 0 8px rgba(230, 0, 18, 0.5);
  pointer-events: none;
}

.yy-page-progress.done {
  width: 100%;
  opacity: 0;
}

.yy-page-fade-in {
  animation: yyPageFadeIn 0.24s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes yyPageFadeIn {
  from {
    opacity: 0.85;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 沉稳加载微动画 */
.yy-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(0, 0, 0, 0.15);
  border-top-color: var(--yy-primary);
  border-radius: 50%;
  animation: yySpin 0.65s linear infinite;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.yy-spinner.light {
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
}

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

.yy-loading-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  gap: 10px;
  color: var(--yy-slate-500);
  font-size: 13px;
  background: #ffffff;
  border: 1px solid var(--yy-slate-200);
  border-radius: var(--yy-radius-md);
}

/* 提示吐司 Toast */
.yy-toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: var(--yy-slate-900);
  color: #ffffff;
  padding: 12px 20px;
  border-radius: var(--yy-radius-md);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--yy-shadow-lg);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 200;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.yy-toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* 空状态 */
.yy-empty-state {
  background: #ffffff;
  border: 1px dashed var(--yy-slate-200);
  border-radius: var(--yy-radius-md);
  padding: 60px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
