/* 智维 Workers 版 · 在 /static/assets/app.css（沿用 Python 版样式）之上的补充：页内开合、会话、公司、二维码、登录页 */

/* ------------------------------------------------------------------ 开合状态挂在 <html data-ui-*>（morph 永不覆盖） */
#zw-drawer {
  display: none;
}
html[data-ui-drawer] #zw-drawer {
  display: block;
}
.bell {
  position: relative;
}
.bell .dropdown {
  display: none;
}
html[data-ui-bell] .bell .dropdown {
  display: block;
}
.bell .dropdown .it[data-href] {
  cursor: pointer;
}
[data-modal] {
  display: none !important;
}
html[data-ui-modal="notice"] [data-modal="notice"],
html[data-ui-modal="chain"] [data-modal="chain"] {
  display: grid !important;
}
.deps-more {
  display: none;
}
html[data-ui-deps] .deps-more {
  display: block;
}
html[data-ui-deps] .when-nodeps,
html:not([data-ui-deps]) .when-deps {
  display: none;
}
[data-href] {
  cursor: pointer;
}
[hidden] {
  display: none !important;
}

/* ------------------------------------------------------------------ 外壳补充 */
.side-foot .org {
  padding: 10px 6px 2px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
}
.side-foot .org b {
  display: block;
  font-family: var(--f-serif);
  font-size: 14px;
  color: var(--ink-2);
  letter-spacing: 0.08em;
  margin-bottom: 2px;
}
.side-foot .org span {
  display: block;
  word-break: break-all;
}
.sid-chip {
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--line);
  background: #fafbfc;
  border-radius: 11px;
  padding: 3px 9px;
  white-space: nowrap;
}
.sid-chip:hover {
  color: var(--brand);
  border-color: rgba(51, 70, 211, 0.35);
}
.drawer-x {
  position: absolute;
  right: 18px;
  top: 14px;
  font-size: 22px;
  color: var(--muted);
  line-height: 1;
}
.drawer {
  position: fixed;
}
.sess-card {
  padding: 12px 14px;
  margin-bottom: 14px;
  background: var(--surface-2);
}
.sess-h {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.sess-h b {
  font-size: 14px;
}
.sess-h code {
  font-size: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
  word-break: break-all;
}
.llm-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}
.llm-row .switch {
  flex: 0 0 52px;
}
.switch[data-busy] {
  opacity: 0.5;
  pointer-events: none;
}
a.btn[data-busy],
.link[data-busy] {
  opacity: 0.5;
  pointer-events: none;
}

/* ------------------------------------------------------------------ 风险定级：案例链接、因子滑杆 */
a.case {
  display: block;
  color: inherit;
}
.factor .fbar .fslide {
  position: absolute;
  left: 0;
  right: 0;
  top: -9px;
  width: 100%;
  height: 28px;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
}
.factor .fbar .fslide:disabled {
  cursor: not-allowed;
}
.factor .fbar:has(.fslide:active) i {
  transition: none;
}
.factor .fbar:hover {
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.tune-note {
  font-size: 12px;
  color: var(--amber);
  margin: -4px 0 10px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.tune-note.muted {
  color: var(--dim);
}

/* ------------------------------------------------------------------ 手机审批：链接与二维码 */
.m-entry-card {
  padding: 16px 20px;
}
.m-entry-card .card-h {
  margin-bottom: 10px;
}
.m-entry {
  display: flex;
  gap: 18px;
  align-items: center;
}
.m-entry .qr {
  width: 128px;
  height: 128px;
  flex: 0 0 128px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px;
}
.m-entry .qr svg {
  width: 100%;
  height: 100%;
  display: block;
}
.m-entry .lk {
  font-size: 13px;
  line-height: 1.8;
  color: var(--muted);
  min-width: 0;
}
.m-entry .lk code {
  display: block;
  font-size: 12px;
  color: var(--ink-2);
  word-break: break-all;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 8px;
  margin: 6px 0;
}

/* ------------------------------------------------------------------ 上传进度（客户端） */
#upl-client .prog i {
  transition: width 0.2s;
}

/* ------------------------------------------------------------------ 登录页 */
.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(380px, 0.9fr);
  background: var(--surface);
}
.login .hero {
  position: relative;
  overflow: hidden;
  background: radial-gradient(1200px 600px at 10% 0%, #2b3bc4 0%, #1e2b9b 45%, #111a2b 100%);
  color: #fff;
  padding: 56px 64px;
  display: flex;
  flex-direction: column;
}
.login .hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.1));
  pointer-events: none;
}
.login .lg-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}
.login .lg-brand img {
  width: 40px;
  height: 40px;
  background: #fff;
  border-radius: 10px;
  padding: 4px;
}
.login .lg-brand b {
  font-family: var(--f-serif);
  font-weight: 900;
  font-size: 26px;
  letter-spacing: 0.04em;
}
.login .lg-brand span {
  font-size: 13px;
  opacity: 0.75;
}
.login .pitch {
  margin-top: auto;
  position: relative;
  z-index: 1;
  max-width: 560px;
}
.login .pitch h1 {
  font-family: var(--f-serif);
  font-size: 40px;
  line-height: 1.3;
  margin: 0 0 16px;
  font-weight: 900;
}
.login .pitch p {
  font-size: 15px;
  line-height: 1.9;
  opacity: 0.82;
  margin: 0;
}
.login .chain {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 26px;
}
.login .chain span {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.22);
}
.login .org-line {
  margin-top: 40px;
  position: relative;
  z-index: 1;
  font-size: 12px;
  opacity: 0.7;
  line-height: 1.8;
}
.login .org-line b {
  font-family: var(--f-serif);
  font-size: 15px;
  opacity: 1;
  letter-spacing: 0.1em;
  display: block;
}
.login .panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: var(--bg);
}
.login form {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 34px 32px 28px;
  box-shadow: 0 24px 60px rgba(30, 40, 70, 0.12);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.login form h2 {
  margin: 0;
  font-size: 22px;
}
.login form .sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: -6px;
}
.login form label {
  font-size: 13px;
  color: var(--ink-2);
  font-weight: 600;
}
.login form input[type="password"] {
  height: 46px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 0 14px;
  font-size: 15px;
  outline: 0;
  background: #fafbfc;
}
.login form input[type="password"]:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
  background: #fff;
}
.login form .err {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: var(--red);
  background: var(--red-soft);
  border: 1px solid rgba(224, 68, 58, 0.3);
  border-radius: 8px;
  padding: 8px 12px;
}
.login form .btn {
  height: 46px;
  font-size: 15px;
  border-radius: 10px;
}
.login form .foot {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 4px;
}
.login form .env {
  align-self: flex-start;
}
@media (max-width: 860px) {
  .login {
    grid-template-columns: 1fr;
  }
  .login .hero {
    padding: 28px 24px 32px;
  }
  .login .pitch {
    margin-top: 28px;
  }
  .login .pitch h1 {
    font-size: 26px;
  }
  .login .org-line {
    margin-top: 22px;
  }
  .login .panel {
    padding: 20px 16px 24px;
    order: -1;
  }
  .login .hero {
    min-height: 0;
  }
  .login .pitch p {
    font-size: 13px;
  }
  .login form {
    padding: 26px 20px 22px;
  }
}

/* ------------------------------------------------------------------ 手机审批页 */
.m-body {
  background: #f2f4f8;
}
.m-wrap {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100vh;
  background: #f2f4f8;
}
.m-head {
  background: #fff;
  text-align: center;
  font-weight: 700;
  font-size: 17px;
  padding: 16px 0 14px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
}
.m-head small {
  display: block;
  font-weight: 400;
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.m-card {
  background: #fff;
  margin: 14px;
  border-radius: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  box-shadow: 0 6px 16px rgba(30, 40, 70, 0.05);
}
.m-card h3 {
  font-size: 16px;
  margin: 0 0 10px;
  line-height: 1.6;
}
.m-row {
  display: flex;
  gap: 10px;
  font-size: 14px;
  padding: 8px 0;
  border-top: 1px solid #f0f2f6;
}
.m-row span:first-child {
  color: var(--muted);
  width: 56px;
  flex: 0 0 56px;
}
.m-actions {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 10px;
  margin-top: 14px;
}
.m-actions .btn {
  height: 46px;
  font-size: 16px;
}
.m-wrap .content {
  padding: 0;
}
.m-wrap .toasts {
  top: 60px;
  right: 12px;
  left: 12px;
}
.m-wrap .toast {
  min-width: 0;
}
