/* 玄机阁 - 东方科技美学设计系统 */
/* Xuan Ji Ge - Oriental Tech Aesthetics Design System */

:root {
  /* 主色调 - 东方美学 */
  --ink-black: #1a1a1a;
  --ink-black-light: #2d2d2d;
  --cinnabar-red: #c9372c;
  --cinnabar-red-dark: #a02a22;
  --imperial-gold: #d4af37;
  --imperial-gold-light: #e5c158;
  --jade-green: #00a86b;
  --jade-green-light: #00c77e;
  
  /* 辅助色 */
  --deep-teal: #2d5a5a;
  --ink-wash: #f8f6f1;
  --paper-yellow: #f5f5dc;
  --gray-100: #f7f7f7;
  --gray-200: #e5e5e5;
  --gray-600: #666666;
  --gray-900: #1a1a1a;
  
  /* 功能色 */
  --success: #00a86b;
  --warning: #d4af37;
  --danger: #c9372c;
  --info: #2d5a5a;
  
  /* 字体 */
  --font-display: 'Noto Serif SC', 'Source Han Serif SC', 'STSong', 'SimSun', serif;
  --font-body: 'Noto Sans SC', 'Source Han Sans SC', 'Microsoft YaHei', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  
  /* 阴影 */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-gold: 0 0 20px rgba(212, 175, 55, 0.3);
  
  /* 圆角 */
  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;
  
  /* 过渡 */
  --transition-fast: 150ms ease;
  --transition: 300ms ease;
  --transition-slow: 500ms ease;
}

/* 基础重置 */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--ink-wash);
  color: var(--ink-black);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* 水墨背景效果 */
.ink-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: 
    radial-gradient(ellipse at 20% 30%, rgba(0,0,0,0.03) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(0,0,0,0.03) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(212,175,55,0.02) 0%, transparent 70%),
    var(--ink-wash);
  animation: inkFlow 20s ease-in-out infinite;
}

@keyframes inkFlow {
  0%, 100% { 
    background-position: 0% 0%, 100% 100%, 50% 50%;
    transform: scale(1);
  }
  50% { 
    background-position: 2% 1%, 98% 99%, 52% 51%;
    transform: scale(1.02);
  }
}

/* 导航栏 */
.navbar {
  background: linear-gradient(135deg, var(--ink-black) 0%, var(--ink-black-light) 100%);
  padding: 0;
  box-shadow: var(--shadow-lg);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.75rem 2rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1.5rem;
  flex-wrap: wrap;
  min-height: 80px;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--imperial-gold);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  transition: var(--transition);
  white-space: nowrap;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
  flex-shrink: 0;
  line-height: 1;
  margin: 0.25rem 0;
}

.navbar-brand:hover {
  color: var(--imperial-gold-light);
  text-shadow: 0 0 15px rgba(212, 175, 55, 0.6);
}

.navbar-brand-icon {
  width: auto;
  height: auto;
  background: none;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  animation: none;
  filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.6));
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.navbar-nav {
  display: grid;
  grid-template-columns: repeat(9, auto); /* 18 items = 9+9 rows */
  gap: 0.5rem 0.25rem;
  list-style: none;
  padding: 0.5rem 0;
  flex: 1;
  min-width: 0;
}

@media (max-width: 1200px) {
  .navbar-nav {
    grid-template-columns: repeat(6, auto);
  }
}

@media (max-width: 768px) {
  .navbar-nav {
    grid-template-columns: repeat(4, auto);
  }
}

.nav-item {
  position: relative;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0.6rem;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  border-radius: 6px;
  transition: all 0.3s ease;
  white-space: nowrap;
  letter-spacing: 0.02em;
  text-align: center;
  justify-content: center;
}

.nav-link:hover {
  background: rgba(212, 175, 55, 0.15);
  color: var(--imperial-gold);
  transform: translateY(-1px);
}

.nav-link.active {
  background: linear-gradient(135deg, var(--cinnabar-red) 0%, #a02a22 100%);
  color: white;
  box-shadow: 0 3px 8px rgba(201, 55, 44, 0.3);
}

/* 移动端菜单按钮 */
.navbar-toggler {
  display: none;
  background: none;
  border: none;
  color: var(--imperial-gold);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
}

/* 主内容区 */
.main-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* 英雄区 */
.hero {
  text-align: center;
  padding: 4rem 1rem;
  position: relative;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4rem);
  color: var(--ink-black);
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.hero-title span {
  color: var(--cinnabar-red);
  position: relative;
}

.hero-title span::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--cinnabar-red), var(--imperial-gold));
  border-radius: 2px;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--gray-600);
  margin-bottom: 3rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* 快速输入框 */
.quick-input-container {
  max-width: 600px;
  margin: 0 auto 4rem;
  position: relative;
}

.quick-input {
  width: 100%;
  padding: 1rem 1.5rem;
  padding-right: 120px;
  font-size: 1.1rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-xl);
  background: white;
  transition: var(--transition);
  box-shadow: var(--shadow);
}

.quick-input:focus {
  outline: none;
  border-color: var(--imperial-gold);
  box-shadow: var(--shadow-gold);
}

.quick-input-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, var(--cinnabar-red) 0%, var(--cinnabar-red-dark) 100%);
  color: white;
  border: none;
  border-radius: var(--radius-lg);
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.quick-input-btn:hover {
  transform: translateY(-50%) scale(1.05);
  box-shadow: 0 4px 12px rgba(201, 55, 44, 0.4);
}

/* 功能卡片网格 */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.feature-card {
  background: white;
  border-radius: var(--radius-xl);
  padding: 2rem;
  text-decoration: none;
  color: var(--ink-black);
  box-shadow: var(--shadow);
  transition: var(--transition);
  border: 1px solid var(--gray-200);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--imperial-gold), var(--cinnabar-red));
  transform: scaleX(0);
  transition: var(--transition);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.feature-card:hover::before {
  transform: scaleX(1);
}

.feature-icon {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

.feature-card:nth-child(1) .feature-icon { background: linear-gradient(135deg, #fff5f0 0%, #ffe4d6 100%); }
.feature-card:nth-child(2) .feature-icon { background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%); }
.feature-card:nth-child(3) .feature-icon { background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%); }
.feature-card:nth-child(4) .feature-icon { background: linear-gradient(135deg, #fefce8 0%, #fef9c3 100%); }

.feature-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--ink-black);
}

.feature-desc {
  font-size: 0.9rem;
  color: var(--gray-600);
  line-height: 1.5;
}

/* 热门标签 */
.hot-tags {
  text-align: center;
  padding: 2rem 0;
}

.hot-tags-title {
  font-size: 0.9rem;
  color: var(--gray-600);
  margin-bottom: 1rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 1rem;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  color: var(--gray-600);
  text-decoration: none;
  transition: var(--transition-fast);
}

.tag:hover {
  background: var(--cinnabar-red);
  color: white;
  border-color: var(--cinnabar-red);
  transform: translateY(-2px);
}

/* 内容卡片 */
.content-card {
  background: white;
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}

.content-card-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--gray-200);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.content-card-title::before {
  content: '';
  width: 4px;
  height: 24px;
  background: linear-gradient(180deg, var(--cinnabar-red), var(--imperial-gold));
  border-radius: 2px;
}

/* 表单样式 */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--ink-black);
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 1rem;
  transition: var(--transition-fast);
  background: white;
}

.form-input:focus {
  outline: none;
  border-color: var(--imperial-gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition-fast);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--cinnabar-red) 0%, var(--cinnabar-red-dark) 100%);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(201, 55, 44, 0.4);
}

.btn-secondary {
  background: var(--gray-200);
  color: var(--ink-black);
}

.btn-secondary:hover {
  background: var(--gray-600);
  color: white;
}

.btn-gold {
  background: linear-gradient(135deg, var(--imperial-gold) 0%, #b8941f 100%);
  color: var(--ink-black);
}

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

/* 表格样式 */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.data-table th,
.data-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
}

.data-table th {
  background: var(--ink-black);
  color: var(--imperial-gold);
  font-weight: 600;
}

.data-table tr:hover {
  background: var(--ink-wash);
}

/* 结果展示 */
.result-container {
  background: white;
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  margin-top: 2rem;
}

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

.result-icon {
  width: 100px;
  height: 100px;
  margin: 0 auto 1rem;
  background: linear-gradient(135deg, var(--imperial-gold) 0%, var(--cinnabar-red) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  animation: rotate 10s linear infinite;
}

.result-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: var(--ink-black);
}

.result-subtitle {
  color: var(--gray-600);
  margin-top: 0.5rem;
}

/* 八卦可视化 */
.bagua-display {
  width: 200px;
  height: 200px;
  margin: 0 auto 2rem;
  position: relative;
}

.bagua-svg {
  width: 100%;
  height: 100%;
}

/* 页脚 */
.footer {
  background: var(--ink-black);
  color: rgba(255, 255, 255, 0.8);
  padding: 3rem 0 2rem;
  margin-top: 4rem;
}

.footer-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
  text-align: center;
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--imperial-gold);
  margin-bottom: 1rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.footer-link {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  transition: var(--transition-fast);
}

.footer-link:hover {
  color: var(--imperial-gold);
}

.footer-copyright {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.4);
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* 响应式设计 */
@media (max-width: 991px) {
  .navbar-toggler {
    display: block;
  }
  
  .navbar-nav {
  display: grid;
  grid-template-columns: repeat(9, auto); /* 18 items = 9+9 rows */
  gap: 0.5rem 0.25rem;
  list-style: none;
  padding: 0.5rem 0;
  flex: 1;
  min-width: 0;
}

@media (max-width: 1200px) {
  .navbar-nav {
    grid-template-columns: repeat(6, auto);
  }
}

@media (max-width: 768px) {
  .navbar-nav {
    grid-template-columns: repeat(4, auto);
  }
}
  
  .navbar-nav.active {
    display: flex;
  }
  
  .nav-link {
    width: 100%;
    padding: 1rem;
  }
  
  .features-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
}

@media (max-width: 576px) {
  .hero {
    padding: 2rem 1rem;
  }
  
  .hero-title {
    font-size: 2rem;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
  }
  
  .feature-card {
    padding: 1.5rem;
  }
  
  .quick-input-btn {
    position: relative;
    right: auto;
    top: auto;
    transform: none;
    width: 100%;
    margin-top: 0.75rem;
  }
  
  .quick-input {
    padding-right: 1.5rem;
  }
}

/* 加载动画 */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(212, 175, 55, 0.3);
  border-top-color: var(--imperial-gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 提示信息 */
.alert {
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

.alert-info {
  background: #f0f9ff;
  border-left: 4px solid var(--info);
  color: var(--deep-teal);
}

.alert-success {
  background: #f0fdf4;
  border-left: 4px solid var(--success);
  color: var(--jade-green);
}

.alert-warning {
  background: #fefce8;
  border-left: 4px solid var(--warning);
  color: #854d0e;
}

.alert-danger {
  background: #fef2f2;
  border-left: 4px solid var(--danger);
  color: var(--cinnabar-red);
}
