/* ──────────────────────────────────────────────────────────────
   軒古講堂 · AI 工具頁「知微島風格」換皮（tool-theme.css）

   AI 工具是編譯後的 React 程式，畫面顏色寫在程式裡（Tailwind 的 slate／amber 深色系）。
   這支檔案不動程式，只從外面把顏色、字體、圓角換成知微島那一套：
   米白紙色底、墨綠字、深綠按鈕、古金點綴、明體標題。

   搭配 tools/apply_tool_theme.py 使用：它在工具頁的 <head> 加上
     1. Tailwind 色票對照（slate → 紙色系、amber → 綠／金），處理九成的顏色
     2. 這支樣式檔，處理對照表管不到的地方（寫死的色碼、行內樣式、字體、陰影）
   要換色：改這裡的 :root 變數，以及 apply_tool_theme.py 的 PALETTE（兩邊要一致）。
   拿掉：python tools\apply_tool_theme.py --remove --apply
   ────────────────────────────────────────────────────────────── */

:root {
  --tt-paper: #f7f6f0;   /* 頁面底色（知微島 --paper） */
  --tt-card:  #fffef9;   /* 卡片 */
  --tt-pale:  #eef1e7;   /* 淡綠底（選取、提示） */
  --tt-line:  #e4e5d9;   /* 細線 */
  --tt-ink:   #2d443b;   /* 墨綠（標題、內文） */
  --tt-green: #365a49;   /* 深綠（按鈕） */
  --tt-muted: #788177;   /* 次要文字 */
  --tt-gold:  #b59562;   /* 古金（裝飾線、小標） */
  --tt-gold-ink: #8a6c3a;/* 古金文字（在紙色上要深一點才讀得清楚） */
  --tt-serif: 'Noto Serif TC', 'Songti TC', 'PMingLiU', serif;
  --tt-sans:  'Noto Sans TC', system-ui, sans-serif;
  --tt-shadow: 0 1px 2px rgba(45, 68, 59, .05), 0 12px 30px -18px rgba(45, 68, 59, .28);
}

/* ── 基礎：頁面底色與文字 ── */
html, body.tt-theme {
  background-color: var(--tt-paper) !important;
  color: var(--tt-ink) !important;
  font-family: var(--tt-sans);
  -webkit-font-smoothing: antialiased;
}
body.tt-theme #license-note { color: var(--tt-muted) !important; background: transparent !important; }

/* ── 標題用明體 ── */
.tt-theme h1, .tt-theme h2, .tt-theme h3, .tt-theme .serif, .tt-theme .font-serif {
  font-family: var(--tt-serif) !important;
  letter-spacing: .04em;
}

/* ── 程式裡寫死的深色（對照表管不到） ── */
.tt-theme [class*="bg-[#020617]"] { background-color: var(--tt-paper) !important; }
/* 命盤中央的資訊框 */
.tt-theme [class*="bg-[#0a0f1e]"] { background-color: var(--tt-card) !important; }
.tt-theme [style*="rgb(2, 6, 23)"], .tt-theme [style*="rgba(2, 6, 23"],
.tt-theme [style*="rgb(15, 23, 42)"], .tt-theme [style*="rgba(15, 23, 42"] {
  background: rgba(247, 246, 240, .94) !important;
  color: var(--tt-ink) !important;
  border-color: var(--tt-line) !important;
}
/* 最上面的促銷／會員橫條（深藍漸層）→ 淡綠底 */
.tt-theme [style*="rgb(26, 26, 46)"] {
  background: var(--tt-pale) !important;
  border-bottom: 1px solid var(--tt-line) !important;
  color: var(--tt-ink) !important;
}
.tt-theme [style*="rgb(26, 26, 46)"] span, .tt-theme [style*="rgb(26, 26, 46)"] div { color: var(--tt-ink) !important; }
/* 最下面的購買提示：字是行內樣式寫死的白色 */
.tt-theme [style*="rgb(2, 6, 23)"] [style*="color: white"],
.tt-theme [style*="rgba(2, 6, 23"] [style*="color: white"] { color: var(--tt-ink) !important; }
.tt-theme [style*="color: rgb(156, 163, 175)"], .tt-theme [style*="color: rgb(107, 114, 128)"] { color: var(--tt-muted) !important; }
/* 「升級會員」橘色按鈕 → 深綠 */
.tt-theme [style*="rgb(217, 119, 6)"] { background: var(--tt-green) !important; color: #fffef9 !important; border-radius: 999px !important; }
.tt-theme [style*="color: rgb(180, 83, 9)"] { color: var(--tt-gold-ink) !important; }

/* ── 白字：原本在深色底上，現在底是紙色，改成墨綠 ── */
.tt-theme .text-white, .tt-theme .hover\:text-white:hover { color: var(--tt-ink) !important; }

/* ── 深綠底上的字維持亮色（上面把 text-white 改成墨綠，按鈕要改回來） ── */
.tt-theme .bg-amber-600, .tt-theme .bg-amber-500, .tt-theme .bg-amber-800,
.tt-theme .bg-indigo-600, .tt-theme .bg-emerald-500,
.tt-theme .bg-amber-600 *, .tt-theme .bg-amber-500 *, .tt-theme .bg-amber-800 *,
.tt-theme [class*="from-amber-6"], .tt-theme [class*="from-amber-6"] * { color: #fffef9 !important; }
.tt-theme .bg-indigo-600 { background-color: var(--tt-green) !important; }
.tt-theme .bg-red-900\/90, .tt-theme .bg-red-900\/90 * { color: #fff5f3 !important; }

/* ── 卡片：細線、柔和陰影（原本是很重的黑色陰影） ── */
.tt-theme [class*="shadow-2xl"], .tt-theme [class*="shadow-xl"], .tt-theme [class*="shadow-lg"],
.tt-theme [class*="shadow-\[0_0_50px"] { box-shadow: var(--tt-shadow) !important; }
.tt-theme [class*="shadow-\[inset"] { box-shadow: none !important; }
.tt-theme .backdrop-blur-xl, .tt-theme .backdrop-blur-md, .tt-theme .backdrop-blur-sm { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }

/* ── 輸入欄位 ── */
.tt-theme input, .tt-theme select, .tt-theme textarea {
  background-color: #fff !important;
  color: var(--tt-ink) !important;
  border-color: var(--tt-line) !important;
}
.tt-theme input::placeholder, .tt-theme textarea::placeholder { color: #a9b0a5 !important; }
.tt-theme input:focus, .tt-theme select:focus, .tt-theme textarea:focus {
  border-color: var(--tt-green) !important;
  box-shadow: 0 0 0 3px rgba(54, 90, 73, .14) !important;
  outline: none !important;
}

/* ── 彈出視窗的遮罩：黑色 → 墨綠半透明 ── */
.tt-theme .bg-black\/80, .tt-theme .bg-black\/70, .tt-theme .bg-black\/60 { background-color: rgba(45, 68, 59, .45) !important; }

/* ── 漸層標題（原本金色漸層字）→ 墨綠實色 ── */
.tt-theme .bg-clip-text.text-transparent {
  background-image: none !important;
  -webkit-text-fill-color: var(--tt-ink);
  color: var(--tt-ink) !important;
}

/* ── 小裝飾：標題下的金色細線（只加在工具自己的畫面 #root 裡，不要跑進 Google 廣告牆的視窗） ── */
.tt-theme h1 { font-weight: 700; }
.tt-theme #root h1::after {
  content: ""; display: block; width: 44px; height: 2px; margin: .5em auto 0;
  background: var(--tt-gold); opacity: .8; border-radius: 2px;
}

/* ── 其他工具的重點色按鈕（黃、青、紫）：底已換成深綠，字維持亮色 ── */
.tt-theme [class~="bg-amber-500"], .tt-theme [class~="bg-amber-600"], .tt-theme [class~="bg-amber-800"], .tt-theme [class~="bg-yellow-500"], .tt-theme [class~="bg-yellow-600"], .tt-theme [class~="bg-yellow-800"], .tt-theme [class~="bg-cyan-500"], .tt-theme [class~="bg-cyan-600"], .tt-theme [class~="bg-cyan-800"], .tt-theme [class~="bg-purple-500"], .tt-theme [class~="bg-purple-600"], .tt-theme [class~="bg-purple-800"], .tt-theme [class~="bg-indigo-500"], .tt-theme [class~="bg-indigo-600"], .tt-theme [class~="bg-indigo-800"],
.tt-theme [class~="bg-amber-500"] *, .tt-theme [class~="bg-amber-600"] *, .tt-theme [class~="bg-amber-800"] *, .tt-theme [class~="bg-yellow-500"] *, .tt-theme [class~="bg-yellow-600"] *, .tt-theme [class~="bg-yellow-800"] *, .tt-theme [class~="bg-cyan-500"] *, .tt-theme [class~="bg-cyan-600"] *, .tt-theme [class~="bg-cyan-800"] *, .tt-theme [class~="bg-purple-500"] *, .tt-theme [class~="bg-purple-600"] *, .tt-theme [class~="bg-purple-800"] *, .tt-theme [class~="bg-indigo-500"] *, .tt-theme [class~="bg-indigo-600"] *, .tt-theme [class~="bg-indigo-800"] * { color: #fffef9 !important; }
/* 其他實色按鈕（綠、紅…原色保留；藍色已由色票換成深綠）：字維持白色 */
.tt-theme [class~="bg-emerald-500"], .tt-theme [class~="bg-emerald-600"], .tt-theme [class~="bg-emerald-700"], .tt-theme [class~="bg-emerald-800"],
.tt-theme [class~="bg-emerald-500"] *, .tt-theme [class~="bg-emerald-600"] *, .tt-theme [class~="bg-emerald-700"] *, .tt-theme [class~="bg-emerald-800"] *,
.tt-theme [class~="bg-green-500"], .tt-theme [class~="bg-green-600"], .tt-theme [class~="bg-green-700"], .tt-theme [class~="bg-green-800"],
.tt-theme [class~="bg-green-500"] *, .tt-theme [class~="bg-green-600"] *, .tt-theme [class~="bg-green-700"] *, .tt-theme [class~="bg-green-800"] *,
.tt-theme [class~="bg-red-500"], .tt-theme [class~="bg-red-600"], .tt-theme [class~="bg-red-700"], .tt-theme [class~="bg-red-800"],
.tt-theme [class~="bg-red-500"] *, .tt-theme [class~="bg-red-600"] *, .tt-theme [class~="bg-red-700"] *, .tt-theme [class~="bg-red-800"] *,
.tt-theme [class~="bg-rose-500"], .tt-theme [class~="bg-rose-600"], .tt-theme [class~="bg-rose-700"], .tt-theme [class~="bg-rose-800"],
.tt-theme [class~="bg-rose-500"] *, .tt-theme [class~="bg-rose-600"] *, .tt-theme [class~="bg-rose-700"] *, .tt-theme [class~="bg-rose-800"] *,
.tt-theme [class~="bg-blue-500"], .tt-theme [class~="bg-blue-600"], .tt-theme [class~="bg-blue-700"], .tt-theme [class~="bg-blue-800"],
.tt-theme [class~="bg-blue-500"] *, .tt-theme [class~="bg-blue-600"] *, .tt-theme [class~="bg-blue-700"] *, .tt-theme [class~="bg-blue-800"] *,
.tt-theme [class~="bg-orange-500"], .tt-theme [class~="bg-orange-600"], .tt-theme [class~="bg-orange-700"], .tt-theme [class~="bg-orange-800"],
.tt-theme [class~="bg-orange-500"] *, .tt-theme [class~="bg-orange-600"] *, .tt-theme [class~="bg-orange-700"] *, .tt-theme [class~="bg-orange-800"] *,
.tt-theme [class~="bg-teal-500"], .tt-theme [class~="bg-teal-600"], .tt-theme [class~="bg-teal-700"], .tt-theme [class~="bg-teal-800"],
.tt-theme [class~="bg-teal-500"] *, .tt-theme [class~="bg-teal-600"] *, .tt-theme [class~="bg-teal-700"] *, .tt-theme [class~="bg-teal-800"] * { color: #fff !important; }
/* 漸層按鈕（梅花的紫→青、紫微的橘漸層）→ 深綠實色 */
.tt-theme button[class*="bg-gradient"], .tt-theme a[class*="bg-gradient"],
.tt-theme button[class*="bg-linear"], .tt-theme a[class*="bg-linear"] {
  background-image: none !important; background-color: var(--tt-green) !important; color: #fffef9 !important;
}
.tt-theme button[class*="bg-gradient"] *, .tt-theme a[class*="bg-gradient"] *,
.tt-theme button[class*="bg-linear"] *, .tt-theme a[class*="bg-linear"] * { color: #fffef9 !important; }
/* 其他寫死的深色頁面底 */
.tt-theme [class*="bg-[#0f172a]"], .tt-theme [class*="bg-[#1a1a1a]"] { background-color: var(--tt-paper) !important; }
/* 停用的按鈕不要整個消失 */
.tt-theme button:disabled { opacity: .55; }

/* ══════════════════════════════════════════════════════════════
   各工具自己的調整（body 上有 tt-工具名）
   ══════════════════════════════════════════════════════════════ */

/* ── 姓名：原本是米色＋棕灰的色碼寫死在程式裡，逐一對到知微島的顏色 ── */
.tt-name [class*="bg-[#FDFCF8]"] { background-color: var(--tt-card) !important; }
.tt-name [class*="bg-[#F5F5F0]"] { background-color: var(--tt-paper) !important; }
.tt-name [class*="bg-[#E6D5B8]"] { background-color: var(--tt-pale) !important; }
.tt-name [class~="bg-[#1A1A1A]"], .tt-name [class~="bg-[#2D2926]"], .tt-name [class~="bg-[#8B7E66]"] { background-color: var(--tt-green) !important; }
.tt-name [class~="bg-[#1A1A1A]"], .tt-name [class~="bg-[#1A1A1A]"] *,
.tt-name [class~="bg-[#2D2926]"], .tt-name [class~="bg-[#2D2926]"] *,
.tt-name [class~="bg-[#8B7E66]"], .tt-name [class~="bg-[#8B7E66]"] * { color: #fffef9 !important; }
.tt-name [class*="hover:bg-[#2D2926]"]:hover, .tt-name [class*="hover:bg-[#1A1A1A]"]:hover, .tt-name [class*="hover:bg-[#8B7E66]"]:hover { background-color: #426b57 !important; color: #fffef9 !important; }
.tt-name [class~="text-[#1A1A1A]"], .tt-name [class~="text-[#2D2926]"] { color: var(--tt-ink) !important; }
.tt-name [class~="text-[#5A5A40]"] { color: #3d564b !important; }
.tt-name [class~="text-[#8B7E66]"] { color: var(--tt-gold-ink) !important; }
.tt-name [class*="border-[#E6D5B8]"], .tt-name [class*="border-[#F5F5F0]"] { border-color: #d9dccd !important; }
.tt-name [class*="border-[#8B7E66]"], .tt-name [class*="border-[#5A5A40]"] { border-color: var(--tt-gold) !important; }
.tt-name input, .tt-name select, .tt-name textarea { background-color: transparent !important; }
.tt-name #root h1::after { display: none; }

/* ── 面相：頁面底是自訂的深色漸層（mystic-gradient），卡片是半透明深色 ── */
.tt-physiognomy, .tt-physiognomy button, .tt-physiognomy p { font-family: var(--tt-sans) !important; }
.tt-physiognomy .mystic-gradient { background: var(--tt-paper) !important; }
.tt-physiognomy .gold-glow { box-shadow: var(--tt-shadow) !important; }
.tt-physiognomy [class*=" bg-slate-800/"], .tt-divination [class*=" bg-slate-800/"],
.tt-physiognomy [class^="bg-slate-800/"], .tt-divination [class^="bg-slate-800/"],
.tt-physiognomy [class~="bg-slate-800"], .tt-divination [class~="bg-slate-800"] { background-color: var(--tt-card) !important; }

/* ── 梅花：頁首的金色細線不需要（標題很小） ── */
.tt-divination #root h1::after { display: none; }
