/* Vuetify base styles - 移到插件中导入 */
/* @import 'vuetify/styles'; */

/* 导入CSS变量系统 */
@import './variables.css';

/* 导入响应式工具类 */
@import './responsive.css';

/* UnoCSS 重置样式暂时禁用，避免与 Vuetify 冲突 */
/* @import '@unocss/reset/tailwind.css'; */

/* 全局基础样式 */
* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: auto;
  -moz-osx-font-smoothing: auto;
}

body {
  font-family: var(--font-sans);
  color: rgb(var(--color-text-primary));
  background: var(--gradient-surface);
  min-height: 100vh;
  margin: 0;
  padding: 0;
  line-height: var(--line-height-normal);
  background-attachment: fixed;
}

/* Vuetify integration */
.v-application {
  font-family: var(--font-sans) !important;
}

/* Naive UI integration */
.n-config-provider {
  font-family: var(--font-sans);
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: var(--spacing-1-5);
  height: var(--spacing-1-5);
}

::-webkit-scrollbar-track {
  background: rgb(var(--color-background-secondary));
  border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb {
  background: rgb(var(--color-border-secondary));
  border-radius: var(--radius-sm);
  transition: var(--transition-colors);
}

::-webkit-scrollbar-thumb:hover {
  background: rgb(var(--color-border-hover));
}

/* 焦点样式 */
:focus-visible {
  outline: var(--border-width-2) solid rgb(var(--color-border-focus));
  outline-offset: var(--border-width-2);
  border-radius: var(--radius-sm);
}

/* 选择文本样式 */
::selection {
  background-color: rgb(var(--color-primary));
  color: rgb(var(--color-text-inverse));
}

/* 动画类 */
.animate-fade-in {
  animation: fadeIn var(--duration-300) var(--ease-in-out);
}

.animate-slide-up {
  animation: slideUp var(--duration-300) var(--ease-out);
}

.animate-pulse-slow {
  animation: pulse var(--duration-1000) var(--ease-in-out) infinite;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* 工具类 */
.text-balance {
  text-wrap: balance;
}

.text-pretty {
  text-wrap: pretty;
}

.screen-reader-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* 响应式容器 */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

@media (min-width: 640px) {
  .container {
    padding: 0 var(--spacing-lg);
  }
}

@media (min-width: 1024px) {
  .container {
    padding: 0 var(--spacing-xl);
  }
}

.shadow-custom {
  box-shadow: var(--shadow-lg);
}

/* 特殊效果色彩 */
.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-gradient-secondary {
  background: var(--gradient-secondary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 玻璃态效果 */
.glass-effect {
  background: rgba(255, 255, 255, 0.7) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  box-shadow: 0 8px 32px rgba(139, 92, 246, 0.1) !important;
}

/* 发光效果 */
.glow-effect {
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.3) !important;
}

.glow-effect-primary {
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.4) !important;
}

.glow-effect-secondary {
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.4) !important;
}

/* 浮动动画 */
.float-animation {
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

/* 脉冲效果 */
.pulse-effect {
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 5px rgba(139, 92, 246, 0.3); }
  50% { box-shadow: 0 0 20px rgba(139, 92, 246, 0.6); }
}

/* Vuetify specific enhancements */
.v-card {
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-md) !important;
  transition: var(--transition-transform) !important;
  background: rgb(var(--color-background-card)) !important;
  backdrop-filter: blur(10px) !important;
  border: 1px solid rgba(var(--color-border-primary), 0.5) !important;
}

.v-card:hover {
  transform: translateY(-2px) !important;
  box-shadow: var(--shadow-lg) !important;
  border-color: rgba(var(--color-border-accent), 0.3) !important;
}

.v-btn {
  border-radius: var(--radius-md) !important;
  font-weight: 500 !important;
  text-transform: none !important;
  letter-spacing: 0.5px !important;
  transition: var(--transition-transform) !important;
  position: relative !important;
  overflow: hidden !important;
}

.v-btn::before {
  content: '' !important;
  position: absolute !important;
  top: 0 !important;
  left: -100% !important;
  width: 100% !important;
  height: 100% !important;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent) !important;
  transition: left 0.5s !important;
}

.v-btn:hover::before {
  left: 100% !important;
}

.v-btn:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3) !important;
}

.v-field__field {
  border-radius: var(--radius-md) !important;
}

.v-data-table__th {
  font-weight: 600 !important;
  color: rgb(var(--color-text-primary)) !important;
  background-color: rgb(var(--color-background-secondary)) !important;
}

.v-data-table__td {
  border-bottom: 1px solid rgb(var(--color-border-secondary)) !important;
}

/* Vuetify app bar enhancement */
.v-app-bar {
  border-radius: 0 !important;
}

.v-tabs {
  border-radius: var(--radius-md) !important;
}

.v-tab {
  text-transform: none !important;
  letter-spacing: 0.5px !important;
  font-weight: 500 !important;
  border-radius: var(--radius-md) !important;
}

.v-expansion-panel {
  border-radius: var(--radius-lg) !important;
  margin-bottom: var(--spacing-2) !important;
}

.v-expansion-panel-text {
  border-radius: 0 0 var(--radius-lg) var(--radius-lg) !important;
}

.v-alert {
  border-radius: var(--radius-md) !important;
}

.v-progress-linear {
  border-radius: var(--radius-sm) !important;
}

.v-chip {
  border-radius: var(--radius-full) !important;
  font-weight: 500 !important;
}

.v-dialog .v-card {
  border-radius: var(--radius-xl) !important;
}

/* Naive UI specific enhancements */
.n-button {
  border-radius: var(--radius-md) !important;
  font-weight: 500 !important;
  transition: var(--transition-transform) !important;
}

.n-button:hover {
  transform: translateY(-1px) !important;
}

.n-input {
  border-radius: var(--radius-md) !important;
}

.n-card {
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-md) !important;
  transition: var(--transition-transform) !important;
}

.n-card:hover {
  transform: translateY(-2px) !important;
  box-shadow: var(--shadow-lg) !important;
}

/* Status badges for both frameworks */
.status-badge {
  padding: var(--spacing-1) var(--spacing-3);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-1);
}

.status-badge.success {
  background-color: rgb(var(--color-success-100));
  color: rgb(var(--color-success-700));
}

.status-badge.warning {
  background-color: rgb(var(--color-warning-100));
  color: rgb(var(--color-warning-700));
}

.status-badge.error {
  background-color: rgb(var(--color-error-100));
  color: rgb(var(--color-error-700));
}

.status-badge.info {
  background-color: rgb(var(--color-info-100));
  color: rgb(var(--color-info-700));
}

/* Loading states */
.loading-skeleton {
  background: linear-gradient(
    90deg,
    rgb(var(--color-background-secondary)) 25%,
    rgb(var(--color-border-secondary)) 50%,
    rgb(var(--color-background-secondary)) 75%
  );
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

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

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  body {
    background: linear-gradient(
      135deg,
      #0f172a 0%,
      #1e293b 50%,
      #334155 100%
    );
    background-attachment: fixed;
    min-height: 100vh;
  }

  .glass-effect {
    background: rgba(15, 23, 42, 0.6) !important;
    border-color: rgba(148, 163, 184, 0.2) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
  }

  .v-card {
    background-color: rgba(30, 41, 59, 0.8) !important;
    border: 1px solid rgba(148, 163, 184, 0.2) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
  }

  .v-data-table__th {
    background-color: rgba(30, 41, 59, 0.9) !important;
    color: #f1f5f9 !important;
  }

  .v-data-table__td {
    border-bottom-color: rgba(148, 163, 184, 0.2) !important;
  }

  .v-expansion-panel {
    background-color: rgba(30, 41, 59, 0.8) !important;
    border: 1px solid rgba(148, 163, 184, 0.2) !important;
  }

  .v-field {
    background-color: rgba(30, 41, 59, 0.8) !important;
  }

  .v-alert {
    background-color: rgba(30, 41, 59, 0.8) !important;
    border: 1px solid rgba(148, 163, 184, 0.2) !important;
  }

  .glow-effect {
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.4) !important;
  }

  .glow-effect-primary {
    box-shadow: 0 0 20px rgba(167, 139, 250, 0.4) !important;
  }

  .glow-effect-secondary {
    box-shadow: 0 0 20px rgba(34, 211, 238, 0.4) !important;
  }

  /* 文本颜色优化 */
  .text-on-surface {
    color: #f1f5f9 !important;
  }

  .opacity-90 {
    opacity: 0.9 !important;
  }

  /* 按钮和交互元素 */
  .v-btn {
    background-color: rgba(30, 41, 59, 0.8) !important;
    border-color: rgba(148, 163, 184, 0.3) !important;
  }

  .v-btn:hover {
    background-color: rgba(51, 65, 85, 0.9) !important;
  }

  /* 文本和标题优化 */
  h1, h2, h3, h4, h5, h6 {
    color: #f1f5f9 !important;
  }

  .text-h4, .text-h6, .text-body-2 {
    color: #f1f5f9 !important;
  }

  /* 输入字段优化 */
  .v-text-field,
  .v-select,
  .v-textarea {
    background-color: rgba(30, 41, 59, 0.8) !important;
  }

  .v-text-field .v-field__input,
  .v-select .v-field__input,
  .v-textarea .v-field__input {
    color: #f1f5f9 !important;
  }

  .v-text-field .v-label,
  .v-select .v-label,
  .v-textarea .v-label {
    color: rgba(241, 245, 249, 0.7) !important;
  }

  /* 分隔线优化 */
  .v-divider {
    border-color: rgba(148, 163, 184, 0.2) !important;
  }

  /* 进度条优化 */
  .v-progress-linear {
    background-color: rgba(148, 163, 184, 0.2) !important;
  }

  .v-progress-linear__determinate {
    background: linear-gradient(90deg, var(--v-theme-primary), var(--v-theme-secondary)) !important;
  }

  /* 工具提示优化 */
  .v-tooltip .v-card {
    background-color: rgba(15, 23, 42, 0.95) !important;
    border: 1px solid rgba(148, 163, 184, 0.3) !important;
    color: #f1f5f9 !important;
  }

  /* 徽章和指示器优化 */
  .v-badge__badge {
    background-color: var(--v-theme-primary) !important;
    color: white !important;
  }

  /* 开关优化 */
  .v-switch .v-selection-control {
    color: var(--v-theme-primary) !important;
  }

  /* 复选框和单选按钮优化 */
  .v-checkbox .v-selection-control,
  .v-radio .v-selection-control {
    color: var(--v-theme-primary) !important;
  }

  /* 滑块优化 */
  .v-slider__track-fill {
    background: var(--v-theme-primary) !important;
  }

  .v-slider__thumb {
    background: var(--v-theme-primary) !important;
    border: 2px solid #1e293b !important;
  }

  /* 面包屑优化 */
  .v-breadcrumb {
    color: rgba(241, 245, 249, 0.7) !important;
  }

  .v-breadcrumb-item--active {
    color: #f1f5f9 !important;
  }

  /* 步骤器优化 */
  .v-stepper {
    background-color: transparent !important;
  }

  .v-stepper-header {
    background-color: rgba(30, 41, 59, 0.8) !important;
  }

  /* 时间线优化 */
  .v-timeline-divider__dot {
    background-color: var(--v-theme-primary) !important;
  }

  /* 虚拟键盘优化 */
  .v-bottom-navigation {
    background: linear-gradient(
      135deg,
      rgba(15, 23, 42, 0.95) 0%,
      rgba(30, 41, 59, 0.95) 100%
    ) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-top: 1px solid rgba(148, 163, 184, 0.2) !important;
  }

  /* 系统栏优化 */
  .v-system-bar {
    background: linear-gradient(
      135deg,
      rgba(15, 23, 42, 0.95) 0%,
      rgba(30, 41, 59, 0.95) 100%
    ) !important;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2) !important;
  }

  /* 消息提示优化 */
  .v-snackbar {
    background: linear-gradient(
      135deg,
      rgba(15, 23, 42, 0.95) 0%,
      rgba(30, 41, 59, 0.95) 100%
    ) !important;
    border: 1px solid rgba(148, 163, 184, 0.3) !important;
    color: #f1f5f9 !important;
  }

  /* 通知优化 */
  .v-notification {
    background: linear-gradient(
      135deg,
      rgba(15, 23, 42, 0.95) 0%,
      rgba(30, 41, 59, 0.95) 100%
    ) !important;
    border: 1px solid rgba(148, 163, 184, 0.3) !important;
    color: #f1f5f9 !important;
  }
}

/* Vuetify dark mode theme integration */
.v-theme--dark {
  .v-card {
    background-color: rgba(30, 41, 59, 0.8) !important;
    border: 1px solid rgba(148, 163, 184, 0.2) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
  }

  .v-expansion-panel {
    background-color: rgba(30, 41, 59, 0.8) !important;
    border: 1px solid rgba(148, 163, 184, 0.2) !important;
  }

  .v-field__outline {
    --v-field-border-opacity: 0.3 !important;
  }

  .v-alert {
    background-color: rgba(30, 41, 59, 0.8) !important;
    border: 1px solid rgba(148, 163, 184, 0.2) !important;
  }

  .v-tabs .v-tab {
    color: rgba(241, 245, 249, 0.7) !important;
  }

  .v-tabs .v-tab.v-tab--selected {
    color: #f1f5f9 !important;
  }

  .v-app-bar {
    background: linear-gradient(
      135deg,
      rgba(15, 23, 42, 0.9) 0%,
      rgba(30, 41, 59, 0.9) 50%,
      rgba(51, 65, 85, 0.9) 100%
    ) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
  }

  .v-navigation-drawer {
    background: linear-gradient(
      180deg,
      rgba(15, 23, 42, 0.95) 0%,
      rgba(30, 41, 59, 0.95) 100%
    ) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-right: 1px solid rgba(148, 163, 184, 0.2) !important;
  }

  .v-list-item {
    color: #f1f5f9 !important;
  }

  .v-list-item:hover {
    background-color: rgba(51, 65, 85, 0.5) !important;
  }

  .v-list-item--active {
    background-color: rgba(139, 92, 246, 0.2) !important;
    color: #a78bfa !important;
  }

  .v-footer {
    background: linear-gradient(
      135deg,
      rgba(15, 23, 42, 0.9) 0%,
      rgba(30, 41, 59, 0.9) 100%
    ) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-top: 1px solid rgba(148, 163, 184, 0.2) !important;
  }

  .glass-effect {
    background: rgba(15, 23, 42, 0.6) !important;
    border-color: rgba(148, 163, 184, 0.2) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
  }

  .glow-effect {
    box-shadow: 0 0 20px rgba(167, 139, 250, 0.4) !important;
  }

  .glow-effect-primary {
    box-shadow: 0 0 20px rgba(167, 139, 250, 0.4) !important;
  }

  .glow-effect-secondary {
    box-shadow: 0 0 20px rgba(34, 211, 238, 0.4) !important;
  }

  /* 表单字段优化 */
  .v-field__input {
    color: #f1f5f9 !important;
  }

  .v-label {
    color: rgba(241, 245, 249, 0.7) !important;
  }

  .v-text-field .v-input__details {
    color: rgba(241, 245, 249, 0.6) !important;
  }

  /* 数据表格优化 */
  .v-data-table {
    background: transparent !important;
  }

  .v-data-table .v-table__wrapper > table > thead > tr > th {
    background-color: rgba(30, 41, 59, 0.9) !important;
    color: #f1f5f9 !important;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2) !important;
  }

  .v-data-table .v-table__wrapper > table > tbody > tr > td {
    color: #e2e8f0 !important;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1) !important;
  }

  .v-data-table .v-table__wrapper > table > tbody > tr:hover {
    background-color: rgba(51, 65, 85, 0.3) !important;
  }

  /* 按钮优化 */
  .v-btn {
    background-color: rgba(30, 41, 59, 0.8) !important;
    border: 1px solid rgba(148, 163, 184, 0.3) !important;
  }

  .v-btn:hover {
    background-color: rgba(51, 65, 85, 0.9) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3) !important;
  }

  .v-btn--variant-flat {
    background-color: rgba(139, 92, 246, 0.2) !important;
  }

  .v-btn--variant-outlined {
    background-color: transparent !important;
    border: 1px solid rgba(139, 92, 246, 0.5) !important;
  }

  /* 芯片和标签优化 */
  .v-chip {
    background-color: rgba(51, 65, 85, 0.8) !important;
    color: #e2e8f0 !important;
    border: 1px solid rgba(148, 163, 184, 0.2) !important;
  }

  .v-chip.v-chip--variant-tonal {
    background-color: rgba(139, 92, 246, 0.2) !important;
    color: #a78bfa !important;
  }

  /* 对话框优化 */
  .v-dialog .v-card {
    background: linear-gradient(
      135deg,
      rgba(15, 23, 42, 0.95) 0%,
      rgba(30, 41, 59, 0.95) 100%
    ) !important;
    border: 1px solid rgba(148, 163, 184, 0.3) !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5) !important;
  }

  /* 菜单优化 */
  .v-menu .v-card {
    background: linear-gradient(
      135deg,
      rgba(15, 23, 42, 0.95) 0%,
      rgba(30, 41, 59, 0.95) 100%
    ) !important;
    border: 1px solid rgba(148, 163, 184, 0.3) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4) !important;
  }

  .v-list-item:hover {
    background-color: rgba(51, 65, 85, 0.6) !important;
  }
}

/* Framework integration utilities */
.framework-integrated {
  /* Ensures both Vuetify and Naive UI components work harmoniously */
  font-family: var(--font-sans) !important;
}

.framework-integrated .v-card,
.framework-integrated .n-card {
  transition: var(--transition-transform), var(--transition-shadow) !important;
}

.framework-integrated .v-btn,
.framework-integrated .n-button {
  transition: var(--transition-transform) !important;
}

/* Enhanced focus visible for better accessibility */
.framework-integrated :focus-visible {
  outline: var(--border-width-2) solid rgb(var(--color-primary)) !important;
  outline-offset: var(--border-width-2) !important;
}

/* Consistent spacing utilities */
.spacing-consistent .v-card,
.spacing-consistent .n-card {
  margin-bottom: var(--spacing-4) !important;
}

.spacing-consistent .v-expansion-panel,
.spacing-consistent .n-collapse-item {
  margin-bottom: var(--spacing-2) !important;
}
