/* ============================================================
   同频 · 设计系统 token
   来源：Ardot「公众号矩阵工作台」1440×900 设计稿
   ============================================================ */
:root{
  /* 纸与墨 */
  --bg:#F5F1E9;
  --sidebar:#14120F;
  --sidebar-item:#1E1A16;
  --sidebar-line:#2B251F;
  --ink:#1B1815;
  --ink-2:#2A251F;
  --ink-3:#3B352C;
  --ink-4:#4A443B;
  --muted:#6E6558;
  --muted-2:#7C7365;
  --muted-3:#8A8175;
  --muted-4:#9C9183;
  --muted-5:#A79E92;
  --faint:#B0A79A;
  --na:#D8D0C1;

  /* 面 */
  --card:#FFFFFF;
  --soft:#FBF8F2;
  --soft-2:#FAF7F1;
  --soft-3:#FAF7F0;
  --soft-4:#F4F1EA;
  --soft-5:#F1EDE4;
  --track:#F0EADD;
  --bar-mute:#DBCFBE;
  --bar-mute-2:#C4B49E;

  /* 线 */
  --line:#E7E0D3;
  --line-2:#E4DDD0;
  --line-3:#EDE7DA;
  --line-4:#F2ECE0;
  --line-5:#E9E3D6;

  /* 强调 */
  --brand:#8C3A2B;
  --brand-hover:#7A3225;
  --brand-2:#B58542;
  --brand-3:#9A6B3F;
  --brand-soft:#F5E7E1;
  --brand-soft-2:#F8E9E3;
  --warm-bg:#FBF3E9;
  --warm-line:#EBD8C4;
  --warm-ink:#8A6A45;
  --warm-ink-2:#7A4E2E;
  --warm-ink-3:#9A7B52;
  --sage:#9AA48E;
  --sage-bg:#EDF1EA;
  --green:#4C6B52;
  --green-2:#5C7A5E;
  --down:#B4553F;

  /* 字体：全部用系统自带，不依赖 Google Fonts（国内服务器加载慢/失败） */
  --serif:"Songti SC","STSong","Source Han Serif SC","Noto Serif CJK SC","SimSun",serif;
  --sans:-apple-system,BlinkMacSystemFont,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","Segoe UI","Noto Sans CJK SC",sans-serif;
  --num:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue","PingFang SC","Microsoft YaHei",sans-serif;

  /* 尺寸 */
  --sidebar-w:232px;
  --radius-card:14px;
  --radius-ctl:9px;
  --shadow-pop:0 18px 48px rgba(27,24,21,.16), 0 2px 8px rgba(27,24,21,.06);
}

*,*::before,*::after{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font-family:var(--sans);
  font-size:13px;
  line-height:1.5;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}
button{font-family:inherit;color:inherit}
a{color:inherit;text-decoration:none}
img{display:block;max-width:100%}
input,select,textarea{font-family:inherit;font-size:inherit;color:inherit}
h1,h2,h3,h4,p{margin:0}
ul{margin:0;padding:0;list-style:none}
::selection{background:#E8CFC2;color:#2A1A15}

/* 滚动条：低调的纸感 */
*{scrollbar-width:thin;scrollbar-color:#DCD3C3 transparent}
::-webkit-scrollbar{width:9px;height:9px}
::-webkit-scrollbar-thumb{background:#DCD3C3;border-radius:9px;border:2px solid transparent;background-clip:content-box}
::-webkit-scrollbar-thumb:hover{background:#C9BEA9;background-clip:content-box}
::-webkit-scrollbar-track{background:transparent}

/* ============================================================
   布局骨架
   ============================================================ */
.app{
  display:flex;
  height:100vh;
  overflow:hidden;
  background:var(--bg);
}
.sidebar{
  width:var(--sidebar-w);
  flex:0 0 var(--sidebar-w);
  background:var(--sidebar);
  padding:16px;
  display:flex;
  flex-direction:column;
  gap:18px;
  position:sticky;
  top:0;
  height:100vh;
  overflow-y:auto;
}
.main{
  flex:1;
  min-width:0;
  height:100vh;
  overflow-y:auto;
  overflow-x:hidden;
  padding:24px 26px;
  display:flex;
  flex-direction:column;
}
.view{
  flex:1;
  min-width:0;
  min-height:0;
  display:flex;
  flex-direction:column;
  gap:18px;
}
.view[data-view="library"]{gap:16px}

/* ============================================================
   侧边栏
   ============================================================ */
.brand{display:flex;align-items:center;gap:10px}
.brand-mark{
  width:34px;height:34px;border-radius:9px;background:var(--brand);
  display:grid;place-items:center;flex:0 0 34px;
  font-family:var(--serif);font-size:15px;font-weight:600;color:#F7EFE6;
}
.brand-text{display:flex;flex-direction:column;gap:3px;min-width:0}
.brand-name{font-size:15px;font-weight:600;color:#F3EDE2;line-height:1.2}
.brand-sub{font-size:11px;color:#857C6F;line-height:1.2}

.nav-group{display:flex;flex-direction:column;gap:2px}
.nav-label{
  font-size:10px;color:#6E6558;letter-spacing:.06em;
  padding:2px 10px 4px;margin-top:2px;font-weight:500;
}
.nav-group--create .nav-item{padding-top:8px;padding-bottom:8px}
.nav-gap{height:12px}
.nav-item{
  display:flex;align-items:center;gap:10px;
  padding:10px;border-radius:10px;
  font-size:13px;color:#B4AB9C;
  cursor:pointer;border:0;background:none;text-align:left;width:100%;
  transition:background .16s ease,color .16s ease;
}
.nav-item svg{flex:0 0 16px;color:#9A9184;transition:color .16s ease}
.nav-item:hover{background:#1C1814;color:#E4DCCD}
.nav-item:hover svg{color:#C9BFAD}
.nav-item.is-active{background:#F1EBE0;color:#1D1A16;font-weight:500}
.nav-item.is-active svg{color:#3A332B}
.nav-item .nav-count{
  margin-left:auto;font-family:var(--num);font-size:10px;color:#857C6F;
  background:#221E19;border-radius:20px;padding:1px 6px;
}
.nav-item.is-active .nav-count{background:#E0D6C4;color:#5C5346}

.sidebar-spacer{flex:1;min-height:12px}
.sidebar-divider{height:1px;background:var(--sidebar-line)}
.user-card{
  display:flex;align-items:center;gap:9px;padding:9px;background:var(--sidebar-item);
  border-radius:10px;border:0;width:100%;cursor:pointer;text-align:left;
}
.user-card:hover{background:#26211B}
.user-avatar{
  width:28px;height:28px;border-radius:14px;background:#3C332A;color:#E6DCCC;
  display:grid;place-items:center;font-size:12px;font-weight:500;flex:0 0 28px;
}
.user-meta{display:flex;flex-direction:column;gap:2px;min-width:0}
.user-name{font-size:12px;font-weight:500;color:#EBE3D6}
.user-sub{font-size:10px;color:#7C7365}

/* ============================================================
   页头
   ============================================================ */
.page-head{display:flex;align-items:flex-start;gap:24px}
.page-title-block{display:flex;flex-direction:column;gap:9px;flex:1;min-width:0}
.eyebrow{font-size:11px;font-weight:500;color:var(--muted-4);letter-spacing:.01em}
.page-title{
  font-family:var(--serif);font-size:29px;font-weight:600;color:var(--ink);
  line-height:1.28;letter-spacing:-.01em;
}
.page-sub{font-size:12.5px;color:var(--muted-2);line-height:1.5}
.page-actions{display:flex;align-items:center;gap:10px;flex:0 0 auto;padding-top:2px}

/* ============================================================
   按钮
   ============================================================ */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:6px;
  height:38px;padding:0 16px;border-radius:var(--radius-ctl);
  border:1px solid var(--line-2);background:#fff;color:var(--ink-4);
  font-size:12.5px;font-weight:500;cursor:pointer;
  transition:background .15s ease,border-color .15s ease,color .15s ease,transform .06s ease;
  white-space:nowrap;
}
.btn:hover{border-color:#D3C9B7;background:#FDFBF6}
.btn:active{transform:translateY(.5px)}
.btn:focus-visible{outline:2px solid #C58C6F;outline-offset:2px}
.btn-primary{background:var(--brand);border-color:var(--brand);color:#F8F0E7;padding:0 18px;gap:8px}
.btn-primary:hover{background:var(--brand-hover);border-color:var(--brand-hover)}
.btn-sm{height:32px;padding:0 12px;font-size:11.5px;border-radius:8px}
.btn-ghost{background:transparent;border-color:transparent;color:var(--muted)}
.btn-ghost:hover{background:var(--soft-4);border-color:transparent}
.btn[disabled]{opacity:.45;cursor:not-allowed}
.btn-block{width:100%}

/* ============================================================
   卡片与通用块
   ============================================================ */
.card{
  background:var(--card);border:1px solid var(--line);border-radius:var(--radius-card);
  padding:20px;display:flex;flex-direction:column;
}
.card-head{display:flex;align-items:center;justify-content:space-between;gap:12px}
.card-title{font-family:var(--serif);font-size:17px;font-weight:600;color:var(--ink);line-height:1.35}
.card-title-sm{font-family:var(--serif);font-size:15px;font-weight:600;color:var(--ink);line-height:1.35}
.card-sub{font-size:10.5px;color:var(--muted-4);line-height:1.5}
.card-link{
  font-size:11.5px;color:var(--muted-4);background:none;border:0;cursor:pointer;padding:0;
  white-space:nowrap;
}
.card-link:hover{color:var(--brand)}

.tag{
  display:inline-flex;align-items:center;justify-content:center;
  height:22px;padding:0 9px;border-radius:5px;
  font-size:10.5px;font-weight:500;white-space:nowrap;
}
.tag--ok{background:var(--sage-bg);color:var(--green)}
.tag--warm{background:#F6EFE3;color:var(--warm-ink)}
.tag--rose{background:var(--brand-soft);color:var(--brand)}
.tag--muted{background:var(--soft-5);color:var(--muted-3)}
.tag--flat{background:var(--soft-5);color:var(--muted);font-weight:400}
.tag--line{background:#fff;border:1px solid var(--line);color:var(--muted)}

.dot{width:6px;height:6px;border-radius:3px;flex:0 0 6px}
.dot--ok{background:var(--green-2)}
.dot--warn{background:var(--brand-2)}
.dot--off{background:var(--muted-5)}

.avatar{
  display:grid;place-items:center;border-radius:8px;flex:0 0 auto;
  font-family:var(--serif);font-size:12px;font-weight:500;color:#F7EFE6;
  width:28px;height:28px;overflow:hidden;
}
.avatar img{width:100%;height:100%;object-fit:cover;display:block}
.avatar--lg{width:46px;height:46px;border-radius:13px;font-size:19px}
.avatar--xl{width:30px;height:30px;border-radius:8px}

.meta{font-size:11px;color:var(--muted-4);line-height:1.5}
.meta-sm{font-size:10.5px;color:var(--muted-5);line-height:1.5}
.num{font-family:var(--num);font-variant-numeric:tabular-nums}

.hr{height:1px;background:var(--line-3);border:0;margin:0}

/* 进度条 / 条形图基元 */
.track{height:8px;border-radius:4px;background:var(--track);overflow:hidden;position:relative}
.track > i{display:block;height:100%;border-radius:4px;background:var(--brand)}
.track--sm{height:6px;border-radius:3px}
.track--sm > i{border-radius:3px}

/* 空态 */
.empty{
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:8px;padding:40px 20px;color:var(--muted-5);font-size:12px;text-align:center;
  border:1px dashed var(--line-2);border-radius:12px;background:var(--soft-3);
}
.empty strong{font-weight:500;color:var(--muted-2);font-size:13px}

/* 输入控件 */
.field{display:flex;flex-direction:column;gap:7px}
.label{font-size:11px;font-weight:500;color:var(--muted-3)}
.input,.select,.textarea{
  height:38px;padding:0 12px;border:1px solid var(--line-2);border-radius:9px;background:#fff;
  font-size:12.5px;color:var(--ink);outline:none;transition:border-color .15s ease,box-shadow .15s ease;
  width:100%;
}
.textarea{height:auto;padding:10px 12px;line-height:1.6;resize:vertical;min-height:80px}
.input:focus,.select:focus,.textarea:focus{border-color:#C08A6E;box-shadow:0 0 0 3px rgba(140,58,43,.08)}
.select{
  appearance:none;padding-right:30px;cursor:pointer;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238A8175' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right 12px center;
}
.hint{font-size:10.5px;color:var(--muted-5)}
.err{font-size:10.5px;color:var(--danger,#B4553F)}

/* 分段控件 */
.segmented{display:inline-flex;gap:2px;padding:3px;background:#EBE5D9;border-radius:9px;height:32px}
.segmented button{
  border:0;background:transparent;border-radius:7px;padding:0 12px;height:26px;
  font-size:11px;color:var(--muted-3);cursor:pointer;white-space:nowrap;
}
.segmented button.is-on{background:#fff;color:#1D1A16;font-weight:500}
.segmented button:hover:not(.is-on){color:var(--ink-3)}

/* 筛选标签 */
.tabs{display:flex;align-items:center;gap:4px;flex-wrap:wrap}
.tab{
  height:32px;padding:0 14px;border-radius:8px;border:0;background:transparent;
  font-size:11.5px;color:var(--muted);cursor:pointer;white-space:nowrap;
  transition:background .15s ease,color .15s ease;
}
.tab:hover{background:#EFE9DD;color:var(--ink-3)}
.tab.is-on{background:#221E19;color:#F5EFE5;font-weight:500}

/* 工具条 */
.toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:32px}
.toolbar-side{display:flex;align-items:center;gap:10px}

/* ============================================================
   浮层：遮罩 / 抽屉 / 弹窗 / toast
   ============================================================ */
.overlay{
  position:fixed;inset:0;background:rgba(27,24,21,.4);z-index:60;
  display:flex;justify-content:flex-end;
  animation:fadeIn .18s ease both;
}
.overlay--center{align-items:center;justify-content:center;padding:32px}
@keyframes fadeIn{from{opacity:0}to{opacity:1}}

.drawer{
  width:520px;max-width:94vw;height:100%;background:var(--soft);
  border-left:1px solid var(--line);
  padding:24px;display:flex;flex-direction:column;gap:14px;
  overflow-y:auto;animation:slideIn .24s cubic-bezier(.22,.8,.3,1) both;
  box-shadow:-24px 0 48px rgba(27,24,21,.08);
}
@keyframes slideIn{from{transform:translateX(24px);opacity:.6}to{transform:translateX(0);opacity:1}}

.modal{
  width:520px;max-width:100%;max-height:calc(100vh - 64px);background:#fff;
  border:1px solid var(--line);border-radius:16px;box-shadow:var(--shadow-pop);
  display:flex;flex-direction:column;overflow:hidden;
  animation:popIn .2s cubic-bezier(.22,.8,.3,1) both;
}
.modal--wide{width:720px}
.modal--narrow{width:420px}
@keyframes popIn{from{transform:translateY(8px) scale(.985);opacity:0}to{transform:none;opacity:1}}
.modal-head{
  padding:18px 20px;display:flex;align-items:flex-start;justify-content:space-between;gap:16px;
  border-bottom:1px solid var(--line-3);
}
.modal-title{font-family:var(--serif);font-size:17px;font-weight:600;line-height:1.4}
.modal-desc{font-size:11.5px;color:var(--muted-4);margin-top:4px}
.modal-body{padding:20px;display:flex;flex-direction:column;gap:16px;overflow-y:auto}
.modal-foot{
  padding:14px 20px;border-top:1px solid var(--line-3);display:flex;justify-content:flex-end;gap:10px;
  background:var(--soft-3);
}
.icon-btn{
  width:30px;height:30px;border-radius:8px;border:1px solid var(--line);background:#fff;
  display:grid;place-items:center;cursor:pointer;color:var(--muted);flex:0 0 30px;
}
.icon-btn:hover{background:var(--soft-4);color:var(--ink-3)}

/* ---------- 添加账号：扫码浮层 ---------- */
.modal-foot--split{justify-content:space-between}
.modal-foot--split .grow{flex:1}
.scan{display:flex;flex-direction:column;gap:14px}
.scan-desc{margin:0;font-size:11.5px;line-height:1.65;color:var(--muted-2)}

.steps{display:flex;gap:6px;flex-wrap:wrap}
.step{
  padding:7px 10px;border-radius:7px;font-size:11px;
  background:var(--soft-4);color:var(--muted-5);
}
.step--done{background:var(--sage-bg);color:var(--green)}
.step--on{
  background:var(--warm-bg);color:var(--brand);font-weight:500;
  box-shadow:inset 0 0 0 1px var(--brand);
}

.browser-mock{
  display:flex;flex-direction:column;gap:10px;padding:12px;
  border:1px solid var(--line);border-radius:10px;background:var(--soft-2);
}
.browser-bar{display:flex;align-items:center;gap:6px}
.browser-bar i{width:6px;height:6px;border-radius:50%;background:var(--na);flex:0 0 6px}
.browser-url{
  flex:1;min-width:0;padding:3px 8px;border-radius:5px;background:#fff;
  font-size:10px;color:var(--muted-3);
}
.browser-hint{margin:0;font-size:11.5px;line-height:1.6;color:var(--muted-2)}

.scan-row{display:flex;align-items:center;gap:8px}
.pulse{
  width:7px;height:7px;border-radius:50%;background:var(--brand-2);flex:0 0 7px;
  animation:pulse 1.6s ease-out infinite;
}
@keyframes pulse{
  0%{box-shadow:0 0 0 0 rgba(181,133,66,.45)}
  70%{box-shadow:0 0 0 6px rgba(181,133,66,0)}
  100%{box-shadow:0 0 0 0 rgba(181,133,66,0)}
}
.scan-status{font-size:12px;color:var(--ink)}
.scan-tag{margin-left:auto;font-size:11px;color:var(--muted-5)}

.scan-account{
  display:flex;align-items:center;gap:10px;padding:12px 14px;
  border:1px solid var(--line);border-radius:10px;background:#fff;
}
.scan-avatar{
  width:34px;height:34px;border-radius:8px;background:var(--brand);color:#F8F0E7;
  display:grid;place-items:center;font-family:var(--serif);font-size:13px;font-weight:600;
}
.scan-name{font-size:13px;font-weight:500;color:var(--ink)}
.scan-meta{margin-top:3px;font-size:10.5px;color:var(--muted-4)}
.scan-ok{
  padding:8px 10px;border-radius:8px;background:var(--sage-bg);color:var(--green);
  font-size:11px;line-height:1.5;
}
.scan-link{
  padding:0;border:0;background:none;cursor:pointer;
  font-family:inherit;font-size:11.5px;font-weight:500;color:var(--brand);
}
.scan-link:hover{color:var(--brand-hover)}

.toasts{position:fixed;right:24px;bottom:24px;z-index:90;display:flex;flex-direction:column;gap:8px;align-items:flex-end}
.toast{
  background:#221E19;color:#F5EFE5;border-radius:10px;padding:10px 14px;font-size:12px;
  display:flex;align-items:center;gap:9px;box-shadow:0 10px 30px rgba(27,24,21,.2);
  animation:toastIn .22s ease both;max-width:360px;
}
.toast.is-out{animation:toastOut .2s ease both}
.toast .dot{background:var(--brand-2)}
@keyframes toastIn{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes toastOut{to{opacity:0;transform:translateY(6px)}}

/* 下拉菜单 */
.menu{
  position:absolute;z-index:80;background:#fff;border:1px solid var(--line);border-radius:10px;
  box-shadow:var(--shadow-pop);padding:5px;min-width:150px;
  animation:popIn .14s ease both;
}
.menu button{
  display:flex;width:100%;align-items:center;gap:8px;padding:8px 10px;border:0;background:none;
  border-radius:6px;font-size:12px;color:var(--ink-3);cursor:pointer;text-align:left;
}
.menu button:hover{background:var(--soft-4)}
.menu button.is-on{color:var(--brand);font-weight:500}
.menu button.is-danger{color:var(--down)}
.menu button.is-danger:hover{background:var(--brand-soft)}

/* 骨架屏 */
.skeleton{
  background:linear-gradient(90deg,#F1ECE1 25%,#F8F4EC 37%,#F1ECE1 63%);
  background-size:400% 100%;animation:shimmer 1.2s ease infinite;border-radius:6px;
}
@keyframes shimmer{0%{background-position:100% 0}100%{background-position:0 0}}

/* 可访问性 */
.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;
}
:focus-visible{outline:2px solid #C58C6F;outline-offset:2px}

/* ============================================================
   浏览器插件相关（登录态捕获 / 安装引导）
   ============================================================ */
.scan-avatar img{width:100%;height:100%;object-fit:cover;border-radius:8px;display:block}
.scan-avatar{overflow:hidden}

/* 本机已捕获的登录态，选一个入库 */
.capture-list{display:flex;flex-direction:column;gap:6px;max-height:246px;overflow-y:auto;padding-right:2px}
.capture-list::-webkit-scrollbar{width:4px}
.capture-list::-webkit-scrollbar-thumb{background:#DDD5C6;border-radius:2px}
.capture-item{
  display:flex;align-items:center;gap:10px;width:100%;padding:9px 11px;
  border:1px solid var(--line);border-radius:10px;background:#fff;cursor:pointer;
  font-family:inherit;text-align:left;transition:border-color .14s ease,background .14s ease;
}
.capture-item:hover{border-color:#CBB9A2;background:var(--soft-2)}
.capture-avatar{
  width:30px;height:30px;flex:0 0 30px;border-radius:7px;background:var(--brand);
  color:#F8F0E7;display:grid;place-items:center;font-family:var(--serif);font-size:12px;overflow:hidden;
}
.capture-avatar img{width:100%;height:100%;object-fit:cover;display:block}
.capture-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.capture-name{font-size:12.5px;font-weight:500;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.capture-meta{font-size:10px;color:var(--muted-5);font-family:var(--num)}
.capture-state{font-size:10px;color:var(--muted-4);flex:0 0 auto}

/* 账号名后的「插件」小标 */
.via-tag{
  display:inline-flex;align-items:center;gap:4px;margin-left:7px;
  padding:1px 6px;border-radius:4px;background:var(--sage-bg);
  font-size:9px;font-weight:500;color:var(--green);vertical-align:1px;
}
.via-tag .dot{width:4px;height:4px;border-radius:2px;flex:0 0 4px}

/* 安装引导 */
.ext-status{
  display:flex;align-items:center;gap:8px;padding:10px 12px;border-radius:9px;
  background:var(--warm-bg);border:1px solid var(--warm-line);
  font-size:12px;color:var(--warm-ink-2);
}
.ext-path{
  display:flex;align-items:center;gap:10px;padding:9px 12px;border-radius:8px;
  background:var(--soft-2);border:1px dashed var(--line-2);
}
.ext-path-label{font-size:10px;letter-spacing:1px;color:var(--muted-5);flex:0 0 auto}
.ext-path code{
  font-family:var(--num);font-size:11px;color:var(--ink-3);
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
