:root {
  --primary-color: #6a0dad;
  --secondary-color: #ffd700;
  --background-color: #f8f5ff;
  --card-bg: #ffffff;
  --text-color: #333333;
  --border-radius: 10px;
  --box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Microsoft YaHei', 'Segoe UI', sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
  line-height: 1.6;
  max-width: 1300px;
  min-width: 980px;
  width: 100%;
  margin: 0 auto;
  padding: 20px;
}

header {
  text-align: center;
  margin: 10px auto;
  padding: 20px;
  background: linear-gradient(135deg, var(--primary-color), #4b0082);
  color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.subtitle {
  font-size: 1.1rem;
  opacity: 0.9;
  max-width: 800px;
  margin: 0 auto;
}

.disclaimer {
  background-color: #fff8e1;
  border-left: 4px solid #ffc107;
  padding: 15px;
  margin: 10px auto;
  border-radius: 4px;
  font-size: 0.9rem;
}

.container {
  display: grid;
  grid-template-columns: 3fr 8fr;
  gap: 10px;
  min-height: 960px;
  margin-bottom: 20px;
}

@media (max-width: 900px) {
  .container {
    grid-template-columns: 1fr;
  }
}

.input-section,
.result-section,
.palace-info {
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 15px;
  box-shadow: var(--box-shadow);
}

.section-title {
  display: flex;
  align-items: center;
  font-size: 1.4rem;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--secondary-color);
  color: var(--primary-color);
}

.section-title span {
  margin-right: 10px;
  font-size: 1.5rem;
}

.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

select,
input {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
  transition: border-color 0.3s;
}

select:focus,
input:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 2px rgba(106, 13, 173, 0.2);
}

.radio-group {
  display: flex;
  gap: 20px;
}

.radio-option {
  display: flex;
  align-items: center;
}

.radio-option input {
  width: auto;
  margin-right: 6px;
  margin-bottom: 6px;
}

.btn {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 14px 20px;
  font-size: 1.1rem;
  border-radius: 6px;
  cursor: pointer;
  width: 100%;
  font-weight: bold;
  transition: background-color 0.3s;
  margin-top: 10px;
}

.btn:hover {
  background-color: #5a0a9d;
}

.btn-secondary {
  background-color: #f0f0f0;
  color: var(--text-color);
}

.btn-secondary:hover {
  background-color: #e0e0e0;
}

.astrolabe-header{
  margin-bottom: 10px;
  color: #333;
}

.astrolabe-header p{
  color: #666;
  font-size: 14px;
}

.astrolabe-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
}

.palace {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 15px;
  background-color: #f9f9ff;
  min-height: 150px;
  position: relative;
}

.palace-title {
  font-weight: bold;
  font-size: 16px;
  color: var(--primary-color);
  text-align: center;
  border-bottom: 1px dashed #ddd;
  line-height: 30px;
  height: 30px;
}

.palace-content {
  box-sizing: border-box;
  font-size: 0.75rem;
  padding: 6px;
  height: calc(100% - 31px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.palace-content p{
  margin-bottom: 4px;
}
.major-stars , .minor-stars, .adject-stars{
  width: 100%;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}
.star {
  display: inline-block;
  background-color: #e6e2ff;
  padding: 2px 4px;
  border-radius: 4px;
  margin: 2px;
  margin-right: 4px;
  margin-bottom: 4px;
  font-size: 0.7rem;
}

.adject{
  background-color: #ffe2e2;
}

.star i{
  color: #999;
  margin-left: 2px;
  font-style: normal;
}

.palace-info-content {
  max-height: 400px;
  overflow-y: auto;
  padding-right: 10px;
}

.palace-info-item {
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #eee;
}

.palace-info-item h3 {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  color: var(--primary-color);
}

.palace-info-item h3 span {
  margin-right: 8px;
}

.result-buttons {
  display: flex;
  gap: 15px;
  margin-top: 20px;
}

footer {
  text-align: center;
  margin-top: 40px;
  padding: 20px;
  color: #666;
  font-size: 0.9rem;
}

.loading {
  text-align: center;
  padding: 30px;
  font-size: 1.1rem;
}

.hidden {
  display: none;
}

/* 星盘样式 */
.astrolabe-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 5px;
  height: 980px;
}

.grid-item {
  border: 1px solid #e0d6ff;
  border-radius: 8px;
  padding: 0;
  background-color: #f9f7ff;
  overflow: auto;
}

.center-grid {
  grid-column: 2 / 4;
  grid-row: 2 / 4;
  display: flex;
  flex-direction: column;
  background-color: #f0ebff;
  border: 1px solid #e0d6ff;
  border-radius: 8px;
}
.center-grid .info{
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap:wrap;
  width: 100%;
  box-sizing: border-box;
  padding: 10px;
}
.center-grid .info p{
  width: calc(50% - 6px);
  margin-bottom: 8px;
  font-size: 0.85rem;
  color: #816a91;
}
.center-grid .info p span{
  font-weight: 700;
  color: #333;
}
/* 响应式调整 */
@media (max-width: 768px) {
  .astrolabe-grid {
    height: auto;
  }

  .container {
    padding: 10px;
  }

  .input-section,
  .result-section,
  .palace-info {
    padding: 15px;
  }
}
