/* ===== 工作备忘录 ===== */
/* 搜索框（与顶栏 .gsearch 同风格） */
.search-box{position:relative;display:flex;align-items:center;gap:6px;background:rgba(120,120,128,.12);border:1px solid transparent;border-radius:9px;padding:6px 11px;width:200px;transition:border-color .2s,width .2s,background .2s}
.search-box:focus-within{border-color:var(--blue);background:#fff;width:240px}
.search-box>svg{width:14px;height:14px;color:var(--text-3);flex:none}
.search-box input{border:0;background:transparent;outline:none;font-size:13px;color:var(--text);width:100%;line-height:1.4}
html[data-theme="dark"] .search-box:focus-within{background:#1c1c1e}

.memo-wrap{display:grid;grid-template-columns:370px 1fr;gap:16px;align-items:start}

/* 左侧快速记录 */
.memo-editor-card{padding:18px 20px 16px;background:var(--card);backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px);border-radius:16px;box-shadow:0 8px 30px rgba(0,0,0,.06),0 1px 3px rgba(0,0,0,.04);position:sticky;top:14px;border:1px solid var(--hairline)}
.memo-editor-card .card-hd{margin-bottom:12px}
.memo-editor-card .card-hd h2{font-size:15px}
.memo-field{margin-bottom:9px}
.memo-field input,.memo-field textarea{width:100%;box-sizing:border-box;border:1px solid var(--hairline);border-radius:10px;background:var(--card-solid);color:var(--text);transition:border-color .15s,box-shadow .15s,background .15s;font-family:inherit}
.memo-field input{font-size:14px;font-weight:600;padding:10px 12px;height:42px}
.memo-field textarea{font-size:13.5px;padding:10px 12px;resize:vertical;line-height:1.6;min-height:72px}
.memo-field input:focus,.memo-field textarea:focus{outline:none;border-color:var(--blue);box-shadow:0 0 0 3px rgba(0,113,227,.13);background:var(--card-solid)}
.memo-editor-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:12px}
.memo-editor-actions .btn{height:36px;padding:0 18px;border-radius:9px;font-size:13.5px}

/* 右侧列表 */
.memo-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(290px,1fr));gap:12px;align-items:start;min-height:120px}
.memo-stats{grid-column:1/-1;display:flex;align-items:center;gap:8px;font-size:12.5px;color:var(--text-3);font-weight:500;padding:2px 2px 0}
.memo-stats b{color:var(--blue);font-weight:700}
.memo-group-label{grid-column:1/-1;font-size:11.5px;font-weight:600;color:var(--text-3);letter-spacing:.08em;margin:2px 0 -2px;display:flex;align-items:center;gap:8px}
.memo-group-label::after{content:"";flex:1;height:1px;background:var(--hairline)}

.memo-card{padding:14px 16px 12px;position:relative;border-radius:14px;border:1px solid var(--hairline);background:var(--card);box-shadow:0 3px 14px rgba(0,0,0,.04);transition:transform .15s,box-shadow .15s,border-color .15s;overflow:hidden}
.memo-card:hover{transform:translateY(-1px);box-shadow:0 8px 22px rgba(0,0,0,.08);border-color:rgba(0,113,227,.25)}
.memo-card.is-top{border-color:rgba(255,149,0,.4)}
.memo-card.is-top::before{content:"";position:absolute;left:0;top:10px;bottom:10px;width:3px;border-radius:2px;background:#ff9500}
.memo-card-hd{display:flex;align-items:flex-start;gap:8px}
.memo-card-title{font-size:14px;font-weight:600;flex:1;line-height:1.5;word-break:break-word;color:var(--text)}
.memo-card-content{font-size:13px;color:var(--text-2);line-height:1.65;margin-top:6px;white-space:pre-wrap;word-break:break-word}
.memo-card-foot{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:9px}
.memo-card-time{font-size:11px;color:var(--text-3);display:flex;align-items:center;gap:5px;min-width:0}
.memo-card-time svg{flex:none;opacity:.7}
.memo-card-ops{display:flex;gap:2px;flex:none;opacity:0;transition:opacity .15s}
.memo-card:hover .memo-card-ops,.memo-card.is-top .memo-card-ops{opacity:1}
.memo-op{width:28px;height:28px;border-radius:7px;border:0;background:transparent;color:var(--text-3);display:flex;align-items:center;justify-content:center;cursor:pointer;transition:background .15s,color .15s;padding:0}
.memo-op:hover{background:rgba(120,120,128,.12);color:var(--text)}
.memo-op-del:hover{background:rgba(255,59,48,.12);color:#ff3b30}
.memo-card.is-top .memo-op[data-op="top"]{color:#ff9500}

/* 空态 */
.memo-empty{grid-column:1/-1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:64px 20px;color:var(--text-3);text-align:center}
.memo-empty-ic{width:64px;height:64px;border-radius:20px;background:linear-gradient(135deg,rgba(0,113,227,.1),rgba(0,113,227,.04));display:flex;align-items:center;justify-content:center;color:var(--blue)}
.memo-empty b{font-size:15px;color:var(--text-2);font-weight:600}
.memo-empty p{font-size:13px;margin:0;line-height:1.6}

@media(max-width:1024px){
  .memo-wrap{grid-template-columns:1fr}
  .memo-editor-card{position:static}
}
@media(max-width:640px){
  .search-box{width:100%;box-sizing:border-box}
  .search-box:focus-within{width:100%}
  .memo-wrap{gap:10px}
  .memo-list{grid-template-columns:1fr;gap:10px}
  .memo-card{padding:12px 14px 11px}
  .memo-editor-card{padding:14px 14px 12px}
  .memo-empty{padding:40px 16px}
  /* 操作按钮移到卡片底部一行，与时间并排 */
  .memo-card-ops{opacity:1;gap:4px}
  .memo-op{width:34px;height:34px;border-radius:9px;background:rgba(120,120,128,.08)}
  .memo-op:active{background:rgba(120,120,128,.18)}
  .memo-card-foot{margin-top:10px}
  /* 输入框 16px 防止 iOS 聚焦缩放 */
  .memo-field input,.memo-field textarea{font-size:16px}
  .memo-field input{height:44px}
  .memo-field textarea{min-height:84px}
  .memo-editor-actions{display:grid;grid-template-columns:1fr 1.6fr;gap:10px;margin-top:12px}
  .memo-editor-actions .btn{height:44px;font-size:15px;border-radius:10px}
  .memo-editor-actions .btn:not(.ghost){grid-column:1/-1}
  .memo-editor-actions.editing .btn.ghost{grid-column:1}
  .memo-editor-actions.editing .btn:not(.ghost){grid-column:2}
  .memo-stats{font-size:12px;padding:0 2px}
  .memo-group-label{font-size:11px}
}

