:root{--bg:#f5f6f8;--surface:#fff;--ink:#1d2733;--muted:#738091;--line:#e6eaf0;--blue:#356fe5;--blue-soft:#edf3ff;--green:#16845b;--green-soft:#eaf7f1;--red:#b84e4e;--red-soft:#fff0f0;--shadow:0 8px 26px rgba(28,43,62,.055)}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans TC",Arial,sans-serif;font-size:15px}.topbar{height:68px;background:#fff;border-bottom:1px solid var(--line)}.topbar-inner{max-width:1180px;height:100%;margin:auto;padding:0 24px;display:flex;align-items:center;justify-content:space-between}.brand{display:flex;gap:11px;align-items:center;color:var(--ink);text-decoration:none;font-weight:700;font-size:17px}.brand-mark{width:52px;height:52px;border-radius:16px;background:var(--blue);color:white;display:grid;place-items:center;font-weight:800;font-size:25px;box-shadow:0 6px 14px rgba(53,111,229,.2)}.brand-mark.small{width:34px;height:34px;border-radius:11px;font-size:17px}.top-actions{display:flex;align-items:center;gap:16px}.top-actions form{margin:0}.status-pill{font-size:12px;color:var(--muted);display:flex;align-items:center;gap:7px}.status-pill i{width:7px;height:7px;background:#27a875;border-radius:99px}.container{max-width:1180px;margin:0 auto;padding:36px 24px 50px}.welcome{display:flex;justify-content:space-between;align-items:center;gap:24px;margin-bottom:27px}.eyebrow{font-size:10px;font-weight:800;letter-spacing:1.3px;color:#8a98a9;margin-bottom:7px}.welcome h1{font-size:30px;margin:0 0 8px;font-weight:750;letter-spacing:-.5px}.muted{color:var(--muted);margin:0;line-height:1.65}.welcome-actions{display:flex;gap:10px;align-items:center}.btn{border:0;border-radius:9px;min-height:40px;padding:0 15px;display:inline-flex;align-items:center;justify-content:center;gap:8px;text-decoration:none;font:inherit;font-weight:650;cursor:pointer;transition:.15s ease;white-space:nowrap}.btn:hover{filter:brightness(.97);transform:translateY(-1px)}.btn.primary{color:white;background:var(--blue);box-shadow:0 4px 11px rgba(53,111,229,.17)}.btn.secondary{color:#335fa9;background:var(--blue-soft)}.btn.ghost{color:#647386;background:#f2f4f7}.btn.success{color:#11734e;background:var(--green-soft)}.btn.danger-ghost{color:var(--red);background:#fff5f5}.btn.small{min-height:32px;padding:0 10px;font-size:12px;border-radius:7px}.btn.full{width:100%;margin-top:17px}.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:24px}.stat-card{background:#fff;border:1px solid var(--line);border-radius:13px;padding:16px 19px;box-shadow:var(--shadow);display:flex;justify-content:space-between;align-items:center}.stat-card span{font-size:13px;color:var(--muted)}.stat-card strong{font-size:24px;font-weight:750}.stat-card.total{background:#f0f4fc;border-color:#e3eafb}.panel{background:#fff;border:1px solid var(--line);border-radius:15px;padding:23px 25px;margin-bottom:22px;box-shadow:var(--shadow)}.panel-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:19px}.panel-heading h2{font-size:20px;margin:0}.text-link{font-size:13px;text-decoration:none;color:var(--blue);font-weight:650}.editor-form{display:grid;gap:9px}.editor-form label,.login-card label{font-size:13px;font-weight:700;color:#465364;margin-top:6px}.text-input{width:100%;border:1px solid #dce2eb;border-radius:9px;padding:12px 13px;font:inherit;color:var(--ink);background:#fff;outline:none}.text-input:focus{border-color:#7ea2f4;box-shadow:0 0 0 3px rgba(53,111,229,.1)}.content-input{resize:vertical;min-height:155px;line-height:1.65}.hint{font-size:11px;color:#96a1af;font-weight:400;margin-left:5px}.form-actions{display:flex;gap:9px;margin-top:8px}.import-panel p{color:#5d6978;line-height:1.7}.import-form{display:flex;align-items:center;gap:13px;flex-wrap:wrap;margin:18px 0}.file-picker{border:1px dashed #b8c6da;border-radius:9px;padding:10px 14px;display:flex;align-items:center;gap:12px;color:#4c5c71;font-size:13px}.file-picker input{max-width:240px}.notice{background:#f7f9fc;color:#778496;padding:11px 13px;border-radius:8px;font-size:12px;line-height:1.6}.toolbar{display:flex;align-items:center;justify-content:space-between;gap:18px;margin:0 0 17px}.filters{display:flex;align-items:center;gap:6px;flex-wrap:wrap}.filters a{display:inline-flex;align-items:center;gap:7px;padding:9px 12px;border-radius:8px;text-decoration:none;color:#758193;font-size:13px}.filters a.selected{background:#eaf0fc;color:#2d5cba;font-weight:700}.filters b{font-size:11px;color:#8c99a8}.search-form{height:38px;width:min(340px,42vw);border:1px solid var(--line);background:#fff;display:flex;border-radius:9px;overflow:hidden}.search-form input{border:0;outline:none;flex:1;min-width:0;padding:0 12px;font:inherit;font-size:13px}.search-form button{width:42px;border:0;background:#fff;color:#6f8095;font-size:22px;cursor:pointer}.note-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:15px}.note-card{background:#fff;border:1px solid var(--line);border-radius:13px;padding:17px 17px 14px;box-shadow:var(--shadow);min-width:0;display:flex;flex-direction:column;min-height:230px}.note-card h3{font-size:16px;line-height:1.45;margin:11px 0 9px;overflow-wrap:anywhere}.note-top{display:flex;justify-content:space-between;align-items:center}.note-id{font-size:11px;color:#9ba6b3;font-variant-numeric:tabular-nums}.state-tag{font-size:10px;font-weight:750;border-radius:99px;padding:5px 9px}.state-tag.open{background:#fff6e7;color:#9a6b14}.state-tag.done{background:var(--green-soft);color:#14724c}.state-tag.trash{background:#f0f1f3;color:#777f88}.note-content{color:#657284;font-size:13px;line-height:1.65;white-space:pre-wrap;overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:5;-webkit-box-orient:vertical;overflow:hidden;min-height:0}.is-done h3{text-decoration:line-through;color:#647284}.is-deleted{opacity:.78}.tag-row{display:flex;gap:6px;flex-wrap:wrap;margin-top:12px}.tag{font-size:10px;background:#f2f5f9;color:#6f7d8e;border-radius:5px;padding:4px 7px}.note-meta{display:flex;gap:9px;align-items:center;color:#a0aab7;font-size:10px;margin-top:auto;padding-top:16px}.edited-mark{color:#7188b6}.note-actions{display:flex;gap:7px;align-items:center;border-top:1px solid #f0f2f5;padding-top:12px;margin-top:12px}.note-actions form{margin:0}.empty-state{background:#fff;border:1px dashed #d9e0e9;border-radius:14px;text-align:center;padding:60px 15px}.empty-icon{margin:auto auto 10px;width:45px;height:45px;display:grid;place-items:center;background:#f1f4f8;border-radius:50%;font-size:24px;color:#8391a3}.empty-state h3{margin:0 0 7px}.empty-state p{margin:0;color:var(--muted);font-size:13px}.page-foot{display:flex;justify-content:space-between;color:#9aa5b1;font-size:11px;padding:22px 2px 0}.flash{padding:12px 15px;border-radius:9px;margin:0 0 19px;font-size:13px}.flash.success{background:var(--green-soft);color:#116c4a}.flash.error{background:var(--red-soft);color:#a83d3d}.login-page{min-height:100vh;display:grid;place-items:center;padding:20px}.login-card{width:min(410px,100%);background:white;padding:36px;border:1px solid var(--line);border-radius:17px;box-shadow:0 16px 48px rgba(27,43,61,.1)}.login-card .brand-mark{margin-bottom:22px}.login-card h1{font-size:23px;margin:0 0 8px}.login-card p{font-size:13px;margin-bottom:23px}.login-card form{display:grid;gap:9px}.login-foot{font-size:11px;color:#9ba5b1;text-align:center;margin-top:22px}code{background:#f0f3f7;padding:2px 5px;border-radius:4px;font-size:12px}
@media(max-width:900px){.note-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.welcome{align-items:flex-start;flex-direction:column}.welcome-actions{width:100%}}@media(max-width:620px){.topbar-inner{padding:0 16px}.container{padding:25px 14px 35px}.welcome h1{font-size:26px}.stats{grid-template-columns:repeat(2,1fr);gap:8px}.stat-card{padding:12px 13px}.stat-card strong{font-size:21px}.toolbar{align-items:stretch;flex-direction:column}.search-form{width:100%}.note-grid{grid-template-columns:1fr}.note-card{min-height:200px}.page-foot{gap:8px;flex-direction:column}.panel{padding:18px}.welcome-actions .btn{flex:1}.top-actions .status-pill{display:none}}

/* Checklist tasks are grouped under their original Google Keep note. */
.task-filter-form{display:flex;align-items:center;gap:16px;color:#657284;font-size:13px;font-weight:650}.show-completed-toggle{display:inline-flex;align-items:center;gap:8px;cursor:pointer;user-select:none}.show-completed-toggle input{width:17px;height:17px;accent-color:var(--green);cursor:pointer}.task-count-hint{font-size:12px;color:var(--muted);font-weight:500}.task-note-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:15px;align-items:start}.task-note-card{background:#fff;border:1px solid var(--line);border-radius:13px;padding:17px 17px 14px;box-shadow:var(--shadow);min-width:0;display:flex;flex-direction:column;min-height:190px}.task-note-card:hover{box-shadow:0 10px 28px rgba(28,43,62,.09)}.task-note-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:9px}.task-note-heading>div{min-width:0}.task-note-heading h3{font-size:16px;line-height:1.45;margin:8px 0 0;overflow-wrap:anywhere}.task-note-heading .btn{flex:none}.task-note-summary{font-size:11px;color:var(--muted);margin:9px 0 12px;padding-bottom:10px;border-bottom:1px solid #edf0f4}.checklist-items{min-width:0}.checklist-row{display:flex;justify-content:space-between;align-items:center;gap:14px;padding:11px 0;border-bottom:1px solid #f0f2f5}.checklist-row:last-child{border-bottom:0}.checklist-row .checklist-toggle-form{display:flex;align-items:center;gap:9px;flex-wrap:wrap;width:100%;margin:0}.checklist-checkbox-label{display:flex;align-items:center;gap:10px;min-width:0;flex:1;cursor:pointer}.checklist-checkbox{width:18px;height:18px;flex:none;accent-color:var(--green);cursor:pointer}.checklist-row-content{display:flex;align-items:center;gap:10px;min-width:0}.checklist-mark{width:21px;height:21px;flex:none;display:grid;place-items:center;border:1px solid #cbd4df;border-radius:50%;font-size:13px;color:#8793a2}.checklist-mark.checked{background:var(--green-soft);border-color:#b8e2cf;color:var(--green);font-weight:800}.checklist-text{font-size:14px;line-height:1.5;overflow-wrap:anywhere}.checklist-row.is-done .checklist-text{text-decoration:line-through;color:#8b96a4}.checklist-row .state-tag{flex:none}.checklist-row .edited-mark{font-size:10px;white-space:nowrap}@media(max-width:900px){.task-note-list{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:620px){.task-note-list{grid-template-columns:1fr}.task-filter-form{width:100%;justify-content:space-between;flex-wrap:wrap}.task-count-hint{width:100%}.task-note-card{padding:15px}.task-note-heading{align-items:flex-start}.checklist-row{align-items:flex-start}.checklist-row-content{flex-wrap:wrap}.checklist-row form .btn{white-space:normal}}

/* v1.1.4：手機版加大字體、操作區與卡片間距，提升觸控易讀性。 */
@media (max-width: 620px) {
  body { font-size: 16px; }
  .topbar { height: 62px; }
  .topbar-inner { padding: 0 13px; }
  .brand { gap: 9px; font-size: 16px; }
  .brand-mark.small { width: 38px; height: 38px; border-radius: 12px; font-size: 19px; }
  .top-actions { gap: 8px; }
  .top-actions .btn { min-height: 40px; padding: 0 12px; }
  .container { padding: 22px 12px 34px; }
  .welcome { gap: 14px; margin-bottom: 20px; }
  .welcome h1 { font-size: 25px; line-height: 1.35; }
  .welcome .muted { font-size: 14px; }
  .welcome-actions { gap: 8px; }
  .welcome-actions .btn { min-height: 46px; padding: 0 10px; font-size: 14px; }
  .stats { gap: 9px; margin-bottom: 18px; }
  .stat-card { min-height: 78px; padding: 13px 14px; border-radius: 12px; }
  .stat-card span { font-size: 13px; }
  .stat-card strong { font-size: 23px; }
  .panel { padding: 17px 15px; margin-bottom: 17px; border-radius: 13px; }
  .panel-heading { margin-bottom: 15px; }
  .panel-heading h2 { font-size: 19px; }
  .filters { width: 100%; gap: 7px; }
  .filters a { flex: 1; justify-content: center; min-height: 44px; padding: 10px 8px; font-size: 14px; }
  .toolbar { gap: 13px; margin-bottom: 14px; }
  .search-form { width: 100%; height: 46px; border-radius: 11px; }
  .search-form input { font-size: 16px; padding: 0 13px; }
  .search-form button { width: 48px; font-size: 24px; }
  .note-grid, .task-note-list { grid-template-columns: minmax(0, 1fr); gap: 13px; }
  .note-card, .task-note-card { padding: 18px 17px 16px; border-radius: 13px; }
  .note-card { min-height: 190px; }
  .note-card h3, .task-note-heading h3 { font-size: 18px; line-height: 1.5; }
  .note-content { font-size: 15px; line-height: 1.7; -webkit-line-clamp: 7; }
  .note-meta { font-size: 12px; padding-top: 13px; }
  .note-actions { flex-wrap: wrap; gap: 8px; }
  .note-actions .btn { min-height: 40px; font-size: 13px; }
  .task-filter-form { gap: 10px; padding: 3px 1px; }
  .show-completed-toggle { min-height: 42px; gap: 10px; font-size: 15px; }
  .show-completed-toggle input { width: 21px; height: 21px; }
  .task-count-hint { font-size: 13px; }
  .task-note-summary { font-size: 12px; line-height: 1.5; margin: 10px 0 12px; }
  .checklist-row { gap: 10px; padding: 13px 0; }
  .checklist-row .checklist-toggle-form { gap: 8px; }
  .checklist-checkbox-label { gap: 12px; min-height: 34px; }
  .checklist-checkbox { width: 24px; height: 24px; }
  .checklist-text { font-size: 16px; line-height: 1.55; }
  .checklist-row .state-tag { font-size: 11px; padding: 5px 9px; }
  .checklist-row .edited-mark { font-size: 11px; }
  .btn { min-height: 44px; }
  .btn.small { min-height: 38px; padding: 0 12px; font-size: 13px; }
  .text-input { min-height: 46px; font-size: 16px; }
  .content-input { min-height: 180px; }
  .page-foot { font-size: 12px; line-height: 1.6; }
}

/* Unified Keep page: checklist stays inside its original note tile. */
.unified-toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px}.unified-toolbar>div{display:flex;align-items:baseline;gap:12px;flex-wrap:wrap}.unified-toolbar strong{font-size:15px}.unified-count{font-size:12px;color:var(--muted)}.note-checklist{margin-top:13px;padding-top:9px;border-top:1px solid #edf0f4}.note-checklist .checklist-row{padding:9px 0}.note-checklist .checklist-toggle-form{display:flex;align-items:center;gap:8px;width:100%;margin:0}.note-checklist .checklist-checkbox-label{display:flex;align-items:center;gap:9px;flex:1;min-width:0;cursor:pointer}.note-checklist .checklist-checkbox{width:18px;height:18px;flex:none;accent-color:var(--green)}.note-checklist .checklist-text{font-size:13px;line-height:1.5}.note-checklist .checklist-row.is-done .checklist-text{text-decoration:line-through;color:#8b96a4}.checklist-foot{padding-top:7px;color:#98a3b1;font-size:10px}.note-checklist+.tag-row{margin-top:10px}@media(max-width:620px){.unified-toolbar{align-items:flex-start;flex-direction:column}.unified-toolbar .show-completed-toggle{min-height:40px}.note-checklist .checklist-checkbox{width:22px;height:22px}.note-checklist .checklist-text{font-size:15px}}


/* v1.1.6：記事卡片完整顯示全文，不再以行數或字數截斷。 */
.note-card .note-content {
  display: block;
  -webkit-line-clamp: unset;
  -webkit-box-orient: initial;
  max-height: none;
  height: auto;
  overflow: visible;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
@media (max-width: 620px) {
  .note-card .note-content {
    display: block;
    -webkit-line-clamp: unset;
    max-height: none;
    overflow: visible;
  }
}


/* v1.1.7: completion toggle and scroll position after deleting a note. */
.note-complete-form { margin: 0; display: inline-flex; align-items: center; }
.note-complete-toggle {
  display: inline-flex; align-items: center; gap: 6px; min-height: 34px;
  padding: 0 9px; border: 1px solid var(--line); border-radius: 8px;
  color: var(--muted); font-size: 12px; cursor: pointer; user-select: none;
}
.note-complete-toggle input { width: 16px; height: 16px; margin: 0; accent-color: var(--green); cursor: pointer; }
.note-card { scroll-margin-top: 22px; }
.note-card:target { outline: 2px solid var(--green); outline-offset: 4px; }


/* v1.1.11：記事卡片預覽限制 200 字，提升內文字體對比與可讀性。 */
.note-card .note-content {
  color: #263445;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.75;
}
.note-card .note-content a,
.detail-note-content a {
  color: #1558c7;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
}
.detail-note-content {
  color: #263445;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.85;
}
@media (max-width: 620px) {
  .note-card .note-content { font-size: 16px; line-height: 1.8; }
  .detail-note-content { font-size: 17px; line-height: 1.85; }
}


/* v1.1.12：記事卡片採用 masonry 排列，避免同列短卡片下方產生大片空白。 */
.note-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 6px;
  grid-auto-flow: row;
  align-items: start;
  gap: 15px;
}
.note-grid > .note-card {
  min-height: 230px;
  height: auto;
  align-self: start;
}
@media (max-width: 900px) {
  .note-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .note-grid { grid-template-columns: minmax(0, 1fr); grid-auto-rows: 6px; gap: 13px; }
}
/* Memo and checklist pin controls */
.state-tag.memo{background:#fff2d9;color:#91600c}
.memo-check{display:flex;align-items:center;gap:8px;margin-top:8px;padding:10px 12px;background:#fff9ed;border:1px solid #f2e5c9;border-radius:8px;color:#795b22!important}
.memo-check input{width:16px;height:16px;accent-color:#c28b27}
.note-checklist .checklist-row{display:flex;align-items:center;gap:7px}
.note-checklist .checklist-toggle-form{flex:1;min-width:0}
.task-pin-form{margin:0;flex:none}
.pin-btn{border:0;background:transparent;color:#a5afbc;font-size:20px;line-height:1;padding:4px 6px;cursor:pointer;border-radius:6px}
.pin-btn:hover,.pin-btn.pinned{color:#c18a22;background:#fff7e8}

/* v1.1.15: pinned notes */
.note-card.is-pinned { border: 2px solid #e0b75d; }
.note-pin-form { display: inline-flex; }
