html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}
#particles-js {
  position: fixed;
  width: 100%;
  height: 100%;
  background: linear-gradient(120deg, #e6ffe6, #ccffcc);
  z-index: -1;
}
body > div.content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: auto;
  padding: 30px 20px;
  background: #ffffffcc;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 128, 0, 0.1);
}
h1 {
  text-align: center;
  color: #2e7d32;
  font-size: 28px;
  margin-bottom: 24px;
}
label {
  display: block;
  margin-top: 16px;
  font-weight: bold;
  color: #1b5e20;
}
select, input, button {
  width: 100%;
  padding: 12px;
  margin-top: 6px;
  font-size: 1rem;
  border: 1px solid #a5d6a7;
  border-radius: 8px;
  box-sizing: border-box;
}
button {
  background-color: #66bb6a;
  color: white;
  font-weight: bold;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s;
}
button:hover {
  background-color: #43a047;
}
.result {
  margin-top: 30px;
  background: #e8f5e9;
  padding: 20px;
  border: 1px solid #a5d6a7;
  border-radius: 8px;
  color: #2e7d32;
  word-break: break-word;
}
.hidden { display: none; }
button:disabled { background: #c8e6c9; cursor: not-allowed; }

/* 语言选择器样式 */
.language-selector {
  text-align: right;
  margin-bottom: 15px;
  position: relative;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}
.language-selector select {
  width: auto;
  padding: 5px;
  margin: 0;
  font-size: 0.9rem;
}
.language-label {
  margin-right: 8px;
  font-weight: bold;
  color: #2e7d32;
}

/* 方向切换按钮样式 */
.direction-btn {
  width: auto;
  margin-left: 10px;
  padding: 5px 10px;
  font-size: 0.9rem;
  background-color: #f0f7f0;
  color: #2e7d32;
  border: 1px solid #a5d6a7;
}
.direction-btn:hover {
  background-color: #e0f2e0;
}

/* 实时时间显示样式 */
.current-time-container {
  text-align: center;
  margin-bottom: 15px;
  color: #2e7d32;
  font-size: 1.1rem;
  font-weight: bold;
  background-color: #e8f5e9;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid #a5d6a7;
}

/* 汇率刷新按钮和输入框组合样式 */
.exchange-rate-container {
  position: relative;
}
.input-with-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}
.input-with-button input {
  flex: 1;
  width: 100%;
}
.refresh-btn {
  width: auto;
  min-width: 80px;
  padding: 0 10px;
  margin-top: 6px;
  background-color: #81c784;
}
.refresh-btn:hover {
  background-color: #66bb6a;
}
.rate-update-info {
  font-size: 0.8em;
  margin-top: 5px;
  color: #757575;
  overflow-wrap: break-word;
  max-width: 100%;
}

/* 美化汇率信息在结果中的显示 */
.rate-info-in-result {
  font-size: 0.85em;
  padding: 5px 8px;
  margin-top: 5px;
  background-color: #f1f8e9;
  border-radius: 4px;
  border-left: 3px solid #689f38;
  display: inline-block;
}

/* RTL支持 - 当文档方向为RTL时应用的样式 */
html[dir="rtl"] body {
  font-family: 'Segoe UI', 'Tahoma', sans-serif;
}

/* 确保语言选择器在RTL模式下也位于右侧 */
html[dir="rtl"] .language-selector {
  text-align: right;
  flex-direction: row;
}

html[dir="rtl"] .language-label {
  margin-right: 0;
  margin-left: 8px;
}

html[dir="rtl"] .direction-btn {
  margin-left: 0;
  margin-right: 10px;
}

/* 确保数字和英文在RTL环境中正确显示 */
html[dir="rtl"] input[type="number"],
html[dir="rtl"] .result span.number,
html[dir="rtl"] #current-time,
html[dir="rtl"] .rate-update-info {
  direction: ltr;
  text-align: right;
  unicode-bidi: embed;
}

/* 确保价格显示在RTL模式下正确 */
html[dir="rtl"] .result {
  text-align: right;
}

@media (max-width: 600px) {
  h1 { font-size: 22px; }
  .content {
    padding: 20px 15px;
    margin: 10px;
  }
  select, input, button {
    font-size: 15px;
  }
  .language-selector {
    flex-wrap: wrap;
  }
  .direction-btn {
    margin-top: 5px;
    margin-left: 0;
  }
  html[dir="rtl"] .direction-btn {
    margin-right: 0;
  }
  .input-with-button {
    flex-direction: column;
    gap: 5px;
  }
  .refresh-btn {
    width: 100%;
  }
} 