/* 全站基礎樣式 */
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0f172a;
  color: #e5e7eb;
}

/* 頂部導覽列 */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  background: #020617;
  border-bottom: 1px solid #1e293b;
}

.logo {
  font-weight: 700;
  color: #e5e7eb;
  text-decoration: none;
}

.nav a {
  margin-left: 16px;
  color: #9ca3af;
  text-decoration: none;
  font-size: 14px;
}

.nav a:hover {
  color: #e5e7eb;
}

/* 內文容器 */
.page {
  max-width: 960px;
  margin: 24px auto 48px;
  padding: 0 16px;
}

.page-title {
  margin-bottom: 4px;
}

.page-subtitle {
  margin-top: 0;
  color: #9ca3af;
}

/* 工具卡片列表（首頁用） */
.tool-list {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.tool-card {
  display: block;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid #1e293b;
  background: #020617;
  text-decoration: none;
  color: inherit;
  transition: transform 0.12s ease-out, box-shadow 0.12s ease-out, border-color 0.12s ease-out;
}

.tool-card h2 {
  margin: 0 0 4px;
  font-size: 18px;
}

.tool-card p {
  margin: 0;
  font-size: 14px;
  color: #9ca3af;
}

.tool-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.8);
  border-color: #3b82f6;
}

/* 單一工具區塊 */
.tool {
  margin-top: 24px;
  padding: 16px;
  border-radius: 12px;
  background: #020617;
  border: 1px solid #1e293b;
}

.tool label {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}

.tool textarea,
.tool input {
  width: 100%;
  padding: 8px;
  margin-bottom: 12px;
  border-radius: 8px;
  border: 1px solid #1e293b;
  background: #020617;
  color: #e5e7eb;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 13px;
  box-sizing: border-box;
}

.tool textarea:focus,
.tool input:focus {
  outline: none;
  border-color: #3b82f6;
}

/* 按鈕 */
.tool button {
  padding: 8px 16px;
  border-radius: 999px;
  border: none;
  background: #3b82f6;
  color: #0b1120;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
}

.tool button:hover {
  filter: brightness(1.1);
}

/* pre 結果區 */
.pre-output {
  margin-top: 8px;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid #1e293b;
  background: #020617;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 13px;
  max-height: 320px;
  overflow: auto;
}

/* 錯誤訊息 */
.error-text {
  color: #f97373;
  font-size: 13px;
  margin-top: 4px;
}

/* 底部資訊＋廣告區可以共用的容器（如果之後要加） */
.tool-info {
  margin-top: 24px;
  padding: 16px;
  border-radius: 12px;
  background: #020617;
  border: 1px solid #1e293b;
  font-size: 14px;
  color: #9ca3af;
}

/* AdSense 區塊 */
.ad-block {
  margin: 16px 0;
}

/* 頁尾 */
.site-footer {
  text-align: center;
  padding: 16px;
  font-size: 12px;
  color: #6b7280;
  border-top: 1px solid #1e293b;
  background: #020617;
}

/* 手機優化 */
@media (max-width: 640px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .nav {
    display: flex;
    flex-wrap: wrap;
  }

  .nav a {
    margin-left: 0;
    margin-right: 12px;
    margin-bottom: 4px;
  }
}
