/* 现代化计算力学资源网站样式 */

:root {
  /* 现代色彩系统 */
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --accent-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --dark-gradient: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  
  /* 科技蓝调色彩 */
  --tech-blue: #2563eb;
  --tech-indigo: #1e40af;
  --tech-purple: #7c3aed;
  --tech-cyan: #0891b2;
  --tech-slate: #475569;
  
  /* 中性色彩 */
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-600: #475569;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  
  /* 阴影系统 */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  
  /* 圆角系统 */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  
  /* 间距系统 */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
}

/* 全局样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: var(--gray-800);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
}

/* 英雄区域 */
.hero-section {
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
  opacity: 0.3;
}

/* 导航栏现代化 */
.navbar {
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  padding: 1rem 0;
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.5rem;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-link {
  font-weight: 500;
  color: var(--gray-600) !important;
  transition: all 0.3s ease;
  position: relative;
}

.nav-link:hover {
  color: var(--tech-blue) !important;
  transform: translateY(-1px);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-gradient);
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

/* 卡片现代化 */
.card {
  border: none;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
}

.card-title {
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 1rem;
  line-height: 1.3;
}

.card-text {
  color: var(--gray-600);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

/* 分类卡片特殊样式 */
.category-card {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(17, 24, 39, 0.12);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
}

.category-card::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  pointer-events: none;
}

/* 数学基础卡片 */
.math-card .card-title {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* 有限元理论卡片 */
.fea-card .card-title {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* 编程实现卡片 */
.programming-card .card-title {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* 在线工具卡片 */
.tools-card .card-title {
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tools-card {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

/* 首页分类区块高对比背景 */
.categories-section {
  padding: 4rem 0;
  background: transparent;
}

/* 分类图标容器增强对比 */
.category-icon {
  width: 64px;
  height: 64px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.8);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
}

/* 工具页高对比背景与卡片样式 */
.tool-contrast-dark {
  padding: 4rem 0;
  background: linear-gradient(135deg, #0b1220 0%, #122033 100%);
}

.tool-contrast-dark .tool-card {
  background: #ffffff;
  border: 1px solid rgba(17, 24, 39, 0.15);
  box-shadow: var(--shadow-xl);
  color: var(--gray-800);
}

.tool-contrast-dark .result-card {
  background: #ffffff;
  border: 1px solid rgba(17, 24, 39, 0.12);
  box-shadow: var(--shadow-lg);
  color: var(--gray-800);
}

.tool-contrast-dark .result-card .text-white,
.tool-contrast-dark .text-white,
.tool-contrast-dark .text-white-50 {
  color: var(--gray-800) !important;
}

.tool-contrast-dark .text-gradient {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tool-contrast-dark .input-group-text {
  background: #f1f5f9;
  color: #0f172a;
  border: 1px solid #e2e8f0;
}

.tool-contrast-dark .matrix-input,
.tool-contrast-dark .tool-input,
.tool-contrast-dark .form-control {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #e2e8f0;
}

.tool-contrast-dark .form-control:focus {
  border-color: var(--tech-blue);
  box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.25);
}

/* 热门资源区域 */
.hot-resources-section {
  margin-top: 4rem;
  padding-top: 3rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.hot-resources-title {
  color: white;
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 3rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 资源标签样式 */
.badge-custom {
  background: var(--accent-gradient);
  color: white;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
  display: inline-block;
}

/* 工具页面现代化 */
.tool-container {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl);
  padding: 2.5rem;
  margin: 2rem auto;
  max-width: 800px;
}

.tool-header {
  text-align: center;
  margin-bottom: 2rem;
}

.tool-title {
  font-size: 2rem;
  font-weight: 700;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
}

.tool-description {
  color: var(--gray-600);
  font-size: 1.1rem;
}

/* 按钮现代化 */
.btn {
  border-radius: var(--radius-lg);
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  transition: all 0.3s ease;
  border: none;
  position: relative;
  overflow: hidden;
}

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

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background: var(--primary-gradient);
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-light {
  background: rgba(255, 255, 255, 0.9);
  color: var(--gray-800);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-outline-light {
  border: 2px solid rgba(255, 255, 255, 0.5);
  color: white;
  background: transparent;
}

.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: white;
}

/* 表单现代化 */
.form-control {
  border-radius: var(--radius-lg);
  border: 2px solid var(--gray-200);
  padding: 0.75rem 1rem;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.9);
}

.form-control:focus {
  border-color: var(--tech-blue);
  box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.25);
  background: white;
  transform: translateY(-1px);
}

.form-label {
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 0.5rem;
}

/* 表格现代化 */
.table {
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.table thead th {
  background: var(--primary-gradient);
  color: white;
  font-weight: 600;
  border: none;
  padding: 1rem;
}

.table tbody tr {
  transition: all 0.3s ease;
}

.table tbody tr:hover {
  background: rgba(37, 99, 235, 0.05);
  transform: scale(1.01);
}

/* 代码块现代化 */
.code-block {
  background: #1e293b;
  color: #e2e8f0;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  font-family: 'Fira Code', 'Consolas', monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  overflow-x: auto;
  box-shadow: var(--shadow-lg);
  border: 1px solid #334155;
}

.code-block .keyword {
  color: #f472b6;
}

.code-block .string {
  color: #34d399;
}

.code-block .comment {
  color: #64748b;
  font-style: italic;
}

/* 警告框现代化 */
.alert {
  border: none;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}

.alert::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}

.alert-info {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(147, 197, 253, 0.1) 100%);
  color: #1e40af;
}

.alert-info::before {
  background: #3b82f6;
}

.alert-warning {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(254, 243, 199, 0.1) 100%);
  color: #92400e;
}

.alert-warning::before {
  background: #f59e0b;
}

.alert-success {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(187, 247, 208, 0.1) 100%);
  color: #166534;
}

.alert-success::before {
  background: #22c55e;
}

/* 结果展示区域 */
.result-container {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.95) 100%);
  border-radius: var(--radius-2xl);
  padding: 2rem;
  margin-top: 2rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.3);
  position: relative;
  overflow: hidden;
}

.result-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--accent-gradient);
}

.result-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
}

.result-title::before {
  content: '';
  width: 4px;
  height: 20px;
  background: var(--accent-gradient);
  margin-right: 0.75rem;
  border-radius: 2px;
}

.result-content {
  font-family: 'Fira Code', 'Consolas', monospace;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--gray-700);
  background: #f8fafc;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid #e2e8f0;
}

/* 动画效果 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

.animate-fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

.animate-pulse {
  animation: pulse 2s infinite;
}

/* 加载动画 */
.loading-shimmer {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* 响应式设计优化 */
@media (max-width: 768px) {
  .navbar {
    padding: 0.75rem 0;
  }
  
  .navbar-brand {
    font-size: 1.25rem;
  }
  
  .card {
    margin-bottom: 1rem;
  }
  
  .tool-container {
    padding: 1.5rem;
    margin: 1rem;
  }
  
  .hot-resources-title {
    font-size: 1.5rem;
  }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
  body {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #e2e8f0;
  }
  
  .navbar {
    background: rgba(30, 41, 59, 0.95) !important;
  }
  
  .card {
    background: rgba(30, 41, 59, 0.9);
    color: #e2e8f0;
  }
  
  .form-control {
    background: rgba(30, 41, 59, 0.9);
    color: #e2e8f0;
    border-color: #475569;
  }
}

/* 特殊效果 */
.glow-effect {
  box-shadow: 0 0 20px rgba(37, 99, 235, 0.3);
}

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

/* 列表和链接美化 */
.list-group-item {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  margin-bottom: 0.5rem;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.8);
}

.list-group-item:hover {
  background: rgba(255, 255, 255, 0.95);
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
}

/* 响应式字体 */
html {
  font-size: 16px;
}

@media (max-width: 768px) {
  html {
    font-size: 14px;
  }
}

/* 工具提示 */
.tooltip {
  font-size: 0.875rem;
  background: var(--gray-800);
  color: white;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
}

/* 浮动动画 */
@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

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

.floating-card {
  animation: float 6s ease-in-out infinite;
}

.floating-card .card:nth-child(2) {
  animation: float-reverse 8s ease-in-out infinite;
}

.floating-card .card:nth-child(3) {
  animation: float 10s ease-in-out infinite;
}

/* 页面头部区域 */
.page-header-section {
  padding-top: 100px;
  padding-bottom: 4rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  position: relative;
  overflow: hidden;
}

.page-header-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
  opacity: 0.3;
}

.page-header-content {
  position: relative;
  z-index: 2;
}

.page-header-visual {
  position: relative;
  z-index: 2;
}

.min-vh-50 {
  min-height: 50vh;
}

/* 主要内容区域 */
.main-content-section {
  padding: 4rem 0;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

/* 搜索区域 */
.search-area {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-2xl);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.search-box .input-group-text {
  background: var(--primary-gradient);
  color: white;
  border: none;
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  padding: 0.75rem 1rem;
}

.search-box .form-control {
  border-left: none;
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  padding: 0.75rem 1rem;
  font-size: 1.1rem;
}

.search-box .form-control:focus {
  border-color: var(--tech-blue);
  box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.25);
}

/* 资源统计 */
.resource-stats {
  padding: 1rem;
}

.stat-item {
  display: inline-block;
  text-align: center;
  margin: 0 1rem;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-label {
  color: var(--gray-600);
  font-size: 0.9rem;
  font-weight: 500;
}

/* 资源卡片 */
.resource-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
  height: 100%;
}

.resource-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
}

.resource-header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  padding-bottom: 1rem;
}

.resource-meta {
  margin-bottom: 0.5rem;
}

.resource-tags {
  min-height: 2rem;
}

.resource-footer {
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  padding-top: 1rem;
  margin-top: auto;
}

.difficulty-indicator {
  font-size: 0.9rem;
}
:root {
  --journal-blue: #003366;
  --journal-accent: #0056b3;
  --journal-light: #F0F4F8;
  --journal-text: #1a202c;
}

::selection {
  background: var(--journal-blue);
  color: #ffffff;
}

.hero-section::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(240,244,248,0.6), rgba(240,244,248,0.2), rgba(240,244,248,0.6));
  pointer-events: none;
}

.hero-section h1,
.page-header-section h1,
.page-header-section h2,
.hot-resources-title,
.features-section h2 {
  font-family: 'Noto Serif SC', serif;
  letter-spacing: 0;
}

.features-section h2 {
  font-weight: 700;
}

a:focus-visible,
button:focus-visible,
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 0.2rem rgba(0, 51, 102, 0.35);
}
