/* 富盈管理中心 · 富盈红 + 浅暖灰。颜色、字号和组件规则的唯一来源是知识库《富盈网页后台视觉规范》，改这里前先改那一页。 */
:root{
  --brand:#D21F19;--brand-hover:#B81A14;--brand-soft:#FDEEEC;--brand-line:#F6CFCB;
  --bg:#F5F3F0;--surface:#FFFFFF;--surface-2:#FAF9F7;--line:#E9E5E0;--line-strong:#DAD4CD;
  --ink:#1F1B18;--ink-2:#3D3732;--muted:#756D66;--faint:#A39B93;
  --green:#1F8A5B;--green-soft:#E7F4EC;--amber:#B86E00;--amber-soft:#FDF2DE;--blue:#2F6FB0;--blue-soft:#E8F0F9;--gray-soft:#EFECE8;
  --radius:14px;--shadow:0 1px 2px rgba(31,27,24,.04),0 1px 1px rgba(31,27,24,.03);
  --shadow-lg:0 24px 60px -12px rgba(31,27,24,.28),0 8px 20px -8px rgba(31,27,24,.12);
  --ease:cubic-bezier(.32,.72,0,1);
  --num:"Segoe UI","SF Pro Display",system-ui,sans-serif;
  font-family:"Microsoft YaHei UI","Microsoft YaHei","PingFang SC","Segoe UI",system-ui,sans-serif;
  color:var(--ink);background:var(--bg);font-size:14px;line-height:1.5;-webkit-font-smoothing:antialiased;
}
*{box-sizing:border-box}
html{scrollbar-gutter:stable}
body{margin:0;background:var(--bg)}
body,body *{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
input,textarea,[contenteditable=true]{-webkit-user-select:text;user-select:text;-webkit-touch-callout:default}
/* Platform-wide text box rule (tools/check-input-behavior.mjs): scroll inside, no resize handle. */
textarea{resize:none!important;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
[hidden]{display:none!important}
h1,h2,h3,p{margin:0}
a{color:var(--brand)}
.sprite{position:absolute;width:0;height:0;overflow:hidden}
.visually-hidden{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
svg.i{width:18px;height:18px;flex:none;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.num{font-family:var(--num);font-variant-numeric:tabular-nums}
.muted,.help{color:var(--muted)}
.faint{color:var(--faint)}
.error{color:var(--brand)!important}
:focus{outline:none}
:focus-visible{outline:2px solid var(--brand);outline-offset:2px}
[tabindex="-1"]:focus-visible{outline:none}
/* The shadow only appears once the link is shown: parked above the page it would leak a grey patch into the top-left corner. */
.skip-link{position:fixed;top:-60px;left:12px;z-index:500;padding:10px 14px;border-radius:10px;background:var(--surface)}
.skip-link:focus{top:12px;box-shadow:var(--shadow-lg)}

/* ---------- 按钮：按下只缩背景，不缩文字 ---------- */
button,input,select{font:inherit;color:inherit}
button{cursor:pointer;border:0;background:none;padding:0}
.primary,.secondary,.danger,.ghost{position:relative;isolation:isolate;display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:36px;padding:0 14px;border-radius:10px;font-weight:600;white-space:nowrap;transition:color .15s}
.primary::before,.secondary::before,.danger::before,.ghost::before{content:"";position:absolute;inset:0;z-index:-1;border-radius:inherit;background:var(--btn-bg,transparent);box-shadow:var(--btn-line,none);transition:transform .32s cubic-bezier(.34,1.56,.64,1),background-color .15s,box-shadow .15s}
.primary:active::before,.secondary:active::before,.danger:active::before,.ghost:active::before{transform:scale(.96);transition-duration:.09s,.15s,.15s}
.primary{--btn-bg:var(--brand);color:#fff}
.primary:hover{--btn-bg:var(--brand-hover)}
.secondary{--btn-bg:var(--surface);--btn-line:inset 0 0 0 1px var(--line-strong);color:var(--ink-2)}
.secondary:hover{--btn-bg:var(--surface-2)}
.danger{--btn-bg:var(--surface);--btn-line:inset 0 0 0 1px var(--brand-line);color:var(--brand)}
.danger:hover{--btn-bg:var(--brand-soft)}
.ghost{color:var(--muted)}
.ghost:hover{--btn-bg:var(--gray-soft);color:var(--ink)}
.small{min-height:30px;padding:0 10px;font-size:13px;border-radius:8px}
button:disabled{cursor:not-allowed;opacity:.5}
button:disabled::before{transform:none!important}
[aria-disabled="true"]{cursor:not-allowed;color:var(--faint)!important}
[aria-disabled="true"]::before{--btn-bg:var(--gray-soft);--btn-line:none;transform:none!important}
.icon-button{display:grid;place-items:center;flex:none;width:36px;height:36px;border-radius:10px;color:var(--muted);transition:background-color .15s,color .15s}
.icon-button:hover{background:var(--gray-soft);color:var(--ink)}
.link{color:var(--brand);font-weight:600;text-align:left}
.link:hover{text-decoration:underline;text-underline-offset:3px}
.inline-link{color:var(--brand);font-weight:600;text-decoration:none}
.inline-link:hover{text-decoration:underline}

/* ---------- 输入 ---------- */
label{display:grid;gap:6px;font-size:13px;font-weight:600;color:var(--ink-2)}
label small{font-size:12px;font-weight:400;color:var(--muted);line-height:1.55}
input,select{width:100%;min-width:0;min-height:40px;padding:0 12px;border:1px solid var(--line-strong);border-radius:10px;background:var(--surface);font-weight:400;color:var(--ink);transition:border-color .15s,box-shadow .15s}
input:hover,select:hover{border-color:#C8C0B7}
input:focus,select:focus{border-color:var(--brand);box-shadow:0 0 0 3px rgba(210,31,25,.12)}
input[readonly]{background:var(--surface-2)}
input[aria-invalid=true]{border-color:var(--brand)}
select{appearance:none;padding-right:32px;background:var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23756D66' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 11px center}
input[type=checkbox]{width:16px;height:16px;min-height:0;padding:0;accent-color:var(--brand)}
.check{display:flex;align-items:center;gap:8px;font-weight:500}
form{display:grid;gap:14px}
.password-control{position:relative;display:block}
.password-control input{padding-right:46px}
.password-control input::-ms-reveal,.password-control input::-ms-clear{display:none}
.password-control>.password-toggle{position:absolute;top:50%;right:4px;display:grid;place-items:center;width:34px;height:34px;border-radius:8px;color:var(--muted);transform:translateY(-50%)}
.password-toggle:hover:not(:disabled){background:var(--gray-soft);color:var(--ink)}
.password-toggle svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.password-toggle::after{content:"";position:absolute;top:50%;left:50%;width:22px;height:2px;border-radius:99px;background:currentColor;pointer-events:none;transform:translate(-50%,-50%) rotate(45deg);transition:opacity .15s}
.password-toggle.is-visible::after{opacity:0}
.password-toggle.is-visible{color:var(--brand);background:var(--brand-soft)}

/* ---------- 登录 ---------- */
.login-screen{position:fixed;inset:0;display:grid;grid-template-columns:minmax(380px,44%) 1fr;overflow:auto;background:var(--bg)}
.login-side{position:relative;overflow:hidden;display:flex;flex-direction:column;padding:48px 56px;background:#1E1A17;color:#F3EEE9}
.login-side::before{content:"";position:absolute;width:620px;height:620px;right:-260px;top:-220px;border-radius:50%;background:radial-gradient(circle,rgba(216,32,26,.55),rgba(216,32,26,0) 68%)}
.login-side::after{content:"";position:absolute;inset:0;background-image:linear-gradient(rgba(255,255,255,.035) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.035) 1px,transparent 1px);background-size:40px 40px;-webkit-mask-image:linear-gradient(180deg,#000,transparent 85%);mask-image:linear-gradient(180deg,#000,transparent 85%)}
.login-side>*{position:relative;z-index:1}
.logo-tile{display:inline-flex;align-items:center;gap:12px}
.logo-tile b{display:block;font-size:17px;letter-spacing:.5px}
.logo-tile small{display:block;color:#A99F96;font-size:12px}
.login-copy{margin-top:auto}
.login-copy h2{margin:0 0 14px;font-size:34px;line-height:1.25;letter-spacing:.5px}
.login-copy p{max-width:380px;margin:0 0 32px;color:#B5ABA2}
.login-feats{display:grid;gap:14px;margin:0;padding:0;list-style:none}
.login-feats li{display:flex;align-items:center;gap:12px;color:#DCD4CC}
.login-feats li span{display:grid;place-items:center;width:34px;height:34px;border-radius:10px;background:rgba(255,255,255,.07);color:#FF8E86}
.login-foot{margin-top:44px;color:#7D746C;font-size:12px}
.login-main{display:grid;place-items:center;padding:32px 16px}
.login-card{width:min(380px,100%)}
.login-card h1{font-size:24px;margin-bottom:6px}
.login-card>.muted{margin-bottom:24px}
.login-card form{gap:16px}
.login-card .primary{width:100%;min-height:44px;margin-top:6px;font-size:15px}
.login-card input{min-height:42px}
#login-status-slot #status{margin:0 0 16px}

/* ---------- 外框 ---------- */
.shell{display:grid;grid-template-columns:240px minmax(0,1fr);min-height:100vh}
.sidebar{position:sticky;top:0;z-index:30;display:flex;flex-direction:column;height:100vh;padding:18px 14px 14px;background:var(--surface);border-right:1px solid var(--line)}
.brand{display:flex;align-items:center;gap:10px;padding:4px 8px 18px;margin-bottom:10px;border-bottom:1px solid var(--line);color:inherit;text-decoration:none}
.brand>span{min-width:0}
.brand strong{display:block;font-size:15px}
.brand small{display:block;color:var(--muted);font-size:12px}
.sidebar nav{flex:1;min-height:0;overflow-y:auto;display:grid;align-content:start;gap:2px;margin-right:-6px;padding-right:6px}
.nav-label{margin:14px 10px 6px;font-size:12px;font-weight:600;letter-spacing:.5px;color:var(--faint)}
.nav-label:first-child{margin-top:4px}
nav button{position:relative;display:flex;align-items:center;gap:10px;width:100%;min-height:38px;padding:0 10px;border-radius:10px;color:var(--ink-2);font-weight:500;text-align:left;transition:background-color .15s,color .15s}
nav button svg{color:var(--faint);transition:color .15s}
nav button:hover{background:var(--surface-2);color:var(--ink)}
nav button[aria-current=page]{background:var(--brand-soft);color:var(--brand);font-weight:700}
nav button[aria-current=page] svg{color:var(--brand)}
nav button[aria-current=page]::before{content:"";position:absolute;left:-14px;top:9px;bottom:9px;width:3px;border-radius:0 3px 3px 0;background:var(--brand)}
.nav-count{margin-left:auto;min-width:22px;height:20px;padding:0 6px;border-radius:10px;background:var(--gray-soft);color:var(--muted);font-size:12px;font-weight:600;display:grid;place-items:center}
.nav-count:empty{display:none}
nav button[aria-current=page] .nav-count{background:#fff;color:var(--brand)}
.sidebar-footer{padding-top:12px;border-top:1px solid var(--line)}
#identity{display:flex;align-items:center;gap:10px;padding:0 4px}
#identity:empty{display:none}
.identity-copy{flex:1;min-width:0}
#identity-name{display:block;font-weight:700;font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.identity-copy small{color:var(--muted);font-size:12px}
#environment{display:block;margin:10px 4px 0;padding:6px 10px;border-radius:8px;background:var(--amber-soft);color:var(--amber);font-size:12px}
#environment:empty{display:none}
.avatar{display:grid;place-items:center;flex:none;width:34px;height:34px;border-radius:50%;background:var(--brand-soft);color:var(--brand);font-weight:700}
.avatar.blue{background:var(--blue-soft);color:var(--blue)}
.nav-scrim{position:fixed;inset:0;z-index:25;background:rgba(31,27,24,.3)}
main{min-width:0;width:100%;max-width:1680px;padding:28px 36px 48px}

.page-head{display:flex;align-items:flex-end;gap:16px;min-height:58px;margin-bottom:20px}
.page-copy{min-width:0;flex:1}
.page-head h1{font-size:24px;line-height:1.3;letter-spacing:.3px}
.page-head p{margin-top:4px;color:var(--muted)}
.page-actions{display:flex;align-items:center;gap:10px;flex:none}
.menu-button{display:none}
.sync-time{display:inline-flex;align-items:center;gap:6px;color:var(--muted);font-size:13px;white-space:nowrap}
.sync-time:not(:empty)::before{content:"";width:7px;height:7px;border-radius:50%;background:var(--green);box-shadow:0 0 0 3px var(--green-soft)}
#status{padding:10px 14px;margin:0 0 16px;border:1px solid var(--line);border-radius:10px;background:var(--surface);font-size:13px;color:var(--ink-2)}
#status:empty{display:none}
#status.error{border-color:var(--brand-line);background:#FFFBFA}
.refresh-state{margin:-6px 0 16px;padding:8px 12px;border-radius:10px;background:var(--green-soft);color:var(--green);font-size:13px}
.refresh-state.error{background:var(--brand-soft);color:var(--brand)}
[data-page]:not([hidden]),#record-page:not([hidden]){animation:page-in .18s ease-out}
@keyframes page-in{from{opacity:0}to{opacity:1}}

/* ---------- 卡片与总览 ---------- */
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow)}
.section-head{display:flex;align-items:center;gap:10px;padding:16px 18px 0}
.section-head h2{font-size:15px}
.section-head .muted{font-size:13px}
.section-head>button{margin-left:auto}
.metrics{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:14px;margin-bottom:16px}
.metric{display:flex;flex-direction:column;gap:2px;padding:16px 16px 14px;text-align:left;transition:border-color .15s,box-shadow .15s}
.metric:hover{border-color:var(--line-strong);box-shadow:0 6px 18px -8px rgba(31,27,24,.18)}
.metric-top{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px;color:var(--muted);font-size:13px;font-weight:600}
.metric-icon{display:grid;place-items:center;width:30px;height:30px;border-radius:9px;background:var(--gray-soft);color:var(--ink-2)}
.metric-icon svg.i{width:16px;height:16px}
.metric strong{font-size:30px;line-height:1.15;font-weight:700}
.metric-of{font-size:16px;font-weight:500;color:var(--faint)}
.metric small{color:var(--muted);font-size:12px}
.metric.hot .metric-icon{background:var(--brand-soft);color:var(--brand)}
.metric.good .metric-icon{background:var(--green-soft);color:var(--green)}
.metric.warn .metric-icon{background:var(--amber-soft);color:var(--amber)}
.metric.warn strong{color:var(--amber)}
.overview-grid{display:grid;grid-template-columns:minmax(0,1.65fr) minmax(0,1fr);gap:16px;align-items:start}
.chart{height:260px;margin:4px 8px 8px}
.chart.chart-empty{display:grid;place-items:center}
.list{padding:8px 8px 8px}
.list-item{display:flex;align-items:center;gap:12px;min-width:0;padding:10px;border-radius:10px;transition:background-color .12s}
.list-item:hover{background:var(--surface-2)}
.list-item>div:not(.list-end){flex:1;min-width:0}
.list-item strong{display:block;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.list-item p{color:var(--muted);font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.list-icon{display:grid;place-items:center;flex:none;width:36px;height:36px;border-radius:10px;background:var(--gray-soft);color:var(--ink-2)}
.list-icon svg.i{width:16px;height:16px}
.list-end{display:flex;align-items:center;gap:10px;flex:none;font-size:13px}
.list-end .link{font-size:13px}
.summary-note{margin:14px 2px 0;color:var(--faint);font-size:12px}
progress{width:100%;height:8px;border:0;border-radius:4px;background:var(--gray-soft);overflow:hidden;appearance:none;-webkit-appearance:none}
progress::-webkit-progress-bar{background:var(--gray-soft);border-radius:4px}
progress::-webkit-progress-value{background:var(--brand);border-radius:4px}
progress::-moz-progress-bar{background:var(--brand);border-radius:4px}
progress.mini{width:80px;height:6px}

/* ---------- 状态标签 ---------- */
.pill{display:inline-flex;align-items:center;gap:6px;height:24px;padding:0 9px;border-radius:12px;background:var(--gray-soft);color:var(--ink-2);font-size:12px;font-weight:600;white-space:nowrap}
.pill::before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor;opacity:.85}
.pill.good{background:var(--green-soft);color:var(--green)}
.pill.warn{background:var(--amber-soft);color:var(--amber)}
.pill.bad{background:var(--brand-soft);color:var(--brand)}
.pill.info{background:var(--blue-soft);color:var(--blue)}
.pill.neutral{background:var(--gray-soft);color:var(--muted)}
.pill.plain::before{display:none}
.badges{display:flex;flex-wrap:wrap;gap:6px}
.urgent{color:var(--brand)}

/* ---------- 列表页 ---------- */
.toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:10px;padding:14px 16px;border-bottom:1px solid var(--line)}
.toolbar label:not(.date-label){display:block}
.search-label{position:relative;flex:1;min-width:220px;max-width:380px}
.search-label svg.i{position:absolute;left:11px;top:50%;width:16px;height:16px;color:var(--faint);transform:translateY(-50%);pointer-events:none}
.search-label input{padding-left:34px}
.toolbar input,.toolbar select{min-height:36px}
.toolbar select{min-width:140px}
#factory-filter-label{flex:1;min-width:220px;max-width:300px}
.date-label:not([hidden]){display:flex;align-items:center;gap:6px;font-weight:500;color:var(--muted)}
.date-label input{width:150px}
.result-count{margin-left:auto;color:var(--muted);font-size:13px;white-space:nowrap}
.filter-help{padding:10px 16px;border-bottom:1px solid var(--line);background:var(--surface-2);color:var(--muted);font-size:12px;line-height:1.7}
#factory-context:not(:empty){padding:12px 16px;border-bottom:1px solid var(--line)}
.factory-matches{display:flex;flex-wrap:wrap;gap:10px}
.factory-matches>div{max-width:100%;padding:8px 12px;border:1px solid var(--line);border-radius:10px;overflow-wrap:anywhere}
.factory-matches small{display:block;color:var(--muted);font-size:12px}
.table-scroll{width:100%;overflow-x:auto}
table{width:100%;border-collapse:collapse;text-align:left}
th{padding:10px 16px;border-bottom:1px solid var(--line);background:var(--surface-2);color:var(--muted);font-size:12px;font-weight:600;white-space:nowrap}
td{padding:12px 16px;border-bottom:1px solid var(--line);vertical-align:middle;max-width:340px;overflow-wrap:anywhere}
tbody tr{transition:background-color .12s}
tbody tr:hover{background:#FCFBFA}
tbody tr.clickable{cursor:pointer}
tbody tr:last-child td{border-bottom:0}
td strong{font-weight:600}
td .sub{display:block;margin-top:2px;color:var(--muted);font-size:12px}
td .link{font-size:14px;color:var(--ink);font-weight:600}
td .sub .link{color:var(--ink-2);font-weight:500;font-size:12px}
td:last-child .link{color:var(--brand)}
th.r,td.r{text-align:right}
td.num{font-weight:500}
.nowrap{white-space:nowrap}
.who{display:flex;align-items:center;gap:10px}
.who .avatar{width:32px;height:32px;font-size:13px}
/* Login names are often phone numbers: keep the digits on one line and let the column widen instead. */
td .login-name{white-space:nowrap;overflow-wrap:normal}
.pagination{display:flex;align-items:center;gap:10px;padding:12px 16px;border-top:1px solid var(--line);color:var(--muted);font-size:13px}
.pagination>button,.pager-buttons{margin-left:auto}
.pager-buttons{display:flex;gap:8px}
.audit-scope{font-size:12px}
.empty{padding:36px 18px;text-align:center;color:var(--muted);line-height:1.8}
.empty strong{display:block;color:var(--ink-2);font-size:15px}

.driver-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:14px;padding:16px}
.driver-card{display:grid;gap:12px;padding:16px;border:1px solid var(--line);border-radius:12px}
.driver-head{display:flex;align-items:center;gap:10px}
.driver-head>div:nth-child(2){flex:1;min-width:0}
.driver-head h2{font-size:15px;overflow-wrap:anywhere}
.driver-head .sub{color:var(--muted);font-size:12px}
.progress-label{display:flex;justify-content:space-between;gap:10px;color:var(--muted);font-size:13px}
.progress-label strong{color:var(--ink)}
.driver-foot{display:flex;align-items:flex-end;justify-content:space-between;gap:10px}
.driver-foot p{color:var(--muted);font-size:12px;line-height:1.7}
.driver-foot strong{color:var(--ink)}

/* ---------- 弹窗 ---------- */
dialog{width:min(560px,calc(100vw - 32px));max-height:calc(100dvh - 48px);padding:0;border:0;border-radius:16px;background:var(--surface);color:var(--ink);box-shadow:var(--shadow-lg);overflow:auto;overscroll-behavior:contain}
dialog::backdrop{background:rgba(31,27,24,.36)}
dialog[open]:not(.detail-dialog){animation:dialog-in .22s var(--ease)}
@keyframes dialog-in{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:none}}
dialog>header{position:sticky;top:0;z-index:2;display:flex;align-items:center;gap:12px;padding:18px 24px 14px;border-bottom:1px solid var(--line);background:var(--surface)}
dialog>header .close{margin-left:auto}
.detail-heading{flex:1;min-width:0}
.detail-heading h2{font-size:18px;line-height:1.35;overflow-wrap:anywhere}
.detail-heading p.muted{font-size:13px;margin-top:2px}
.eyebrow{font-size:12px;font-weight:700;letter-spacing:.5px;color:var(--brand)}
dialog{scrollbar-width:thin;scrollbar-color:var(--line-strong) transparent}
.form-dialog form,.form-dialog .one-time-credential,#account-status,.self-note,.self-facts{margin-left:24px;margin-right:24px}
.form-dialog form{padding:18px 0;border-bottom:1px solid var(--line)}
.form-dialog form:last-of-type{border-bottom:0}
.form-dialog h3{display:flex;align-items:center;gap:8px;font-size:14px}
.changed{font-size:12px;font-weight:500;color:var(--amber)}
.form-row{display:grid;grid-template-columns:1fr 1fr;gap:12px;align-items:start}
.form-row .check{align-self:end;min-height:40px}
small.error{color:var(--brand)!important}
/* 表单按钮组：靠右，主按钮在最右，左侧空处放说明；保存类按钮用常规大小（知识库视觉规范） */
.button-row{display:flex;align-items:center;justify-content:flex-end;gap:10px}
.button-row>.help{margin-right:auto}
.button-row>.primary,.button-row>.secondary,.button-row>.danger{min-height:40px;min-width:96px}
.help{font-size:12px;line-height:1.6}
#create-status:empty,#account-status:empty{display:none}
#create-status{font-size:13px;color:var(--ink-2)}
#account-status{margin-top:16px;padding:10px 12px;border-radius:10px;background:var(--green-soft);color:var(--green);font-size:13px}
#account-status.error{background:var(--brand-soft)}
.account-meta{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin-top:6px;color:var(--muted);font-size:12px}
.account-meta .pill{height:22px;padding:0 8px}
.meta-sep{color:var(--line-strong)}
.form-dialog>header{align-items:flex-start}
.self-note{display:flex;gap:10px;margin-top:18px;padding:12px 14px;border-radius:12px;background:var(--amber-soft);color:#7A4A00;font-size:13px;line-height:1.6}
.self-note svg.i{margin-top:1px;color:var(--amber)}
/* .detail-grid further down resets margins; the doubled class keeps the facts in line with .self-note above. */
.detail-grid.self-facts{margin:16px 24px 22px}
.field-label{display:block;margin-bottom:6px;font-size:13px;font-weight:600;color:var(--ink-2)}
.field-row{display:flex;flex-wrap:wrap;align-items:center;gap:12px}
.field-note{color:var(--muted);font-size:12px}
.field-note.error{color:var(--brand)}
/* 账号状态：正常 / 封禁 二选一 */
.segmented{display:inline-flex;gap:2px;padding:3px;border-radius:10px;background:var(--gray-soft)}
.segmented label{position:relative;display:block;cursor:pointer}
.segmented input{position:absolute;inset:0;width:100%;height:100%;min-height:0;margin:0;padding:0;opacity:0;pointer-events:none}
.segmented span{display:inline-flex;align-items:center;min-height:34px;padding:0 16px;border-radius:8px;color:var(--muted);font-weight:600;transition:background-color .15s,color .15s}
.segmented input:checked+span{background:var(--surface);color:var(--ink);box-shadow:0 1px 2px rgba(0,0,0,.08)}
.segmented .danger-choice input:checked+span{background:var(--brand);color:#fff}
.segmented input:focus-visible+span{outline:2px solid var(--brand);outline-offset:2px}
/* 富盈风格确认框（替代浏览器自带的） */
.confirm-dialog{width:min(440px,calc(100vw - 32px))}
.confirm-body{display:flex;gap:14px;padding:22px 24px 8px}
.confirm-body h2{font-size:16px;line-height:1.4;margin-bottom:6px}
.confirm-body p{color:var(--ink-2);font-size:13px;line-height:1.7}
.confirm-mark{display:grid;place-items:center;flex:none;width:40px;height:40px;border-radius:12px;background:var(--brand-soft);color:var(--brand)}
.confirm-mark.warn{background:var(--amber-soft);color:var(--amber)}
.confirm-dialog .button-row{padding:12px 24px 20px}
.change-list{display:grid;gap:6px;margin:10px 0 0;padding:0;list-style:none}
.change-list li{padding:8px 10px;border-radius:8px;background:var(--surface-2);font-size:13px;line-height:1.6}
.change-list li b{font-weight:600}
.change-list li small{display:block;color:var(--muted);font-size:12px}
.change-list li.bad{background:var(--brand-soft);color:var(--brand)}
.change-list li.bad small{color:var(--brand)}
.danger.solid{--btn-bg:var(--brand);--btn-line:none;color:#fff}
.danger.solid:hover{--btn-bg:var(--brand-hover)}
.notice{padding:10px 12px;border-radius:10px;background:var(--amber-soft);color:var(--amber);font-size:13px;line-height:1.6}
.one-time-credential{display:grid;gap:12px;margin-top:4px!important;margin-bottom:18px!important;padding:16px;border:1px solid var(--green);border-radius:12px;background:var(--green-soft)}
.one-time-credential h3{font-size:14px;color:var(--green)}
.one-time-credential p{color:var(--ink-2);font-size:12px;line-height:1.6}
.one-time-credential input[readonly]{background:#fff}

/* 右侧详情抽屉：滑动用 transform；关闭时先瞬间去掉模糊再收回，不出现“由糊变清楚”。 */
.detail-dialog{position:fixed;inset:0 0 0 auto;width:min(640px,100vw);max-width:none;height:100dvh;max-height:none;margin:0;border-radius:0;overflow:hidden;flex-direction:column;
  transform:translateX(102%);transition:transform .33s var(--ease),display .33s allow-discrete,overlay .33s allow-discrete}
.detail-dialog[open]{display:flex;transform:none}
@starting-style{.detail-dialog[open]{transform:translateX(102%)}}
.detail-dialog::backdrop{background:rgba(31,27,24,0);transition:background-color .33s var(--ease),display .33s allow-discrete,overlay .33s allow-discrete}
.detail-dialog[open]::backdrop{background:rgba(31,27,24,.32);-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px)}
@starting-style{.detail-dialog[open]::backdrop{background:rgba(31,27,24,0)}}
.detail-dialog>header{position:static;flex:none;padding:18px 20px 14px 24px}
.detail-dialog .detail-heading h2{font-size:20px}
#detail-body{flex:1;overflow:auto;overscroll-behavior:contain;padding:0 24px 32px}
#detail-body>:first-child:not(.tabs){margin-top:20px}
.tabs{position:sticky;top:0;z-index:1;display:flex;gap:4px;margin:0 -24px 20px;padding:0 12px;border-bottom:1px solid var(--line);background:var(--surface)}
.tabs button{position:relative;min-height:42px;padding:0 12px;color:var(--muted);font-weight:600}
.tabs button:hover{color:var(--ink)}
.tabs button[aria-selected=true]{color:var(--ink)}
.tabs button[aria-selected=true]::after{content:"";position:absolute;left:12px;right:12px;bottom:-1px;height:2px;border-radius:2px;background:var(--brand)}
.tab-count{margin-left:5px;color:var(--faint);font-weight:500}
.detail-grid{display:grid;grid-template-columns:1fr 1fr;margin:0 0 20px;border:1px solid var(--line);border-radius:12px;background:var(--surface);overflow:hidden}
/* Lines come from each cell's right/bottom edge; the outer ones are clipped, so an odd last cell leaves no grey block. */
.detail-grid>div{min-width:0;padding:11px 14px;box-shadow:1px 0 0 var(--line),0 1px 0 var(--line)}
.detail-grid .wide{grid-column:1/-1}
.detail-grid dt{margin-bottom:2px;color:var(--muted);font-size:12px}
.detail-grid dd{margin:0;font-weight:500;line-height:1.6;overflow-wrap:anywhere}
.detail-section{margin-bottom:22px}
.detail-section h3{margin-bottom:10px;font-size:14px}
.detail-section-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}
.detail-section-head h3{margin:0}
.detail-section table{border:1px solid var(--line);border-radius:12px;border-collapse:separate;border-spacing:0;overflow:hidden}
.context-note{margin:0 0 20px;padding:10px 12px;border-radius:10px;background:var(--surface-2);color:var(--muted);font-size:12px;line-height:1.7}
.detail-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:4px}
.detail-actions .link{display:inline-flex;align-items:center;min-height:30px;padding:0 10px;border-radius:8px;box-shadow:inset 0 0 0 1px var(--line-strong);color:var(--ink-2);font-size:13px}
.detail-actions .link:hover{background:var(--surface-2);text-decoration:none}
.detail-loading{padding:52px 20px;text-align:center;color:var(--muted)}
.timeline{margin:0;padding:0 0 0 18px;border-left:2px solid var(--line)}
.timeline article{position:relative;padding:0 0 18px 14px}
.timeline article::before{content:"";position:absolute;left:-25px;top:4px;width:10px;height:10px;border-radius:50%;border:2px solid var(--brand);background:var(--surface)}
.timeline small{color:var(--muted)}
.timeline p{margin:2px 0}
.route-detail>.muted{margin:-4px 0 14px;font-size:13px}
.route-filters{display:inline-flex;gap:2px;margin:0 0 14px;padding:3px;border-radius:10px;background:var(--gray-soft)}
.route-filters button{min-height:30px;padding:0 12px;border-radius:8px;color:var(--muted);font-size:13px;font-weight:600}
.route-filters button[aria-pressed=true]{background:var(--surface);color:var(--ink);box-shadow:0 1px 2px rgba(0,0,0,.08)}
.route-photo-group{margin-top:10px}
.route-photo-group>span{display:block;margin-bottom:6px;color:var(--muted);font-size:12px}
.route-photo-list{display:flex;flex-wrap:wrap;gap:6px}
.route-photo{display:inline-flex;align-items:center;gap:6px;min-height:30px;padding:0 10px;border-radius:8px;background:var(--surface-2);box-shadow:inset 0 0 0 1px var(--line-strong);color:var(--ink-2);font-size:12px}
.route-photo:hover{background:var(--gray-soft)}
.route-photo svg.i{width:14px;height:14px}
.route-photo-empty{margin-top:8px;color:var(--muted);font-size:12px}

.photo-dialog{width:min(980px,calc(100vw - 32px))}
.photo-preview-stage{display:grid;place-items:center;height:min(64vh,660px);margin:16px 24px 0;border-radius:12px;background:#1E1A17;overflow:hidden;touch-action:none;cursor:grab}
.photo-preview-stage:active{cursor:grabbing}
.photo-preview-stage img{display:block;width:100%;height:100%;object-fit:contain;transform-origin:center;will-change:transform}
.photo-preview-footer{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px 24px 20px}
.photo-preview-footer p{color:var(--muted);font-size:13px}

/* ---------- 提示 ---------- */
.toast{position:fixed;left:50%;bottom:28px;z-index:60;max-width:calc(100vw - 32px);padding:10px 16px;border-radius:10px;background:#2A2522;color:#fff;font-size:13px;box-shadow:var(--shadow-lg);opacity:0;pointer-events:none;transform:translate(-50%,16px);transition:opacity .2s,transform .25s var(--ease)}
.toast.show{opacity:1;transform:translate(-50%,0)}

/* ---------- 窄屏 ---------- */
@media (max-width:1280px){.metrics{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media (max-width:1100px){.overview-grid{grid-template-columns:minmax(0,1fr)}main{padding:24px 24px 40px}}
@media (max-width:900px){
  .login-screen{grid-template-columns:1fr}
  .login-side{display:none}
  .shell{display:block}
  /* Park the closed menu far enough left that its large shadow (reaches ~48px past the edge) leaves no grey strip on screen. */
  .sidebar{position:fixed;left:0;top:0;width:260px;transform:translateX(calc(-100% - 64px));transition:transform .3s var(--ease);box-shadow:var(--shadow-lg)}
  .sidebar.open{transform:none}
  .menu-button{display:grid}
  main{padding:16px 16px 40px}
  .page-head{flex-wrap:wrap;align-items:center;min-height:0}
  .page-actions{width:100%;flex-wrap:wrap}
  .page-actions .sync-time{margin-right:auto}
  .metrics{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .search-label{max-width:none;min-width:100%}
  .result-count{margin-left:0}
  .date-label input{width:auto}
  .form-row{grid-template-columns:1fr}
  .detail-grid{grid-template-columns:1fr}
  .danger-zone{flex-direction:column;align-items:stretch}
  .photo-preview-stage{height:55vh;margin:12px 12px 0}
  .photo-preview-footer{flex-direction:column;align-items:stretch;padding:12px}
}
@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
