/* HyperCloud in HyperCluster's shared design (ui/hc.css). The pages are built from the design's
   parts; what drive.js, notes.js and account.js draw still carries the classes those scripts always
   used (.drive-*, .notes-*, .pricing-*, the SweetAlert2 dialogs), and they are put in the new look
   here, in the kit's colours. styles.css is no longer loaded by these pages. */

/* The scripts' inline styles name the old colours (drive.js: the storage bar, the share dialog). */
:root {
  --hx-bg: var(--bg); --hx-bg-2: var(--head); --hx-card: var(--card); --hx-border: var(--line);
  --hx-text: var(--text); --hx-muted: var(--muted); --hx-blue: var(--blue); --hx-blue-2: var(--link);
  --hx-error: var(--bad); --hx-success: var(--good); --hx-warning: var(--wait); --hx-glow: rgba(47, 140, 255, .35);
}
.hidden, .hide { display: none !important; }
.cl-wrap { overflow-wrap: anywhere; }
.cl-danger { color: var(--bad); border-color: rgba(248, 113, 113, .35); background: transparent; }
.cl-danger:hover { color: var(--bad); border-color: var(--bad); background: var(--bad-bg); }
.btn svg, .chip svg { flex-shrink: 0; }
@container site (min-width: 900px) { .cl-only-narrow { display: none !important; } }

/* waiting for the member (#loadingScreen) */
.cl-loading { display: flex; align-items: center; justify-content: center; flex: 1; padding: 80px 16px; }
.cl-spinner, .spinner, .loading-spinner { display: inline-block; width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--link); animation: cl-spin .8s linear infinite; vertical-align: middle; }
.loading-spinner { width: 18px; height: 18px; border-width: 2px; }
@keyframes cl-spin { to { transform: rotate(360deg); } }
#app { display: flex; flex-direction: column; flex: 1; min-width: 0; }
#app.hidden { display: none !important; }

/* a page's buttons next to its title go under it on a phone */
@container site (max-width: 599px) {
  .shell-head > .stack.grow { flex-basis: 100%; }
  .cl-head-actions { flex: 1; }
  .cl-head-actions > .btn { flex: 1; }
}

/* ---------- the drive (index.html, drive.js) ---------- */
.cl-drive-head { align-items: flex-start; }
.cl-drive-head h1 { overflow-wrap: anywhere; }
.cl-actions { display: flex; gap: 8px; align-items: center; position: relative; margin-left: auto; }
.drive-breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; margin: 0 0 2px -8px; }
.drive-breadcrumb:has(#breadcrumbPath:empty) { display: none; }
#breadcrumbPath { display: contents; }
.drive-breadcrumb svg { color: var(--faint); width: 14px; height: 14px; }
.drive-breadcrumb-item { border: 0; background: none; color: var(--link); font-size: 13px; padding: 4px 8px; border-radius: 8px; cursor: pointer; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drive-breadcrumb-item:hover { background: var(--blue-bg); }
.drive-breadcrumb-item:last-child { color: var(--muted); }

/* the "New" menu and the sort menu */
.drive-new-menu, .drive-sort-menu, .context-menu { background: var(--card-2); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: 0 14px 40px rgba(0, 0, 0, .5); padding: 6px; z-index: 60; }
.drive-new-menu { position: absolute; top: calc(100% + 6px); right: 0; min-width: 210px; }
.drive-new-menu-item, .drive-sort-option, .context-menu-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 42px; padding: 0 12px; border: 0; border-radius: 10px; background: none; color: var(--text); font-size: 14px; text-align: left; cursor: pointer; }
.drive-new-menu-item:hover, .drive-sort-option:hover, .context-menu-item:hover { background: var(--blue-bg); }
.drive-new-menu-item svg, .context-menu-item svg { color: var(--link); flex-shrink: 0; }
.context-menu-item.danger, .context-menu-item.danger svg { color: var(--bad); }
.context-menu-item.danger:hover { background: var(--bad-bg); }
.context-menu-divider, .drive-sort-divider { height: 1px; background: var(--line); margin: 4px 6px; }
.context-menu { position: fixed; min-width: 190px; z-index: 110; }

/* how much space is used */
.cl-storage .bar i { transition: width .3s ease; }

/* toolbar: sort, grid or list */
.drive-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.drive-toolbar-right { display: flex; align-items: center; gap: 8px; }
.drive-sort-dropdown { position: relative; }
.drive-sort-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--text); font-size: 13px; font-weight: 500; cursor: pointer; }
.drive-sort-btn:hover { border-color: var(--line-2); }
.drive-sort-btn svg { color: var(--muted); }
.drive-sort-menu { position: absolute; top: calc(100% + 6px); left: 0; min-width: 200px; }
.drive-sort-option span { flex: 1; }
.drive-sort-option .sort-check { opacity: 0; color: var(--link); }
.drive-sort-option.active .sort-check { opacity: 1; }
.drive-sort-option svg:not(.sort-check) { color: var(--muted); }
.cl-view { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--field); }
.drive-view-btn { width: 36px; height: 34px; border: 0; border-radius: 999px; background: none; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.drive-view-btn.active { background: rgba(47, 140, 255, .18); color: var(--text); }

/* where files can be dropped */
.drive-drop-zone { position: relative; min-height: 320px; flex: 1; }
.drive-drop-overlay { position: absolute; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; border: 2px dashed var(--link); border-radius: var(--r); background: rgba(47, 140, 255, .08); }
.drive-drop-content { display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--link); font-weight: 600; }

/* the files: cards (grid) or rows (list) */
.drive-files.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
@container site (min-width: 600px) { .drive-files.grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); } }
.drive-files.list { display: flex; flex-direction: column; gap: 6px; }
.drive-item { position: relative; display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.drive-item:hover { border-color: var(--line-2); }
.drive-item.selected { border-color: var(--link); background: rgba(47, 140, 255, .07); }
.drive-item.dragging { opacity: .5; }
.drive-item.drag-over { border-color: var(--link); outline: 2px dashed var(--link); outline-offset: 2px; }
.drive-item.loading { pointer-events: none; opacity: .7; }
.drive-item.loading::after { content: ''; position: absolute; top: 72px; left: 50%; width: 24px; height: 24px; margin: -12px 0 0 -12px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--link); animation: cl-spin .8s linear infinite; }
/* The picture sits low enough for the buttons above it (always shown on a touch screen). */
.drive-item-icon { height: 96px; padding-top: 24px; border-radius: 10px; background: var(--field); color: var(--link); display: flex; align-items: center; justify-content: center; margin-bottom: 4px; }
.drive-item-icon svg { width: 30px; height: 30px; }
/* The scripts' file icons come in many colours; the design draws them all in one. */
.drive-item-icon [stroke]:not([stroke="none"]) { stroke: currentColor; }
.drive-item-icon text, .drive-item-icon polygon[fill]:not([fill="none"]) { fill: currentColor; }
.drive-item-name { font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drive-item-meta { display: flex; flex-wrap: wrap; gap: 0 6px; }
.drive-item-size, .drive-item-date { font-size: 12px; color: var(--muted); }
.drive-item-meta .drive-item-size::after { content: '·'; margin-left: 6px; }
/* share, download, delete: over the picture; on a touch screen always there */
.drive-item-actions { position: absolute; top: 18px; right: 18px; z-index: 2; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.drive-item:hover .drive-item-actions, .drive-item:focus-within .drive-item-actions { opacity: 1; }
@media (hover: none) { .drive-item-actions { opacity: 1; } }
.drive-item-action { width: 32px; height: 32px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; border: 1px solid var(--line-2); background: var(--card-2); color: var(--text); cursor: pointer; }
.drive-item-action:hover { border-color: var(--link); color: var(--link); }
.drive-item-action[data-action="delete"]:hover { border-color: var(--bad); color: var(--bad); }
.drive-item-shared-badge { position: absolute; top: 18px; left: 18px; z-index: 2; width: 24px; height: 24px; border-radius: 50%; background: var(--good); color: #050911; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.drive-item-shared-badge:hover { background: var(--bad); }
/* rows */
.drive-files.list .drive-item { flex-direction: row; align-items: center; gap: 12px; padding: 8px 12px; }
.drive-files.list .drive-item-icon { width: 44px; height: 44px; padding: 0; flex-shrink: 0; margin: 0; }
.drive-files.list .drive-item-icon svg { width: 22px; height: 22px; }
.drive-files.list .drive-item-name { flex: 1; min-width: 0; }
.drive-files.list .drive-item-meta, .drive-files.list .drive-item.folder > .drive-item-date { flex-shrink: 0; }
.drive-files.list .drive-item-actions { position: static; order: 5; flex-shrink: 0; }
.drive-files.list .drive-item-shared-badge { top: 4px; left: 4px; width: 18px; height: 18px; }
.drive-files.list .drive-item-shared-badge svg { width: 10px; height: 10px; }
@container site (max-width: 599px) {
  .drive-files.list .drive-item-meta, .drive-files.list .drive-item.folder > .drive-item-date { display: none; }
}
/* nothing here yet / drop more */
.drive-upload-prompt { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 40px 20px; border: 2px dashed var(--line); border-radius: var(--r); color: var(--muted); }
.drive-upload-prompt h3 { color: var(--text); }
.drive-upload-prompt p { font-size: 14px; }
.drive-upload-prompt-icon { color: var(--faint); }
.drive-upload-prompt.compact { flex-direction: row; flex-wrap: wrap; justify-content: center; padding: 14px 16px; margin-top: 4px; }
.drive-upload-prompt.compact h3 { font-size: 14px; font-weight: 500; color: var(--muted); }
.drive-upload-prompt-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--blue); background: var(--blue); color: #050911; font-weight: 600; font-size: 14px; cursor: pointer; }
.drive-upload-prompt-btn:hover { background: var(--link); border-color: var(--link); }
.drive-upload-prompt.compact .drive-upload-prompt-btn { min-height: 40px; }
@container site (max-width: 599px) { .drive-upload-prompt.compact .drive-upload-prompt-icon { display: none; } }
.drive-empty { display: none; }

/* the drive's folders in the sidebar (shell.js moves #folderTree under "My files") */
.side .drive-folder-tree { display: flex; flex-direction: column; gap: 2px; margin: 0 0 6px; }
.side .drive-folder-tree:empty { display: none; }
.drive-folder-item { display: flex; align-items: center; gap: 10px; min-height: 36px; margin-left: 14px; padding-right: 10px; border-radius: 10px; color: var(--muted); font-size: 13px; cursor: pointer; }
.drive-folder-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drive-folder-item svg { flex-shrink: 0; }
.drive-folder-item:hover { color: var(--text); }
.drive-folder-item.active { color: var(--text); background: rgba(47, 140, 255, .08); }
.drive-folder-item.drag-over, .side a.drag-over { outline: 2px dashed var(--link); outline-offset: -2px; }

/* new folder */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(3, 6, 12, .72); }
.modal-content { position: relative; width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 16px; padding: 22px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
.modal-btn { min-height: 44px; padding: 0 18px; border-radius: 12px; font-weight: 600; font-size: 14px; cursor: pointer; border: 1px solid var(--line); background: var(--card); color: var(--text); }
.modal-btn.primary { background: var(--blue); border-color: var(--blue); color: #050911; }
.modal-btn.primary:hover { background: var(--link); }
.form-input { width: 100%; height: 50px; border-radius: 12px; border: 1px solid var(--line); background: var(--field); padding: 0 14px; font-size: 15px; color: var(--text); }
.form-input:focus, .input:focus { outline: none; border-color: var(--link); }

/* uploads under way: above the phone's tab bar */
.upload-progress { position: fixed; z-index: 90; right: 16px; bottom: 16px; width: min(360px, calc(100vw - 32px)); max-height: 420px; display: flex; flex-direction: column; background: var(--card-2); border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: 0 14px 40px rgba(0, 0, 0, .5); overflow: hidden; }
@container site (max-width: 899px) { .upload-progress { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); } }
.upload-progress-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 14px; font-weight: 600; }
.upload-progress-close { width: 32px; height: 32px; border: 0; border-radius: 8px; background: none; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.upload-progress-list { overflow-y: auto; }
.upload-progress-item { padding: 10px 14px; border-bottom: 1px solid var(--line); }
.upload-progress-item:last-child { border-bottom: 0; }
.upload-item-name { font-size: 13px; margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upload-item-status { display: flex; align-items: center; gap: 10px; }
.upload-item-bar { flex: 1; height: 6px; border-radius: 999px; background: #1a2333; overflow: hidden; }
.upload-item-fill { height: 100%; width: 0; background: var(--blue); border-radius: 999px; transition: width .2s; }
.upload-item-percent { font-size: 12px; color: var(--muted); min-width: 36px; text-align: right; }
.upload-progress-item.complete .upload-item-fill { background: var(--good); }
.upload-progress-item.error .upload-item-fill { background: var(--bad); }

/* ---------- dialogs (SweetAlert2, drawn by drive.js and notes.js) ---------- */
.swal2-container.swal2-backdrop-show { background: rgba(3, 6, 12, .72) !important; }
.swal2-popup { font-family: var(--font) !important; background: var(--card) !important; color: var(--text) !important; border: 1px solid var(--line); border-radius: var(--r) !important; padding: 22px 18px !important; }
.swal2-title { color: var(--text) !important; font-size: 20px !important; font-weight: 600 !important; }
.swal2-html-container { color: var(--muted) !important; font-size: 15px !important; }
.swal2-actions { gap: 10px; }
.swal2-styled { border-radius: 12px !important; min-height: 46px; padding: 0 20px !important; font-weight: 600 !important; font-size: 15px !important; margin: 0 !important; box-shadow: none !important; }
.swal2-styled.swal2-confirm { color: #050911 !important; }
.swal2-styled.swal2-cancel { background: var(--card-2) !important; border: 1px solid var(--line-2) !important; color: var(--text) !important; }
.swal2-input { background: var(--field) !important; border: 1px solid var(--line) !important; color: var(--text) !important; border-radius: 12px !important; box-shadow: none !important; font-size: 15px !important; }
.swal2-input:focus { border-color: var(--link) !important; }
.swal2-close { color: var(--muted) !important; }
.swal2-validation-message { background: var(--bad-bg) !important; color: var(--bad) !important; }
.swal2-icon.swal2-warning { border-color: var(--wait) !important; color: var(--wait) !important; }
.swal2-icon.swal2-error { border-color: var(--bad) !important; } .swal2-icon.swal2-error [class^='swal2-x-mark-line'] { background: var(--bad) !important; }
.swal2-icon.swal2-success [class^='swal2-success-line'] { background: var(--good) !important; } .swal2-icon.swal2-success .swal2-success-ring { border-color: rgba(52, 211, 153, .3) !important; }
.swal2-loader { border-color: var(--link) transparent var(--link) transparent !important; }
/* the share dialog */
.cl-share p { margin: 0 0 14px; }
.copybox input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); font: 14px var(--font); outline: none; text-overflow: ellipsis; }
.copybox .cl-copy { width: auto; padding: 0 16px; font-weight: 600; font-size: 14px; }

/* ---------- notes (notes.html, notes.js) ---------- */
.cl-notes { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); flex: 1; min-height: 560px; }
@container site (min-width: 900px) { .cl-notes { grid-template-columns: 280px minmax(0, 1fr); gap: 18px; } }
.cl-notes-list { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.cl-notes-list .input { height: 44px; }
@container site (max-width: 899px) {
  /* on a phone the list opens over the note (#menuToggle) */
  .cl-notes-list { position: absolute; inset: 0; z-index: 30; padding: 16px; background: var(--head); border: 1px solid var(--line); border-radius: var(--r); transform: translateX(calc(-100% - 24px)); visibility: hidden; transition: transform .18s ease, visibility .18s; }
  .cl-notes-list.open { transform: none; visibility: visible; }
}
.notes-list { display: flex; flex-direction: column; gap: 4px; overflow-y: auto; max-height: 640px; }
.notes-list-item { padding: 10px 12px; border-radius: 12px; border: 1px solid transparent; cursor: pointer; }
.notes-list-item:hover { background: var(--card); }
.notes-list-item.active { background: var(--blue-bg); border-color: rgba(47, 140, 255, .3); }
.notes-list-item-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notes-list-item-date { font-size: 12px; color: var(--muted); }
.notes-list-empty { padding: 14px 4px; font-size: 14px; color: var(--muted); }
.notes-main { display: flex; flex-direction: column; min-width: 0; min-height: 520px; padding: 0; overflow: hidden; }
.notes-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 40px 20px; text-align: center; color: var(--muted); }
.notes-empty h2 { font-size: 18px; color: var(--text); }
.notes-editor { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.notes-editor.hidden { display: none !important; }
.notes-editor-header { display: flex; align-items: center; gap: 12px; padding: 16px 18px 10px; }
.notes-title-input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); font: 600 22px var(--font); outline: none; padding: 0; }
.notes-title-input::placeholder { color: var(--faint); }
.notes-save-status { flex-shrink: 0; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.notes-save-status.saved { background: var(--good-bg); color: var(--good); }
.notes-save-status.saving { background: var(--blue-bg); color: var(--link); }
.notes-save-status.editing { background: var(--wait-bg); color: var(--wait); }
.notes-save-status.error { background: var(--bad-bg); color: var(--bad); }
.notes-editor-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 10px 18px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.notes-cid-link { font-family: var(--mono); font-size: 11px; color: var(--muted); text-decoration: none; padding: 2px 8px; border-radius: 6px; background: rgba(148, 163, 184, .1); }
.notes-cid-link:hover { color: var(--link); }
.notes-cid-link.hidden { display: none; }
.notes-delete-btn { margin-left: auto; min-height: 36px; padding: 0 12px; border-radius: 10px; border: 1px solid rgba(248, 113, 113, .35); background: none; color: var(--bad); font-size: 13px; font-weight: 600; cursor: pointer; }
.notes-delete-btn:hover { background: var(--bad-bg); }
/* Quill, the editor, in the dark look */
.notes-editor .ql-toolbar.ql-snow { border: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--card-2); padding: 6px 12px; font-family: var(--font); }
.notes-editor .ql-container.ql-snow { border: 0; flex: 1; overflow-y: auto; font: 15px var(--font); }
.notes-editor .ql-editor { padding: 18px; color: var(--text); line-height: 1.7; min-height: 280px; }
.notes-editor .ql-editor.ql-blank::before { color: var(--faint); font-style: normal; left: 18px; }
.notes-editor .ql-snow .ql-stroke { stroke: var(--muted); }
.notes-editor .ql-snow .ql-fill { fill: var(--muted); }
.notes-editor .ql-snow .ql-picker { color: var(--muted); }
.notes-editor .ql-snow button:hover .ql-stroke, .notes-editor .ql-snow .ql-active .ql-stroke { stroke: var(--link); }
.notes-editor .ql-snow button:hover .ql-fill, .notes-editor .ql-snow .ql-active .ql-fill { fill: var(--link); }
.notes-editor .ql-snow .ql-picker-label:hover, .notes-editor .ql-snow .ql-picker-label.ql-active, .notes-editor .ql-snow .ql-picker-item:hover { color: var(--link); }
.notes-editor .ql-snow .ql-picker-options { background: var(--card-2); border-color: var(--line-2) !important; border-radius: 10px; padding: 6px; }
.notes-editor .ql-snow .ql-picker-item { color: var(--text); }
.notes-editor .ql-editor blockquote { border-left: 3px solid var(--link); padding-left: 14px; color: var(--muted); }
.notes-editor .ql-editor pre.ql-syntax { background: var(--field); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 12px; font: 13px var(--mono); }
.notes-editor .ql-editor code { background: rgba(148, 163, 184, .12); padding: 1px 6px; border-radius: 4px; }
.notes-editor .ql-editor a { color: var(--link); }
.notes-editor .ql-snow .ql-tooltip { background: var(--card-2); border-color: var(--line-2); color: var(--text); border-radius: 10px; box-shadow: 0 14px 40px rgba(0, 0, 0, .5); z-index: 5; }
.notes-editor .ql-snow .ql-tooltip input[type=text] { background: var(--field); border-color: var(--line); color: var(--text); border-radius: 8px; height: 32px; }
.notes-editor .ql-snow .ql-tooltip a { color: var(--link); }
/* The editor's own words come from Quill's stylesheet: in Chinese on a Chinese page (html lang zh-CN) */
:lang(zh) .notes-editor .ql-snow .ql-picker.ql-header :is(.ql-picker-label, .ql-picker-item)::before { content: '正文'; }
:lang(zh) .notes-editor .ql-snow .ql-picker.ql-header :is(.ql-picker-label, .ql-picker-item)[data-value="1"]::before { content: '标题 1'; }
:lang(zh) .notes-editor .ql-snow .ql-picker.ql-header :is(.ql-picker-label, .ql-picker-item)[data-value="2"]::before { content: '标题 2'; }
:lang(zh) .notes-editor .ql-snow .ql-picker.ql-header :is(.ql-picker-label, .ql-picker-item)[data-value="3"]::before { content: '标题 3'; }
:lang(zh) .notes-editor .ql-snow .ql-tooltip::before { content: '打开链接：'; }
:lang(zh) .notes-editor .ql-snow .ql-tooltip[data-mode=link]::before { content: '输入链接：'; }
:lang(zh) .notes-editor .ql-snow .ql-tooltip a.ql-action::after { content: '编辑'; }
:lang(zh) .notes-editor .ql-snow .ql-tooltip a.ql-remove::before { content: '移除'; }
:lang(zh) .notes-editor .ql-snow .ql-tooltip.ql-editing a.ql-action::after { content: '保存'; }
@container site (max-width: 599px) {
  .notes-editor .ql-snow .ql-tooltip { left: 8px !important; right: 8px; }
  .notes-editor .ql-snow .ql-tooltip input[type=text] { width: 140px; }
}

/* ---------- storage plan (account.html, account.js) ---------- */
/* A row's label keeps its width: Chinese can break between any two characters ("续费" went one per line) */
.kv > span:first-child { flex-shrink: 0; }
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: rgba(148, 163, 184, .14); color: var(--muted); }
.badge.verified { background: var(--good-bg); color: var(--good); }
.badge.unverified { background: var(--wait-bg); color: var(--wait); }
.btn.btn-primary { background: var(--blue); border-color: var(--blue); color: #050911; }
.btn.btn-primary:hover { background: var(--link); border-color: var(--link); color: #050911; }
.btn.btn-secondary { background: var(--card); color: var(--text); }
.btn.loading { opacity: .6; pointer-events: none; }
.btn:disabled { cursor: not-allowed; }
.pay-error { padding: 10px 14px; border-radius: 12px; background: var(--bad-bg); border: 1px solid rgba(248, 113, 113, .3); color: var(--bad); font-size: 14px; }
.plan-due { padding: 12px 14px; border-radius: 12px; background: var(--wait-bg); }
.plan-due-title { font-weight: 600; color: var(--wait); margin-bottom: 4px; }
.plan-due-text { font-size: 14px; } .plan-due-text + .plan-due-text { margin-top: 4px; color: var(--muted); }
.plan-billing-hint { font-size: 13px; color: var(--muted); }
.account-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.account-actions:not(:has(> :not([style*="display: none"]))) { display: none; }
.account-actions .btn { min-height: 44px; font-size: 14px; }
.pricing-grid { display: flex; flex-direction: column; gap: 10px; }
.pricing-card { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--field); }
.pricing-card.recommended { border-color: #1f3a63; background: #0d1a2e; }
.pricing-card.current-plan { border-color: rgba(52, 211, 153, .45); }
.pricing-card-header { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.pricing-card-header h4 { font-size: 16px; }
.pricing-storage { font-size: 13px; color: var(--muted); }
.pricing-recommended-tag { order: 2; }
.pricing-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pricing-btn { min-height: 46px; padding: 6px 10px; font-size: 14px; white-space: normal; text-align: center; line-height: 1.25; flex-wrap: wrap; gap: 4px; }
.pricing-btn-interval { font-weight: 500; color: inherit; opacity: .8; }
.pricing-btn.current { background: var(--good-bg); border-color: rgba(52, 211, 153, .4); color: var(--good); opacity: 1; }
.pricing-btn:disabled:not(.current) { opacity: .6; }
.savings-badge { display: inline-flex; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--good-bg); color: var(--good); }
.btn-primary .savings-badge { background: rgba(5, 9, 17, .18); color: #050911; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
/* account.js's own toast */
.cl-toast { display: none; position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(92px + env(safe-area-inset-bottom, 0px)); z-index: 120; max-width: calc(100vw - 32px); width: max-content; padding: 10px 16px; border-radius: 12px; background: #0b1424; border: 1px solid #22324d; box-shadow: 0 14px 40px rgba(0, 0, 0, .5); font-size: 14px; }
@container site (min-width: 900px) { .cl-toast { bottom: 28px; } }
.cl-toast.show { display: block; }
.cl-toast.error { border-color: rgba(248, 113, 113, .5); }
.cl-toast.success { border-color: rgba(52, 211, 153, .45); }

/* ---------- reading pages: help, terms ---------- */
.cl-read { max-width: 820px; }
.cl-read h2 { margin-bottom: 4px; }
.cl-read :is(.card, .help-card) h3 { margin-bottom: 8px; }
.cl-read :is(.card, .help-card) :is(p, ul, ol) + :is(p, ul, ol) { margin-top: 10px; }
.cl-read ul, .cl-read ol { margin: 8px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.cl-read li { color: var(--text); }
.cl-read :is(.card, .help-card) :is(p, li) { font-size: 14px; }
.cl-read :is(.card, .help-card) p { color: var(--muted); }
.cl-read :is(.card, .help-card) :is(p, li) strong { color: var(--text); }
.cl-toc { display: flex; flex-wrap: wrap; gap: 8px; }
/* terms.html keeps its old markup (help-section, help-card) */
.legal-section, .help-section { display: flex; flex-direction: column; gap: 14px; scroll-margin-top: 80px; }
.help-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.help-card.warning-card { border-color: rgba(251, 191, 36, .35); }
.help-card.agreement-card { background: var(--blue-bg); border-color: #1f3a63; }

/* ---------- small pages: a share link, a welcome, an email link ---------- */
.cl-center { display: flex; justify-content: center; align-items: flex-start; padding: 40px 16px 64px; flex: 1; }
@container site (min-width: 720px) { .cl-center { padding: 72px 32px; } }
.cl-center > .card { width: 100%; max-width: 460px; align-items: center; text-align: center; padding: 28px 22px; }
.cl-center > .card.wide { max-width: 640px; }
.share-icon { width: 72px; height: 72px; border-radius: 18px; background: var(--blue-bg); color: var(--link); display: flex; align-items: center; justify-content: center; }
.share-icon svg { width: 34px; height: 34px; }
.share-icon.error { background: var(--bad-bg); color: var(--bad); }
.share-title { font-size: 20px; overflow-wrap: anywhere; }
.share-meta { color: var(--muted); font-size: 14px; margin-top: 4px; overflow-wrap: anywhere; }
#shareContent { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; }
.share-password-form { width: 100%; display: flex; flex-direction: column; gap: 6px; text-align: left; }
.share-error { color: var(--bad); font-size: 13px; }
.cl-feats { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); width: 100%; text-align: left; }
@container site (min-width: 600px) { .cl-feats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.cl-feats > div { padding: 14px; border-radius: 14px; background: var(--field); border: 1px solid var(--line); }
.cl-check { width: 64px; height: 64px; border-radius: 50%; background: var(--good-bg); color: var(--good); display: flex; align-items: center; justify-content: center; }

/* ---------- the signed-out home (landing.html) ---------- */
/* The heading in Chinese breaks at its comma, not inside a word (社区). */
.cl-keep { word-break: keep-all; }
.cl-crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--muted); }
.cl-crumbs a { color: var(--muted); }
.cl-crumbs span[aria-current] { color: var(--text); }
.cl-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 10px; }
.cl-price b { font-size: 18px; }
.cl-plans { display: flex; flex-direction: column; gap: 10px; }
.cl-plan { display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 62px; border-radius: 14px; border: 1px solid var(--line); background: var(--field); }
.cl-plan.pop { border-color: #1f3a63; background: #0d1a2e; }
.cl-plan .p { text-align: right; flex-shrink: 0; }
.cl-plan .p b { font-size: 16px; }
@container site (min-width: 900px) { .cl-buy { position: sticky; top: 92px; } }
