/* ========== 全局基础 ========== */
:root {
  --md-primary-fg-color: #5865f2;
  --md-accent-fg-color: #7289da;
  --md-default-bg-color: #111827;
  --md-code-bg-color: #1e1e2f;
}

body {
  font-family: "Inter", "Microsoft YaHei", "PingFang SC", sans-serif;
  line-height: 1.75;
  background-color: var(--md-default-bg-color);
}

/* ========== 修复 Grid Cards 显示 ========== */
.md-typeset .grid.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}

/* ========== 联系我们 - 3列布局 ========== */
.md-typeset .grid.cards.contact-grid {
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

/* ========== 应用场景 - 3列布局 ========== */
.md-typeset .grid.cards.scenario-grid {
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

/* 响应式：平板设备显示2列 */
@media screen and (max-width: 960px) {
  .md-typeset .grid.cards.contact-grid,
  .md-typeset .grid.cards.scenario-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 响应式：手机设备显示1列 */
@media screen and (max-width: 600px) {
  .md-typeset .grid.cards.contact-grid,
  .md-typeset .grid.cards.scenario-grid {
    grid-template-columns: 1fr;
  }
}

.md-typeset .grid.cards > * {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ========== 修复居中对齐 ========== */
.md-typeset div[align="center"] {
  text-align: center;
  margin: 2rem auto;
}

/* ========== 美化表格样式 ========== */
.md-typeset table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  overflow: hidden;
}

.md-typeset table th {
  background: rgba(88, 101, 242, 0.15);
  color: #e4e7eb;
  font-weight: 600;
  padding: 1.2rem 1.5rem;
  text-align: left;
  font-size: 1.05rem;
}

.md-typeset table td {
  padding: 1.2rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #c7d0dd;
  line-height: 1.6;
}

.md-typeset table tr:hover {
  background: rgba(255, 255, 255, 0.05);
  transition: background 0.2s ease;
}

.md-typeset table td:first-child {
  font-weight: 600;
  color: #94a3b8;
  width: 35%;
}

.md-typeset table td:last-child {
  width: 65%;
}

/* ========== 修复图片显示 ========== */
.md-typeset img[width] {
  max-width: 100%;
  height: auto;
  display: inline-block;
  margin: 0 0.5rem;
  vertical-align: middle;
}

/* ========== 功能展示卡片样式 ========== */
.md-typeset .grid > div {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 2rem 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.md-typeset .grid > div:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(88, 101, 242, 0.3);
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.md-typeset .grid > div img {
  border-radius: 8px;
  margin-bottom: 1rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.md-typeset .grid > div strong {
  display: block;
  font-size: 1.2rem;
  margin: 1rem 0 0.5rem;
  color: #e4e7eb;
}

.md-typeset .grid > div p {
  color: #94a3b8;
  line-height: 1.6;
  margin: 0;
}

/* 响应式：小屏幕改为单列 */
@media screen and (max-width: 768px) {
  .md-typeset .grid[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
}

/* ========== 首页标题区域 ========== */
h1, h2, h3 {
  font-weight: 600;
  color: #e4e7eb;
}

h1 {
  font-size: 2.2em;
  margin-bottom: 0.5em;
}

h2 {
  border-left: 4px solid var(--md-accent-fg-color);
  padding-left: 0.6em;
  margin-top: 2em;
  color: #d8dee9;
}

/* ========== 首页段落优化 ========== */
p {
  color: #c7d0dd;
  margin: 0.5em 0 1em;
}

/* ========== 卡片布局样式 ========== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.2rem;
  margin-top: 1em;
}

.card {
  background: #1f2937;
  border-radius: 12px;
  padding: 1.2em 1.4em;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.25);
  transition: all 0.25s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.card h3 {
  margin-top: 0;
  color: #ffffff;
  font-size: 1.1em;
}

.card p {
  color: #9ca3af;
  font-size: 0.95em;
}

/* ========== 图标 + 标题组合 ========== */
.section-icon {
  font-size: 1.4em;
  margin-right: 6px;
  vertical-align: middle;
}

.section-title {
  display: flex;
  align-items: center;
  font-size: 1.6em;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.8em;
}

/* ========== 按钮样式 ========== */
.md-button {
  display: inline-block;
  margin-top: 1em;
  padding: 0.6em 1.4em;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.25s;
}

.md-button--primary {
  background-color: var(--md-primary-fg-color);
  color: #fff !important;
}

.md-button--primary:hover {
  background-color: #4752c4;
  transform: translateY(-2px);
}

/* ========== 图片优化 ========== */
img {
  border-radius: 10px;
  margin: 1em 0;
  max-width: 100%;
  display: block;
}

/* ========== 页脚样式增强 ========== */
.md-footer {
  background-color: #0f172a;
  border-top: 1px solid #1e293b;
  padding-top: 1.5em;
}

.md-footer__inner {
  color: #94a3b8;
}

.md-footer a {
  color: #a5b4fc;
}

.md-footer a:hover {
  color: #c7d2fe;
}

/* ========== 响应式优化 ========== */
@media (max-width: 768px) {
  .card-grid {
    grid-template-columns: 1fr;
  }

  .section-title {
    font-size: 1.3em;
  }
}
