/* 科技感深色主题：深空背景 + 细网格 + 玻璃面板 + 青蓝渐变高光 */
:root {
  --bg: #05080f;
  --panel: rgba(12, 18, 32, .78);
  --panel-solid: #0a101c;
  --panel2: rgba(148, 178, 255, .06);
  --field: rgba(148, 178, 255, .05);
  --line: rgba(148, 178, 255, .13);
  --line-strong: rgba(148, 178, 255, .28);
  --text: #e7edff;
  --muted: #7d89aa;
  --accent: #5b8cff;
  --accent2: #22d3ee;
  --accent-soft: rgba(91, 140, 255, .16);
  --grad: linear-gradient(135deg, #5b8cff 0%, #22d3ee 100%);
  --red: #f43f5e;
  --amber: #f59e0b;
  --green: #10b981;
  --pink: #ec4899;
  --radius: 12px;
  --shadow: 0 12px 40px rgba(0, 0, 0, .55);
  --glow: 0 0 0 1px rgba(91, 140, 255, .45), 0 0 24px rgba(34, 211, 238, .18);
  --mono: "JetBrains Mono", "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  color: var(--text);
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(900px 520px at 8% -12%, rgba(91, 140, 255, .20), transparent 60%),
    radial-gradient(760px 420px at 105% -5%, rgba(34, 211, 238, .12), transparent 60%),
    linear-gradient(rgba(148, 178, 255, .035) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, rgba(148, 178, 255, .035) 1px, transparent 1px) 0 0 / 32px 32px,
    var(--bg);
  background-attachment: fixed;
}
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea {
  width: 100%;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=checkbox] { width: auto; accent-color: var(--accent); }
input[type=range] { padding: 0; border: 0; accent-color: var(--accent); }
input[type=range]:focus { box-shadow: none; }
textarea { resize: vertical; }
a { color: var(--accent); text-decoration: none; word-break: break-all; }
mark { background: #fde68a; color: #1d2030; border-radius: 3px; padding: 0 1px; }
kbd { background: var(--panel2); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; font-size: 12px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
h3 { margin: 0 0 12px; font-size: 16px; }
h4 { margin: 14px 0 8px; font-size: 13px; color: var(--muted); }
.muted { color: var(--muted); }
.tiny { font-size: 12px; }
.pre { white-space: pre-wrap; word-break: break-word; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  border: 1px solid var(--line); background: var(--panel); border-radius: 8px;
  padding: 7px 13px; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--panel2); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, var(--line)); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--panel2); }
.btn.sm { padding: 5px 8px; font-size: 13px; justify-content: flex-start; }
.btn.big { padding: 11px; font-size: 15px; width: 100%; }
.btn.icon { padding: 5px 8px; min-width: 32px; }
.link { border: 0; background: none; color: var(--accent); cursor: pointer; padding: 0 2px; font-size: 12px; }
.check { display: flex; align-items: center; gap: 7px; cursor: pointer; font-size: 13px; }
.check.sm { font-size: 12px; white-space: nowrap; }

/* 锁屏 */
.lock { min-height: 100%; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(1200px 600px at 50% -10%, var(--accent-soft), transparent); }
.lock-card { width: min(400px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  padding: 32px 28px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; text-align: center; }
.lock-card h1 { margin: 0; font-size: 22px; }
.lock-card p { margin: 0; }
.lock-card .check { text-align: left; align-items: flex-start; }
.logo { font-size: 42px; }
.notice { background: color-mix(in srgb, var(--amber) 14%, transparent); color: var(--amber); border-radius: 8px; padding: 8px; font-size: 13px; }
.meter { height: 4px; background: var(--panel2); border-radius: 4px; overflow: hidden; margin-top: 4px; }
.meter i { display: block; height: 100%; width: 0; transition: width .2s, background .2s; background: var(--red); }
.meter i[data-level="2"] { background: var(--amber); }
.meter i[data-level="3"] { background: var(--green); }
.meter i[data-level="4"] { background: var(--accent); }
.spinner { width: 28px; height: 28px; margin: 20px auto; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 布局 */
.shell { display: grid; grid-template-columns: 230px minmax(280px, 380px) 1fr; height: 100vh; height: 100dvh; }
.sidebar { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.brand { font-weight: 700; font-size: 16px; padding: 18px 16px 10px; display: flex; gap: 8px; align-items: center; }
#nav { flex: 1; overflow-y: auto; padding: 4px 8px; }
.nav-item { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; padding: 7px 10px; border-radius: 8px; cursor: pointer; text-align: left; }
.nav-item:hover { background: var(--panel2); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nl { flex: 1; }
.nc { color: var(--muted); font-size: 12px; }
.dot { background: var(--red); color: #fff; font-size: 11px; border-radius: 10px; padding: 0 6px; }
.nav-sep { font-size: 11px; color: var(--muted); padding: 12px 10px 4px; letter-spacing: .05em; }
.tagcloud { display: flex; flex-wrap: wrap; gap: 4px; padding: 2px 6px; }
.tag { border: 1px solid var(--line); background: var(--panel2); border-radius: 20px; padding: 1px 9px; font-size: 12px; cursor: pointer; }
.tag:hover, .tag.active { border-color: var(--accent); color: var(--accent); }
.tag small { color: var(--muted); }
.side-foot { border-top: 1px solid var(--line); padding: 8px; }
.side-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.sync { font-size: 12px; color: var(--muted); padding: 4px 8px 8px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sync i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.sync.ok i { background: var(--green); }
.sync.busy i { background: var(--accent); animation: pulse 1s infinite; }
.sync.warn i { background: var(--amber); }
.sync.err i { background: var(--red); }
@keyframes pulse { 50% { opacity: .3; } }

.listpane { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: var(--bg); }
.list-head { display: flex; gap: 8px; padding: 12px; align-items: center; }
.search { flex: 1; }
.search input { border-radius: 20px; padding-left: 14px; }
.newwrap { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; z-index: 20; min-width: 150px; }
.menu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.menu button:hover { background: var(--panel2); }
.list-sub { display: flex; justify-content: space-between; align-items: center; padding: 0 14px 8px; color: var(--muted); font-size: 12px; }
.list-sub select { width: auto; padding: 3px 6px; font-size: 12px; }
.list { flex: 1; overflow-y: auto; padding: 0 8px 12px; }
.row { display: flex; gap: 10px; width: 100%; align-items: center; text-align: left; border: 1px solid transparent; background: none; border-radius: 10px; padding: 9px 10px; cursor: pointer; }
.row:hover { background: var(--panel); }
.row.active { background: var(--panel); border-color: var(--accent); }
.row-icon { font-size: 20px; width: 28px; text-align: center; }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub, .row-tags { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-tags { color: var(--accent); opacity: .8; }
.star { color: #f59e0b; }
.empty { text-align: center; color: var(--muted); padding: 50px 10px; }
.badge { font-size: 11px; border-radius: 10px; padding: 1px 7px; white-space: nowrap; background: var(--panel2); }
.badge.red, .badge.lv1 { background: color-mix(in srgb, var(--red) 15%, transparent); color: var(--red); }
.badge.amber, .badge.lv2 { background: color-mix(in srgb, var(--amber) 15%, transparent); color: var(--amber); }
.badge.pink { background: color-mix(in srgb, var(--pink) 15%, transparent); color: var(--pink); }
.badge.lv3 { background: color-mix(in srgb, var(--green) 15%, transparent); color: var(--green); }
.badge.lv4 { background: var(--accent-soft); color: var(--accent); }

.detailpane { min-width: 0; min-height: 0; overflow-y: auto; background: var(--panel); }
.detail-head { display: flex; align-items: center; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); z-index: 5; }
.d-icon { font-size: 30px; }
.d-title { flex: 1; min-width: 0; }
.d-title h2 { margin: 0; font-size: 19px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.detail-body { padding: 18px 22px 40px; max-width: 860px; }
.field { display: grid; grid-template-columns: 150px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.f-label { color: var(--muted); font-size: 13px; }
.f-value { min-width: 0; word-break: break-word; }
.f-actions { display: flex; gap: 4px; }
.masked { letter-spacing: 2px; color: var(--muted); }
.stars { color: #f59e0b; font-size: 17px; letter-spacing: 2px; }
.stars .dim { color: var(--line); }
.totp { display: inline-flex; align-items: center; gap: 10px; }
.totp b { font-family: ui-monospace, Consolas, monospace; font-size: 22px; letter-spacing: 2px; color: var(--accent); }
.ring { width: 18px; height: 18px; border-radius: 50%; background: conic-gradient(var(--accent) var(--p, 100%), var(--panel2) 0); }
.d-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.meta { color: var(--muted); font-size: 12px; margin-top: 20px; }

/* 概览 */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); cursor: pointer; }
.stat:hover { border-color: var(--accent); }
.stat span { font-size: 22px; }
.stat b { font-size: 20px; }
.stat small { color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-bottom: 12px; }
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; background: var(--bg); margin-bottom: 12px; }
.cards .card { margin: 0; }
.card p { margin: 0; font-size: 13px; }
.minis { display: flex; flex-wrap: wrap; gap: 6px; }
.minis.group { padding: 6px; border: 1px dashed var(--line); border-radius: 8px; margin-bottom: 6px; }
.mini { border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 4px 9px; cursor: pointer; font-size: 13px; }
.mini:hover { border-color: var(--accent); }
.mini small { color: var(--muted); }
.health { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.h-item { text-align: center; padding: 10px 4px; border-radius: 8px; background: var(--panel); }
.h-item b { display: block; font-size: 22px; }
.h-item span { font-size: 12px; color: var(--muted); }
.h-item.bad b { color: var(--red); }
.h-item.warn b { color: var(--amber); }
.h-item.good b { color: var(--green); }

/* 编辑器 */
.editor .detail-body { display: flex; flex-direction: column; gap: 14px; }
.e-field { display: flex; flex-direction: column; gap: 5px; }
.e-field > span { font-size: 13px; color: var(--muted); }
.input-row { display: flex; gap: 6px; }
.rating-input { display: flex; align-items: center; gap: 2px; }
.rating-input button:not(.link) { border: 0; background: none; font-size: 26px; color: var(--line); cursor: pointer; padding: 0 2px; }
.rating-input button.on { color: #f59e0b; }
.custom { border: 1px dashed var(--line); border-radius: var(--radius); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.e-sub { font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; }
.custom-row { display: grid; grid-template-columns: 1fr 2fr auto auto; gap: 6px; align-items: center; }

/* 弹窗与提示 */
#modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; }
#modal[hidden] { display: none; }
.modal-bg { position: absolute; inset: 0; background: rgba(10, 10, 25, .45); }
.modal-card { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 22px; width: min(480px, 100%); max-height: 90vh; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.modal-actions.left { justify-content: flex-start; }
#rekeyForm { display: flex; flex-direction: column; gap: 8px; }
.gen-out { display: flex; gap: 8px; align-items: center; background: var(--panel2); border-radius: 8px; padding: 12px; }
.gen-out code { flex: 1; font: 17px/1.4 ui-monospace, Consolas, monospace; word-break: break-all; }
.gen-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
#toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); background: #1d2030; color: #fff; padding: 9px 18px; border-radius: 20px; opacity: 0; pointer-events: none; transition: .2s; z-index: 100; max-width: calc(100% - 32px); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.ok { background: #15803d; }
#toast.err { background: #b91c1c; }

/* 多账号 / 家庭共享 */
.user-pick { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.user-chip { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--panel); border-radius: 24px; padding: 5px 14px 5px 5px; cursor: pointer; }
.user-chip.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 600; }
.badge.fam { background: color-mix(in srgb, var(--green) 15%, transparent); color: var(--green); font-weight: 400; }
.banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--accent-soft); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 14px; font-size: 13px; }
.members { display: flex; flex-direction: column; gap: 8px; }
.member { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; flex-wrap: wrap; }
.member-main { flex: 1; min-width: 180px; }
.member-actions { display: flex; gap: 6px; }
.fp { font-size: 12px; color: var(--muted); margin-top: 4px; }
.fp code { font: 14px ui-monospace, Consolas, monospace; letter-spacing: 1px; color: var(--text); }
.invite { margin-top: 10px; font-size: 13px; }
.invite p { margin: 0 0 8px; }
.space-toggle { background: color-mix(in srgb, var(--green) 10%, transparent); border-radius: 8px; padding: 8px 10px; }

/* 条目图标 */
.ico { position: relative; display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; overflow: hidden; flex: none; vertical-align: middle; }
.ico.xs { width: 18px; height: 18px; border-radius: 5px; }
.ico.xs .ico-badge { font-size: 9px; }
.ico.sm { width: 26px; height: 26px; }
.ico.lg { width: 40px; height: 40px; border-radius: 10px; }
.ico.lg .ico-badge { font-size: 16px; }
.ico > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ico > img.fav { object-fit: contain; background: #fff; padding: 12%; opacity: 0; transition: opacity .15s; }
.ico > img.fav.ok { opacity: 1; } /* 加载成功前透明，先露出下面的品牌标识 */
.ico > img.fav.hd { object-fit: cover; padding: 0; }
.ico-badge { width: 100%; height: 100%; display: grid; place-items: center; font-weight: 700; font-size: 13px; letter-spacing: -.5px; }
.ico-emoji { font-size: 20px; line-height: 1; }
.ico.lg .ico-emoji { font-size: 28px; }
.ico.xs .ico-emoji { font-size: 13px; }
.row-icon { width: auto; display: flex; }
.icon-pick { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.nav-item.sub { padding: 4px 10px 4px 38px; font-size: 13px; color: var(--muted); }
.nav-item.sub.active { color: var(--accent); }

/* 订阅面板 */
.sub-totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.sub-total { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; background: var(--bg); display: flex; flex-direction: column; gap: 2px; }
.sub-total small { color: var(--muted); }
.sub-total b { font-size: 20px; }
.sub-list { display: flex; flex-direction: column; }
.sub-row { display: grid; grid-template-columns: auto 1fr auto auto; gap: 12px; align-items: center; text-align: left; border: 0; border-bottom: 1px dashed var(--line); background: none; padding: 10px 4px; cursor: pointer; }
.sub-row:hover { background: var(--panel); }
.sub-name { display: flex; flex-direction: column; font-weight: 600; min-width: 0; }
.sub-name small { font-weight: 400; color: var(--muted); font-size: 12px; }
.sub-price { font-weight: 600; white-space: nowrap; }
.sub-date { text-align: right; font-size: 13px; white-space: nowrap; }

/* ================= 科技感外观 ================= */
input:focus, select:focus, textarea:focus { border-color: var(--accent2); box-shadow: 0 0 0 3px rgba(34, 211, 238, .14); }
select option { background: var(--panel-solid); }
mark { background: rgba(34, 211, 238, .28); color: var(--text); }
.sidebar, .listpane, .detailpane, .detail-head { background: var(--panel); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.listpane { background: rgba(8, 13, 24, .55); }
.btn { background: var(--field); border-color: var(--line); }
.btn:hover { background: var(--panel2); border-color: var(--line-strong); }
.btn.primary { background: var(--grad); border: 0; color: #031022; font-weight: 600; box-shadow: 0 4px 18px rgba(34, 211, 238, .25); }
.btn.primary:hover { filter: brightness(1.1); box-shadow: 0 6px 24px rgba(34, 211, 238, .35); }
.btn.ghost { background: transparent; }
.brand { letter-spacing: .5px; }
.brand span { filter: drop-shadow(0 0 8px rgba(34, 211, 238, .6)); }
.nav-item { position: relative; }
.nav-item.active { background: linear-gradient(90deg, rgba(91, 140, 255, .18), rgba(34, 211, 238, .04)); color: #cfe0ff; }
.nav-item.active::before { content: ''; position: absolute; left: 0; top: 18%; bottom: 18%; width: 3px; border-radius: 3px; background: var(--grad); box-shadow: 0 0 10px var(--accent2); }
.row { border-radius: 12px; }
.row:hover { background: var(--panel2); }
.row.active { background: linear-gradient(90deg, rgba(91, 140, 255, .14), rgba(34, 211, 238, .03)); border-color: transparent; box-shadow: var(--glow); }
.card, .stat, .sub-total { background: rgba(148, 178, 255, .04); border-color: var(--line); }
.stat:hover, .mini:hover { border-color: var(--accent2); box-shadow: 0 0 16px rgba(34, 211, 238, .15); }
.stat b, .sub-total b { font-family: var(--mono); background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.mini { background: var(--field); }
.masked, .totp b, .gen-out code, .fp code, .f-value .mono { font-family: var(--mono); }
.totp b { color: var(--accent2); text-shadow: 0 0 12px rgba(34, 211, 238, .45); }
.ring { background: conic-gradient(var(--accent2) var(--p, 100%), var(--panel2) 0); }
.gen-out { background: rgba(0, 0, 0, .35); border: 1px solid var(--line); }
.modal-bg { background: rgba(2, 5, 12, .7); backdrop-filter: blur(4px); }
.modal-card { background: rgba(10, 16, 29, .92); border-color: var(--line-strong); box-shadow: var(--shadow), 0 0 40px rgba(91, 140, 255, .12); backdrop-filter: blur(16px); }
.menu { background: rgba(10, 16, 29, .96); border-color: var(--line-strong); }
#toast { background: rgba(10, 16, 29, .95); border: 1px solid var(--line-strong); box-shadow: var(--shadow); }
#toast.ok { background: rgba(6, 78, 59, .95); border-color: rgba(16, 185, 129, .5); }
#toast.err { background: rgba(127, 29, 29, .95); border-color: rgba(244, 63, 94, .5); }
.banner { background: linear-gradient(90deg, rgba(91, 140, 255, .16), rgba(34, 211, 238, .06)); border: 1px solid var(--line); }
.tag { background: var(--field); }
.user-chip { background: var(--field); }
.user-chip.active { box-shadow: var(--glow); }
.avatar { background: var(--grad); color: #031022; }
.meter { background: rgba(255, 255, 255, .06); }
.notice { background: rgba(245, 158, 11, .1); border: 1px solid rgba(245, 158, 11, .3); }
.sync.ok i { box-shadow: 0 0 8px var(--green); }

/* 锁屏：缓慢旋转的光环 */
.lock { background: none; }
.lock-card { background: rgba(10, 16, 29, .82); border-color: var(--line-strong); backdrop-filter: blur(18px); box-shadow: var(--shadow), 0 0 60px rgba(91, 140, 255, .12); }
.logo { position: relative; width: 84px; height: 84px; margin: 0 auto 4px; display: grid; place-items: center; font-size: 36px; }
.logo::before { content: ''; position: absolute; inset: 0; border-radius: 50%; padding: 2px; background: conic-gradient(from 0deg, transparent 0 55%, #22d3ee 75%, #5b8cff 90%, transparent 100%); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: spin 6s linear infinite; }
.logo::after { content: ''; position: absolute; inset: 10px; border-radius: 50%; background: radial-gradient(circle, rgba(34, 211, 238, .16), transparent 70%); }
.lock-card h1 { letter-spacing: 2px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
@media (prefers-reduced-motion: reduce) { .logo::before { animation: none; } }

/* 第三层分类（邮箱服务商） */
.nav-item.sub2 { padding: 3px 10px 3px 52px; font-size: 12.5px; color: var(--muted); }
.nav-item.sub2.active { color: var(--accent2); }
.nav-item.sub2::after { content: ''; position: absolute; left: 42px; top: 50%; width: 5px; height: 5px; border-radius: 50%; background: var(--line-strong); transform: translateY(-50%); }
.nav-item.sub2.active::after { background: var(--accent2); box-shadow: 0 0 6px var(--accent2); }
.nav-item.sub2.active::before { display: none; }

/* 快捷面板 Ctrl+K */
#palette { position: fixed; inset: 0; z-index: 80; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; }
.pal-bg { position: absolute; inset: 0; background: rgba(2, 5, 12, .6); backdrop-filter: blur(6px); }
.pal { position: relative; width: min(640px, 100%); background: rgba(10, 16, 29, .95); border: 1px solid var(--line-strong); border-radius: 16px; box-shadow: var(--shadow), 0 0 50px rgba(34, 211, 238, .14); overflow: hidden; animation: palIn .14s ease-out; }
@keyframes palIn { from { opacity: 0; transform: translateY(-8px) scale(.98); } }
.pal-input { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.pal-input span { filter: drop-shadow(0 0 6px var(--accent2)); }
.pal-input input { border: 0; background: none; padding: 4px 0; font-size: 17px; box-shadow: none; }
.pal-input input:focus { box-shadow: none; }
.pal-list { max-height: 52vh; overflow-y: auto; padding: 6px; }
.pal-row { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; cursor: pointer; }
.pal-row.sel { background: linear-gradient(90deg, rgba(91, 140, 255, .2), rgba(34, 211, 238, .05)); box-shadow: inset 0 0 0 1px rgba(91, 140, 255, .35); }
.pal-main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.pal-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-main small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-tag { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.pal-empty { padding: 30px; text-align: center; color: var(--muted); }
.pal-hint { padding: 9px 14px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.pal-hint kbd { margin: 0 1px; }
.pal-open { width: 100%; justify-content: space-between; margin-bottom: 6px; border-color: var(--line-strong); }
.pal-open kbd { font-size: 10.5px; }

/* 安全中心 */
.score-ring { position: relative; flex: none; }
.score-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.score-ring circle { fill: none; stroke-width: 10; }
.score-ring .track { stroke: rgba(148, 178, 255, .1); }
.score-ring .bar { stroke-linecap: round; transition: stroke-dashoffset 1.2s cubic-bezier(.2, .8, .2, 1); filter: drop-shadow(0 0 6px currentColor); }
.score-num { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; }
.score-num b { font: 700 34px/1 var(--mono); }
.score-num small { font-size: 12px; margin-top: 4px; letter-spacing: 2px; }
.sec-hero { display: flex; gap: 24px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.sec-stats { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; min-width: 260px; }
.sec-stats .h-item { background: rgba(148, 178, 255, .04); border: 1px solid var(--line); }
.sec-stats .h-item b { font-family: var(--mono); }
.sec-block h3 { display: flex; align-items: center; gap: 8px; }
.sec-count { margin-left: auto; font: 600 13px var(--mono); padding: 1px 9px; border-radius: 10px; background: var(--panel2); }
.sec-block.bad .sec-count { color: var(--red); background: rgba(244, 63, 94, .12); }
.sec-block.warn .sec-count { color: var(--amber); background: rgba(245, 158, 11, .12); }
.sec-block.good { opacity: .7; }
.sec-ok { color: var(--green); font-size: 13px; margin: 0; }
.breach-card { border-color: rgba(34, 211, 238, .3); }
.breach-row { display: flex; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.sec-summary { display: flex; align-items: center; gap: 18px; width: 100%; text-align: left; cursor: pointer; color: inherit; font: inherit; }
.sec-summary:hover { border-color: var(--accent2); }
.sec-sum-text { display: flex; flex-direction: column; gap: 4px; }
.sec-sum-text small { color: var(--muted); }
.sec-summary .score-num b { font-size: 24px; }
.sec-summary .score-num small { font-size: 10px; }
.sec-pill { font: 600 11px var(--mono); border-radius: 10px; padding: 0 7px; }
.sec-pill.good { color: var(--green); background: rgba(16, 185, 129, .12); }
.sec-pill.warn { color: var(--amber); background: rgba(245, 158, 11, .12); }
.sec-pill.bad { color: var(--red); background: rgba(244, 63, 94, .12); }
.banner.danger { background: rgba(244, 63, 94, .12); border-color: rgba(244, 63, 94, .4); }

/* 历史版本 */
.hist-list { display: flex; flex-direction: column; gap: 10px; }
.hist { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.hist-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.hist-diff { width: 100%; font-size: 13px; border-collapse: collapse; }
.hist-diff td { padding: 3px 6px; vertical-align: top; word-break: break-all; }
.hist-diff td:first-child { color: var(--muted); white-space: nowrap; }
.hist-diff .from { color: #fda4af; }
.masked[data-secret] { cursor: pointer; }
.btn sup { font-size: 9px; color: var(--accent2); }

/* 分享 */
.share-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.share-fields { display: flex; flex-direction: column; gap: 6px; }
.share-link { display: flex; gap: 8px; align-items: center; background: rgba(0, 0, 0, .35); border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px 10px; margin-top: 8px; }
.share-link code { flex: 1; font: 12px var(--mono); word-break: break-all; color: var(--accent2); }
.share-view { width: min(520px, 100%); text-align: left; }
.share-view h1, .share-view .logo { text-align: center; }
.share-view .field { grid-template-columns: 1fr auto; }
.share-view .f-label { grid-column: 1 / -1; margin-bottom: -8px; }
.f-value.mono { font-family: var(--mono); word-break: break-all; }

/* 登录记录 */
.dev-list, .log-list { display: flex; flex-direction: column; gap: 6px; }
.dev { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.dev.cur { border-color: rgba(34, 211, 238, .45); }
.log { display: grid; grid-template-columns: 82px 1fr auto auto; gap: 10px; align-items: center; font-size: 12.5px; padding: 5px 2px; border-bottom: 1px dashed var(--line); }
.log.fail { background: rgba(244, 63, 94, .05); }

/* 关联条目 */
.rel-card { margin-top: 16px; padding: 12px 14px; border: 1px solid rgba(34, 211, 238, .25); border-radius: var(--radius); background: rgba(34, 211, 238, .04); }
.rel-head { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 8px; }
.rel-card p { margin: 0 0 8px; }
.link-pick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; position: relative; }
.link-pick input { flex: 1; min-width: 180px; }
.chip { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line-strong); background: var(--field); border-radius: 16px; padding: 2px 4px 2px 6px; font-size: 13px; }
.link-results { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 6px; }
.handle { font-family: var(--mono); font-size: 12px; color: var(--accent2); }

/* 提示词 */
.prompt-body { white-space: pre-wrap; word-break: break-word; font-family: var(--mono); font-size: 13px; line-height: 1.7; background: rgba(0, 0, 0, .25); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; max-height: 420px; overflow-y: auto; }
.prompt-edit { font-family: var(--mono); font-size: 13px; line-height: 1.6; }
mark.empty { background: rgba(245, 158, 11, .18); color: #fcd34d; border-radius: 4px; padding: 0 2px; }
mark.filled { background: rgba(16, 185, 129, .2); color: #a7f3d0; border-radius: 4px; padding: 0 2px; }
.var-form { display: flex; flex-direction: column; gap: 8px; }
.var-form textarea { resize: none; overflow: hidden; min-height: 38px; }
.prompt-preview { white-space: pre-wrap; word-break: break-word; font: 13px/1.7 var(--mono); background: rgba(0, 0, 0, .3); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; max-height: 260px; overflow-y: auto; margin: 0; }

/* 附件 */
.att-card { margin-top: 16px; padding: 12px 14px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: rgba(148, 178, 255, .03); }
.att-add { margin-left: auto; }
.att { display: grid; grid-template-columns: 26px 1fr auto auto auto; gap: 8px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); }
.att:first-of-type { border-top: 0; }
.att-ico { font-size: 18px; text-align: center; }
.att-name { text-align: left; font-size: 13.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.att-name:hover { color: var(--accent2); text-decoration: underline; }
.att.uploading { grid-template-columns: 26px 1fr 120px auto; }
.att-bar { height: 6px; border-radius: 3px; background: var(--panel2); overflow: hidden; }
.att-bar i { display: block; height: 100%; background: var(--grad); transition: width .2s; box-shadow: 0 0 8px var(--accent2); }
.att-hint { margin: 4px 0 0; }
.detailpane.drop-over { outline: 2px dashed var(--accent2); outline-offset: -10px; background: rgba(34, 211, 238, .05); }
.modal-card.wide { width: min(920px, 100%); }
.att-preview-img { max-width: 100%; max-height: 70vh; object-fit: contain; border-radius: 8px; align-self: center; background: #fff; }
.att-preview-pdf { width: 100%; height: 72vh; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.att-preview-text { white-space: pre-wrap; word-break: break-word; font: 13px/1.6 var(--mono); background: rgba(0, 0, 0, .3); border: 1px solid var(--line); border-radius: 8px; padding: 12px; max-height: 65vh; overflow: auto; margin: 0; }

/* 备忘录 */
.quick-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 6px; }
.quick-row .pal-open { margin: 0; padding: 5px 7px; }
.quick-row kbd { font-size: 9.5px; }
.quick-capture { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line-strong); border-radius: 14px; padding: 4px 6px 4px 14px; background: rgba(34, 211, 238, .05); margin-bottom: 12px; }
.quick-capture:focus-within { border-color: var(--accent2); box-shadow: 0 0 0 3px rgba(34, 211, 238, .12); }
.quick-capture span { filter: drop-shadow(0 0 6px var(--accent2)); }
.quick-capture input { border: 0; background: none; box-shadow: none !important; padding: 10px 4px; font-size: 15px; }
.memo-row { position: relative; }
.memo-row::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--memo, transparent); }
.memo-row .row-sub { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.clip { font-size: 11px; color: var(--muted); font-weight: 400; }
.memo-head { border-top: 3px solid var(--memo, transparent); flex-wrap: wrap; row-gap: 10px; }
.memo-head .d-title { flex: 1 1 240px; min-width: 0; }
.memo-head .d-actions { flex: 1 1 100%; justify-content: flex-start; align-items: center; padding-left: 42px; }
.memo-colors { display: inline-flex; gap: 4px; align-items: center; padding: 0 4px; }
.color-dot { width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--line-strong); cursor: pointer; padding: 0; }
.color-dot.on { outline: 2px solid var(--text); outline-offset: 2px; }
.color-dot[data-c=""] { background: repeating-linear-gradient(45deg, transparent 0 3px, var(--line-strong) 3px 4px) !important; }
.btn.icon.on { background: rgba(245, 158, 11, .18); border-color: rgba(245, 158, 11, .5); }
.memo-remind { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 8px; padding: 0 0 0 8px; background: var(--field); }
.memo-remind input { width: 136px; border: 0; background: none; padding: 5px 6px; box-shadow: none !important; font-size: 12.5px; color-scheme: dark; }
.memo-body { max-width: 820px; }
.memo-title-input { font-size: 20px; font-weight: 600; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; padding: 6px 2px; margin-bottom: 8px; box-shadow: none !important; }
.memo-tools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.memo-text { min-height: 260px; font-size: 15px; line-height: 1.75; resize: none; background: rgba(0, 0, 0, .18); }
.memo-text.qn { min-height: 160px; }
.memo-view { font-size: 15px; line-height: 1.8; min-height: 140px; padding: 6px 4px; cursor: text; border-radius: 8px; }
.memo-view:hover { background: rgba(148, 178, 255, .03); }
.memo-view code { font-family: var(--mono); font-size: 13px; background: rgba(148, 178, 255, .1); padding: 1px 5px; border-radius: 4px; }
.memo-view a { color: var(--accent2); }
.md-h { font-weight: 700; margin: 10px 0 4px; }
.md-h1 { font-size: 20px; } .md-h2 { font-size: 17px; } .md-h3 { font-size: 15.5px; color: var(--accent2); }
.md-li { padding-left: 20px; position: relative; }
.md-li::before { content: '•'; position: absolute; left: 6px; color: var(--accent2); }
.md-ol::before { content: attr(data-n) '.'; left: 0; font-family: var(--mono); font-size: 13px; }
.md-quote { border-left: 3px solid var(--accent); padding-left: 12px; color: var(--muted); }
.md-gap { height: 10px; }
.todo { display: flex; align-items: flex-start; gap: 10px; padding: 3px 0; cursor: pointer; }
.todo input { width: 18px; height: 18px; margin-top: 5px; flex: none; accent-color: var(--accent2); cursor: pointer; }
.todo.done span { color: var(--muted); text-decoration: line-through; }

/* 待办 */
.task-bar { padding: 0 12px 10px; display: flex; flex-direction: column; gap: 6px; }
.task-input { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-strong); border-radius: 12px; padding: 2px 4px 2px 12px; background: rgba(34, 211, 238, .05); }
.task-input:focus-within { border-color: var(--accent2); box-shadow: 0 0 0 3px rgba(34, 211, 238, .12); }
.task-input span { color: var(--accent2); font-weight: 700; }
.task-input input { border: 0; background: none; box-shadow: none !important; padding: 9px 2px; }
.task-parse { padding: 0 4px; line-height: 1.5; }
.task-parse b { color: var(--text); }
.notify-btn { align-self: flex-start; }
.task-group { margin-bottom: 6px; }
.tg-head { font-size: 12px; color: var(--muted); padding: 8px 10px 4px; letter-spacing: .5px; display: flex; gap: 6px; align-items: center; }
.tg-head span { font-family: var(--mono); background: var(--panel2); border-radius: 8px; padding: 0 6px; }
.task-group.overdue .tg-head { color: var(--red); }
.task-group.finished { opacity: .6; }
.task-check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-strong); display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #031022; cursor: pointer; transition: .15s; flex: none; }
.task-check:hover { border-color: var(--accent2); box-shadow: 0 0 10px rgba(34, 211, 238, .4); }
.task-check.on { background: var(--grad); border-color: transparent; }
.task-row .row-icon { width: 30px; justify-content: center; }
.task-row.done .row-title { text-decoration: line-through; color: var(--muted); }
.task-row.prio-h .task-check { border-color: var(--red); }
.task-row.prio-m .task-check { border-color: var(--amber); }
.task-row.prio-l .task-check { border-color: var(--accent); }

.mobile-only { display: none; }

/* 手机端：三个面板切换显示 */
@media (max-width: 860px) {
  .mobile-only { display: inline-flex; }
  .shell { display: block; position: relative; overflow: hidden; }
  .sidebar, .listpane, .detailpane { position: absolute; inset: 0; display: none; }
  .shell[data-pane="nav"] .sidebar, .shell[data-pane="list"] .listpane { display: flex; }
  .shell[data-pane="detail"] .detailpane { display: block; }
  .detail-head { padding: 12px 14px; flex-wrap: wrap; }
  .detail-body { padding: 14px 16px 40px; }
  .field { grid-template-columns: 1fr auto; }
  .f-label { grid-column: 1 / -1; margin-bottom: -8px; }
  .health { grid-template-columns: repeat(2, 1fr); }
  .custom-row { grid-template-columns: 1fr 1fr auto; }
  .custom-row .check { grid-column: 1; }
  .d-actions { width: 100%; justify-content: flex-start; }
  .sub-totals { grid-template-columns: 1fr 1fr; }
  .sec-stats { grid-template-columns: repeat(2, 1fr); min-width: 0; }
  .sec-hero { justify-content: center; }
  .log { grid-template-columns: 76px 1fr; }
  .share-opts { grid-template-columns: 1fr; }
  #palette { padding-top: 6vh; }
  .sub-row { grid-template-columns: auto 1fr auto; }
  .sub-date { grid-column: 2 / -1; text-align: left; }
}

/* ===== 空间切换：全部 / 个人 / 工作 / 家庭 ===== */
.space-switch { display: flex; gap: 2px; margin: 0 4px 10px; padding: 3px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--line); }
.space-switch button { flex: 1 1 0; min-width: 0; border: 0; background: none; color: var(--muted); font-size: 12px; padding: 5px 0; border-radius: 7px; cursor: pointer; white-space: nowrap; }
.space-switch i { font-style: normal; font-size: 10px; margin-right: 2px; }
.space-switch button:hover { color: var(--text); }
.space-switch button.on { background: var(--accent-soft); color: #cfe0ff; box-shadow: inset 0 0 0 1px rgba(91, 140, 255, .35); font-weight: 600; }
.space-switch button[data-space="work"].on { background: rgba(245, 158, 11, .14); color: var(--amber); box-shadow: inset 0 0 0 1px rgba(245, 158, 11, .4); }
.space-switch button[data-space="family"].on { background: color-mix(in srgb, var(--green) 15%, transparent); color: var(--green); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--green) 40%, transparent); }
.badge.work { background: rgba(245, 158, 11, .14); color: var(--amber); font-weight: 400; }
.space-chip { font-size: 11px; padding: 1px 7px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); margin-right: 2px; }
.space-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.space-pick label { display: flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line); cursor: pointer; font-size: 13px; }
.space-pick label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.space-pick label.sp-work:has(input:checked) { border-color: var(--amber); background: rgba(245, 158, 11, .12); }
.space-pick label.sp-family:has(input:checked) { border-color: var(--green); background: color-mix(in srgb, var(--green) 12%, transparent); }
.space-pick input { accent-color: var(--accent); margin: 0; width: auto; padding: 0; }
.space-pick label { white-space: nowrap; }

/* 粘贴进来、等保存后上传的文件 */
.att-pending { margin: 6px 0 0; font-size: 12.5px; color: var(--accent2); }
.att-pending:empty { display: none; }

/* 图片附件：列表小图 + 悬停预览 */
.att-thumb { width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; border-radius: 5px; overflow: hidden; }
.att-thumb img { width: 100%; height: 100%; object-fit: cover; }
.att-img .att-name { cursor: zoom-in; }
.att-hover { position: fixed; z-index: 60; width: 360px; max-width: calc(100vw - 16px); padding: 8px; border-radius: 12px;
  background: rgba(10, 16, 30, .96); border: 1px solid var(--line-strong, rgba(148, 178, 255, .25)); box-shadow: 0 18px 50px rgba(0, 0, 0, .55); pointer-events: none; }
.att-hover img { display: block; width: 100%; max-height: 320px; object-fit: contain; border-radius: 8px; background: #fff; }
.att-hover-name { margin-top: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-hover-load { padding: 28px 12px; text-align: center; font-size: 13px; color: var(--muted); }
