*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: #1f2933;
  background: radial-gradient(circle at top, #0f172a 0, #020617 45%, #020617 100%);
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.ms-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.3);
}

.ms-header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ms-logo {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: #f97316;
  text-shadow: 0 0 12px rgba(248, 250, 252, 0.6);
  white-space: nowrap;
}

.ms-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.ms-nav-item {
  border: none;
  padding: 6px 10px;
  border-radius: 999px;
  background: transparent;
  color: #e5e7eb;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.ms-nav-item:hover {
  background: rgba(148, 163, 184, 0.25);
}

.ms-nav-item.active {
  background: linear-gradient(135deg, #f97316, #facc15);
  color: #111827;
  box-shadow: 0 0 0 1px rgba(248, 250, 252, 0.12),
    0 8px 20px rgba(248, 250, 252, 0.25);
}

.ms-main {
  flex: 1;
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px 16px 40px;
}

.ms-section {
  display: none;
  animation: fadeIn 0.25s ease;
}

.ms-section.active {
  display: block;
}

.ms-section-title {
  margin: 8px 0 4px;
  font-size: 24px;
  color: #f9fafb;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ms-section-title::before {
  content: "";
  width: 4px;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(180deg, #f97316, #facc15);
}

.ms-section-desc {
  margin: 0 0 16px;
  font-size: 14px;
  color: #cbd5f5;
}

.ms-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.ms-card {
  background: radial-gradient(circle at top left, rgba(248, 250, 252, 0.08), transparent 55%),
    rgba(15, 23, 42, 0.9);
  border-radius: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.7);
}

.ms-card h2 {
  margin: 0 0 6px;
  font-size: 16px;
  color: #e5e7eb;
}

.ms-card p {
  margin: 0 0 10px;
  font-size: 13px;
  color: #9ca3af;
}

.ms-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.ms-btn.primary {
  background: linear-gradient(135deg, #f97316, #facc15);
  color: #111827;
  border-color: transparent;
  box-shadow: 0 10px 30px rgba(248, 250, 252, 0.3);
}

.ms-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.8);
}

.ms-btn.primary:hover {
  filter: brightness(1.05);
}

.ms-panel {
  margin-top: 10px;
  padding: 14px 14px 16px;
  border-radius: 16px;
  background: radial-gradient(circle at top, rgba(248, 250, 252, 0.1), transparent 50%),
    rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.7);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.9);
}

.ms-panel-title {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 600;
  color: #e5e7eb;
}

.ms-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ms-form-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}

.ms-form-row label {
  color: #c7cedd;
}

.ms-form-row input,
.ms-form-row select,
.ms-form-row textarea {
  padding: 7px 9px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.8);
  background: rgba(15, 23, 42, 0.96);
  color: #e5e7eb;
  font-size: 13px;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.ms-form-row input::placeholder,
.ms-form-row textarea::placeholder {
  color: #64748b;
}

.ms-form-row input:focus,
.ms-form-row select:focus,
.ms-form-row textarea:focus {
  border-color: #f97316;
  box-shadow: 0 0 0 1px rgba(249, 115, 22, 0.5);
  background: rgba(15, 23, 42, 1);
}

.ms-form-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.ms-tip {
  font-size: 12px;
  color: #9ca3af;
}

.ms-tag-group {
  margin-bottom: 16px;
}

.ms-tag-title {
  margin-bottom: 4px;
  font-size: 13px;
  color: #d1d5db;
}

.ms-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ms-tag {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
  padding: 2px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.14s ease;
}

.ms-tag:hover {
  background: rgba(248, 250, 252, 0.08);
}

.ms-steps {
  margin: 0 0 10px 18px;
  padding: 0;
  color: #cbd5f5;
  font-size: 13px;
}

.ms-result {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px dashed rgba(148, 163, 184, 0.8);
  font-size: 13px;
  color: #e5e7eb;
  background: rgba(15, 23, 42, 0.9);
}

/* 梅花易数结果样式优化 */
.ms-result h4 {
  margin: 0 0 15px 0;
}

.ms-result .gua-card {
  background: radial-gradient(circle at top left, rgba(248, 250, 252, 0.08), transparent 55%),
    rgba(15, 23, 42, 0.9);
  border-radius: 12px;
  padding: 16px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.6);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ms-result .gua-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.8);
}

.ms-tarot-layout {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.ms-tarot-card {
  border-radius: 14px;
  padding: 10px 8px;
  border: 1px solid rgba(148, 163, 184, 0.9);
  background: radial-gradient(circle at top, rgba(248, 250, 252, 0.12), transparent 55%),
    rgba(15, 23, 42, 0.98);
  text-align: center;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.9);
}

.ms-tarot-label {
  font-size: 12px;
  color: #fbbf24;
  margin-bottom: 6px;
  letter-spacing: 0.2em;
}

.ms-tarot-name {
  font-size: 14px;
  color: #e5e7eb;
  min-height: 1.6em;
  font-weight: 500;
}

.ms-tarot-direction {
  font-size: 12px;
  margin-top: 4px;
  font-weight: 500;
}

.ms-footer {
  padding: 12px 16px 18px;
  text-align: center;
  font-size: 12px;
  color: #9ca3af;
  border-top: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.95);
}

.ms-footer-tip {
  margin-top: 4px;
  color: #6b7280;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 响应式调整 */
@media (max-width: 768px) {
  .ms-header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .ms-logo {
    font-size: 18px;
  }

  .ms-main {
    padding: 12px 12px 28px;
  }

  .ms-section-title {
    font-size: 20px;
  }
}

@media (max-width: 480px) {
  .ms-nav {
    justify-content: flex-start;
  }

  .ms-nav-item {
    font-size: 12px;
    padding: 4px 9px;
  }

  .ms-card-grid {
    grid-template-columns: 1fr;
  }

  .ms-tarot-layout {
    grid-template-columns: 1fr;
  }
}


