* { box-sizing: border-box; }
body { margin: 0; font-family: "Noto Sans TC", system-ui, sans-serif; background: #f4f1ea; color: #222; height: 100vh; display: flex; flex-direction: column; }
header { display: flex; align-items: center; gap: 16px; padding: 10px 16px; background: #fff; border-bottom: 1px solid #e3ded3; }
.title { font-size: 20px; font-weight: 700; border: 0; background: transparent; flex: 1; min-width: 120px; }
.title:focus { outline: 2px solid #d97757; border-radius: 6px; }
nav { display: flex; gap: 4px; }
.tab { border: 1px solid #ddd; background: #faf8f4; padding: 6px 14px; border-radius: 8px; cursor: pointer; }
.tab.active { background: #d97757; color: #fff; border-color: #d97757; }
.who { font-size: 13px; color: #777; cursor: pointer; }
.aibar { display: flex; gap: 8px; padding: 10px 16px; background: #fbfaf7; border-bottom: 1px solid #e3ded3; align-items: center; flex-wrap: wrap; }
.aibar input { flex: 1; min-width: 240px; padding: 9px 12px; border: 1px solid #ccc; border-radius: 8px; font-size: 15px; }
button { font: inherit; padding: 8px 14px; border-radius: 8px; border: 1px solid #ccc; background: #fff; cursor: pointer; }
button.primary { background: #d97757; color: #fff; border-color: #d97757; }
button:disabled { opacity: .5; cursor: wait; }
.status { font-size: 13px; color: #a05a3d; }
main { flex: 1; display: flex; min-height: 0; }
.view { flex: 1; overflow: auto; padding: 16px; }
.hidden { display: none; }
aside { width: 300px; border-left: 1px solid #e3ded3; background: #fff; padding: 12px; overflow: auto; }
aside h3 { margin: 0 0 8px; font-size: 15px; }
.logitem { border-bottom: 1px dashed #ddd; padding: 8px 0; font-size: 13px; white-space: pre-wrap; }
.logitem b { color: #d97757; }
.logitem .q { color: #888; }
.logitem.pending { opacity: .6; }
.lanes { display: flex; gap: 14px; align-items: flex-start; min-height: 100%; }
.lane { width: 240px; flex-shrink: 0; background: #ebe6dc; border-radius: 12px; padding: 10px; min-height: 200px; }
.lane.dragover { outline: 2px dashed #d97757; }
.lane h4 { margin: 0 0 8px; display: flex; justify-content: space-between; gap: 6px; font-size: 15px; }
.lane h4 span { flex: 1; cursor: text; }
.lane .x { border: 0; background: none; padding: 0 4px; color: #999; }
.note { padding: 10px; border-radius: 6px; margin-bottom: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.15); cursor: grab; white-space: pre-wrap; font-size: 14px; position: relative; }
.note .meta { font-size: 11px; color: #777; margin-top: 6px; }
.note .x { position: absolute; top: 2px; right: 4px; border: 0; background: none; color: #999; padding: 0 4px; display: none; }
.note:hover .x { display: block; }
.c-yellow { background: #fff3a8; } .c-pink { background: #ffd0dc; } .c-blue { background: #cfe6ff; } .c-green { background: #d4f5c9; } .c-purple { background: #e6d6ff; }
.addnote, .addcol { width: 100%; border: 1px dashed #aaa; background: transparent; color: #666; }
.addcol { width: 160px; flex-shrink: 0; }
.taskform { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.taskform input { padding: 7px 10px; border: 1px solid #ccc; border-radius: 8px; }
.gantt { position: relative; background: #fff; border-radius: 12px; padding: 10px; overflow-x: auto; }
.grow { display: flex; align-items: center; height: 34px; }
.glabel { width: 220px; flex-shrink: 0; font-size: 13px; padding-right: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.glabel input { margin-right: 4px; }
.gtrack { position: relative; height: 26px; flex-shrink: 0; }
.gbar { position: absolute; top: 3px; height: 20px; border-radius: 5px; background: #d97757; color: #fff; font-size: 11px; padding: 2px 6px; white-space: nowrap; overflow: hidden; cursor: pointer; }
.gbar.done { background: #9bbf8a; }
.gaxis { display: flex; margin-left: 220px; font-size: 11px; color: #888; border-bottom: 1px solid #eee; }
.gaxis div { flex-shrink: 0; text-align: center; border-left: 1px solid #f0f0f0; }
.gaxis div.we { background: #faf6ef; }
.gtoday { position: absolute; top: 0; bottom: 0; width: 2px; background: #3a7bd5; opacity: .5; }
/* ---------- 無限畫布 ---------- */
.canvasview { position: relative; padding: 0; overflow: hidden; }
.cv { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; user-select: none; -webkit-user-select: none;
  background-color: #fbfaf7; background-image: radial-gradient(#d9d3c7 1px, transparent 1px); background-size: 24px 24px; cursor: default; }
.cv[data-tool="hand"], .cv.panning { cursor: grab; }
.cv[data-tool="pen"], .cv[data-tool="rect"], .cv[data-tool="arrow"], .cv[data-tool="note"] { cursor: crosshair; }
.cv[data-tool="eraser"] { cursor: cell; }
.toolbar { position: absolute; z-index: 2; top: 10px; left: 10px; display: flex; gap: 4px; align-items: center; flex-wrap: wrap;
  background: #fff; border: 1px solid #e3ded3; border-radius: 12px; padding: 6px; box-shadow: 0 2px 8px rgba(0,0,0,.08); max-width: calc(100% - 20px); }
.toolbar button { padding: 5px 9px; min-width: 34px; font-size: 16px; border-color: transparent; }
.toolbar button.active { background: #fbe3d9; border-color: #d97757; }
.toolbar .ic { width: 18px; height: 18px; fill: none; stroke: #333; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; pointer-events: none; }
.toolbar .sep { width: 1px; height: 22px; background: #e3ded3; margin: 0 4px; }
.toolbar select { padding: 4px; border-radius: 6px; border: 1px solid #ddd; }
#zoomLabel { font-size: 12px; color: #666; min-width: 40px; text-align: center; }
.colors { display: flex; gap: 3px; }
.colors .sw { width: 20px; height: 20px; min-width: 0; padding: 0; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #ccc; }
.colors .sw.active { box-shadow: 0 0 0 2px #d97757; }
#content .hit { stroke: transparent; fill: none; pointer-events: stroke; }
#content .it { cursor: move; }
#content .it.sel > rect.shadow, #content .it.sel > .frame { stroke: #1a73e8; stroke-width: 2; }
#content .it.sel > path:not(.hit), #content .it.sel > line:not(.hit) { filter: drop-shadow(0 0 3px #1a73e8); }
#content .frame { stroke: #ddd; stroke-width: 1; }
#content .handle { fill: #fff; stroke: #1a73e8; stroke-width: 2; cursor: nwse-resize; }
#content .shadow { filter: drop-shadow(0 1px 2px rgba(0,0,0,.18)); }
.cv[data-tool="pen"] #content, .cv[data-tool="rect"] #content, .cv[data-tool="arrow"] #content { pointer-events: none; }
.cnote { padding: 10px; font-size: 14px; line-height: 20px; white-space: pre-wrap; word-break: break-word; height: 100%; overflow: hidden; color: #222; }
.cnote .meta { font-size: 11px; color: #777; margin-top: 4px; }
.clink { font-size: 13px; color: #222; height: 100%; overflow: hidden; display: flex; flex-direction: column; }
.clink .thumb { height: 146px; background: #eee center / cover no-repeat; border-radius: 8px 8px 0 0; position: relative; flex-shrink: 0; }
.clink .play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: rgba(0,0,0,.6); color: #fff; border-radius: 50%; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.clink .lt { padding: 8px 10px 2px; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clink .ls { padding: 0 10px; color: #888; font-size: 12px; }
.clink a { color: #1a73e8; margin-left: 10px; font-size: 12px; }
.clink.file { justify-content: center; }
.clink.file a { margin-left: 6px; }
@media (max-width: 800px) { aside { display: none; } }
