/* JPCRM 全站统一主题 + 移动端适配 — 待办 / 客户 / 登录 / 首页 */
@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;1,500&display=swap");

:root {
  --bg: #0c0f14;
  --surface: rgba(22, 28, 38, 0.72);
  --surface2: rgba(30, 38, 52, 0.9);
  --border: rgba(148, 163, 184, 0.12);
  --text: #e8edf5;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent2: #a78bfa;
  --success: #34d399;
  --warn: #fbbf24;
  --radius: 14px;
  --shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
  --nav-h: 3.25rem;
  --tap-min: 44px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  background: radial-gradient(1200px 800px at 10% -10%, rgba(56, 189, 248, 0.15), transparent 50%),
    radial-gradient(900px 600px at 100% 0%, rgba(167, 139, 250, 0.12), transparent 45%),
    var(--bg);
  color: var(--text);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

/* ---------- 主导航 ---------- */
.app-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  padding: 0.65rem max(1rem, env(safe-area-inset-left)) 0.65rem max(1rem, env(safe-area-inset-right));
  padding-top: max(0.65rem, env(safe-area-inset-top));
  border-bottom: 1px solid var(--border);
  background: rgba(15, 18, 24, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 200;
}

.app-nav-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  line-height: 0;
  margin-right: 0.15rem;
}

.app-nav-brand img {
  display: block;
  width: 96px;
  height: auto;
  max-width: 24vw;
}

.app-nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  justify-content: flex-end;
  flex: 1;
  min-width: min(100%, 12rem);
}

.app-nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 600;
  padding: 0.5rem 0.75rem;
  min-height: var(--tap-min);
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  border: 1px solid transparent;
}

.app-nav-links a:hover {
  color: var(--text);
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.2);
  text-decoration: none;
}

.app-nav-links a.nav-active {
  color: #042f2e;
  background: linear-gradient(135deg, var(--accent), #0ea5e9);
  border-color: transparent;
}

/* 主导航：小屏右侧三横线展开链接（纯 CSS checkbox，无 JS） */
.app-nav-cb {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  padding: 0.45rem 0.55rem;
  min-width: var(--tap-min);
  min-height: var(--tap-min);
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
}

.app-nav-toggle:hover {
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(56, 189, 248, 0.1);
}

@media (max-width: 900px) {
  .app-nav {
    flex-wrap: wrap;
    align-items: center;
  }

  .app-nav-toggle {
    display: inline-flex;
  }

  .app-nav-links {
    display: none;
    flex: 1 1 100%;
    width: 100%;
    order: 3;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0.2rem;
    padding-top: 0.65rem;
    margin-top: 0.5rem;
    border-top: 1px solid var(--border);
    min-width: 0;
  }

  .app-nav-links a {
    width: 100%;
    justify-content: flex-start;
    border-radius: 10px;
  }

  .app-nav-cb:checked ~ .app-nav-links {
    display: flex;
  }
}

@media (min-width: 901px) {
  .app-nav-toggle {
    display: none !important;
  }

  .app-nav-links {
    display: flex !important;
    flex-direction: row;
    flex-wrap: wrap;
    border-top: none;
    padding-top: 0;
    margin-top: 0;
    order: unset;
  }
}

/* ---------- 待办列表 layout ---------- */
.layout {
  display: flex;
  min-height: calc(100dvh - var(--nav-h));
}

aside {
  width: min(100%, 420px);
  min-width: min(100%, 280px);
  flex-shrink: 0;
  padding: 1.25rem 1.15rem 1.5rem;
  border-right: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  overflow-x: hidden;
}

main {
  flex: 1;
  padding: 1.25rem clamp(0.85rem, 3vw, 1.75rem) 2.5rem;
  overflow-x: auto;
  min-width: 0;
}

h1 {
  font-size: clamp(1.15rem, 4vw, 1.35rem);
  font-weight: 700;
  margin: 0 0 0.25rem;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1rem, 3.5vw, 1.12rem);
  font-weight: 700;
  margin: 0 0 0.75rem;
  letter-spacing: -0.02em;
}

.sub {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
}

label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0.85rem 0 0.35rem;
}

select,
input[type="text"],
input[type="email"],
input[type="date"],
input[type="password"],
textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 0.55rem 0.65rem;
  min-height: var(--tap-min);
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
}

@media (min-width: 768px) {
  select,
  input[type="text"],
  input[type="email"],
  input[type="date"],
  input[type="password"],
  textarea {
    font-size: 0.88rem;
    min-height: 0;
  }
}

input[type="date"] {
  display: block;
}

select:focus,
input:focus,
textarea:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.12);
}

.wrap--form textarea,
.card textarea {
  min-height: 7.5rem;
  resize: vertical;
}

.row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

aside .row2.date-row {
  grid-template-columns: 1fr;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  min-height: var(--tap-min);
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  text-decoration: none;
  transition: transform 0.12s, box-shadow 0.12s, filter 0.12s;
}

.btn:active {
  transform: scale(0.98);
}

.btn[aria-busy="true"],
.btn.is-pending {
  cursor: wait;
  opacity: 0.88;
}

.btn-primary,
a.btn:not(.secondary):not(.btn-ghost):not(.btn-danger):not(.btn-accent),
button.btn:not(.secondary):not(.btn-ghost):not(.btn-danger):not(.btn-accent) {
  background: linear-gradient(135deg, var(--accent), #0ea5e9);
  color: #042f2e;
  box-shadow: 0 8px 24px rgba(14, 165, 233, 0.25);
}

.btn-primary:hover,
a.btn:not(.secondary):hover {
  filter: brightness(1.05);
  text-decoration: none;
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  box-shadow: none;
}

.btn-ghost:hover {
  color: var(--text);
  background: rgba(56, 189, 248, 0.08);
  text-decoration: none;
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent2), #7c3aed);
  color: #fff;
}

.btn-danger {
  background: rgba(248, 113, 113, 0.15);
  color: #fecaca;
  border: 1px solid rgba(248, 113, 113, 0.35);
}

.btn.secondary {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  box-shadow: none;
}

.btn.secondary:hover {
  color: var(--text);
  background: rgba(56, 189, 248, 0.08);
  text-decoration: none;
}

.btn-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.topbar-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
  max-width: min(100%, 22rem);
}

.topbar-actions .btn-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

@media (max-width: 640px) {
  .topbar-actions {
    max-width: none;
    width: 100%;
  }
  .topbar-actions .btn-row {
    justify-content: flex-start;
  }
}

/* ---------- 卡片 / 列表 ---------- */
.cards {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.card {
  background: var(--surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

/* ---------- 表单页细节统一收口 ---------- */
.wrap--form .card {
  padding: 1.05rem 1.15rem 1.15rem;
}

/* 合同编辑/新建：付款表更容易横向完整展示 */
.wrap--form .jp-table-shell {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.wrap--form .jp-table-shell table {
  min-width: 38rem;
}

/* 合同页付款表：优先在当前视口内完整展示，减少横向拖动 */
.wrap--form .jp-contract-payment-shell {
  overflow-x: auto;
}

.wrap--form .jp-contract-payment-table {
  min-width: 0;
  width: 100%;
  table-layout: fixed;
}

.wrap--form .jp-contract-payment-table th,
.wrap--form .jp-contract-payment-table td {
  padding: 0.38rem 0.3rem;
}

.wrap--form .jp-contract-payment-table input {
  min-width: 0 !important;
  width: 100% !important;
  padding: 0.42rem 0.5rem;
}

.wrap--form .jp-contract-payment-table input[type="date"] {
  min-width: 0 !important;
}

.wrap--form .topbar {
  margin-bottom: 0.85rem;
}

.wrap--form .topbar h2 {
  font-size: clamp(1.06rem, 3.3vw, 1.18rem);
  line-height: 1.25;
}

.wrap--form .sub {
  margin: 0.1rem 0 0.95rem;
}

.wrap--form .jp-form-grid-2 {
  gap: 0.85rem 1rem;
}

.wrap--form .field {
  margin-bottom: 0.7rem;
}

.wrap--form label {
  margin: 0.52rem 0 0.32rem;
  font-size: 0.76rem;
  letter-spacing: 0.02em;
  text-transform: none;
  color: #aeb9cb;
}

.wrap--form select,
.wrap--form input[type="text"],
.wrap--form input[type="email"],
.wrap--form input[type="date"],
.wrap--form input[type="password"],
.wrap--form textarea {
  border-radius: 9px;
  padding: 0.52rem 0.65rem;
}

.wrap--form .btn-bar {
  margin-top: 1rem;
  justify-content: flex-end;
}

@media (max-width: 640px) {
  .wrap--form .btn-bar {
    justify-content: flex-start;
  }
}

.card-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.card-title {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.45;
  max-width: 100%;
}

.badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.meta {
  font-size: 0.8rem;
  color: var(--muted);
  display: grid;
  gap: 0.25rem;
}

.meta strong {
  color: var(--text);
  font-weight: 500;
}

.sortable {
  cursor: pointer;
  user-select: none;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.jp-pager {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.jp-pager span {
  color: var(--muted);
  font-size: 0.85rem;
}

.err-toast {
  display: none;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #fecaca;
  font-size: 0.88rem;
}

.err-toast.show {
  display: block;
}

/* ---------- Combobox ---------- */
.combobox-wrap {
  position: relative;
  width: 100%;
}

.combobox-wrap input {
  width: 100%;
}

.combobox-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  margin: 0;
  padding: 0.25rem 0;
  list-style: none;
  max-height: min(240px, 40vh);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  z-index: 80;
  box-shadow: var(--shadow);
}

.combobox-list[hidden] {
  display: none !important;
}

.combobox-list li {
  padding: 0.45rem 0.7rem;
  font-size: 0.84rem;
  cursor: pointer;
  color: var(--text);
  word-break: break-word;
  min-height: var(--tap-min);
  display: flex;
  align-items: center;
}

.combobox-list li:hover,
.combobox-list li[aria-selected="true"] {
  background: rgba(56, 189, 248, 0.14);
}

.combobox-list li.combobox-hint,
.combobox-list li.ms-hint {
  color: var(--muted);
  cursor: default;
  font-size: 0.78rem;
}

.combobox-list li.combobox-hint:hover,
.combobox-list li.ms-hint:hover {
  background: transparent;
}

/* ---------- 多选 ms-*（待办表单） ---------- */
.ms {
  position: relative;
  z-index: 40;
}

.ms-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.45rem;
  min-height: 0;
}

.ms-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.5rem;
  border-radius: 8px;
  font-size: 0.8rem;
  background: rgba(56, 189, 248, 0.18);
  color: var(--text);
  border: 1px solid rgba(56, 189, 248, 0.28);
}

.ms-chip button {
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0 0.15rem;
  line-height: 1;
  font-size: 1rem;
  min-width: var(--tap-min);
  min-height: var(--tap-min);
}

.ms-chip button:hover {
  color: #fecaca;
}

.ms-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.65rem;
  min-height: var(--tap-min);
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
}

.ms-trigger:hover {
  border-color: rgba(56, 189, 248, 0.35);
}

.ms-trigger:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.45);
}

.ms-trigger-text {
  flex: 1;
  color: var(--muted);
}

.ms-trigger-text.has-val {
  color: var(--text);
}

.ms-chev {
  color: var(--muted);
  font-size: 0.75rem;
}

.ms-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  background: rgba(30, 38, 52, 0.98);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  max-height: min(280px, 45vh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ms-panel[hidden] {
  display: none !important;
}

.ms-search {
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  margin: 0;
}

.ms-list {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  max-height: 220px;
  padding: 0.35rem 0;
}

.ms-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  font-size: 0.86rem;
  min-height: var(--tap-min);
}

.ms-item:hover {
  background: rgba(56, 189, 248, 0.1);
}

.ms-item input {
  width: auto;
  margin: 0;
  accent-color: var(--accent);
  min-height: auto;
}

.ms-item.hidden {
  display: none;
}

.readonly {
  opacity: 0.85;
}

/* ---------- 客户模块 .wrap ---------- */
.wrap {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 1.25rem clamp(0.85rem, 3vw, 1.75rem) 2.5rem;
  box-sizing: border-box;
}

.wrap--form {
  max-width: 56rem;
  margin: 0 auto;
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
}

.wrap--contract-form {
  max-width: 80rem;
}

.wrap--account-create {
  max-width: 88rem;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-start;
}

.muted {
  color: var(--muted);
  font-size: 0.88rem;
}

.field {
  margin-bottom: 0.85rem;
}

.jp-form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

@media (max-width: 900px) {
  .jp-form-grid-2 {
    grid-template-columns: 1fr;
  }
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th,
td {
  text-align: left;
  padding: 0.55rem 0.5rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: none;
  letter-spacing: 0.01em;
}

/* 待办主区底部分页按钮 */
main .pager {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

main .pager span {
  color: var(--muted);
  font-size: 0.85rem;
}

/* 客户列表文字分页 */
.wrap .pager {
  margin-top: 1rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.pager a {
  color: var(--accent);
  margin-right: 0.35rem;
  font-weight: 600;
  text-decoration: none;
  padding: 0.35rem 0.5rem;
  min-height: var(--tap-min);
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
}

.pager a:hover {
  background: rgba(56, 189, 248, 0.12);
  text-decoration: none;
}

.pager strong {
  color: var(--text);
}

.jp-account-list-layout {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 1rem;
  width: 100%;
}

.jp-account-list-layout > .jp-filter-panel {
  flex: 0 0 min(100%, 380px);
  min-width: min(100%, 280px);
  max-width: 420px;
}

.jp-account-list-layout > .jp-main-panel {
  flex: 1;
  min-width: min(100%, 280px);
}

/* 小屏：横线按钮展开筛选（与 jpcrm-list-filter-drawer.js 配套） */
.jp-filter-drawer-bar {
  display: none;
}

.jp-filter-drawer-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  padding: 0.5rem 0.75rem;
  min-height: var(--tap-min);
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.jp-filter-drawer-btn:hover {
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(56, 189, 248, 0.08);
}

.jp-filter-drawer-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.jp-hamburger {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 1.15rem;
  flex-shrink: 0;
}

.jp-hamburger > span {
  display: block;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
}

/* 主导航内三横线（覆盖下方通用 .jp-hamburger 宽度） */
.app-nav .jp-hamburger.jp-hamburger--nav {
  width: 1.2rem;
  gap: 5px;
}

.jp-filter-drawer-label {
  letter-spacing: 0.02em;
}

.jp-account-main-topbar {
  margin-bottom: 0.75rem;
}

.wrap.wrap--fullbleed {
  padding-left: 0;
  padding-right: 0;
}

.wrap.wrap--fullbleed .jp-account-list-layout {
  gap: 0;
  min-height: calc(100dvh - var(--nav-h));
}

.wrap.wrap--fullbleed .jp-account-list-layout > .jp-filter-panel {
  max-width: min(100%, 420px);
  border-radius: 0;
  margin-bottom: 0;
  border-right: 1px solid var(--border);
  border-bottom: none;
  padding: 1.25rem 1.15rem 1.5rem;
  align-self: stretch;
}

.wrap.wrap--fullbleed .jp-account-list-layout > .jp-main-panel {
  border-radius: 0;
  margin-bottom: 0;
  border: none;
  box-shadow: none;
  background: transparent;
  padding: 1.25rem clamp(0.75rem, 2.5vw, 1.75rem) 2rem 1rem;
  flex: 1;
  min-width: 0;
}

.wrap.wrap--fullbleed .jp-table-shell {
  background: var(--surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.wrap.wrap--fullbleed .jp-table-shell table {
  margin-bottom: 0;
  min-width: 280px;
}

.wrap.wrap--fullbleed .jp-table-shell th:first-child,
.wrap.wrap--fullbleed .jp-table-shell td:first-child {
  padding-left: 1rem;
}

.wrap.wrap--fullbleed .jp-table-shell th:last-child,
.wrap.wrap--fullbleed .jp-table-shell td:last-child {
  padding-right: 1rem;
}

.jp-main-panel .jp-table-shell td a,
.jp-main-panel .jp-table-shell td a:visited,
.jp-main-panel .jp-table-shell td a:hover,
.jp-main-panel .jp-table-shell td a:active,
.jp-main-panel .jp-table-shell td a:focus {
  color: var(--text);
  text-decoration: none;
}

/* ---------- 项目列表：小屏卡片式（试验；断点可与 .jp-account-list-layout 窄屏一致调整） ---------- */
@media (max-width: 840px) {
  .wrap.wrap--fullbleed .jp-project-table-wrap {
    background: transparent;
    border: none;
    box-shadow: none;
    overflow-x: visible;
  }

  .jp-project-index-table {
    min-width: 0 !important;
  }

  .jp-project-index-table thead {
    display: none;
  }

  .jp-project-index-table tbody tr {
    display: block;
    margin-bottom: 0.85rem;
    padding: 0.95rem 1rem 0.9rem;
    background: linear-gradient(180deg, rgba(30, 38, 52, 0.9), rgba(22, 28, 38, 0.78));
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-left: 3px solid rgba(56, 189, 248, 0.55);
    border-radius: 12px;
    box-shadow: var(--shadow);
  }

  .jp-project-index-table tbody tr:last-child {
    margin-bottom: 0;
  }

  .jp-project-index-table tr.jp-project-list-empty {
    padding: 1.25rem 1rem;
    text-align: center;
  }

  .jp-project-index-table tr.jp-project-list-empty td {
    display: block;
    border: none;
    padding: 0;
    text-align: center;
  }

  .jp-project-index-table tr.jp-project-list-empty td::before {
    content: none;
  }

  .jp-project-index-table tbody tr:not(.jp-project-list-empty) td {
    display: grid;
    grid-template-columns: minmax(5.1rem, 34%) 1fr;
    gap: 0.1rem 0.6rem;
    align-items: start;
    padding: 0.34rem 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  }

  .jp-project-index-table tbody tr:not(.jp-project-list-empty) td:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
  }

  .jp-project-index-table tbody tr:not(.jp-project-list-empty) td:first-child {
    padding-top: 0;
  }

  .jp-project-index-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-weight: 700;
    font-size: 0.74rem;
    line-height: 1.35;
    letter-spacing: 0.02em;
    text-transform: uppercase;
  }

  .jp-project-index-table td.jp-project-card-title {
    grid-template-columns: 1fr;
    gap: 0.2rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    padding-bottom: 0.55rem;
    margin-bottom: 0.2rem;
  }

  .jp-project-index-table td.jp-project-card-title::before {
    font-size: 0.75rem;
  }

  .jp-project-index-table td.jp-project-card-title a {
    font-size: 1.1rem;
    font-weight: 700;
    color: #f4f8ff;
  }

  .jp-project-index-table tbody tr:not(.jp-project-list-empty):active {
    transform: scale(0.995);
  }

  .wrap.wrap--fullbleed .jp-project-table-wrap td:first-child,
  .wrap.wrap--fullbleed .jp-project-table-wrap td:last-child {
    padding-left: 0;
    padding-right: 0;
  }

  .jp-mobile-card-table {
    min-width: 0 !important;
  }

  .jp-mobile-card-table thead {
    display: none;
  }

  .jp-mobile-card-table tbody tr {
    display: block;
    margin-bottom: 0.85rem;
    padding: 0.95rem 1rem 0.9rem;
    background: linear-gradient(180deg, rgba(30, 38, 52, 0.9), rgba(22, 28, 38, 0.78));
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-left: 3px solid rgba(56, 189, 248, 0.55);
    border-radius: 12px;
    box-shadow: var(--shadow);
  }

  .jp-mobile-card-table tbody tr:last-child {
    margin-bottom: 0;
  }

  .jp-mobile-card-table tr.jp-mobile-card-empty {
    padding: 1.25rem 1rem;
    text-align: center;
  }

  .jp-mobile-card-table tr.jp-mobile-card-empty td {
    display: block;
    border: none;
    padding: 0;
    text-align: center;
  }

  .jp-mobile-card-table tr.jp-mobile-card-empty td::before {
    content: none;
  }

  /* 全宽布局里 shell 给「首列/末列」加了左右 padding；卡片模式下每 tr 只有一列竖排 td，首格会单独多出 1rem，与其它行错位 */
  .wrap.wrap--fullbleed .jp-table-shell .jp-mobile-card-table td:first-child,
  .wrap.wrap--fullbleed .jp-table-shell .jp-mobile-card-table td:last-child {
    padding-left: 0;
    padding-right: 0;
  }

  /*
   * 小屏卡片：每行 td 用 flex（标签 ::before + 值）。比 grid 更稳：纯文本与单个 <a>
   * 都是「标签后的若干 flex 子项」，避免匿名 grid 项列错位/看起来像居中。
   * jp-ellipsis-span300 在桌面用于限宽省略；在卡片里会压窄整格，在此重置为换行。
   */
  .jp-mobile-card-table td.jp-ellipsis-span300,
  .jp-mobile-card-table td.jp-ellipsis-abbr {
    max-width: none !important;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  .jp-mobile-card-table tbody tr:not(.jp-mobile-card-empty) td {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0 0.65rem;
    text-align: left;
    min-width: 0;
    overflow-wrap: break-word;
    word-break: break-word;
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  }

  .jp-mobile-card-table tbody tr:not(.jp-mobile-card-empty) td:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
  }

  .jp-mobile-card-table tbody tr:not(.jp-mobile-card-empty) td:first-child {
    padding-top: 0;
  }

  .jp-mobile-card-table td::before {
    content: attr(data-label);
    flex: 0 0 5.85rem;
    width: 5.85rem;
    min-width: 5.85rem;
    box-sizing: border-box;
    padding-right: 0.15rem;
    color: var(--muted);
    font-weight: 700;
    font-size: 0.74rem;
    line-height: 1.35;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    text-align: left;
    word-break: break-word;
  }

  .jp-mobile-card-table tbody tr:not(.jp-mobile-card-empty) td > * {
    flex: 1 1 auto;
    min-width: 0;
    text-align: left;
    align-self: flex-start;
  }

  .jp-mobile-card-table tbody tr:not(.jp-mobile-card-empty) td > input[type="checkbox"] {
    flex: 0 0 auto;
    min-width: auto;
  }

  .jp-mobile-card-table td.jp-mobile-card-title {
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
    padding-bottom: 0.5rem;
    margin-bottom: 0.05rem;
  }

  .jp-mobile-card-table td.jp-mobile-card-title::before {
    font-size: 0.75rem;
  }

  .jp-mobile-card-table td.jp-mobile-card-title a {
    font-size: 1.05rem;
    font-weight: 700;
    color: #f4f8ff;
    text-decoration: none;
    text-align: left;
  }

  .jp-mobile-card-table tbody tr:not(.jp-mobile-card-empty):active {
    transform: scale(0.995);
  }
}

/* ---------- 客户详情：折叠块 ---------- */
.jp-detail-collapse .jp-detail-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.jp-collapse-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0.35rem 0.5rem 0.35rem 0;
  min-height: var(--tap-min);
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  font-size: clamp(1rem, 3.5vw, 1.12rem);
  cursor: pointer;
  text-align: left;
  flex: 1;
  min-width: min(100%, 12rem);
}

.jp-collapse-toggle:hover {
  color: var(--accent);
}

.jp-collapse-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.jp-collapse-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1;
  flex-shrink: 0;
}

.jp-collapse-title {
  letter-spacing: -0.02em;
}

.jp-collapse-panel {
  margin-top: 1rem;
  padding-top: 0.25rem;
}

.jp-collapse-panel[hidden] {
  display: none !important;
}

/* 项目详情：每行四列 = 两组「标签 | 值」，降低纵向高度 */
.jp-proj-info-kv.jp-proj-info-kv--quad {
  margin: 0;
  width: 100%;
  table-layout: auto;
}

.jp-proj-info-kv--quad th {
  width: 1%;
  white-space: nowrap;
  vertical-align: top;
}

.jp-proj-info-kv--quad td {
  vertical-align: top;
  word-break: break-word;
}

/* 左侧一对与右侧一对之间的空隙 */
.jp-proj-info-kv--quad td:nth-child(2) {
  padding-right: 1.25rem;
}

@media (max-width: 720px) {
  .jp-proj-info-kv--quad tr {
    display: grid;
    grid-template-columns: minmax(4.75rem, auto) 1fr;
    width: 100%;
  }

  .jp-proj-info-kv--quad th,
  .jp-proj-info-kv--quad td {
    width: auto;
  }

  .jp-proj-info-kv--quad td:nth-child(2) {
    padding-right: 0.5rem;
  }
}

.jp-detail-section-meta {
  margin: 0 0 0.65rem;
  font-size: 0.85rem;
}

.jp-detail-pager {
  margin-top: 1rem;
}

/* 客户详情：与 VB Details.vbhtml 一致的表头风格（适配深色主题） */
.jp-detail-vb-table th {
  color: var(--muted);
  background: rgba(148, 163, 184, 0.1);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: none;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.jp-proj-vb-table th {
  color: #b8c2d3;
  background: rgba(148, 163, 184, 0.14);
  font-weight: 700;
  font-size: 0.94rem;
  text-transform: none;
  letter-spacing: 0;
  white-space: nowrap;
}

.jp-proj-vb-table td {
  font-size: 0.9rem;
  line-height: 1.45;
}

/* 待办列表：整行点击进入编辑 */
.jp-proj-vb-table tbody tr.jp-todo-row {
  cursor: pointer;
}

.jp-proj-vb-table tbody tr.jp-todo-row:hover td {
  background: rgba(56, 189, 248, 0.07);
}

.jp-proj-vb-table tbody tr.jp-todo-row:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.jp-profit-table {
  width: auto;
  max-width: 32rem;
  min-width: 18rem;
}

.jp-profit-table th {
  color: #b8c2d3;
  font-size: 0.95rem;
  font-weight: 700;
}

.jp-profit-table td {
  font-size: 0.92rem;
}

.jp-home-grid .jp-home-card {
  margin-bottom: 0;
  max-height: 24rem;
  display: flex;
  flex-direction: column;
}

.jp-home-grid .jp-home-card .jp-table-shell {
  flex: 1;
  overflow: auto;
}

.jp-detail-table-wrap {
  margin-top: 0.75rem;
}

.jp-vb-cell-link {
  color: var(--text);
  text-decoration: none;
}

.jp-vb-cell-link:hover {
  color: var(--accent);
  text-decoration: none;
}

.jp-ellipsis-span300 {
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: top;
}

.jp-ellipsis-abbr {
  max-width: 10rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: top;
}

.wrap:not(.wrap--fullbleed) .jp-table-shell {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.wrap:not(.wrap--fullbleed) .jp-table-shell table {
  margin-bottom: 0;
  min-width: 280px;
}

/* ---------- 登录 / 首页 ---------- */
.auth-page,
.home-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.auth-page {
  background-image: url("/static/img/backgrounds/vb-login-bg.jpg");
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}

.auth-body,
.home-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem max(1rem, env(safe-area-inset-left)) 2rem max(1rem, env(safe-area-inset-right));
}

.auth-card {
  width: 100%;
  max-width: 26rem;
  background: var(--surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(1.25rem, 5vw, 2rem);
  box-shadow: var(--shadow);
}

.auth-card h1 {
  margin-bottom: 1.25rem;
}

.auth-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 0.85rem;
}

.auth-brand-link {
  display: inline-flex;
  line-height: 0;
  text-decoration: none;
}

.auth-brand-link:focus-visible {
  outline: 2px solid rgba(56, 189, 248, 0.75);
  outline-offset: 4px;
  border-radius: 8px;
}

.auth-logo-small {
  width: min(170px, 55vw);
  height: auto;
}

.auth-card label {
  margin-top: 0;
  margin-bottom: 0.35rem;
  text-transform: none;
  font-size: 0.85rem;
  letter-spacing: 0;
  color: #555;
}

.auth-card .field {
  margin-bottom: 1rem;
}

.auth-card button[type="submit"] {
  width: 100%;
  margin-top: 0.25rem;
}


.btn-feishu {
  display: block;
  width: 100%;
  padding: 0.7rem 1rem;
  min-height: var(--tap-min);
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  background: linear-gradient(135deg, #2dd4bf, #14b8a6);
  color: #042f2e;
  margin-top: 0.75rem;
  border: none;
  cursor: pointer;
}

.btn-feishu:hover {
  filter: brightness(1.06);
  text-decoration: none;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.8rem;
  margin: 1.25rem 0;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.err {
  color: #fecaca;
  font-size: 0.9rem;
  margin: 0 0 1rem;
  padding: 0.5rem 0.65rem;
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.35);
  border-radius: 10px;
}

.wrap--form .err {
  margin: 0.1rem 0 0.85rem;
}

.hint {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 1.25rem;
  line-height: 1.5;
}

.hint code,
.auth-card code {
  font-size: 0.8rem;
  background: rgba(56, 189, 248, 0.1);
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  color: var(--text);
}

.home-card {
  width: 100%;
  max-width: 40rem;
  background: var(--surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(1.25rem, 5vw, 2rem);
  box-shadow: var(--shadow);
}

.home-card ul {
  line-height: 2;
  padding-left: 1.2rem;
  margin: 0;
}

.home-card a {
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.home-card a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- 响应式：待办侧栏 ---------- */
@media (min-width: 960px) {
  .cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    align-items: start;
  }
}

@media (max-width: 840px) {
  .layout {
    flex-direction: column;
  }

  aside {
    width: 100%;
    min-width: 0;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .wrap.wrap--fullbleed .jp-account-list-layout > .jp-filter-panel {
    max-width: none;
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    min-height: 0;
    padding: 0.7rem clamp(0.65rem, 3vw, 1rem) 0.85rem;
  }

  /* 与主区并排/上下堆叠的列表页：窄屏下压缩左侧（上方）筛选区 */
  .wrap.wrap--fullbleed .jp-account-list-layout > .jp-filter-panel h2 {
    font-size: clamp(0.92rem, 3.6vw, 1.05rem);
    margin: 0 0 0.45rem;
    letter-spacing: -0.02em;
  }

  .wrap.wrap--fullbleed .jp-account-list-layout > .jp-filter-panel .field {
    margin-bottom: 0.4rem;
  }

  .wrap.wrap--fullbleed .jp-account-list-layout > .jp-filter-panel label {
    margin: 0.32rem 0 0.2rem;
    font-size: 0.66rem;
    letter-spacing: 0.05em;
  }

  .wrap.wrap--fullbleed .jp-account-list-layout > .jp-filter-panel select,
  .wrap.wrap--fullbleed .jp-account-list-layout > .jp-filter-panel input[type="text"] {
    padding: 0.4rem 0.55rem;
    border-radius: 8px;
  }

  .wrap.wrap--fullbleed .jp-account-list-layout > .jp-filter-panel .jp-filter-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    margin-top: 0.35rem;
  }

  .wrap.wrap--fullbleed .jp-account-list-layout > .jp-filter-panel .jp-filter-actions .btn {
    padding: 0.48rem 0.9rem;
    font-size: 0.82rem;
  }

  .wrap.wrap--fullbleed .jp-account-list-layout > .jp-main-panel {
    padding: 1rem clamp(0.75rem, 3vw, 1.25rem) 2rem;
  }

  .wrap.wrap--fullbleed .jp-account-list-layout > .jp-filter-drawer-bar {
    display: flex;
    align-items: center;
    flex: 0 0 100%;
    width: 100%;
    padding: 0 0 0.55rem;
    margin: 0;
    box-sizing: border-box;
  }

  .wrap.wrap--fullbleed .jp-account-list-layout > .jp-filter-drawer-target:not(.jp-filter-drawer-open) {
    display: none !important;
  }
}

@media (min-width: 841px) {
  .wrap.wrap--fullbleed .jp-account-list-layout > .jp-filter-drawer-target {
    display: block !important;
  }
}

/* 项目列表：字段较多，中等窄屏下筛选表单单双列排布（仅带修饰类的面板） */
@media (max-width: 840px) and (min-width: 540px) {
  .jp-filter-panel.jp-filter-panel--stack-2col form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 0.65rem;
    align-items: start;
  }

  .jp-filter-panel.jp-filter-panel--stack-2col form > input[type="hidden"] {
    display: none;
  }

  .jp-filter-panel.jp-filter-panel--stack-2col .jp-filter-actions {
    grid-column: 1 / -1;
    margin-top: 0.2rem;
  }
}

/* ---------- 项目详情 · Chatter（备忘 / 待办 / 字段变更） ---------- */
/* 主栏仍为 1fr；仅加宽第二列「动态」宽度。外层右侧无 padding，侧栏背景顶到视口右缘（文案内边距在安全区内）。 */
.wrap.wrap--fullbleed.jp-detail-layout {
  padding-top: 1.25rem;
  padding-bottom: 2.5rem;
  padding-left: clamp(0.85rem, 3vw, 1.75rem);
  padding-right: 0;
}

.jp-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(24rem, 30vw, 40rem);
  column-gap: 1.25rem;
  row-gap: 1.25rem;
  align-items: start;
  justify-items: stretch;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

.jp-detail-main {
  min-width: 0;
  padding-right: 0;
  justify-self: stretch;
}

.jp-detail-chatter {
  position: sticky;
  top: calc(var(--nav-h) + 0.75rem);
  max-height: calc(100dvh - var(--nav-h) - 1.5rem);
  overflow-y: auto;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  margin-right: 0;
  padding: 1rem 1rem 1rem 1rem;
  padding-right: max(1rem, env(safe-area-inset-right, 0px));
  border-radius: var(--radius) 0 0 var(--radius);
  border: 1px solid var(--border);
  border-right: none;
  background: var(--surface2);
  justify-self: stretch;
}

.jp-chatter-head {
  margin-bottom: 0.35rem;
}

.jp-chatter-title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.jp-chatter-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.jp-chatter-quick .jp-chatter-btn {
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
  border: 1px solid transparent;
}

.jp-chatter-quick .jp-chatter-btn--memo {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #ecfdf5;
}

.jp-chatter-quick .jp-chatter-btn--memo:hover {
  filter: brightness(1.08);
  text-decoration: none;
  color: #ecfdf5;
}

.jp-chatter-quick .jp-chatter-btn--todo {
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: #f0f9ff;
}

.jp-chatter-quick .jp-chatter-btn--todo:hover {
  filter: brightness(1.08);
  text-decoration: none;
  color: #f0f9ff;
}

.jp-chatter-hint {
  font-size: 0.78rem;
  margin: 0 0 0.75rem;
  line-height: 1.45;
}

.jp-chatter-alert {
  font-size: 0.85rem;
  margin: 0 0 0.75rem;
  padding: 0.5rem 0.65rem;
  border-radius: 6px;
  background: rgba(220, 53, 69, 0.14);
  color: #f5a8b0;
  line-height: 1.4;
}

.jp-chatter-filter-shell {
  position: relative;
}

/* 隐藏 radio，由 label 触发（筛选纯 CSS，不依赖脚本） */
.jp-chatter-filter-radio {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.jp-chatter-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin: 0 0 0.65rem;
  position: relative;
  z-index: 2;
}

.jp-chatter-filters-label {
  font-size: 0.72rem;
  margin-right: 0.15rem;
}

.jp-chatter-filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.3rem 0.55rem;
  min-height: 2rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
  box-sizing: border-box;
}

.jp-chatter-filter-btn:hover {
  color: var(--text);
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.1);
}

/* 选中态：与对应 radio :checked 联动 */
#jp_chatter_f_all:checked ~ .jp-chatter-filters label[for="jp_chatter_f_all"],
#jp_chatter_f_memo:checked ~ .jp-chatter-filters label[for="jp_chatter_f_memo"],
#jp_chatter_f_todo:checked ~ .jp-chatter-filters label[for="jp_chatter_f_todo"],
#jp_chatter_f_audit:checked ~ .jp-chatter-filters label[for="jp_chatter_f_audit"] {
  color: #042f2e;
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), #0ea5e9);
}

/* radio 与 .jp-chatter-feed 为兄弟，用 :checked ~ 控制显隐 */
#jp_chatter_f_memo:checked ~ .jp-chatter-feed article:not([data-chatter-kind="memo"]) {
  display: none !important;
}

#jp_chatter_f_todo:checked ~ .jp-chatter-feed article:not([data-chatter-kind="todo_open"]):not([data-chatter-kind="todo_closed"]) {
  display: none !important;
}

#jp_chatter_f_audit:checked ~ .jp-chatter-feed article:not([data-chatter-kind="audit"]) {
  display: none !important;
}

.jp-chatter-feed {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.jp-chatter-card {
  padding: 0.75rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border);
}

.jp-chatter-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.jp-chatter-time {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
}

.jp-chatter-pill {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.jp-chatter-pill-todo {
  color: var(--warn);
}

.jp-chatter-pill-done {
  color: var(--success);
}

.jp-chatter-pill-audit {
  color: var(--accent2);
}

.jp-chatter-creator {
  font-size: 0.78rem;
  margin: 0 0 0.35rem;
}

.jp-chatter-text {
  font-size: 0.88rem;
  line-height: 1.45;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.jp-chatter-linked {
  font-size: 0.78rem;
  margin: 0.35rem 0 0;
}

.jp-chatter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.65rem;
  align-items: center;
}

.jp-chatter-action-form {
  display: inline;
  margin: 0;
}

.jp-chatter-audit-text {
  font-size: 0.85rem;
  margin: 0;
  line-height: 1.45;
}

.jp-chatter-val {
  color: var(--text);
  font-weight: 500;
}

.btn-sm {
  font-size: 0.72rem;
  padding: 0.35rem 0.55rem;
  min-height: 2.25rem;
}

@media (max-width: 960px) {
  .wrap.wrap--fullbleed.jp-detail-layout {
    padding-right: clamp(0.85rem, 3vw, 1.75rem);
  }

  .jp-detail-layout {
    grid-template-columns: 1fr;
  }

  .jp-detail-chatter {
    position: static;
    max-height: none;
    border-radius: var(--radius);
    border-right: 1px solid var(--border);
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  .app-nav {
    flex-direction: column;
    align-items: stretch;
  }

  .app-nav-links {
    justify-content: center;
  }

  .app-nav-links a {
    flex: 1 1 auto;
    justify-content: center;
    text-align: center;
    font-size: 0.82rem;
    padding: 0.55rem 0.5rem;
  }
}

/* ---------- API 文档页面 ---------- */
.jp-docs-wrap {
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
}

.jp-docs-card {
  padding: 0.75rem;
}

.jp-docs-topbar {
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.65rem;
}

.jp-docs-iframe {
  width: 100%;
  min-height: calc(100dvh - 10.5rem);
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

/* ---------- 项目详情 · Mark Done 弹窗 ---------- */
body.jp-modal-open {
  overflow: hidden;
}

.jp-modal {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
}

.jp-modal[hidden] {
  display: none !important;
}

.jp-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
}

.jp-modal__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  max-height: min(90dvh, 520px);
  overflow: auto;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.jp-modal__head {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  background: rgba(148, 163, 184, 0.08);
}

.jp-modal__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.jp-modal__form {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.jp-modal__label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.jp-modal__hint {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.4;
}

.jp-modal__textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(12, 15, 20, 0.6);
  color: var(--text);
  font: inherit;
  line-height: 1.45;
}

.jp-modal__textarea::placeholder {
  color: var(--muted);
  opacity: 0.85;
}

.jp-modal__textarea:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.12);
}

.jp-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 0.35rem;
}

.jp-chatter-feedback {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
}

.jp-chatter-feedback .muted {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.75rem;
}

.jp-chatter-feedback-body {
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
  line-height: 1.45;
}

/* ---------- 创建项目：只读编号 + 可筛选下拉 ---------- */
.jp-input-readonly {
  opacity: 0.92;
  cursor: default;
}

.jp-combobox-filter {
  width: 100%;
  margin-bottom: 0.4rem;
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(12, 15, 20, 0.55);
  color: var(--text);
  font: inherit;
}

.jp-combobox-filter:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.45);
}

.jp-filterable-select {
  width: 100%;
  min-height: 7.5rem;
  padding: 0.35rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(12, 15, 20, 0.55);
  color: var(--text);
  font: inherit;
}

.jp-filterable-select option {
  padding: 0.25rem 0.35rem;
}
