:root {
  --primary-500: #ffe07e;
  --primary-600: #ffd03e;
  --secondary-100: #fffdf3;
  --secondary-300: #fff9e6;
  --accent-500: #bce3f7;
  --accent-600: #0284c7;
  --accent-700: #0369a1;
  --neutral-50: #fafafa;
  --neutral-300: #d4d4d4;
  --neutral-600: #525252;
  --neutral-800: #262626;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans TC', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--neutral-800);
  background-color: var(--neutral-50);
  padding: 20px;
  min-height: 100vh;
}

button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

.skill-system {
  max-width: 1200px;
  margin: 0 auto;
  background: white;
  border: 1px solid var(--neutral-300);
  border-radius: 16px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.system-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
  border-bottom: 1px solid var(--primary-600);
}

.system-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--neutral-800);
  margin: 0;
}

.version-info {
  font-size: 14px;
  color: var(--neutral-600);
  text-align: right;
}

.class-selector {
  padding: 24px;
  background: var(--neutral-50);
  border-bottom: 1px solid #f2dca5;
}

.class-selector h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--neutral-800);
}

.search-container {
  position: relative;
  margin-bottom: 16px;
}

.search-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--neutral-300);
  border-radius: 16px;
  font-size: 16px;
  background: white;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-600);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--neutral-300);
  border-radius: 8px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
}

.search-result-item {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid #f2dca5;
}

.search-result-item:hover {
  background: var(--neutral-50);
}

.class-tabs {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.class-tab {
  padding: 12px 16px;
  background: white;
  border: 2px solid var(--neutral-300);
  border-radius: 16px;
  font-weight: 500;
  color: var(--neutral-800);
  transition: all 200ms ease;
  cursor: pointer;
  text-align: center;
  font-size: 14px;
  min-width: 80px;
  display: inline-block;
}

.class-tab:hover {
  border-color: var(--accent-500);
  background: var(--accent-500);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.class-tab.active {
  background: var(--accent-600);
  border-color: var(--accent-600);
  color: white;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.class-content-container {
  display: none;
  width: 100%;
}

.class-content-container.active {
  display: block;
}

.class-header {
  padding: 20px 24px;
  background: var(--secondary-100);
  border-bottom: 1px solid #f2dca5;
  width: 100%;
}

.class-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--neutral-800);
  margin-bottom: 8px;
}

.class-description {
  color: var(--neutral-600);
  font-size: 14px;
}

.job-progression-container {
  padding: 24px;
  background: white;
  width: 100%;
}

.skill-list {
  padding: 24px;
  background: white;
  width: 100%;
}

.skill-table-container {
  overflow-x: auto;
  width: 100%;
}

.skill-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.skill-table th {
  background: var(--accent-500);
  color: var(--neutral-800);
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 16px 20px;
  text-align: left;
  white-space: nowrap;
}

.skill-table tbody tr {
  display: table-row;
}

.skill-table tbody tr:last-child {
}

.skill-table td {
  padding: 20px;
  border-bottom: 1px solid #f2dca5;
  vertical-align: middle;
  display: table-cell;
}

.skill-table tr:last-child td {
  border-bottom: none;
}

.skill-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.skill-icon img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  display: block;
}

.skill-name {
  font-weight: 600;
  color: var(--neutral-800);
  vertical-align: middle;
  display: block;
}

.skill-type {
  vertical-align: middle;
  display: block;
}

.skill-description-cell {
  max-width: 400px;
  vertical-align: middle;
  display: table-cell;
}

.skill-description {
  color: var(--neutral-600);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 8px;
}

.skill-description-max-level {
  color: var(--accent-700);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 8px;
}

.skill-levels {
  margin-top: 8px;
}

.skill-levels details {
  border: 1px solid var(--neutral-300);
  border-radius: 8px;
  overflow: hidden;
}

.skill-levels summary {
  padding: 8px 12px;
  background: var(--neutral-50);
  cursor: pointer;
  font-weight: 500;
  color: var(--neutral-800);
}

.skill-levels summary:hover {
  background: var(--neutral-300);
}

.levels-content {
  padding: 12px;
  background: white;
}

.level-entry {
  padding: 4px 0;
  font-size: 14px;
  color: var(--neutral-600);
  border-bottom: 1px solid var(--neutral-300);
}

.level-entry:last-child {
  border-bottom: none;
}

.skill-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid transparent;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
}

.skill-badge::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
  box-shadow: 0 0 8px currentColor;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.8; }
  100% { transform: scale(1); opacity: 1; }
}

.skill-badge.passive {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  color: #1e40af;
  border-color: #93c5fd;
}

.skill-badge.passive::before {
  background: #3b82f6;
}

.skill-badge.active {
  background: linear-gradient(135deg, #fce7f3, #fbcfe8);
  color: #be185d;
  border-color: #f9a8d4;
}

.skill-badge.active::before {
  background: #ec4899;
}

.skill-badge.buff {
  background: linear-gradient(135deg, #dcfce7, #bbf7d0);
  color: #166534;
  border-color: #86efac;
}

.skill-badge.buff::before {
  background: #22c55e;
}

.skill-badge.debuff {
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  color: #991b1b;
  border-color: #fca5a5;
}

.skill-badge.debuff::before {
  background: #ef4444;
}

/* 職業進階樹樣式 */
.job-progression {
  margin: 20px 0;
}

.tree-flex-row {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 5px 0;
}

.progression-branch {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
}

.job-link {
  min-width: 130px;
  max-width: 130px;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  word-break: keep-all;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-height: 36px;
  padding: 8px 12px;
  background: white;
  border: 1px solid var(--neutral-300);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.job-link:hover {
  background: var(--neutral-50);
  border-color: var(--neutral-600);
}

.job-link.active {
  background: var(--accent-500);
  border-color: var(--accent-600);
  color: var(--accent-700);
  font-weight: 600;
}

.branch-arrow,
.progression-arrow {
  flex-shrink: 0;
}

@media (max-width: 768px) {
  body { 
    padding: 12px; 
  }
  
  .skill-system { 
    margin: 0; 
    border-radius: 8px; 
  }
  
  .system-header { 
    padding: 16px 20px; 
    flex-direction: column; 
    gap: 8px; 
  }
  
  .system-title { 
    font-size: 20px; 
  }
  
  .class-selector { 
    padding: 16px; 
  }
  
  .class-tabs { 
    grid-template-columns: repeat(2, 1fr); 
    gap: 8px; 
  }
  
  .class-tab { 
    padding: 8px 12px; 
  }
  
  .job-progression-container,
  .skill-list {
    padding: 16px;
  }
  
  .skill-table th, 
  .skill-table td { 
    padding: 12px 16px; 
    font-size: 14px; 
  }
  
  .skill-description-cell {
    max-width: none;
  }
  
  .skill-icon {
    width: 40px;
    height: 40px;
  }
  
  .skill-icon img {
    width: 28px;
    height: 28px;
  }
  
  .job-link {
    min-width: 115px;
    max-width: 115px;
    font-size: 12px;
  }
}

/* 新增：橘色文字樣式 (提高優先級) */
.skill-description .orange-text,
.skill-description-max-level .orange-text,
.level-entry .orange-text {
  color: orange !important; /* 添加 !important 確保最高優先級，如果前面不夠力的話 */
  font-weight: 600; /* 可選：讓橘色文字更顯眼 */
}

/* 移除舊的 .orange-text 樣式 */
/*
.orange-text {
  color: orange; 
  font-weight: 600; 
}
*/ 