/* CSS 變數定義 */
:root {
  --bg-primary: #f7f7f9;
  --bg-secondary: #fff;
  --text-primary: #222;
  --text-secondary: #666;
  --text-muted: #aaa;
  --border-color: #eee;
  --accent-color: #2d72d9;
  --accent-hover: #1a4e96;
  --card-bg: #f7f7f9;
  --card-border: #bfc9d9;
  --skill-bg: #f0f4fa;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* 暗色主題變數 */
[data-theme="dark"] {
  --bg-primary: #181a1b;
  --bg-secondary: #23272a;
  --text-primary: #e3e8ee;
  --text-secondary: #bfc9d9;
  --text-muted: #888;
  --border-color: #222;
  --accent-color: #7ab8ff;
  --accent-hover: #5a9bff;
  --card-bg: #23272a;
  --card-border: #444e5e;
  --skill-bg: #383f44;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

body {
  font-family: "Inter", "Noto Sans TC", Arial, sans-serif;
  margin: 0;
  padding: 0;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* 全域超連結樣式 */
a {
  color: var(--accent-color);
  text-decoration: underline;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent-hover);
}

a:visited {
  color: var(--accent-color);
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1rem;
}

.navbar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 1.5rem 8px;
  margin-bottom: 2rem;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.nav-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.logo h2 {
  margin: 0;
  font-weight: 700;
  color: var(--accent-color);
  transition: color 0.3s ease;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--accent-color);
}

/* 主題切換按鈕樣式 */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  transition: background-color 0.2s ease, color 0.2s ease;
  position: relative;
}

.theme-toggle:hover {
  background-color: var(--skill-bg);
}

.theme-toggle svg {
  transition: opacity 0.3s ease;
}

.theme-toggle .sun-icon {
  opacity: 1;
}

.theme-toggle .moon-icon {
  opacity: 0;
  position: absolute;
}

[data-theme="dark"] .theme-toggle .sun-icon {
  opacity: 0;
}

[data-theme="dark"] .theme-toggle .moon-icon {
  opacity: 1;
}

.hero {
  padding: 3rem 0 2rem 0;
  text-align: center;
}

.hero-title {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
}

.hero-subtitle {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  transition: color 0.3s ease;
}

.hero-buttons .btn {
  display: inline-block;
  margin: 0 0.5rem;
  padding: 0.6rem 1.4rem;
  border-radius: 6px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

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

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

.btn-secondary {
  background: var(--skill-bg);
  color: var(--accent-color);
}

.btn-secondary:hover {
  background: var(--card-bg);
}

.section-container {
  background: var(--bg-secondary);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 2rem 1.5rem;
  margin-bottom: 2rem;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.section-title {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--accent-color);
  transition: color 0.3s ease;
}

.skills {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.skill-item {
  background: var(--skill-bg);
  color: var(--accent-color);
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 1rem;
  font-weight: 500;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.hobby-item {
  background: var(--skill-bg);
  color: var(--accent-color);
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 1rem;
  font-weight: 500;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.tools-grid {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.tool-card {
  background: var(--card-bg);
  border: 1px dashed var(--card-border);
  border-radius: 10px;
  padding: 1.2rem 1rem;
  min-width: 180px;
  flex: 1 1 180px;
  text-align: center;
  color: var(--text-secondary);
  transition: background-color 0.3s ease, border-color 0.3s ease,
    color 0.3s ease;
}

.tool-card.placeholder h3 {
  color: var(--card-border);
}

.footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 2rem 0 1rem 0;
  transition: color 0.3s ease;
}

@media (max-width: 600px) {
  .container {
    padding: 0 0.3rem;
  }

  .section-container {
    padding: 1.2rem 0.5rem;
  }

  .tools-grid {
    flex-direction: column;
    gap: 1rem;
  }

  .nav-right {
    gap: 1rem;
  }

  .nav-links {
    gap: 1rem;
  }
}

/* 移除舊的 prefers-color-scheme 規則，因為現在使用手動控制 */
