/* ============================================================
   天津高中学习系统 - 视觉系统CSS
   ============================================================ */

/* ---------- CSS变量 ---------- */
:root {
  /* 主色调 */
  --color-bg-deep: #050810;
  --color-bg-dark: #0a1020;
  --color-neon-pink: #ff3d7f;
  --color-neon-cyan: #00e5ff;
  --color-neon-purple: #b76eff;
  --color-neon-gold: #ffd700;

  /* 辅助色 */
  --color-white: #ffffff;
  --color-gray-light: #a0b0d0;
  --color-gray-mid: #607090;
  --color-gray-dark: #304050;

  /* 阴影 */
  --shadow-neon-pink: 0 0 10px rgba(255, 61, 127, 0.5), 0 0 20px rgba(255, 61, 127, 0.3), 0 0 40px rgba(255, 61, 127, 0.2);
  --shadow-neon-cyan: 0 0 10px rgba(0, 229, 255, 0.5), 0 0 20px rgba(0, 229, 255, 0.3), 0 0 40px rgba(0, 229, 255, 0.2);
  --shadow-neon-purple: 0 0 10px rgba(183, 110, 255, 0.5), 0 0 20px rgba(183, 110, 255, 0.3), 0 0 40px rgba(183, 110, 255, 0.2);
  --shadow-neon-gold: 0 0 10px rgba(255, 215, 0, 0.5), 0 0 20px rgba(255, 215, 0, 0.3), 0 0 40px rgba(255, 215, 0, 0.2);

  /* 文字阴影 */
  --text-shadow-3d: 
    1px 1px 0px rgba(0,0,0,0.8),
    2px 2px 0px rgba(0,0,0,0.7),
    3px 3px 0px rgba(0,0,0,0.6),
    4px 4px 0px rgba(0,0,0,0.5),
    5px 5px 10px rgba(0,0,0,0.4);

  /* 圆角 */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 30px;
  --radius-full: 9999px;

  /* 过渡 */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
  --transition-bounce: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---------- 全局Reset ---------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background-color: var(--color-bg-deep);
  color: var(--color-white);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* 隐藏滚动条但保留滚动功能 */
body::-webkit-scrollbar {
  width: 0px;
  background: transparent;
}

body {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
}

input, textarea {
  font-family: inherit;
  outline: none;
}

img {
  max-width: 100%;
  display: block;
}

/* ---------- 页面容器 ---------- */
.page {
  position: relative;
  width: 100%;
  min-height: 100vh;
  background: rgba(10, 16, 32, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

/* ---------- 3D文字效果 ---------- */
.text-3d {
  font-weight: 900;
  letter-spacing: 2px;
  text-shadow: var(--text-shadow-3d);
  transform-style: preserve-3d;
}

/* ---------- 霓虹发光文字 ---------- */
.text-neon-pink {
  color: var(--color-neon-pink);
  text-shadow: var(--shadow-neon-pink);
}

.text-neon-cyan {
  color: var(--color-neon-cyan);
  text-shadow: var(--shadow-neon-cyan);
}

.text-neon-purple {
  color: var(--color-neon-purple);
  text-shadow: var(--shadow-neon-purple);
}

.text-neon-gold {
  color: var(--color-neon-gold);
  text-shadow: var(--shadow-neon-gold);
}

/* ---------- 主按钮 ---------- */
.btn-primary {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 40px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-white);
  background: linear-gradient(135deg, var(--color-neon-pink), var(--color-neon-cyan));
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  overflow: hidden;
  transition: transform var(--transition-fast), box-shadow var(--transition-normal);
  box-shadow: 0 4px 15px rgba(255, 61, 127, 0.3);
  letter-spacing: 1px;
}

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

.btn-primary:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(255, 61, 127, 0.6), 0 0 40px rgba(0, 229, 255, 0.4), 0 0 60px rgba(255, 61, 127, 0.2);
}

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

.btn-primary:active {
  transform: scale(0.96);
}

/* ripple容器 */
.btn-primary .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transform: scale(0);
  animation: ripple-effect 0.6s ease-out;
  pointer-events: none;
}

@keyframes ripple-effect {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* ---------- 次要按钮 ---------- */
.btn-secondary {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 32px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-neon-cyan);
  background: transparent;
  border: 2px solid var(--color-neon-cyan);
  border-radius: var(--radius-full);
  cursor: pointer;
  overflow: hidden;
  transition: all var(--transition-normal);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.2);
}

.btn-secondary::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0%;
  height: 100%;
  background: linear-gradient(135deg, var(--color-neon-cyan), var(--color-neon-purple));
  transition: width var(--transition-normal);
  z-index: -1;
}

.btn-secondary:hover {
  color: var(--color-white);
  border-color: transparent;
  box-shadow: var(--shadow-neon-cyan);
}

.btn-secondary:hover::before {
  width: 100%;
}

.btn-secondary:active {
  transform: scale(0.96);
}

/* ---------- 霓虹输入框 ---------- */
.glow-input {
  position: relative;
  width: 100%;
  max-width: 360px;
  padding: 14px 20px;
  font-size: 1rem;
  color: var(--color-white);
  background: rgba(10, 16, 32, 0.8);
  border: 2px solid var(--color-gray-dark);
  border-radius: var(--radius-full);
  transition: border-color var(--transition-normal);
  outline: none;
}

.glow-input::placeholder {
  color: var(--color-gray-mid);
}

.glow-input-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
  max-width: 360px;
}

.glow-input-wrapper::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--color-neon-pink), var(--color-neon-cyan), var(--color-neon-purple), var(--color-neon-pink));
  background-size: 300% 100%;
  opacity: 0;
  z-index: -1;
  transition: opacity var(--transition-normal);
  animation: border-flow 3s linear infinite;
}

.glow-input-wrapper:focus-within::before {
  opacity: 1;
}

.glow-input-wrapper:focus-within .glow-input {
  border-color: transparent;
  background: rgba(10, 16, 32, 0.95);
}

@keyframes border-flow {
  0% { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

/* ---------- 3D透视卡片 ---------- */
.card-3d {
  position: relative;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 24px;
  transform-style: preserve-3d;
  perspective: 1000px;
  transition: transform var(--transition-slow), box-shadow var(--transition-slow);
  overflow: hidden;
}

.card-3d::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 61, 127, 0.1), rgba(0, 229, 255, 0.1));
  opacity: 0;
  transition: opacity var(--transition-slow);
  border-radius: inherit;
  z-index: 0;
}

.card-3d:hover {
  transform: translateY(-8px) rotateX(2deg);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), var(--shadow-neon-pink);
}

.card-3d:hover::before {
  opacity: 1;
}

.card-3d > * {
  position: relative;
  z-index: 1;
}

/* ---------- 弹窗遮罩 ---------- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(5, 8, 16, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: linear-gradient(145deg, var(--color-bg-dark), var(--color-bg-deep));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 500px;
  width: 90%;
  transform: scale(0.8);
  transition: transform var(--transition-bounce);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

/* ---------- 发光进度条 ---------- */
.progress-glow {
  position: relative;
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-glow .progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--color-neon-pink), var(--color-neon-cyan));
  border-radius: var(--radius-full);
  box-shadow: 0 0 10px rgba(255, 61, 127, 0.5), 0 0 20px rgba(0, 229, 255, 0.3);
  transition: width var(--transition-slow);
  position: relative;
}

.progress-glow .progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 20px;
  height: 100%;
  background: rgba(255, 255, 255, 0.5);
  filter: blur(4px);
  animation: progress-shine 2s ease-in-out infinite;
}

@keyframes progress-shine {
  0% { transform: translateX(0); opacity: 0; }
  50% { opacity: 1; }
  100% { transform: translateX(20px); opacity: 0; }
}

/* ---------- Toast提示 ---------- */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 14px 28px;
  background: linear-gradient(135deg, rgba(255, 61, 127, 0.9), rgba(183, 110, 255, 0.9));
  color: var(--color-white);
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 10px 30px rgba(255, 61, 127, 0.3);
  z-index: 2000;
  opacity: 0;
  transition: all var(--transition-bounce);
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ---------- 加载动画 ---------- */
.loader {
  position: relative;
  width: 60px;
  height: 60px;
}

.loader::before,
.loader::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
}

.loader::before {
  width: 100%;
  height: 100%;
  border: 3px solid transparent;
  border-top-color: var(--color-neon-pink);
  border-right-color: var(--color-neon-cyan);
  animation: loader-spin 1s linear infinite;
}

.loader::after {
  width: 70%;
  height: 70%;
  border: 3px solid transparent;
  border-bottom-color: var(--color-neon-purple);
  border-left-color: var(--color-neon-gold);
  animation: loader-spin 1.5s linear infinite reverse;
}

@keyframes loader-spin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ---------- 标签页 ---------- */
.tab-btn {
  position: relative;
  padding: 10px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-gray-light);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.tab-btn:hover {
  color: var(--color-neon-cyan);
}

.tab-btn.active {
  color: var(--color-neon-pink);
  border-bottom-color: var(--color-neon-pink);
  text-shadow: var(--shadow-neon-pink);
}

.tab-content {
  display: none;
  padding: 20px 0;
  animation: tab-fade-in 0.3s ease;
}

.tab-content.active {
  display: block;
}

@keyframes tab-fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- 聊天气泡 ---------- */
.chat-bubble {
  position: relative;
  max-width: 70%;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  line-height: 1.5;
  word-break: break-word;
}

.chat-bubble.left {
  background: linear-gradient(135deg, rgba(255, 61, 127, 0.15), rgba(183, 110, 255, 0.15));
  border: 1px solid rgba(255, 61, 127, 0.2);
  color: var(--color-white);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.chat-bubble.right {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.15), rgba(0, 229, 255, 0.05));
  border: 1px solid rgba(0, 229, 255, 0.2);
  color: var(--color-white);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

/* ---------- 特性标签 ---------- */
.feature-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  color: var(--color-gray-light);
  transition: all var(--transition-normal);
}

.feature-tag:hover {
  background: rgba(255, 61, 127, 0.1);
  border-color: rgba(255, 61, 127, 0.3);
  color: var(--color-white);
}

.feature-tag .icon {
  width: 16px;
  height: 16px;
  display: inline-block;
  position: relative;
}

/* 纯CSS绘制的图标样式 */
.icon-brain::before {
  content: '';
  display: block;
  width: 12px;
  height: 12px;
  border: 2px solid var(--color-neon-cyan);
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(0, 229, 255, 0.4);
}

.icon-chart::before {
  content: '';
  display: block;
  width: 12px;
  height: 10px;
  border-left: 2px solid var(--color-neon-pink);
  border-bottom: 2px solid var(--color-neon-pink);
  position: relative;
}

.icon-chart::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 2px;
  width: 3px;
  height: 6px;
  background: var(--color-neon-pink);
  box-shadow: 4px -2px 0 0 var(--color-neon-pink);
}

.icon-user::before {
  content: '';
  display: block;
  width: 8px;
  height: 8px;
  border: 2px solid var(--color-neon-purple);
  border-radius: 50%;
  margin: 0 auto 2px;
}

.icon-user::after {
  content: '';
  display: block;
  width: 12px;
  height: 5px;
  border: 2px solid var(--color-neon-purple);
  border-radius: 6px 6px 0 0;
  border-bottom: none;
}

/* ---------- 脉冲动画 ---------- */
.pulse-glow {
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 15px rgba(255, 61, 127, 0.4); }
  50% { box-shadow: 0 0 30px rgba(255, 61, 127, 0.7), 0 0 60px rgba(0, 229, 255, 0.3); }
}

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

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

/* ---------- 淡入动画 ---------- */
.fade-in {
  animation: fade-in 0.6s ease forwards;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---------- 从下方飞入 ---------- */
.slide-up {
  animation: slide-up 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes slide-up {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- 闪烁光标 ---------- */
.cursor-blink::after {
  content: '|';
  animation: blink 1s step-end infinite;
  color: var(--color-neon-cyan);
}

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

/* ---------- 网格背景 ---------- */
.grid-bg {
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
}

/* ---------- 响应式布局 ---------- */
@media (max-width: 768px) {
  html {
    font-size: 14px;
  }

  .btn-primary,
  .btn-secondary {
    padding: 12px 28px;
    font-size: 1rem;
  }

  .card-3d {
    padding: 18px;
  }

  .chat-bubble {
    max-width: 85%;
  }

  .modal-content {
    padding: 24px;
    width: 95%;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 13px;
  }

  .glow-input {
    padding: 12px 16px;
  }

  .feature-tag {
    padding: 6px 12px;
    font-size: 0.8rem;
  }
}

/* ---------- 工具类 ---------- */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }

.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }

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

.hidden { display: none; }
