/* ==========================================================================
   登录页 / 工作区列表页 —— 按 Figma（DesignCode UI）以下组件复现：
   Input · Button Shiny · Payment Modal（登录卡片）· Navigation Menu（顶栏）·
   Notification / Activity（列表行）· List Card（汇总卡 + Progress）· Button Circle
   令牌与玻璃底子沿用 styles.css。
   ========================================================================== */

/* ---------- 通用：Figma Input ---------- */
/* 圆角 8，自下而上 白 50%→5%，1px 白描边，内边距 4 8 4 12，文字 13/20 左对齐，右侧 Icon Circle */
.input-f {
  display: flex; align-items: center; gap: 8px; min-height: 32px; box-sizing: border-box;
  padding: 3px 7px 3px 11px; border: 1px solid var(--container-border); border-radius: 8px;
  background: var(--search-bg);
  -webkit-backdrop-filter: blur(var(--blur-sm)); backdrop-filter: blur(var(--blur-sm));
  box-shadow: var(--shadow-sm); transition: box-shadow .15s, border-color .15s;
}
.input-f input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: 400 13px/20px var(--font); color: var(--text); }
.input-f input::placeholder { color: var(--muted); }
.input-f:focus-within { border-color: var(--menu-accent); box-shadow: var(--shadow-sm), 0 0 0 3px var(--accent-ring); }
/* Icon Circle：24 外框（4 内边距 + 16 图标），圆角 20，1px 10% 黑描边，白 2%→50% */
.icon-circle {
  flex: none; width: 24px; height: 24px; box-sizing: border-box; padding: 3px; display: grid; place-items: center;
  border: 1px solid var(--divider); border-radius: 20px; background: var(--btn-primary); color: var(--text-2);
}
.icon-circle svg { width: 16px; height: 16px; }
button.icon-circle { cursor: pointer; transition: background .12s; }
button.icon-circle:hover { background: var(--container); color: var(--text); }

.field { display: grid; gap: 6px; }
.field > label { font: 500 12px/16px var(--font); color: var(--text-2); display: flex; justify-content: space-between; }
.field > label a { color: var(--menu-accent); text-decoration: none; font-weight: 400; }
.field > label a:hover { text-decoration: underline; }
.field.is-error .input-f { border-color: var(--bad); box-shadow: var(--shadow-sm), 0 0 0 3px rgba(255, 69, 58, 0.18); }
.field .err { display: none; color: var(--bad); font: 400 12px/16px var(--font); }
.field.is-error .err { display: block; }

/* ---------- 通用：Button Shiny ---------- */
/* 玻璃底 白 60%→50%，2px 白描边，圆角 8，内边距 6×16，13/20 Medium + 16px 右箭头，背后 10px 模糊的彩色光晕（screen 30%） */
.btn.shiny { position: relative; height: auto; min-height: 34px; padding: 5px 14px 5px 16px; gap: 8px; border: 2px solid var(--container-border); background: var(--container); }
.btn.shiny svg { display: block; width: 16px; height: 16px; }
.btn.shiny::before {
  content: ""; position: absolute; inset: -10px; border-radius: 10px; z-index: -1; pointer-events: none;
  opacity: .3; mix-blend-mode: screen; filter: blur(10px);
  background: conic-gradient(from 90deg, #7147ff 0%, rgba(101, 111, 255, .75) 6.6%, rgba(90, 152, 255, .5) 13.2%, rgba(78, 192, 255, .25) 19.8%, rgba(66, 232, 255, 0) 26.4%, rgba(113, 206, 234, .125) 32.7%, rgba(160, 179, 213, .25) 39%, rgba(208, 153, 192, .375) 45.3%, rgba(255, 126, 171, .5) 51.6%, rgba(151, 128, 213, .75) 64%, rgba(100, 130, 234, .875) 70.2%, #3083ff 76.4%, #5165ff 88.2%, #7147ff 100%);
}
.btn.shiny:hover { background: var(--container-strong); }
.btn.shiny:hover::before { opacity: .45; }

/* ---------- 通用：Button Toggle（Navigation Menu 里的文字胶囊）与 Button Circle ---------- */
.nav-toggle { height: 32px; padding: 0 16px; border: 1px solid transparent; border-radius: 99px; background: transparent; color: var(--text); font: 500 14px/20px var(--font); cursor: pointer; white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; transition: background .12s; }
.nav-toggle:hover { background: var(--bg-hover); }
.nav-toggle.is-on { background: var(--container); border-color: var(--container-border); box-shadow: var(--shadow-sm); }
.btn.round { border-radius: 99px; font-size: 14px; background: var(--container); }
.btn.round:hover { background: var(--container-strong); }
.circle { width: 28px; height: 28px; padding: 0; display: grid; place-items: center; border: 1px solid var(--container-border); border-radius: 32px; background: var(--btn-secondary); color: var(--text); cursor: pointer; box-shadow: var(--shadow-sm); -webkit-backdrop-filter: blur(var(--blur-sm)); backdrop-filter: blur(var(--blur-sm)); transition: background .12s; }
.circle:hover { background: var(--btn-primary); }
.circle svg { width: 16px; height: 16px; }
.avatar { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--menu-accent); color: #fff; font: 600 11px/1 var(--font); flex: none; }

/* 径向淡出的分割线（Container Divider） */
.hr { height: 1px; width: 100%; background: var(--divider-line); }

/* ---------- 登录页（Payment Modal） ---------- */

.auth { flex: 1 1 auto; min-height: 0; display: grid; place-items: center; padding: 40px 24px; }
.auth-corner { position: fixed; top: 14px; right: 16px; display: flex; gap: 8px; z-index: 20; }
/* 卡片 340 宽，外 12 + 内 12 的双层内边距，项目居中，间距 12，Strong xl 投影 */
.auth-card { width: 340px; box-sizing: border-box; padding: 24px; display: grid; justify-items: center; gap: 12px; box-shadow: var(--shadow-strong); }
.auth-brand { display: grid; justify-items: center; gap: 6px; text-align: center; padding-bottom: 4px; }
/* 手机 / 平板上打开登录页：整站 body 那条 min-width:1200px 是给工作台的布局留的，
   登录卡片不需要。不摘掉的话卡片会被摆在 1200 宽画布的正中（离左边 430px），
   iOS Safari 不会缩放页面，屏幕上就只剩壁纸，看着像打不开。 */
body[data-page="login"] { min-width: 0; overflow-y: auto; }
body[data-page="login"] .auth { padding: 24px 16px; }
body[data-page="login"] .auth-card { width: min(340px, 100%); }
.brand-mark { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: var(--btn-primary); border: 1px solid var(--container-border); box-shadow: var(--shadow-sm); margin-bottom: 6px; }
.brand-mark svg { width: 22px; height: 22px; color: var(--text); }
.auth-brand h1 { font: 600 30px/34px var(--font); letter-spacing: -0.04em; }
.auth-brand p { margin: 0; color: var(--text-2); font: 500 14px/20px var(--font); }
.form { display: grid; gap: 12px; width: 100%; justify-items: center; }
.form .field { width: 100%; }
.form-row { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.form-row a { color: var(--text-2); font: 400 13px/20px var(--font); text-decoration: none; }
.form-row a:hover { color: var(--text); text-decoration: underline; }
.auth-or { font: 500 14px/20px var(--font); color: var(--text); letter-spacing: .02em; }
.auth-note { margin: 0; text-align: center; color: var(--text-2); font: 400 13px/20px var(--font); }
.auth-foot { width: 100%; display: flex; justify-content: space-between; align-items: center; color: var(--muted-2); font: 400 12px/16px var(--font); padding-top: 4px; }
.auth-foot .hint { color: inherit; }

/* ---------- 列表页顶栏（Navigation Menu） ---------- */

.nav {
  position: relative; z-index: 20; flex: none; margin: 10px auto 0; width: calc(100% - 24px); max-width: 1456px; padding: 6px; box-sizing: border-box; height: 44px;
  display: grid; grid-template-columns: max-content minmax(0, 1fr) max-content; align-items: center; gap: 12px;
  border: 1px solid var(--container-border); border-radius: 99px; background: var(--container);
  -webkit-backdrop-filter: blur(var(--blur-sm)); backdrop-filter: blur(var(--blur-sm)); box-shadow: var(--shadow-sm);
}
.nav-left, .nav-right { display: flex; align-items: center; gap: 2px; }
.nav-left { padding-left: 2px; }
.nav-logo { display: flex; align-items: center; gap: 6px; padding: 0 10px 0 4px; }
.nav-logo .mark { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; background: var(--btn-primary); border: 1px solid var(--container-border); }
.nav-logo .mark svg { width: 14px; height: 14px; }
.nav-logo b { font: 700 18px/24px var(--font); letter-spacing: -0.05em; }
.nav-center { display: flex; justify-content: center; min-width: 0; }
.nav-center .search { width: 340px; max-width: 100%; height: 30px; }
.nav-right { gap: 6px; padding-right: 2px; }
.nav-right .nav-toggle { padding: 0 12px; color: var(--text-2); }
.user-chip { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px 0 4px; border: 1px solid var(--container-border); border-radius: 99px; background: var(--btn-secondary); box-shadow: var(--shadow-sm); font: 500 13px/20px var(--font); color: var(--text); cursor: pointer; }
.user-chip:hover { background: var(--btn-primary); }
.nav-right .nav-toggle:hover { color: var(--text); }

/* ---------- 列表页主体 ---------- */

/* 页面过宽时不再无限拉长：内容最宽 1480，居中 */
.ws-main { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 12px; display: grid; gap: 12px; align-content: start; }
.ws-main > * { width: 100%; max-width: 1456px; margin: 0 auto; box-sizing: border-box; }

/* 汇总卡（List Card）：圆角 8，双层 10 内边距，Logo 44，标题 16/24，分割线，说明 12/18 Medium 次要色，Progress 5/3 */
.sum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.sum .card { border-radius: 8px; padding: 20px; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 10px 20px; align-items: center; }
.sum .logo { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: var(--btn-primary); border: 1px solid var(--container-border); box-shadow: var(--shadow-sm); grid-row: 1 / span 2; color: var(--text); }
.sum .logo svg { width: 20px; height: 20px; }
.sum .t { display: flex; align-items: baseline; gap: 8px; font: 500 16px/24px var(--font); }
.sum .t b { font: 600 26px/28px var(--font); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.sum .t small { color: var(--muted); font: 500 12px/18px var(--font); margin-left: auto; }
.sum .d { display: grid; gap: 8px; }
.sum .d span { color: var(--text-2); font: 500 12px/18px var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prog { height: 5px; box-sizing: border-box; padding: 1px; border-radius: 8px; background: var(--bg-secondary); border: 1px solid var(--divider); }
.prog i { display: block; height: 100%; border-radius: 4px; background: var(--text); }

/* 列表（Notification）：容器 20 内边距、8 间距；标题 14/20 Medium 次要色；行 = Activity */
.nlist { padding: 20px; display: grid; gap: 8px; }
.nlist-head { display: flex; align-items: center; gap: 8px; min-height: 28px; }
.nlist-head h2 { font: 500 14px/20px var(--font); color: var(--text-2); }
.nlist-head .pill { flex: none; }
.nlist-head .seg { flex: none; }
.nlist-head .seg.chips { width: auto; grid-auto-columns: max-content; }
.nlist-head .seg.chips button { padding: 0 10px; font-size: 12px; }
.nlist-head .hint { flex: none; margin-left: auto; }
.nlist-head .btn { flex: none; margin-left: auto; }
.nlist-cols { display: grid; align-items: center; gap: 8px 14px; padding: 0 8px; color: var(--muted); font: 500 11px/16px var(--font); letter-spacing: .04em; text-transform: uppercase; }
.nlist-cols, .act { grid-template-columns: 32px minmax(200px, 1.1fr) minmax(280px, 1.6fr) max-content 120px 28px; }
.nlist-cols span:nth-child(5) { text-align: right; }
.ws-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.act {
  position: relative; display: grid; align-items: center; gap: 8px 14px; padding: 8px; box-sizing: border-box;
  border: 1px solid var(--divider); border-radius: 8px; background: transparent; cursor: pointer;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.act:hover { background: var(--bg-hover); }
.act.is-selected { background: var(--container); border-color: var(--container-border); box-shadow: var(--shadow-sm); -webkit-backdrop-filter: blur(var(--blur-sm)); backdrop-filter: blur(var(--blur-sm)); }
.act .tile { width: 32px; height: 32px; box-sizing: border-box; display: grid; place-items: center; border-radius: 8px; background: var(--btn-primary); border: 1px solid var(--container-border); color: var(--text-2); }
.act .tile svg { width: 16px; height: 16px; }
.act.is-selected .tile { color: var(--menu-accent); }
.act .id { display: grid; min-width: 0; }
.act .name { font: 500 13px/20px var(--font); color: var(--text); display: flex; align-items: center; gap: 6px; min-width: 0; }
.act .name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act .name .tag { font: 500 10.5px/16px var(--mono); color: var(--muted); border: 1px solid var(--divider); border-radius: 5px; padding: 0 5px; background: var(--bg-secondary); flex: none; }
.act .name-link { color: var(--text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act .name-link:hover { color: var(--menu-accent); text-decoration: underline; text-underline-offset: 3px; }
.act .note { font: 400 13px/20px var(--font); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act .note.empty { color: var(--muted); }
.act .note.editable { cursor: text; margin-left: -6px; padding: 0 6px; border-radius: 5px; border: 1px dashed transparent; transition: background .12s, border-color .12s; }
.act .note.editable:hover { background: var(--bg-hover); border-color: var(--divider); color: var(--text); }
.note-input { box-sizing: border-box; width: 100%; height: 22px; margin: -1px 0 -1px -6px; padding: 0 6px; font: 400 13px/20px var(--font); color: var(--text); background: var(--bg-secondary); border: 1px solid var(--menu-accent); border-radius: 5px; outline: 0; box-shadow: 0 0 0 3px var(--accent-ring); }
.act .prog-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.mini { display: grid; gap: 4px; min-width: 0; }
.mini .t { display: flex; justify-content: space-between; font: 400 11px/14px var(--font); color: var(--muted); }
.mini .t b { font: 500 12px/14px var(--font); color: var(--text); font-variant-numeric: tabular-nums; }
.mini .t b.zero { color: var(--muted-2); font-weight: 400; }
.mini .t b i { font-style: normal; color: var(--muted); font-weight: 400; }
.act .flags { display: flex; gap: 4px; flex-wrap: nowrap; }
/* 可勾选状态：玻璃小胶囊 + 12px 勾选框 */
.chk { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px 0 7px; border: 1px solid var(--divider); border-radius: 6px; background: var(--bg-secondary); color: var(--muted); font: 400 12px/18px var(--font); cursor: pointer; white-space: nowrap; transition: background .12s, color .12s, border-color .12s; }
.chk i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted-2); display: block; transition: background .12s, box-shadow .12s; }
.chk i svg { display: none; }
.chk:hover { color: var(--text); border-color: var(--container-border); background: var(--bg-hover); }
.chk.is-on { color: var(--text); background: var(--btn-primary); border-color: var(--container-border); }
.chk.is-on i { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.act .menu { display: grid; place-items: center; }
.circle.is-on, .user-chip.is-on { background: var(--btn-primary); }
/* 弹出菜单（Figma Popover / Inspector Menu 同款）：渲染在 body 级的 fixed 宿主里，
   避免放在带 backdrop-filter 的玻璃容器内被其他玻璃层盖住 */
.pop-host { position: fixed; inset: 0; z-index: 70; pointer-events: none; }
.pop-host:empty { display: none; }
.pop { position: fixed; pointer-events: auto; min-width: 168px; padding: 6px; display: grid; gap: 2px; border-radius: var(--r-container); background: var(--pop-bg); border: 1px solid var(--container-border); box-shadow: var(--shadow-xl); animation: pop-in .12s ease-out; }
:root { --pop-bg: rgba(255, 255, 255, 0.96); }
[data-theme="dark"] { --pop-bg: rgba(26, 28, 34, 0.97); }
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px); } }
/* 按钮和菜单之间留一条看不见的桥，鼠标走过去不会断 */
.pop::before { content: ""; position: absolute; left: 0; right: 0; top: -8px; height: 8px; }
.pop button { height: 30px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; text-align: left; font: 500 13px/20px var(--font); color: var(--text); cursor: pointer; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.pop button svg { width: 14px; height: 14px; color: var(--text-2); }
.pop button:hover { background: var(--bg-hover); }
.pop button.danger { color: var(--bad); }
.pop button.danger svg { color: var(--bad); }
.act .time { font: 400 12px/18px var(--font); color: var(--text-2); text-align: right; white-space: nowrap; }
.act .time small { display: block; color: var(--muted); }
.ws-empty { padding: 32px; text-align: center; color: var(--muted); font: 400 13px/20px var(--font); }
.nlist-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--text-2); font: 400 13px/20px var(--font); }
.nlist-foot .hint { color: var(--muted); }

/* 新建工作区对话框（Payment Modal 同款） */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.22); z-index: 60; }
.modal { position: fixed; left: 50%; top: 46%; transform: translate(-50%, -50%); width: 360px; box-sizing: border-box; padding: 24px; z-index: 61; display: grid; justify-items: center; gap: 12px; box-shadow: var(--shadow-strong); }
.modal h2 { width: 100%; font: 500 14px/20px var(--font); color: var(--text-2); display: flex; align-items: center; }
.modal h2 .spacer { flex: 1; }
.modal .field { width: 100%; }
.modal .path { width: 100%; font: 400 12px/18px var(--mono); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }
.modal .acts { display: flex; align-items: center; gap: 8px; padding-top: 4px; }

@media (max-width: 1500px) {
  .nlist-cols, .act { grid-template-columns: 32px minmax(180px, 1fr) minmax(260px, 1.5fr) max-content 110px 28px; }
}
@media (max-width: 1280px) {
  .nav-center .search { width: 260px; }
  .nlist-cols, .act { grid-template-columns: 32px minmax(150px, 1fr) minmax(220px, 1.4fr) max-content 100px 28px; gap: 8px 10px; }
}
