/* === 立刻查 - 主样式文件 === */

/* 基础样式 */
@import url('./base/variables.css');
@import url('./base/reset.css');

/* 组件样式 */
@import url('./components/buttons.css');
@import url('./components/chat.css');

/* === Font Awesome 图标支持 === */
.fas, .far, .fab {
  font-family: 'Font Awesome 6 Free', 'Font Awesome 6 Brands';
  font-weight: 900;
}

/* === 通用工具类 === */
.hidden {
  display: none !important;
}

.visible {
  display: block !important;
}

.flex {
  display: flex !important;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.w-full {
  width: 100%;
}

.h-full {
  height: 100%;
}

.pointer {
  cursor: pointer;
}

.no-select {
  user-select: none;
}

.overflow-hidden {
  overflow: hidden;
}

.overflow-auto {
  overflow: auto;
}

.relative {
  position: relative;
}

.absolute {
  position: absolute;
}

.fixed {
  position: fixed;
}

.z-10 {
  z-index: 10;
}

.z-50 {
  z-index: 50;
}

.z-100 {
  z-index: 100;
}

/* === 间距工具类 === */
.m-0 { margin: 0; }
.m-1 { margin: 0.25rem; }
.m-2 { margin: 0.5rem; }
.m-3 { margin: 0.75rem; }
.m-4 { margin: 1rem; }
.m-6 { margin: 1.5rem; }
.m-8 { margin: 2rem; }

.p-0 { padding: 0; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }

.pt-0 { padding-top: 0; }
.pt-1 { padding-top: 0.25rem; }
.pt-2 { padding-top: 0.5rem; }
.pt-3 { padding-top: 0.75rem; }
.pt-4 { padding-top: 1rem; }
.pt-6 { padding-top: 1.5rem; }
.pt-8 { padding-top: 2rem; }

.pb-0 { padding-bottom: 0; }
.pb-1 { padding-bottom: 0.25rem; }
.pb-2 { padding-bottom: 0.5rem; }
.pb-3 { padding-bottom: 0.75rem; }
.pb-4 { padding-bottom: 1rem; }
.pb-6 { padding-bottom: 1.5rem; }
.pb-8 { padding-bottom: 2rem; }

/* === 文字工具类 === */
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }

.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* === 颜色工具类 === */
.text-primary { color: var(--primary-green); }
.text-secondary { color: var(--secondary-blue); }
.text-gray-500 { color: var(--neutral-gray-500); }
.text-gray-600 { color: var(--neutral-gray-600); }
.text-gray-700 { color: var(--neutral-gray-700); }
.text-gray-900 { color: var(--neutral-gray-900); }

.bg-primary { background-color: var(--primary-green); }
.bg-secondary { background-color: var(--secondary-blue); }
.bg-white { background-color: var(--neutral-white); }
.bg-gray-50 { background-color: var(--neutral-gray-50); }
.bg-gray-100 { background-color: var(--neutral-gray-100); }

/* === 边框和圆角 === */
.border { border: 1px solid var(--neutral-gray-200); }
.border-primary { border-color: var(--primary-green); }
.border-gray-200 { border-color: var(--neutral-gray-200); }
.border-gray-300 { border-color: var(--neutral-gray-300); }

.rounded { border-radius: 0.25rem; }
.rounded-md { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-full { border-radius: 50%; }

/* === 阴影 === */
.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
.shadow { box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06); }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); }
.shadow-xl { box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); }

/* === 过渡动画 === */
.transition { transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-all { transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-colors { transition-property: color, background-color, border-color, text-decoration-color, fill, stroke; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-opacity { transition-property: opacity; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-transform { transition-property: transform; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }

.duration-75 { transition-duration: 75ms; }
.duration-100 { transition-duration: 100ms; }
.duration-150 { transition-duration: 150ms; }
.duration-200 { transition-duration: 200ms; }
.duration-300 { transition-duration: 300ms; }
.duration-500 { transition-duration: 500ms; }

.ease-in { transition-timing-function: cubic-bezier(0.4, 0, 1, 1); }
.ease-out { transition-timing-function: cubic-bezier(0, 0, 0.2, 1); }
.ease-in-out { transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }

/* === 变换 === */
.transform { transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); }
.scale-95 { --tw-scale-x: .95; --tw-scale-y: .95; transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); }
.scale-100 { --tw-scale-x: 1; --tw-scale-y: 1; transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); }
.scale-105 { --tw-scale-x: 1.05; --tw-scale-y: 1.05; transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); }

/* === 毛玻璃效果工具类 === */
.glass {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-backdrop);
  -webkit-backdrop-filter: var(--glass-backdrop);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

.glass-strong {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* === 加载动画 === */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

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

@keyframes bounce {
  0%, 100% { 
    transform: translateY(-25%);
    animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
  }
  50% { 
    transform: translateY(0);
    animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
  }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-bounce {
  animation: bounce 1s infinite;
}

/* === 滚动条样式 === */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

/* === 选择文本样式 === */
::selection {
  background: var(--primary-green-alpha);
  color: var(--primary-green-dark);
}

::-moz-selection {
  background: var(--primary-green-alpha);
  color: var(--primary-green-dark);
}

/* === 焦点样式 === */
*:focus {
  outline: 2px solid var(--primary-green);
  outline-offset: 2px;
}

*:focus:not(:focus-visible) {
  outline: none;
}

/* === 深色模式优化 === */
[data-theme="dark"] {
  /* 重新定义深色模式下的中性色 */
  --neutral-gray-50: #1e293b;
  --neutral-gray-100: #334155;
  --neutral-gray-200: #475569;
  --neutral-gray-300: #64748b;
  --neutral-gray-400: #94a3b8;
  --neutral-gray-500: #cbd5e1;
  --neutral-gray-600: #e2e8f0;
  --neutral-gray-700: #f1f5f9;
  --neutral-gray-800: #f8fafc;
  --neutral-gray-900: #f8fafc;
  --neutral-white: #1e293b;
  
  /* 深色模式下的毛玻璃效果 */
  --glass-bg: rgba(15, 23, 42, 0.7);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] body {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
  color: var(--neutral-gray-900);
}

[data-theme="dark"] ::-webkit-scrollbar-track {
  background: rgba(30, 41, 59, 0.7);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.8);
  transition: background-color 0.2s ease;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: rgba(203, 213, 225, 0.9);
}

[data-theme="dark"] ::selection {
  background: rgba(87, 180, 1, 0.3);
  color: var(--primary-green-light);
}

[data-theme="dark"] ::-moz-selection {
  background: rgba(87, 180, 1, 0.3);
  color: var(--primary-green-light);
}

/* === 无障碍性优化 === */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
  :root {
    --primary-green: #0f5132;
    --primary-green-light: #198754;
    --primary-green-dark: #0a3622;
    --neutral-gray-500: #495057;
    --neutral-gray-600: #343a40;
    --neutral-gray-700: #212529;
  }
  
  .glass {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid var(--neutral-gray-300);
  }
}

/* === 打印样式 === */
@media print {
  .top-header,
  .action-btn,
  .input-container,
  .typing-indicator,
  .loading-overlay {
    display: none !important;
  }
  
  .messages-list {
    padding: 0 !important;
  }
  
  .message-bubble {
    background: white !important;
    border: 1px solid #000 !important;
    box-shadow: none !important;
  }
  
  .user .message-bubble {
    background: #f8f9fa !important;
  }
}

/* 游客访问拒绝提示框 */
.guest-access-denied-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
}

.guest-access-denied-modal .modal-overlay {
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.guest-access-denied-modal .modal-content {
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 450px;
  width: 90%;
  max-height: 90vh;
  overflow: hidden;
  animation: modalSlideIn 0.3s ease-out;
}

.guest-access-denied-modal .modal-header {
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
  color: white;
  padding: 24px;
  text-align: center;
}

.guest-access-denied-modal .modal-header i {
  font-size: 48px;
  margin-bottom: 12px;
  display: block;
}

.guest-access-denied-modal .modal-header h3 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
}

.guest-access-denied-modal .modal-body {
  padding: 32px 24px;
  text-align: center;
  background: #f8f9fa;
}

.guest-access-denied-modal .modal-body p {
  margin: 0;
  font-size: 16px;
  color: #555;
  line-height: 1.6;
}

.guest-access-denied-modal .modal-footer {
  padding: 20px 24px 24px;
  display: flex;
  gap: 12px;
  justify-content: center;
  background: white;
}

.guest-access-denied-modal .btn-primary {
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.guest-access-denied-modal .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(52, 152, 219, 0.3);
}

.guest-access-denied-modal .btn-secondary {
  background: #95a5a6;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.guest-access-denied-modal .btn-secondary:hover {
  background: #7f8c8d;
  transform: translateY(-1px);
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* === 页脚样式 === */
.site-footer {
  padding: 15px 0;
  text-align: center;
  font-size: 12px;
  color: var(--footer-text, #bdc3c7);
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.footer-text {
  margin: 0;
  line-height: 1.5;
}

.footer-text a {
  color: var(--footer-text, #bdc3c7);
  text-decoration: none;
  margin: 0 3px;
  transition: color 0.3s ease;
}

.footer-text a:hover {
  color: var(--primary-green-dark);
  text-decoration: none;
}

/* 深色主题下的footer样式 */
[data-theme="dark"] .site-footer {
  --footer-text: #6c757d;
}


/* 响应式设计 */
@media (max-width: 768px) {
  .footer-content {
    padding: 0 15px;
  }
  
  .footer-text {
    font-size: 11px;
  }
  
  .footer-text a {
    margin: 0 4px;
  }
}

/* 移动端小屏幕优化 - 改为静态定位 */
@media (max-width: 480px) {
  .site-footer {
    position: static; /* 改为静态定位，跟随内容流 */
    padding: 10px 0;
    font-size: 11px;
  }
  
  .footer-content {
    padding: 0 10px;
  }
  
  .footer-text {
    font-size: 10px;
    line-height: 1.4;
  }
  
  .footer-text a {
    margin: 0 2px;
  }
}

/* 极小屏幕优化 (高度小于600px) */
@media (max-height: 600px) {
  /* 在极小屏幕高度时，如果宽度也是移动端，使用静态定位 */
}

@media (max-height: 600px) and (min-width: 481px) {
  /* 只有在桌面端但屏幕高度很小时才保持固定定位并优化尺寸 */
  .site-footer {
    padding: 10px 0;
    font-size: 10px;
  }
  
  .footer-text {
    font-size: 9px;
  }
}

/* 横屏模式优化 */
@media (max-height: 500px) and (orientation: landscape) and (min-width: 481px) {
  /* 只在非移动端的横屏模式下应用 */
  .site-footer {
    padding: 8px 0;
    font-size: 9px;
  }
  
  .footer-text {
    font-size: 8px;
  }
} 