/* public/style.css */

:root {
  --primary-color: #1a73e8;
  --primary-dark: #155cb0;
  --secondary-color: #6c757d;
  --success-color: #28a745;
  --error-color: #dc3545;
  --info-color: #17a2b8;
  --warning-color: #ffc107;

  --bg-light: #f8f9fa;
  --bg-white: #ffffff;
  --text-dark: #343a40;
  --border-color: #e9ecef;

  --font-sans-sc: 'Noto Sans SC', sans-serif;
  --font-uyghur: 'Noto Sans Uyghur', 'UKIJ Tuz', sans-serif; /* 确保维吾尔语字体 */
}

body {
  font-family: var(--font-sans-sc);
  margin: 0;
  padding: 0;
  background-color: var(--bg-light);
  color: var(--text-dark);
  line-height: 1.6;
}

.container {
  max-width: 960px;
  margin: 30px auto;
  padding: 30px;
  background-color: var(--bg-white);
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

header {
  text-align: center;
  margin-bottom: 40px;
  position: relative;
}

header h1 {
  color: var(--primary-color);
  font-size: 2.5em;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

header h1 i {
  font-size: 1em;
}

.description {
  color: var(--secondary-color);
  font-size: 1.1em;
  max-width: 700px;
  margin: 0 auto;
}

.back-btn {
  position: absolute;
  left: 0;
  top: 5px;
  background-color: var(--secondary-color);
  color: white;
  padding: 8px 15px;
  border-radius: 5px;
  text-decoration: none;
  font-size: 0.9em;
  transition: background-color 0.3s ease;
  display: flex;
  align-items: center;
  gap: 5px;
}

.back-btn:hover {
  background-color: #5a6268;
}

.main-options {
  display: flex;
  justify-content: space-around;
  gap: 30px;
  flex-wrap: wrap;
}

.option-card {
  flex: 1;
  min-width: 300px;
  background-color: var(--bg-light);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 30px;
  text-align: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.option-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.option-card h2 {
  color: var(--primary-color);
  font-size: 1.8em;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.option-card p {
  color: var(--secondary-color);
  margin-bottom: 25px;
}

.content-area {
  padding: 20px 0;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: bold;
  margin-bottom: 8px;
  color: var(--text-dark);
}

textarea, select, input[type="text"] {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 1em;
  font-family: var(--font-sans-sc); /* 默认中文输入 */
  box-sizing: border-box;
  resize: vertical;
  min-height: 50px;
  background-color: var(--bg-white);
  color: var(--text-dark);
}

textarea:focus, select:focus, input[type="text"]:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.2);
}

select {
  appearance: none; /* 移除默认箭头 */
  background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23000000%22%20d%3D%22M287%2C114.7L146.2%2C255.5L5.5%2C114.7L31.7%2C88.4L146.2%2C202.9L260.7%2C88.4L287%2C114.7z%22%2F%3E%3C%2Fsvg%3E');
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
  padding-right: 30px;
}

.hint {
  font-size: 0.9em;
  color: var(--secondary-color);
  margin-top: 5px;
  display: block;
}

.action-buttons {
  display: flex;
  gap: 15px;
  margin-top: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  padding: 12px 25px;
  border: none;
  border-radius: 6px;
  font-size: 1.1em;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  justify-content: center;
}

.btn.primary {
  background-color: var(--primary-color);
  color: white;
}

.btn.primary:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
}

.btn.success {
  background-color: var(--success-color);
  color: white;
}

.btn.success:hover {
  background-color: #218838;
  transform: translateY(-2px);
}

.btn:not(.primary):not(.success) {
  background-color: var(--secondary-color);
  color: white;
}

.btn:not(.primary):not(.success):hover {
  background-color: #5a6268;
  transform: translateY(-2px);
}

.btn:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
  transform: none;
}

.btn .fas {
  font-size: 1.1em;
}

.status-box {
  padding: 15px;
  border-radius: 6px;
  margin-top: 20px;
  font-weight: bold;
  display: none;
  text-align: center;
}

.status-box.info {
  background-color: #e2f2f7;
  color: var(--info-color);
  border: 1px solid #bce8f1;
}

.status-box.success {
  background-color: #d4edda;
  color: var(--success-color);
  border: 1px solid #c3e6cb;
}

.status-box.error {
  background-color: #f8d7da;
  color: var(--error-color);
  border: 1px solid #f5c6cb;
}

.options-group {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.option-item {
  flex: 1;
  min-width: 250px;
}

.result-group {
  margin-top: 30px;
}

footer {
  text-align: center;
  margin-top: 50px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  color: var(--secondary-color);
  font-size: 0.9em;
}

/* 维吾尔语文本区域特定样式 */
#uyghurOutput {
  font-family: var(--font-uyghur); /* 应用维吾尔语字体 */
  text-align: right;
  direction: rtl;
  min-height: 200px;
}

/* loading spinner */
.fa-spinner.fa-spin {
  animation: spin 1s linear infinite;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@media (max-width: 768px) {
  .container {
    margin: 15px auto;
    padding: 20px;
  }
  header h1 {
    font-size: 2em;
    flex-direction: column;
    gap: 5px;
  }
  .main-options, .options-group {
    flex-direction: column;
    gap: 20px;
  }
  .option-card, .option-item {
    min-width: unset;
    width: 100%;
  }
  .back-btn {
    position: static;
    margin-bottom: 20px;
    width: 100%;
    text-align: center;
    justify-content: center;
  }
}