:root {
  --bg-primary: #121212;
  --bg-secondary: #1e1e1e;
  --bg-tertiary: #2d2d2d;
  --text-primary: #e0e0e0;
  --text-secondary: #a0a0a0;
  --accent-primary: #7289da;
  --accent-secondary: #5c73c9;
  --danger: #cf6679;
  --success: #03dac5;
  --warning: #ffb74d;
  --border-radius: 8px;
  --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', 'Microsoft JhengHei', 'PingFang TC', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  padding: 0;
  margin: 0;
  min-height: 100vh;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 30px 20px;
}

header {
  text-align: center;
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 1px solid #333;
}

h1 {
  font-size: 2.4rem;
  font-weight: 700;
  margin-bottom: 10px;
  background: linear-gradient(90deg, var(--accent-primary), var(--success));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

.section {
  background-color: var(--bg-secondary);
  border-radius: var(--border-radius);
  padding: 25px;
  margin-bottom: 30px;
  box-shadow: var(--box-shadow);
  transition: var(--transition);
  border-left: 4px solid transparent;
}

.section:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

/* 商店類別相關樣式 */
.section.category {
  border-left-color: var(--accent-primary);
}

.category .section-icon {
  background-color: rgba(114, 137, 218, 0.2);
  color: var(--accent-primary);
}

.section.situation {
  border-left-color: #ff5252;
}

.section.task {
  border-left-color: #ffb74d;
}

.section.action {
  border-left-color: #64b5f6;
}

.section.result {
  border-left-color: #81c784;
}

.section-header {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}

.section-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 15px;
  flex-shrink: 0;
}

.situation .section-icon {
  background-color: rgba(255, 82, 82, 0.2);
  color: #ff5252;
}

.task .section-icon {
  background-color: rgba(255, 183, 77, 0.2);
  color: #ffb74d;
}

.action .section-icon {
  background-color: rgba(100, 181, 246, 0.2);
  color: #64b5f6;
}

.result .section-icon {
  background-color: rgba(129, 199, 132, 0.2);
  color: #81c784;
}

.section-title {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 0;
}

.section-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-top: 3px;
  font-weight: normal;
}

.input-group {
  margin-bottom: 25px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-primary);
}

textarea {
  width: 100%;
  min-height: 120px;
  background-color: var(--bg-tertiary);
  border: 1px solid #444;
  border-radius: var(--border-radius);
  padding: 15px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
  transition: var(--transition);
}

/* 商店類別選擇器樣式 */
.store-select {
  width: 100%;
  background-color: var(--bg-tertiary);
  border: 1px solid #444;
  border-radius: var(--border-radius);
  padding: 12px 15px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  transition: var(--transition);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a0a0a0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
  background-size: 16px;
}

.store-select:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(114, 137, 218, 0.3);
}

textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(114, 137, 218, 0.3);
}

textarea::placeholder {
  color: #777;
}

.counter {
  display: flex;
  justify-content: flex-end;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 5px;
}

.counter.warning {
  color: var(--warning);
}

/* 為輸出計數器添加樣式 */
.output-counter {
  margin-top: 5px;
}

.output {
  background-color: rgba(114, 137, 218, 0.1);
  border: 1px solid rgba(114, 137, 218, 0.3);
  border-radius: var(--border-radius);
  padding: 15px;
  color: var(--text-primary);
  min-height: 80px;
  transition: var(--transition);
  position: relative;
}

.output.empty {
  color: var(--text-secondary);
  font-style: italic;
}

.output-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.output-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--accent-primary);
}

.copy-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 3px 6px;
  border-radius: 4px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 5px;
}

.copy-btn:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.1);
}

.copy-btn i {
  font-size: 0.9rem;
}

.controls {
  display: flex;
  justify-content: center;
  margin-top: 40px;
  margin-bottom: 30px;
  gap: 15px;
}

.btn {
  padding: 12px 25px;
  border-radius: var(--border-radius);
  border: none;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 160px;
}

.btn-primary {
  background-color: var(--accent-primary);
  color: white;
}

.btn-primary:hover {
  background-color: var(--accent-secondary);
  transform: translateY(-2px);
}

.btn-secondary {
  background-color: transparent;
  color: var(--text-primary);
  border: 1px solid #444;
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.status {
  text-align: center;
  margin-bottom: 20px;
}

.loading {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-secondary);
  font-weight: 500;
}

.loading-spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(114, 137, 218, 0.3);
  border-radius: 50%;
  border-top-color: var(--accent-primary);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.error {
  display: none;
  color: var(--danger);
  background-color: rgba(207, 102, 121, 0.1);
  border-radius: var(--border-radius);
  padding: 10px 15px;
  text-align: center;
  margin: 15px auto;
  max-width: 80%;
}

.success {
  display: none;
  color: var(--success);
  background-color: rgba(3, 218, 197, 0.1);
  border-radius: var(--border-radius);
  padding: 10px 15px;
  text-align: center;
  margin: 15px auto;
  max-width: 80%;
}

footer {
  text-align: center;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #333;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .container {
    padding: 20px 15px;
  }

  .section {
    padding: 20px;
  }

  h1 {
    font-size: 2rem;
  }

  .section-title {
    font-size: 1.2rem;
  }

  .controls {
    flex-direction: column;
    gap: 10px;
  }

  .btn {
    width: 100%;
  }
}

/* 酷炫閃光效果 */
@keyframes glow {
  0% {
    box-shadow: 0 0 5px rgba(114, 137, 218, 0.5);
  }

  50% {
    box-shadow: 0 0 20px rgba(114, 137, 218, 0.8);
  }

  100% {
    box-shadow: 0 0 5px rgba(114, 137, 218, 0.5);
  }
}

.generating .output {
  animation: glow 2s infinite;
}

/* Token 使用情況容器 */
.token-usage-container {
  text-align: center;
  margin: 15px 0;
}

.token-usage {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 15px;
  padding: 6px 12px;
  border-radius: 4px;
  background-color: rgba(0, 0, 0, 0.15);
  font-size: 0.9rem;
  font-weight: 500;
  margin: 0 auto;
  width: fit-content;
}

.token-detail {
  display: inline-block;
  padding: 0 5px;
}

.token-total {
  display: inline-block;
  padding: 0 5px;
  font-weight: 600;
}

/* 額外添加的樣式 */
.required {
  color: #ff5252;
  margin-left: 4px;
}

.input-error {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 2px rgba(207, 102, 121, 0.3) !important;
}

.field-error {
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: 5px;
  display: none;
}

/* 禁用按鈕的樣式 */
.btn:disabled {
  background-color: #444 !important;
  /* 較暗的背景色 */
  color: #777 !important;
  /* 較暗的文字顏色 */
  cursor: not-allowed !important;
  /* 禁用游標 */
  opacity: 0.7;
  transform: none !important;
  /* 防止懸停效果 */
  box-shadow: none !important;
  /* 移除陰影 */
  border-color: #444 !important;
}

/* 禁用複製按鈕的樣式 */
.copy-btn:disabled {
  opacity: 0.5;
  color: #555 !important;
  cursor: not-allowed;
  background-color: transparent !important;
}

/* 禁用輸入框的樣式 */
textarea:disabled {
  background-color: #222 !important;
  /* 更暗的背景 */
  color: #777 !important;
  /* 灰色文字 */
  border-color: #444 !important;
  cursor: not-allowed;
  opacity: 0.8;
  box-shadow: none !important;
  /* 移除焦點陰影 */
}

/* 禁用下拉選單的樣式 */
.store-select:disabled {
  background-color: #222 !important;
  color: #777 !important;
  border-color: #444 !important;
  cursor: not-allowed;
  opacity: 0.8;
  box-shadow: none !important;
  /* 更改下拉箭頭的顏色 */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23555' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
}