/* ==========================================================================
   先硕企业商城 · 主题样式（Tailwind 之外的补充：设计令牌、动效与组件）
   ========================================================================== */

:root {
  --brand-500: #4f46e5;
  --brand-400: #6366f1;
  --brand-600: #7c3aed;
  --brand-accent: #f97316;
  --ink-900: #0f172a;
  --ink-600: #475569;
  --ink-400: #94a3b8;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-tint: #eef2ff;
  --ring: rgba(99, 102, 241, 0.35);
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 12px 30px -12px rgba(79, 70, 229, 0.28);
  --shadow-lg: 0 26px 60px -22px rgba(79, 70, 229, 0.42);
  --radius-lg: 18px;
  --radius-xl: 26px;
}

* {
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--ink-900);
  background: radial-gradient(1200px 600px at 12% -8%, #eef2ff 0%, rgba(238, 242, 255, 0) 60%),
    radial-gradient(900px 500px at 92% 4%, #f5f3ff 0%, rgba(245, 243, 255, 0) 55%), var(--surface-soft);
  min-height: 100vh;
}

::selection {
  background: rgba(99, 102, 241, 0.22);
}

/* --------------------------- 滚动条美化 --------------------------- */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #c7d2fe, #a5b4fc);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #a5b4fc, #818cf8);
  background-clip: padding-box;
}

/* --------------------------- 通用文本与渐变 --------------------------- */
.gradient-text {
  background: linear-gradient(120deg, var(--brand-500) 0%, var(--brand-400) 45%, var(--brand-600) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-gradient {
  background: linear-gradient(120deg, var(--brand-500) 0%, var(--brand-400) 50%, var(--brand-600) 100%);
}

.brand-gradient-soft {
  background: linear-gradient(120deg, #eef2ff 0%, #f5f3ff 50%, #eef2ff 100%);
}

.glass {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.6);
}

.glass-dark {
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

/* --------------------------- 按钮 --------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.62rem 1.15rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.2;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.24s ease, background-color 0.24s ease, color 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn:active {
  transform: translateY(1px) scale(0.99);
}
.btn[disabled],
.btn.disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  color: #fff;
  background-image: linear-gradient(120deg, var(--brand-500), var(--brand-600));
  box-shadow: var(--shadow-md);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-accent {
  color: #fff;
  background-image: linear-gradient(120deg, #fb923c, var(--brand-accent));
  box-shadow: 0 12px 26px -12px rgba(249, 115, 22, 0.65);
}
.btn-accent:hover {
  transform: translateY(-2px);
}

.btn-outline {
  color: var(--brand-500);
  border-color: rgba(99, 102, 241, 0.4);
  background: rgba(255, 255, 255, 0.7);
}
.btn-outline:hover {
  background: var(--surface-tint);
  border-color: var(--brand-400);
  transform: translateY(-2px);
}

.btn-ghost {
  color: var(--ink-600);
  background: transparent;
}
.btn-ghost:hover {
  color: var(--brand-500);
  background: var(--surface-tint);
}

.btn-danger {
  color: #fff;
  background-image: linear-gradient(120deg, #f87171, #ef4444);
}
.btn-danger:hover {
  transform: translateY(-2px);
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
}
.btn-lg {
  padding: 0.85rem 1.7rem;
  font-size: 1rem;
}
.btn-block {
  width: 100%;
}

/* --------------------------- 卡片 --------------------------- */
.card-soft {
  background: var(--surface);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.hover-lift {
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.28s ease, border-color 0.28s ease;
}
.hover-lift:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(165, 180, 252, 0.9);
}

.card-media {
  overflow: hidden;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: linear-gradient(135deg, #eef2ff, #f5f3ff);
}
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.hover-lift:hover .card-media img {
  transform: scale(1.06);
}

/* --------------------------- 徽章与标签 --------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.badge-brand {
  color: var(--brand-500);
  background: var(--surface-tint);
}
.badge-accent {
  color: #c2410c;
  background: #ffedd5;
}
.badge-success {
  color: #047857;
  background: #d1fae5;
}
.badge-muted {
  color: var(--ink-600);
  background: #f1f5f9;
}
.badge-danger {
  color: #b91c1c;
  background: #fee2e2;
}

/* --------------------------- 表单 --------------------------- */
.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-600);
  margin-bottom: 0.4rem;
}

.input {
  width: 100%;
  padding: 0.68rem 0.95rem;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
  font-size: 0.92rem;
  color: var(--ink-900);
  transition: border-color 0.2s ease, box-shadow 0.24s ease, background-color 0.2s ease;
}
.input::placeholder {
  color: var(--ink-400);
}
.input:hover {
  border-color: #cbd5e1;
}
.input:focus {
  outline: none;
  border-color: var(--brand-400);
  box-shadow: 0 0 0 4px var(--ring);
}
.input-error {
  border-color: #fca5a5;
  background: #fff7f7;
}
.field-error {
  margin-top: 0.35rem;
  font-size: 0.78rem;
  color: #dc2626;
}

/* --------------------------- 导航 --------------------------- */
.nav-link {
  position: relative;
  padding: 0.35rem 0.1rem;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-600);
  text-decoration: none;
  transition: color 0.2s ease;
}
.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand-500), var(--brand-600));
  transform: scaleX(0);
  transition: transform 0.24s ease;
}
.nav-link:hover {
  color: var(--brand-500);
}
.nav-link:hover::after,
.nav-link.active::after {
  transform: scaleX(1);
}
.nav-link.active {
  color: var(--brand-500);
  font-weight: 600;
}

/* --------------------------- 区块标题 --------------------------- */
.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.section-subtitle {
  font-size: 0.88rem;
  color: var(--ink-600);
}

/* --------------------------- 分页 --------------------------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.page-link {
  min-width: 38px;
  height: 38px;
  padding: 0 0.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: var(--ink-600);
  font-size: 0.86rem;
  text-decoration: none;
  transition: all 0.2s ease;
}
.page-link:hover {
  color: var(--brand-500);
  border-color: var(--brand-400);
  transform: translateY(-2px);
}
.page-link.active {
  color: #fff;
  border-color: transparent;
  background-image: linear-gradient(120deg, var(--brand-500), var(--brand-600));
  box-shadow: var(--shadow-md);
}
.page-link.disabled {
  opacity: 0.45;
  pointer-events: none;
}

/* --------------------------- 表格 --------------------------- */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid #e2e8f0;
  background: #fff;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.data-table th {
  text-align: left;
  padding: 0.85rem 1rem;
  background: #f8fafc;
  color: var(--ink-600);
  font-weight: 600;
  white-space: nowrap;
}
.data-table td {
  padding: 0.85rem 1rem;
  border-top: 1px solid #f1f5f9;
  color: var(--ink-900);
  vertical-align: middle;
}
.data-table tbody tr {
  transition: background-color 0.18s ease;
}
.data-table tbody tr:hover {
  background: #fafbff;
}

/* --------------------------- 动效 --------------------------- */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes floatY {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}
@keyframes shimmer {
  0% {
    background-position: -400px 0;
  }
  100% {
    background-position: 400px 0;
  }
}
@keyframes pulseRing {
  0% {
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.35);
  }
  100% {
    box-shadow: 0 0 0 16px rgba(99, 102, 241, 0);
  }
}

.animate-fade-up {
  animation: fadeUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.animate-float {
  animation: floatY 6s ease-in-out infinite;
}
.delay-100 {
  animation-delay: 0.1s;
}
.delay-200 {
  animation-delay: 0.2s;
}
.delay-300 {
  animation-delay: 0.3s;
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .animate-fade-up,
  .animate-float,
  .reveal,
  .hover-lift,
  .btn {
    animation: none !important;
    transition: none !important;
  }
}

/* --------------------------- 公告跑马灯 --------------------------- */
.marquee {
  overflow: hidden;
  white-space: nowrap;
}
.marquee > span {
  display: inline-block;
  padding-left: 100%;
  animation: marquee 26s linear infinite;
}
@keyframes marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-100%);
  }
}

/* --------------------------- Toast --------------------------- */
#toast-container {
  position: fixed;
  top: 84px;
  right: 20px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  min-width: 240px;
  max-width: 340px;
  padding: 0.8rem 1rem;
  border-radius: 14px;
  color: #fff;
  font-size: 0.88rem;
  box-shadow: var(--shadow-lg);
  animation: fadeUp 0.35s ease both;
}
.toast-success {
  background: linear-gradient(120deg, #10b981, #059669);
}
.toast-error {
  background: linear-gradient(120deg, #f87171, #dc2626);
}
.toast-info {
  background: linear-gradient(120deg, var(--brand-500), var(--brand-600));
}

/* --------------------------- 价格 --------------------------- */
.price {
  color: #dc2626;
  font-weight: 700;
}
.price-origin {
  color: var(--ink-400);
  text-decoration: line-through;
  font-size: 0.82rem;
  font-weight: 400;
}

/* --------------------------- 侧边栏（后台） --------------------------- */
.admin-side-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.62rem 0.9rem;
  border-radius: 12px;
  color: rgba(226, 232, 240, 0.82);
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.2s ease;
}
.admin-side-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.admin-side-link.active {
  background: linear-gradient(120deg, rgba(99, 102, 241, 0.95), rgba(124, 58, 237, 0.95));
  color: #fff;
  box-shadow: var(--shadow-md);
}

/* --------------------------- 其他 --------------------------- */
.divider-soft {
  height: 1px;
  background: linear-gradient(90deg, transparent, #e2e8f0, transparent);
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.link-underline {
  color: var(--brand-500);
  text-decoration: none;
  border-bottom: 1px dashed rgba(79, 70, 229, 0.5);
  transition: all 0.2s ease;
}
.link-underline:hover {
  color: var(--brand-600);
  border-bottom-color: var(--brand-600);
}

/* 脚部 */
.site-footer {
  background: linear-gradient(160deg, #1e1b4b 0%, #312e81 55%, #4c1d95 100%);
  color: rgba(226, 232, 240, 0.85);
}
.site-footer a {
  color: rgba(226, 232, 240, 0.85);
  text-decoration: none;
  transition: color 0.2s ease;
}
.site-footer a:hover {
  color: #fff;
}

/* 页面主体最小高度，保证页脚贴底 */
.page-shell {
  min-height: calc(100vh - 380px);
}
