/* 基本設定 */
:root {
    --primary: #2563eb;
    --text: #1f2937;
    --text-light: #6b7280;
    --bg: #ffffff;
    --border: #e5e7eb;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", sans-serif;
    color: var(--text);
    line-height: 1.6;
}

/* 導覽列 */
.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
}

.nav-brand {
    font-weight: 600;
    font-size: 1.125rem;
}

.nav-links a {
    margin-left: 2rem;
    text-decoration: none;
    color: var(--text);
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-links a.active {
    color: var(--primary);
    font-weight: 600;
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* 主視覺 */
.hero {
    text-align: center;
    padding: 4rem 0 3rem;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-light);
}

/* 工具列表控制 */
.tools-controls {
    display: grid;
    grid-template-columns: 1fr 220px;
    gap: 12px;
    margin: 16px 0 8px;
}

.control-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-label {
    font-size: 12px;
    opacity: 0.8;
}

.control-select {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.15);
}

.tag-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-filter {
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(0,0,0,0.15);
    background: transparent;
    cursor: pointer;
    font-size: 12px;
    opacity: 0.85;
}

.tag-filter.is-active {
    opacity: 1;
    border-color: rgba(0,0,0,0.35);
    font-weight: 600;
}

/* 工具網格/列表 */
.tools-grid {
    margin: 24px 0;
}

/* 首頁:預設 3 欄網格 */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

/* 工具一覽頁:卡片模式 2 欄 */
.tools-grid.is-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

/* 工具一覽頁:列表模式 */
.tools-grid.is-list {
    display: block;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 10px;
    padding: 10px 12px;
}

/* 工具卡片 */
.tool-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    transition: transform 0.2s, box-shadow 0.2s;
    background: var(--bg);
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.1);
}

.tool-card.developing {
    opacity: 0.6;
}

.tool-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.tool-card h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.tool-card p {
    color: var(--text-light);
    margin-bottom: 1rem;
}

.tool-meta {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tag {
    background: #dbeafe;
    color: #1e40af;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.875rem;
}

.status {
    background: #dcfce7;
    color: #166534;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.875rem;
}

.tool-updated {
    font-size: 12px;
    opacity: 0.75;
    margin-top: 8px;
}

/* 列表模式樣式 */
.tools-grid.is-list .tool-card {
    border: none;
    padding: 8px 0;
    margin: 0;
    border-bottom: 1px dashed rgba(0,0,0,0.08);
}

.tools-grid.is-list .tool-card:last-child {
    border-bottom: none;
}

.tool-list-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tool-list-date {
    font-size: 12px;
    opacity: 0.7;
    white-space: nowrap;
}

.tool-list-title {
    flex: 1;
    min-width: 0;
    color: #551A8B;
    text-decoration: underline;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tool-list-title:hover {
    opacity: 0.85;
}

.tool-list-meta {
    display: flex;
    gap: 8px;
    white-space: nowrap;
}

.tools-grid.is-list .tool-card-view { 
    display: none; 
}

.tools-grid.is-grid .tool-list-row { 
    display: none; 
}

/* 按鈕 */
.btn-try {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-try:hover {
    background: #1d4ed8;
}

.btn-disabled {
    display: inline-block;
    background: #e5e7eb;
    color: #9ca3af;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 500;
}

/* 公告區塊 */
.announcements {
    margin: 24px 0;
}

.ann-box {
    max-height: 180px;
    overflow-y: auto;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 10px;
    padding: 10px 12px;
}

.ann-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ann-list li {
    display: flex;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px dashed rgba(0,0,0,0.08);
}

.ann-list li:last-child {
    border-bottom: none;
}

.ann-date {
    font-size: 12px;
    opacity: 0.7;
    white-space: nowrap;
}

/* 步驟說明 */
.steps {
    margin: 24px 0;
}

.steps-list {
    margin: 12px 0 0;
    padding-left: 20px;
}

.small-text {
    font-size: 12px;
    opacity: 0.75;
    line-height: 1.5;
}

/* 作者訊息 */
.message {
    text-align: center;
    background-color: antiquewhite;
    padding: 1rem 0 1rem;
    border-radius: 10px;
}

.message h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.message p {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.7;
}

/* 頁尾 */
.footer {
    text-align: center;
    padding: 3rem 2rem;
    border-top: 1px solid var(--border);
    color: var(--text-light);
}

.footer-links {
    margin-top: 1rem;
}

.footer-links a {
    margin: 0 1rem;
    color: var(--text);
    text-decoration: none;
}

/* 關於頁面 */
.about-page {
    max-width: 800px;
    padding-bottom: 4rem;
}

.about-header {
    text-align: center;
    padding: 4rem 0 3rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 3rem;
}

.about-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.lead {
    font-size: 1.25rem;
    color: var(--text-light);
}

.about-section {
    margin-bottom: 3rem;
}

.about-section h2 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.about-section p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

.about-section a {
    color: var(--primary);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.about-section a:hover {
    border-bottom-color: var(--primary);
}

.principles {
    display: grid;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.principle-item {
    padding: 1.5rem;
    background: #f9fafb;
    border-radius: 8px;
    border-left: 4px solid var(--primary);
}

.principle-item h3 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.principle-item p {
    margin: 0;
    color: var(--text-light);
}

.tech-list {
    list-style: none;
    margin: 1.5rem 0;
    padding: 0;
}

.tech-list li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.tech-list li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--primary);
}

.tech-list code {
    background: #f3f4f6;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: 'Monaco', 'Menlo', monospace;
}

.author-info {
    background: #f9fafb;
    padding: 2rem;
    border-radius: 8px;
}

.author-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.author-link {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: 6px;
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s;
}

.author-link:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.support-section {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: white;
}

.support-section h2 {
    color: white;
}

.support-section p {
    color: rgba(255, 255, 255, 0.9);
}

.btn-support {
    display: inline-block;
    background: white;
    color: #667eea;
    padding: 0.875rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    margin-top: 1rem;
    transition: transform 0.2s;
}

.btn-support:hover {
    transform: scale(1.05);
}

/* 一般頁面 */
.page {
    padding: 16px 0 32px;
}

.page .inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 16px;
}

.page h2 {
    font-size: 1.4rem;
    margin-top: 0;
    margin-bottom: 12px;
}

.page h3 {
    font-size: 1.05rem;
    margin-top: 18px;
    margin-bottom: 6px;
}

.page h4 {
    font-size: 0.95rem;
    margin-top: 14px;
    margin-bottom: 4px;
}

.page p {
    font-size: 0.95rem;
    margin-top: 4px;
    margin-bottom: 8px;
}

.page ul,
.page ol {
    font-size: 0.95rem;
    margin-top: 4px;
    margin-bottom: 10px;
    padding-left: 20px;
}

.page li + li {
    margin-top: 2px;
}

/* 聯絡表單 */
.contact-form {
    margin-top: 20px;
}

.google-form {
    width: 100%;
    max-width: 1800px;
    height: 1800px;
    border: none;
}

/* 響應式設計 */
@media (max-width: 1024px) {
    /* 首頁:顯示 2 欄 */
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* 工具一覽頁卡片模式:維持 2 欄 */
    .tools-grid.is-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    /* 首頁和工具一覽頁:都顯示 1 欄 */
    .tools-grid,
    .tools-grid.is-grid {
        grid-template-columns: 1fr;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .about-header h1 {
        font-size: 2rem;
    }
    
    .about-page {
        padding: 0 1rem 3rem;
    }
    
    .author-links {
        flex-direction: column;
    }
    
    .author-link {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 720px) {
    .tools-controls {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .google-form {
        height: 900px;
    }
}

.scenario-block {
  margin: 24px 0;
}

.scenario-block h2 {
  text-align: center;
  margin: 0 0 6px 0;
  font-size: 26px;
  color: #2a43ff;
}

.scenario-block .sub {
  text-align: center;
  margin: 0 0 14px 0;
  opacity: 0.8;
}

/* 讓清單變成卡片格線 */
.scenario-list {
  list-style: none;
  padding: 0;
  margin: 0;

  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 900px) {
  .scenario-list {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

/* 單一卡片：按鈕感 */
.scenario-list li {
  margin: 0;
}

/* 把 a 做成整張卡 */
.scenario-list a {
  display: flex;
  align-items: center;
  justify-content: center;

  min-height: 120px;            /* 卡片高度 */
  padding: 18px 16px;

  background-color: #e6f6ef;    /* 淡綠底 */
  border: 1px solid #d3efe4;
  border-radius: 14px;

  text-align: center;
  text-decoration: none;
  color: #1d1d1d;

  font-weight: 700;
  line-height: 1.6;

  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

/* hover：微浮起 */
.scenario-list a:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(0,0,0,0.12);
  border-color: #bfe7d7;
}

/* focus：鍵盤可用性 */
.scenario-list a:focus-visible {
  outline: 3px solid rgba(42, 60, 255, 0.35);
  outline-offset: 3px;
}

/* 「一覧を見る」放下面 */
.scenario-block .more {
  margin-top: 12px;
  text-align: right;
}

.scenario-block .more a {
  color: #2a3cff;
  text-decoration: underline;
}

/* 一覧：2カラム（PC）、1カラム（スマホ） */
.scenario-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-top: 14px;
}

@media (min-width: 900px) {
  .scenario-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* カード本体：白背景＋薄枠＋控えめ影（実務向け） */
.scenario-card {
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 6px 14px rgba(0,0,0,0.06);
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

/* hover：微浮き。派手にしない */
.scenario-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 18px rgba(0,0,0,0.10);
  border-color: #d9d9d9;
}

/* タイトル（痛点）：カード内で最優先 */
.scenario-card .pain {
  margin: 0;
  font-size: 18px;
  line-height: 1.5;
}

.scenario-card .pain a {
  color: #1d1d1d;
  text-decoration: none;
}

/* タイトル hover：下線で「押せる」感 */
.scenario-card .pain a:hover {
  text-decoration: underline;
}

/* タグ行：小さく、控えめ */
.scenario-card .tags {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.scenario-card .tag {
  display: inline-block;
  font-size: 12px;
  padding: 2px 10px;
  border: 1px solid #e6e6e6;
  border-radius: 999px;
  background: #fafafa;
  color: #444;
}

/* box：セクションのまとまりを付ける */
.scenario-card .box {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #e6e6e6;
}

.scenario-card .box h3 {
  margin: 0 0 8px 0;
  font-size: 13px;
  color: #333;
}

/* リスト：読みやすく */
.scenario-card ul {
  margin: 0;
  padding-left: 18px;
}

.scenario-card li {
  line-height: 1.6;
  margin: 4px 0;
  color: #333;
}

/* 対応ツールリンク：視認性を上げる */
.scenario-card .tools {
  padding-left: 18px;
}

.scenario-card .tool-link {
  color: #2a3cff;
  text-decoration: underline;
}

.scenario-card .tool-link:hover {
  text-decoration: none;
  opacity: 0.85;
}

/* 注意事項：一覧で重要。枠で軽く強調 */
.scenario-card .box.note {
  background: #fbfbfb;
  border: 1px solid #dbdbdb;
  border-radius: 10px;
  padding: 10px 12px;
}

/* キーボード操作：フォーカス表示 */
.scenario-card a:focus-visible {
  outline: 3px solid rgba(42, 60, 255, 0.35);
  outline-offset: 3px;
}
.scenario-controls {
  margin: 12px 0 8px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-chip {
  border: 1px solid #e6e6e6;
  background: #fafafa;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}

.tag-chip:hover {
  border-color: #d9d9d9;
}

.tag-chip.is-active {
  border-color: #2a3cff;
  box-shadow: 0 0 0 3px rgba(42, 60, 255, 0.18);
  background: #fff;
}

.tag-chip:focus-visible {
  outline: 3px solid rgba(42, 60, 255, 0.35);
  outline-offset: 3px;
}

/* controls 行レイアウト */
.control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.control-label {
  font-size: 14px;
  color: #333;
}

/* クリア：タグと完全同型、背景だけ変更 */
.tag-chip.tag-clear {
  background-color: #fff3e0;   /* 淡橘 */
  border-color: #ffcc80;
  color: #e65100;
}

/* hover */
.tag-chip.tag-clear:hover {
  background-color: #ffe0b2;
  border-color: #ffb74d;
}

/* active 狀態（可選，避免被誤認為選中） */
.tag-chip.tag-clear.is-active {
  box-shadow: none;
}
