/* [Claude Code 2026-07-23] singularity_oa 員工端 — 樣式（Singularity 內部平台，紫藍主題，RWD） */
:root {
  --bg: #f4f5f9; --card: #fff; --ink: #1f2430; --muted: #6b7280; --line: #e5e7ef;
  --brand: #5b57e0; --brand2: #7c6cf0; --brand-ink: #fff;
  --ok: #16a34a; --warn: #d97706; --danger: #dc2626;
  --like: #e0245e; --shadow: 0 2px 10px rgba(31,36,48,.06);
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", -apple-system, "Segoe UI", sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.6; font-size: 15px;
}
a { color: var(--brand); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
.hidden { display: none !important; }

/* ── 登入 / 改密 卡片 ── */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1em;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand2) 100%); }
.auth-card { background: var(--card); border-radius: 16px; padding: 2.2em 2em; width: 100%; max-width: 380px;
  box-shadow: 0 12px 40px rgba(0,0,0,.2); }
.auth-card h1 { margin: 0 0 .2em; font-size: 1.5em; }
.auth-card .sub { color: var(--muted); margin: 0 0 1.4em; font-size: .9em; }
.auth-card label { display: block; font-size: .85em; color: var(--muted); margin: .8em 0 .3em; }
.auth-card input { width: 100%; padding: .7em .8em; border: 1px solid var(--line); border-radius: 8px; font-size: 1em; }
.auth-card input:focus { outline: none; border-color: var(--brand); }
.btn-primary { width: 100%; margin-top: 1.4em; padding: .8em; background: var(--brand); color: var(--brand-ink);
  border: none; border-radius: 8px; font-size: 1em; font-weight: 600; }
.btn-primary:hover { background: var(--brand2); }
.err-msg { color: var(--danger); font-size: .85em; margin-top: .8em; min-height: 1.2em; }

/* ── 主框架 ── */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1em;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand2) 100%); color: #fff;
  padding: .6em 1.1em; box-shadow: var(--shadow); flex-wrap: wrap; }
.topbar .logo { font-weight: 700; font-size: 1.05em; display: flex; align-items: center; gap: .4em; }
.topbar .logo .dot { width: 22px; height: 22px; border-radius: 6px; background: rgba(255,255,255,.25);
  display: inline-flex; align-items: center; justify-content: center; font-size: .9em; }
.topbar .search { flex: 1; min-width: 160px; max-width: 420px; }
.topbar .search input { width: 100%; padding: .5em .8em; border: none; border-radius: 20px;
  background: rgba(255,255,255,.2); color: #fff; }
.topbar .search input::placeholder { color: rgba(255,255,255,.75); }
.topbar .search input:focus { outline: none; background: rgba(255,255,255,.3); }
.topbar .spacer { flex: 1; }
.topbar .tb-btn { position: relative; background: rgba(255,255,255,.15); border: none; color: #fff;
  width: 36px; height: 36px; border-radius: 50%; font-size: 1.05em; }
.topbar .tb-btn:hover { background: rgba(255,255,255,.28); }
.topbar .badge { position: absolute; top: -4px; right: -4px; background: #ff4757; color: #fff;
  font-size: .65em; min-width: 16px; height: 16px; border-radius: 8px; padding: 0 4px;
  display: flex; align-items: center; justify-content: center; }
.topbar .user { display: flex; align-items: center; gap: .5em; font-size: .9em; }
.topbar .ver { font-size: .7em; opacity: .8; }

.layout { display: flex; max-width: 1280px; margin: 0 auto; }
.sidebar { width: 200px; flex-shrink: 0; padding: 1em .6em; }
.sidebar .nav-item { display: flex; align-items: center; gap: .6em; padding: .6em .8em; border-radius: 8px;
  color: var(--ink); margin-bottom: .2em; cursor: pointer; }
.sidebar .nav-item:hover { background: #ececfb; }
.sidebar .nav-item.active { background: var(--brand); color: #fff; }
.sidebar .nav-item .ico { width: 20px; text-align: center; }
.main { flex: 1; padding: 1.2em 1.4em; min-width: 0; }

/* ── 卡片 / 通用 ── */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.2em 1.4em; margin-bottom: 1em; }
.page-title { font-size: 1.4em; font-weight: 700; margin: 0 0 .2em; }
.page-sub { color: var(--muted); margin: 0 0 1em; font-size: .9em; }
.btn { padding: .5em .9em; border: 1px solid var(--line); background: #fff; border-radius: 8px; font-size: .9em; }
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn.primary:hover { background: var(--brand2); }
.btn.danger { color: var(--danger); border-color: #f3c6c6; }
.btn.small { padding: .3em .6em; font-size: .82em; }
.row { display: flex; gap: .6em; align-items: center; flex-wrap: wrap; }
.pill { display: inline-block; padding: .1em .6em; border-radius: 20px; font-size: .75em; background: #ececfb; color: var(--brand); }
.muted { color: var(--muted); }
input, textarea, select { font-family: inherit; }
.field { margin-bottom: .8em; }
.field label { display: block; font-size: .85em; color: var(--muted); margin-bottom: .3em; }
.field input, .field textarea, .field select { width: 100%; padding: .6em .7em; border: 1px solid var(--line); border-radius: 8px; font-size: .95em; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--brand); }

/* ── Wiki ── */
.wiki-grid { display: grid; grid-template-columns: 240px 1fr; gap: 1em; }
.space-list .space-item, .tree .tree-item { padding: .5em .7em; border-radius: 8px; cursor: pointer; }
.space-list .space-item:hover, .tree .tree-item:hover { background: #ececfb; }
.space-list .space-item.active, .tree .tree-item.active { background: var(--brand); color: #fff; }
.tree .tree-item { display: flex; justify-content: space-between; align-items: center; }
.tree .tree-item .cnt { font-size: .75em; opacity: .7; }
.tree-children { margin-left: 1em; border-left: 2px solid var(--line); padding-left: .3em; }
.wiki-content h1 { font-size: 1.6em; border-bottom: 1px solid var(--line); padding-bottom: .3em; }
.wiki-content h2 { font-size: 1.3em; margin-top: 1.2em; }
.wiki-content h3 { font-size: 1.1em; }
.wiki-content pre { background: #1e2230; color: #e6e6f0; padding: 1em; border-radius: 8px; overflow-x: auto; }
.wiki-content code { background: rgba(91,87,224,.1); color: #4b3bd0; padding: .1em .4em; border-radius: 4px; font-family: Consolas, monospace; font-size: .9em; }
.wiki-content pre code { background: none; color: inherit; padding: 0; }
.wiki-content blockquote { border-left: 4px solid var(--brand2); margin: .8em 0; padding: .2em 1em; background: #f7f7fd; color: #444; }
.wiki-content img { max-width: 100%; border-radius: 8px; }
.wiki-content table { border-collapse: collapse; width: 100%; margin: .8em 0; }
.wiki-content th, .wiki-content td { border: 1px solid var(--line); padding: .4em .7em; }
.wiki-content th { background: #f3f3fb; }
.wiki-meta { color: var(--muted); font-size: .82em; display: flex; gap: 1em; flex-wrap: wrap; align-items: center; margin: .4em 0 1em; }
.like-btn { display: inline-flex; align-items: center; gap: .3em; padding: .3em .8em; border-radius: 20px;
  border: 1px solid var(--line); background: #fff; font-size: .9em; }
.like-btn.liked { background: #ffe9ef; border-color: var(--like); color: var(--like); }
.editor-md { width: 100%; min-height: 340px; font-family: Consolas, "Microsoft JhengHei", monospace; font-size: .95em;
  padding: .8em; border: 1px solid var(--line); border-radius: 8px; line-height: 1.6; }
.md-split { display: grid; grid-template-columns: 1fr 1fr; gap: 1em; }
.md-preview { border: 1px solid var(--line); border-radius: 8px; padding: .8em 1em; overflow-y: auto; max-height: 460px; background: #fafaff; }

/* 留言 */
.comment { border-top: 1px solid var(--line); padding: .7em 0; }
.comment .c-head { font-size: .82em; color: var(--muted); display: flex; justify-content: space-between; }
.comment .c-body { margin-top: .2em; }
.comment .c-body > :first-child { margin-top: 0; }
.comment .c-body > :last-child { margin-bottom: 0; }
.comment .c-body h1, .comment .c-body h2, .comment .c-body h3 { font-size: 1.05em; border: none; margin: .4em 0 .2em; }

/* 搜尋結果 */
.search-hit { padding: .7em; border-radius: 8px; cursor: pointer; }
.search-hit:hover { background: #ececfb; }

/* 通知下拉 */
.notif-panel { position: absolute; top: 52px; right: 12px; width: 320px; max-height: 60vh; overflow-y: auto;
  background: #fff; border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.18); z-index: 30; color: var(--ink); }
.notif-panel .n-item { padding: .7em 1em; border-bottom: 1px solid var(--line); cursor: pointer; }
.notif-panel .n-item.unread { background: #f2f1ff; }
.notif-panel .n-item .n-title { font-weight: 600; font-size: .9em; }
.notif-panel .n-item .n-body { font-size: .82em; color: var(--muted); }
.notif-panel .n-head { display: flex; justify-content: space-between; padding: .6em 1em; border-bottom: 1px solid var(--line); font-weight: 600; }

/* toast */
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #1f2430; color: #fff;
  padding: .7em 1.2em; border-radius: 8px; z-index: 100; opacity: 0; transition: opacity .2s; }
.toast.show { opacity: .95; }

@media (max-width: 820px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; display: flex; gap: .4em; overflow-x: auto; padding: .6em; }
  .sidebar .nav-item { white-space: nowrap; margin-bottom: 0; }
  .wiki-grid { grid-template-columns: 1fr; }
  .md-split { grid-template-columns: 1fr; }
}
