/* 外出工作台頁面樣式：只用內網 theme.css 的 token（--canvas、--surface、--ink*、--border-*、--brand、--on-brand），
   標頭與側欄沿用 app_header.css／grouped_workspace.css，不覆寫其外觀，只調整定位。 */
/* 基本重設＝Tailwind preflight 的對應部分：正式區頁面都載入 tailwind.css，共用的 app_header.css／grouped_workspace.css
   依賴它（例如 .app-profile-item 沒設背景與框線，靠 preflight 讓 button 透明無框）。外站沒有 Tailwind，在這裡補齊。
   表單元件的 font-family: inherit 是 preflight 本身的規則（繼承 theme.css 的字型），不是另設字型。 */
*, *::before, *::after { box-sizing: border-box; border-width: 0; border-style: solid; }
a { color: inherit; text-decoration: inherit; }
ol, ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p, dl, dd, figure { margin: 0; }
button, input, select, textarea { font-family: inherit; font-size: 100%; font-weight: inherit; line-height: inherit; color: inherit; margin: 0; padding: 0; }
button, [type='button'], [type='reset'], [type='submit'] { -webkit-appearance: button; background-color: transparent; background-image: none; }
button, [role='button'] { cursor: pointer; }
img, svg, video, canvas { display: block; vertical-align: middle; }
img, video { max-width: 100%; height: auto; }
html { scroll-padding-top: calc(var(--app-header-live-h, 64px) + 12px); }
body { min-height: 100vh; margin: 0; }
.od-workspace { min-height: calc(100vh - var(--app-header-live-h, 64px)); }
.od-main { outline: none; max-width: 1200px; }
.od-skip { position: absolute; left: -9999px; top: 8px; z-index: 100; padding: 8px 12px; border-radius: 8px; background: var(--brand); color: var(--on-brand); }
.od-skip:focus { left: 12px; }
.od-icon { width: 16px; height: 16px; }
.od-noscript { padding: 16px; }

.od-section { margin: 0 0 24px; }
.od-section-title { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font-size: 15px; font-weight: 700; color: var(--ink-2); }
.od-section-link { margin-left: auto; font-size: 12px; font-weight: 500; }
.od-panel { padding: 16px; border: 1px solid var(--border-soft); border-radius: 10px; background: var(--surface); }
.od-muted { color: var(--ink-dim); font-size: 13px; margin: 4px 0 0; }
.od-small { font-size: 12px; }
.od-loading { color: var(--ink-dim); font-size: 13px; padding: 12px 0; }
.od-link { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.od-link:hover { color: var(--brand-dark); }

.od-search { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 16px; }
.od-search .grouped-search { flex: 1 1 240px; width: auto; color: var(--ink); }
.od-search .grouped-filter { color: var(--ink); flex: 0 1 180px; }
.od-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 10px 16px; border: 1px solid var(--brand);
    border-radius: 8px; background: var(--brand); color: var(--on-brand); font-size: 13px; font-weight: 700; cursor: pointer; text-decoration: none; }
.od-button:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.od-button:focus-visible, .od-card:focus-visible, .od-tab:focus-visible, .od-link:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.od-button-ghost { background: transparent; color: var(--ink); border-color: var(--border-strong); }
.od-button-ghost:hover { background: var(--surface); border-color: var(--brand); color: var(--ink); }
.od-button-small { min-height: 36px; padding: 6px 12px; }

.od-tabs { display: flex; gap: 6px; overflow-x: auto; margin: 0 0 12px; padding-bottom: 4px; }
.od-tab { flex: 0 0 auto; min-height: 40px; padding: 8px 14px; border: 1px solid var(--border-soft); border-radius: 999px; background: transparent; color: var(--ink-soft); font-size: 13px; cursor: pointer; }
.od-tab:hover { color: var(--ink); border-color: var(--border-strong); }
.od-tab.active { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }

.od-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.od-list { display: flex; flex-direction: column; gap: 10px; }
.od-list-footer { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 12px; }
.od-list-footer .grouped-empty { width: 100%; padding: 32px 16px; }
.od-card { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 14px 16px; border: 1px solid var(--border-soft); border-radius: 10px;
    background: var(--surface); color: var(--ink); text-decoration: none; transition: border-color .2s, box-shadow .2s; }
a.od-card:hover { border-color: var(--brand); box-shadow: 0 3px 12px rgb(var(--c-brand) / .08); }
.od-card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.od-card-title { margin: 6px 0 0; font-size: 15px; line-height: 1.55; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.od-excerpt { margin: 6px 0 0; font-size: 13px; line-height: 1.7; color: var(--ink-soft); overflow-wrap: anywhere; }
.od-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.od-item.is-done .od-card-title { color: var(--ink-dim); text-decoration: line-through; }
.od-chips { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.od-chip { display: inline-flex; align-items: center; min-height: 22px; padding: 2px 8px; border: 1px solid var(--border-soft); border-radius: 999px;
    background: var(--canvas); color: var(--ink-soft); font-size: 11px; white-space: nowrap; }
.od-chip-brand { border-color: var(--brand); color: var(--brand); }
/* 語意色例外：逾期提醒沿用主色反白，避免另立色票。 */
.od-chip-alert { border-color: var(--brand); background: var(--brand); color: var(--on-brand); }

.od-highlights { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.od-highlight { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 44px; padding: 10px 12px; border: 1px solid var(--border-soft); border-radius: 8px;
    background: var(--surface); color: var(--ink); text-decoration: none; }
a.od-highlight:hover { border-color: var(--brand); }
.od-highlight-title { flex: 1 1 180px; min-width: 0; overflow-wrap: anywhere; font-size: 14px; }

.od-facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; font-size: 14px; }
.od-facts dt { color: var(--ink-dim); }
.od-facts dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.od-details { margin-top: 12px; font-size: 13px; color: var(--ink-soft); }
.od-details summary { cursor: pointer; min-height: 32px; color: var(--ink-2); }
.od-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.od-table th, .od-table td { padding: 8px 6px; border-bottom: 1px solid var(--border-soft); text-align: left; }
.od-table thead th { color: var(--ink-dim); font-weight: 500; font-size: 12px; }
.od-plain-list { margin: 0; padding-left: 1.2em; list-style: disc; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }

.od-note { padding: 14px 16px; border: 1px solid var(--border-soft); border-radius: 10px; background: var(--surface); }
.od-note-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.od-note-head h3 { margin: 0; font-size: 15px; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.od-prose { margin-top: 8px; font-size: 14px; line-height: 1.8; color: var(--ink-2); overflow-wrap: anywhere; }
.od-prose p { margin: 0 0 8px; }
.od-prose ul { margin: 0 0 8px; padding-left: 1.3em; list-style: disc; }
.od-prose .od-prose-heading { font-weight: 700; color: var(--ink); }
.od-prose code { padding: 1px 4px; border-radius: 4px; background: var(--canvas); font-size: 13px; }

.od-message { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); color: var(--ink); }
.od-message p { margin: 0; flex: 1 1 200px; font-size: 14px; }
.od-message-error { border-color: var(--brand); }
.od-message-warn { margin: 0 0 16px; border-style: dashed; }
.od-banner { position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 80; display: flex; align-items: center; gap: 12px;
    max-width: calc(100vw - 32px); padding: 10px 14px; border: 1px solid var(--brand); border-radius: 10px; background: var(--surface); color: var(--ink); font-size: 13px;
    box-shadow: 0 8px 24px rgb(0 0 0 / .18); }
.od-banner[hidden] { display: none; }

/* 登入畫面：登出狀態不顯示側欄、使用者名稱與登出鍵。 */
/* 登出狀態不顯示側欄與個人資料按鈕。 */
.od-signed-out .app-sidebar, .od-signed-out #user-nav-info { display: none; }
/* 登入畫面在整個畫面寬度置中（同正式區），不受內容欄最大寬度限制。 */
.od-signed-out .od-main { max-width: none; }

/* 儀表板標題列與分頁鈕：同正式區首頁 #dashboard-header 與 .dashboard-tab-button（選取＝主色字、主色框、10% 主色底）。 */
/* 桌機黏在標頭下方（同正式區 #dashboard-header 的 sticky＋畫布底＋模糊）；<1024px 取消黏住。 */
.od-dashboard-header { position: sticky; top: var(--app-header-live-h, 64px); z-index: 30; background: var(--canvas); backdrop-filter: blur(12px);
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 20px; padding: 12px 0;
    border-bottom: 1px solid rgb(var(--c-zinc-800)); }
.od-dashboard-title h1 { margin: 0; font-size: 20px; font-weight: 700; color: var(--ink); }
.od-dashboard-title p { margin: 2px 0 0; font-size: 12px; color: rgb(var(--c-zinc-500)); }
.od-dash-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.od-dash-tab { display: inline-flex; align-items: center; min-height: 40px; padding: 8px 16px; border: 1px solid rgb(var(--c-zinc-700)); border-radius: 8px;
    color: rgb(var(--c-zinc-300)); font-size: 14px; cursor: pointer; transition: color .15s, border-color .15s; }
.od-dash-tab:hover { border-color: var(--brand); color: var(--brand); }
.od-dash-tab[aria-selected="true"] { color: var(--brand); border-color: var(--brand); background: rgb(var(--c-brand) / 0.1); }
.od-dash-tab:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* 個人資料選單：卡片文字欄可縮；介面配色清單（同內網個人資料頁：色點＋名稱，兩欄）。 */
.od-profile-card-text { min-width: 0; }
.od-theme-current { margin-left: auto; font-size: 12px; color: rgb(var(--c-zinc-500)); }
.od-theme-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 6px 8px 8px; border-top: 1px solid var(--border-soft); }
.od-theme-list[hidden] { display: none; }
.od-theme-swatch { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 6px 8px; border: 0; border-radius: 6px; background: transparent;
    color: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.od-theme-swatch:hover, .od-theme-swatch[aria-checked="true"] { background: rgb(var(--c-brand) / 0.1); }
.od-theme-swatch:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
/* 色點外框與正式區 profile.html 的 .theme-dot 相同（中性灰，所有主題都看得到）。 */
.od-theme-dot { width: 16px; height: 16px; flex: 0 0 16px; border-radius: 50%; border: 1px solid rgb(128 128 128 / 0.25); }
@media (prefers-reduced-motion: reduce) { .od-dash-tab { transition: none; } }
/* 登入畫面：同正式區首頁的帳號登入（index.html #auth-view 與 .auth-card）：置中大標題＋寬字距副標，
   卡片為半透明 zinc-900 底、模糊、柔和框線、左側 4px 主色框；欄位 rounded-lg、登入鈕主色底。 */
/* 同正式區 #auth-view：登入區在標頭以下的可視範圍內垂直置中。 */
.od-auth { display: flex; justify-content: center; align-items: center; min-height: calc(100vh - var(--app-header-live-h, 64px) - 54px); padding: 48px 0 80px; }
.od-auth-inner { width: 100%; max-width: 400px; }
.od-auth-head { margin-bottom: 32px; text-align: center; }
.od-auth-title { font-size: 48px; line-height: 1; font-weight: 900; letter-spacing: -0.05em; color: var(--ink); }
.od-auth-sub { margin-top: 8px; font-size: 10px; letter-spacing: .3em; color: rgb(var(--c-zinc-500)); }
/* 陰影同 Tailwind shadow-2xl（正式區登入卡片使用的值）。 */
.od-auth-card { padding: 32px; border-radius: 16px; background: rgb(var(--c-zinc-900) / .8); backdrop-filter: blur(12px);
    border: 1px solid var(--border-soft); border-left: 4px solid var(--brand); box-shadow: 0 25px 50px -12px rgb(0 0 0 / .25); }
.od-auth-card > .od-message { margin: 0 0 20px; }
.od-auth-form { display: flex; flex-direction: column; gap: 20px; }
.od-auth-field { display: flex; flex-direction: column; gap: 8px; }
.od-auth-label { font-size: 14px; font-weight: 700; color: rgb(var(--c-zinc-300)); }
.od-auth-input { width: 100%; padding: 14px 16px; border-radius: 8px; color: var(--ink); }
.od-auth-submit { width: 100%; padding: 16px; border-radius: 8px; background: var(--brand); color: var(--on-brand); font-size: 14px; font-weight: 900;
    letter-spacing: .1em; transition: background-color .15s; }
.od-auth-submit:hover { background: var(--brand-dark); }
.od-auth-submit:disabled { opacity: .7; cursor: progress; }
.od-auth-submit:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.od-login-robot:empty { display: none; }
.od-login-robot { min-height: 0; }
.od-login-status { margin: 4px 0; padding: 10px 12px; border: 1px solid var(--brand); border-radius: 8px; font-size: 13px; color: var(--ink); }
.od-login-status[hidden] { display: none; }

/* 寫回（P2）表單 */
.od-write-form { display: flex; flex-direction: column; gap: 10px; margin: 0 0 12px; }
.od-field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-2); }
.od-field-label { font-weight: 700; }
.od-field .input-field { width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 8px; color: var(--ink); }
.od-textarea { min-height: 96px; resize: vertical; line-height: 1.7; }
.od-field .input-field:disabled { opacity: .6; cursor: not-allowed; }

/* 同正式區首頁主選單（index.html 的 <1024px 規則）：側欄變成黏在標頭下方、可橫向捲動的一列，不顯示「主選單」標籤；
   儀表板標題列取消黏住，分頁鈕縮小左右內距。頁面 CSS 只調定位與排列，不改導覽鈕的色彩、圓角、高度或字級。 */
@media (max-width: 1023px) {
    .od-workspace { flex-direction: column; }
    .od-workspace > .app-sidebar { position: sticky; top: var(--app-header-live-h, 64px); z-index: 30; width: 100%; height: auto; flex-basis: auto;
        padding: 6px 12px; border-right: 0; border-bottom: 1px solid var(--border-soft); overflow-x: auto; overflow-y: hidden; backdrop-filter: blur(12px); }
    .app-sidebar .grouped-sidebar-label { display: none; }
    .od-workspace .grouped-nav { flex-direction: row; align-items: center; width: max-content; }
    .od-workspace .grouped-nav-button { width: auto; flex: 0 0 auto; white-space: nowrap; }
    .od-dashboard-header { position: relative; top: auto; }
    .od-dash-tabs { width: 100%; min-width: 0; gap: 6px; }
    .od-dash-tab { padding-left: 10px; padding-right: 10px; }
}

@media (max-width: 767px) {
    .od-card-grid { grid-template-columns: minmax(0, 1fr); }
    .od-search .grouped-filter { flex: 1 1 100%; }
    .od-search .od-button { flex: 1 1 100%; }
    .od-facts { grid-template-columns: 1fr; gap: 2px; }
    .od-facts dd { margin-bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) { .od-card { transition: none; } }
