/* ==========================================================
   视图层 B：附件 / 文档 / 网址 / 笔记 / 便签 / 账号
   ========================================================== */
/* ---------- 附件 ---------- */
.dropzone {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px; margin-bottom: 14px;
  border: 1.5px dashed var(--line-strong); border-radius: var(--r-lg); color: var(--text-2); cursor: pointer;
  transition: border-color .15s, background .15s;
}
.dropzone:hover { border-color: var(--ink); background: var(--card); }
.dropzone .emoji { background: var(--card); }
.dropzone small { display: block; color: var(--text-3); font-size: 12px; }
.files { display: grid; }
.file-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; align-items: center; gap: 14px; padding: 11px 16px; border-top: 1px solid var(--line); }
.file-row:first-child { border-top: 0; }
.file-row:hover { background: #faf7f0; }
.file-ext { display: grid; place-items: center; width: 36px; height: 42px; border-radius: 6px 12px 6px 6px; font: 700 10px var(--mono); color: #fff; background: var(--c, var(--ink-3)); text-transform: uppercase; }
.file-row .n { font-weight: 600; }
.file-row .m { font-size: 12px; color: var(--text-3); }

/* ---------- 项目文档 ---------- */
.docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.doc-card { display: grid; gap: 10px; padding: 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); cursor: pointer; transition: box-shadow .15s, transform .15s; }
.doc-card:hover { box-shadow: var(--sh-2); transform: translateY(-2px); }
.doc-card h3 { font: 700 16px/1.35 var(--serif); }
.doc-card p { color: var(--text-2); font-size: 13px; }
.doc-card .foot { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text-3); }
.doc-card .foot .sp { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; }

/* ---------- 网址收藏 ---------- */
.bm-grid { columns: 290px; column-gap: 14px; }
.bm-card { display: flex; flex-direction: column; gap: 12px; width: 100%; min-width: 0; break-inside: avoid; margin-bottom: 14px; padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); transition: box-shadow .15s; }
.bm-card:hover { box-shadow: var(--sh-2); }
.bm-card .top { display: flex; align-items: flex-start; gap: 12px; }
.bm-card h3 { overflow-wrap: anywhere; font: 700 16px/1.3 var(--serif); }
.bm-card .desc { overflow-wrap: anywhere; font-size: 12px; color: var(--text-3); margin-top: 2px; }
.bm-card .ops { display: flex; flex: none; margin-left: auto; opacity: 0; transition: opacity .15s; }
.bm-card:hover .ops, .bm-card:focus-within .ops { opacity: 1; }
.links { display: grid; gap: 4px; }
.bm-card .links { grid-template-columns: minmax(0, 1fr); min-width: 0; }
.link {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: var(--r-sm); background: var(--paper); font-size: 13px; transition: background .12s;
}
.link:hover { background: var(--ink); color: var(--paper); }
.link:hover .u { color: #a7a2ad; }
.link .u { font: 11px var(--mono); color: var(--text-3); }
.link .ico { width: 14px; height: 14px; }
.bm-card .foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-width: 0; font-size: 12px; color: var(--text-3); }
.bm-card .foot .tag { min-width: 0; height: auto; min-height: 22px; overflow-wrap: anywhere; white-space: normal; }
.bm-card .foot > span:last-child { flex: none; }

/* ---------- 笔记：整页列表 + 阅读弹窗 ---------- */
.notes-page .page-head .actions { flex-wrap: wrap; max-width: 100%; }
.notes-page .seg { flex: none; }
.notes-page .seg button { white-space: nowrap; }
.notes-page .chip { min-width: 0; max-width: 100%; }
.notes-page .chip .num { flex: none; }
.notes { min-width: 0; overflow: hidden; }
.note-list-head, .note-item { display: grid; grid-template-columns: minmax(0, 1fr) 140px 120px 20px; align-items: center; gap: 20px; padding: 15px 22px; }
.note-list-head { background: var(--paper); border-bottom: 1px solid var(--line); font-size: 12px; color: var(--text-3); }
.note-list { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; }
.note-item { width: 100%; min-width: 0; max-width: 100%; text-align: left; border-bottom: 1px solid var(--line); transition: background .15s; }
.note-item:last-child { border-bottom: 0; }
.note-item:hover, .note-item:focus-visible { background: var(--paper); }
.note-item:focus-visible { outline-offset: -3px; }
.note-main { display: grid; gap: 5px; min-width: 0; }
.note-item .h { display: flex; align-items: flex-start; gap: 8px; min-width: 0; font-weight: 600; line-height: 1.45; }
.note-item .note-icon { flex: none; }
.note-item .note-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; min-width: 0; overflow: hidden; overflow-wrap: anywhere; }
.note-item .p { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; line-height: 1.5; color: var(--text-3); }
.note-item .note-category { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--text-2); }
.note-item .note-time { white-space: nowrap; font-size: 12px; color: var(--text-3); }
.note-open { display: flex; color: var(--text-3); }
.modal.note-reader { width: min(1040px, 100%); height: min(800px, calc(100vh - 48px)); min-width: 0; overflow: hidden; }
.reader-head { display: flex; flex: none; align-items: flex-start; gap: 14px; padding: 22px 30px 16px; border-bottom: 1px solid var(--line); max-height: 45%; overflow: auto; }
.reader-heading { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.reader-head h1 { font: 700 26px/1.25 var(--serif); }
.reader-head .m { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; font-size: 12px; color: var(--text-3); }
.reader-head .actions { margin-left: auto; display: flex; gap: 4px; flex: none; }
.reader-body { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; overflow-wrap: anywhere; }
.note-reader .prose { width: 100%; margin: 0 auto; }
.note-reader .tag { max-width: 100%; height: auto; white-space: normal; overflow-wrap: anywhere; }
.prose { padding: 24px 30px 34px; font-size: 15px; line-height: 1.85; max-width: 760px; }
.prose > * + * { margin-top: .8em; }
.prose h1, .prose h2, .prose h3 { font-family: var(--serif); line-height: 1.35; margin-top: 1.3em; }
.prose h1 { font-size: 22px; } .prose h2 { font-size: 19px; } .prose h3 { font-size: 16px; }
.prose ul, .prose ol { padding-left: 1.4em; } .prose ul { list-style: disc; } .prose ol { list-style: decimal; }
.prose blockquote { margin: 1em 0; padding: 4px 16px; border-left: 3px solid var(--accent); color: var(--text-2); background: var(--paper); }
.prose code { padding: 1px 6px; border-radius: 4px; background: var(--paper-2); font: 13px var(--mono); }
.prose pre { padding: 14px 16px; border-radius: var(--r); background: var(--ink); color: #e9e5dc; overflow-x: auto; }
.prose pre code { background: none; padding: 0; color: inherit; }
.prose a { color: var(--accent-ink); text-decoration: underline; }
.prose table { border-collapse: collapse; font-size: 13px; }
.prose th, .prose td { border: 1px solid var(--line); padding: 6px 10px; }

/* ---------- 便签墙 ---------- */
.wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 22px 18px; padding: 8px 4px; }
.sticky {
  position: relative; display: flex; flex-direction: column; gap: 8px; min-height: 200px; padding: 22px 18px 14px;
  background: var(--bg); border-radius: 3px 3px 18px 3px; cursor: pointer; text-align: left;
  box-shadow: 0 1px 1px rgba(0,0,0,.06), 0 14px 22px -14px rgba(60,40,10,.45);
  transform: rotate(var(--tilt, 0deg)); transition: transform .2s, box-shadow .2s;
}
.sticky:hover { transform: rotate(0) translateY(-4px) scale(1.02); box-shadow: 0 24px 36px -18px rgba(60,40,10,.55); z-index: 1; }
.sticky::before { content: ""; position: absolute; top: -9px; left: 50%; width: 74px; height: 20px; transform: translateX(-50%) rotate(-2deg); background: rgba(255,255,255,.55); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.sticky h3 { display: flex; gap: 6px; font: 700 16px/1.35 var(--serif); color: #2b2416; }
.sticky .b { font-size: 13px; color: #4a4232; flex: 1; }
.sticky .f { display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: rgba(43,36,22,.6); }
.sticky .ops { position: absolute; top: 8px; right: 8px; display: flex; opacity: 0; transition: opacity .15s; }
.sticky:hover .ops, .sticky:focus-within .ops { opacity: 1; }
.sticky .icon-btn { width: 26px; height: 26px; color: #4a4232; }
.sticky .icon-btn:hover { background: rgba(255,255,255,.55); }
.wall.mini { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 18px 14px; padding: 14px 20px 20px; }
.wall.mini .sticky { min-height: 140px; padding: 18px 14px 10px; }

/* ---------- 账号 ---------- */
.acc-grid { columns: 3 300px; column-gap: 14px; }
.acc-card { break-inside: avoid; margin-bottom: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.acc-card .top { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px dashed var(--line-strong); }
.acc-card .acc-heading { flex: 1; min-width: 0; }
.acc-card h3 { overflow-wrap: anywhere; font: 700 16px/1.35 var(--serif); }
.acc-card .acc-category { display: block; overflow-wrap: anywhere; margin-top: 3px; font-size: 12px; color: var(--text-3); }
.acc-card .ops { margin-left: auto; display: flex; flex: none; }
.acc-card .acc-empty { padding: 6px; font-size: 12px; color: var(--text-3); }
.acc-card .field .k { min-width: 0; overflow-wrap: anywhere; }
.fields { display: grid; padding: 8px 10px; }
.field { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 5px 6px; border-radius: var(--r-sm); }
.field:hover { background: var(--paper); }
.field .k { font-size: 12px; color: var(--text-3); }
.field .v { font: 13px var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.field .v.secret { letter-spacing: .12em; }
.field .acts { display: flex; opacity: .5; transition: opacity .15s; }
.field:hover .acts { opacity: 1; }
.field .icon-btn { width: 24px; height: 24px; }
.acc-card .remark { margin: 0 16px 14px; padding: 8px 10px; border-radius: var(--r-sm); background: var(--paper); font-size: 12px; color: var(--text-2); overflow-wrap: anywhere; white-space: pre-wrap; }

@media (max-width: 760px) {
  .note-list-head { display: none; }
  .note-item { grid-template-columns: minmax(0, 1fr) auto 16px; gap: 8px 12px; padding: 15px 16px; }
  .note-main { grid-column: 1 / 3; }
  .note-item .note-category { grid-column: 1; grid-row: 2; }
  .note-item .note-time { grid-column: 2; grid-row: 2; }
  .note-open { grid-column: 3; grid-row: 1 / 3; }
  .note-reader .reader-head { flex-wrap: wrap; gap: 10px; padding: 18px 20px 14px; }
  .note-reader .reader-heading { flex-basis: calc(100% - 60px); }
  .note-reader .reader-head h1 { font-size: 22px; }
  .note-reader .reader-head .actions { order: -1; justify-content: flex-end; width: 100%; }
  .note-reader .prose { padding: 20px; }
}
