/* 共享基础样式（学术/典藏风）。所有页面 <link> 引用，消除各页重复。 */
body { font-family: 'Plus Jakarta Sans', sans-serif; }

/* 侧边导航 */
.sidebar-item { transition: all .2s; }
.sidebar-item:hover { background: rgba(201,165,90,.08); }
.sidebar-item.active { background: rgba(201,165,90,.12); border-right: 2px solid #c9a55a; }
.sidebar-item.active .sidebar-icon { color: #c9a55a; }
.sidebar-item.active .sidebar-text { color: #fff; font-weight: 600; }

/* 列表/卡片 */
.table-row:hover { background: #faf8f5; }
.cr-table { table-layout: fixed; width: 100%; }
.cr-col-check { width: 4%; }
.cr-col-person { width: 16%; }
.cr-col-field { width: 8%; }
.cr-col-time { width: 14%; }
.cr-col-status { width: 10%; }
.cr-col-actions { width: 16%; }
.cr-change, .cr-person { overflow-wrap: anywhere; word-break: break-word; }
.cr-actions { white-space: nowrap; }
.card-stat { transition: transform .2s, box-shadow .2s; }
.card-stat:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.06); }
.badge { padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; }
.tree-node { padding-left: 18px; border-left: 1px solid #e8e4dd; }
.org-row { margin: 1px 0; padding: .4rem .6rem; border-radius: .5rem; transition: background .15s; }
.org-row:hover { background: rgba(201, 165, 90, .14); }

/* 模态 / 抽屉 */
.modal-overlay { opacity: 0; pointer-events: none; transition: opacity .2s; }
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal-card { transform: translateY(16px) scale(.98); transition: transform .2s; }
.modal-overlay.open .modal-card { transform: translateY(0) scale(1); }

/* 动效 */
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn .35s ease both; }
.fade-in-d1 { animation: fadeIn .35s ease .05s both; }
.fade-in-d2 { animation: fadeIn .35s ease .1s both; }
.fade-in-d3 { animation: fadeIn .35s ease .15s both; }
.fade-in-d4 { animation: fadeIn .35s ease .2s both; }

/* Toast */
.toast { transform: translateX(120%); transition: transform .4s cubic-bezier(.22,1,.36,1); }
.toast.show { transform: translateX(0); }

/* Spinner。display 不能压过 .hidden，否则按钮里默认隐藏的加载圈会一直转
   （app.css 后于 tailwind.css 加载，同优先级时后写的规则胜出）。 */
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid rgba(0,0,0,.1); border-left-color: #c9a55a; border-radius: 50%; animation: spin .6s linear infinite; }
.spinner.hidden { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 系统设置里的当前 Logo，避免按原图像素撑开 */
.brand-logo-preview { display: block; max-width: 100px; width: auto; height: auto; object-fit: contain; }

.logo-picker { position: relative; }
.logo-picker-input {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.logo-picker-face {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px; border: 1px dashed #d9d3c7; border-radius: 12px;
  background: #faf8f5; cursor: pointer; transition: border-color .15s, background .15s;
}
.logo-picker-face:hover { border-color: #c9a55a; background: #fff; }
.logo-picker-thumb {
  width: 56px; height: 56px; flex: none; border-radius: 10px;
  background: #fff; border: 1px solid #e8e4dd; color: #a8863d;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.logo-picker-thumb img { width: 100%; height: 100%; object-fit: contain; }
.logo-picker-title { display: block; font-size: 14px; font-weight: 600; color: #1a2536; }
.logo-picker-hint { display: block; margin-top: 2px; font-size: 12px; color: #8a8478; }

/* 表单控件统一观感 */
.field { width: 100%; padding: .5rem .75rem; border: 1px solid #e8e4dd; border-radius: .5rem; font-size: .875rem; background: #fff; transition: border-color .15s; }
.field.field-compact { width: 11rem; flex: none; padding: .7rem 1rem; font-size: 1rem; }
.field:focus { outline: none; border-color: #c9a55a; }
/* .field 的 padding 简写会覆盖 tailwind.css 里的 .pl-9（同优先级、后加载的赢），
   带搜索图标的输入框需要更高优先级的复合选择器才能保住左内边距 */
.field.pl-9 { padding-left: 2.25rem; }
.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .5rem .9rem; border-radius: .5rem; font-size: .875rem; font-weight: 500; transition: all .15s; cursor: pointer; }
.btn-primary { background: #1a2536; color: #fff; }
.btn-primary:hover { background: #2d4a6f; }
.btn-gold { background: #c9a55a; color: #fff; }
.btn-gold:hover { background: #a8863d; }
.btn-ghost { background: #faf8f5; color: #2d4a6f; border: 1px solid #e8e4dd; }
.btn-ghost:hover { background: #f3f0eb; }
.btn-danger { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.btn-danger:hover { background: #fee2e2; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

/* 门户页签：中文可在任意字间断行，flex 收缩后会把「个人信息」拆成竖排单字。
   页签保持整词，窄屏横向滑动。 */
@media (max-width: 640px) {
  .portal-bar, .portal-page { padding-left: 1rem; padding-right: 1rem; }
}
.portal-badges { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .25rem; }
.portal-hero { display: flex; align-items: flex-start; gap: 1.25rem; }
.portal-photo { width: 108px; aspect-ratio: 295 / 413; flex: none; border-radius: 12px; overflow: hidden; background: #f3f0eb; }
.portal-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.portal-photo-fallback { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: #e7eef6; color: #2d4a6f; font-weight: 600; font-size: 1.5rem; }
.portal-hero-main { flex: 1; min-width: 0; }
.portal-id-list { display: flex; flex-direction: column; gap: .5rem; margin-top: .75rem; }
.portal-id { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .65rem .85rem; border: 1px solid #e8e4dd; border-radius: .75rem; background: #faf8f5; }
.portal-id-type { font-weight: 600; color: #1a2536; }
.portal-id-meta { margin-top: .15rem; font-size: .75rem; color: #8a8478; overflow-wrap: anywhere; }
.portal-id-empty { margin-top: .75rem; font-size: .875rem; color: #8a8478; }
@media (max-width: 640px) {
  .portal-hero { gap: .85rem; }
  .portal-photo { width: 84px; }
}
.portal-tabs { display: flex; gap: .25rem; margin-bottom: 1.5rem; border-bottom: 1px solid #e8e4dd; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.portal-tabs .tab-btn { flex: none; white-space: nowrap; }
.portal-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 220px)); gap: 1rem; justify-content: start; }
@media (max-width: 640px) {
  .portal-photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; justify-content: stretch; }
}
.portal-photo-card { background: #fff; border: 1px solid #e8e4dd; border-radius: 1rem; overflow: hidden; }
.portal-photo-shot { width: 100%; height: auto; display: block; background: #f7f6f2; }
.portal-photo-empty { aspect-ratio: 295 / 413; display: flex; align-items: center; justify-content: center; background: #f7f6f2; color: #c5bfb4; }
.portal-photo-more { display: block; width: calc(100% - 1rem); margin: .75rem .5rem 0; border: 0; border-radius: 999px; background: #f7f6f2; color: #1a2536; font-size: .75rem; line-height: 1.2; padding: .45rem .75rem; cursor: pointer; }
.portal-photo-more:hover { background: #efeae2; }
.portal-photo-meta { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .65rem .75rem .75rem; font-size: .75rem; color: #8a8478; }
.portal-review-filters { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .9rem; }
.portal-review-chip { font-size: .75rem; line-height: 1.4; padding: .2rem .7rem; border-radius: 999px; background: #fff; color: #8e9aaf; border: 1px solid #ece8dc; cursor: pointer; }
.portal-review-chip.on { background: #1f2a44; color: #fff; border-color: #1f2a44; }
.portal-review-list { display: flex; flex-direction: column; gap: .75rem; }
.portal-review-card { background: #faf8f5; border: 1px solid #ece8dc; border-radius: 1rem; padding: 1rem 1.1rem; }
.portal-review-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.portal-review-title { font-size: .875rem; font-weight: 600; color: #1a2536; }
.portal-review-detail { margin-top: .5rem; font-size: .75rem; color: #3e4c6d; overflow-wrap: anywhere; }
.portal-review-reason { margin-top: .5rem; padding: .5rem .65rem; border-radius: .5rem; background: #f9d6db; color: #d1495b; font-size: .75rem; line-height: 1.5; }
.portal-review-time { margin-top: .5rem; font-size: .7rem; color: #8e9aaf; }
.lang-switch { display: inline-flex; border-radius: 999px; overflow: hidden; border: 1px solid rgba(255,255,255,.28); flex: none; }
.lang-switch button { background: transparent; color: rgba(255,255,255,.72); border: 0; padding: .2rem .55rem; font-size: .75rem; line-height: 1.4; cursor: pointer; }
.lang-switch button.on { background: #c9a55a; color: #fff; }
.lang-switch-light { border-color: #e8e4dd; background: #fff; }
.lang-switch-light button { color: #8a8478; }
.lang-switch-light button.on { background: #1a2536; color: #fff; }
.portal-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.portal-head h1 { min-width: 0; flex: 1; }
.portal-id .badge { flex: none; }
.portal-name { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.portal-name h1 { min-width: 0; }
.portal-edit-icon { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 999px; color: #2d4a6f; background: #faf8f5; border: 1px solid #e8e4dd; }
.portal-edit-icon:hover { background: #f3f0eb; }
.portal-app-bar { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.portal-app-hint { flex: 1; min-width: 0; font-size: .75rem; line-height: 1.45; color: #8a8478; }
.portal-app-bar .btn { flex: none; white-space: nowrap; border-radius: 999px; padding: .4rem 1rem; line-height: 1.2; }
.portal-app-bar .btn-primary { background: #c9a55a; }
.portal-app-bar .btn-primary:hover { background: #a8863d; }
.portal-apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: .85rem; }
.portal-app { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; background: #fff; border: 1px solid #e8e4dd; border-radius: .9rem; padding: 1.15rem .5rem .8rem; transition: box-shadow .18s ease, transform .18s ease, border-color .15s; }
.portal-app:hover { border-color: #c9a55a; }
.portal-app.is-edit { cursor: grab; touch-action: none; user-select: none; }
.portal-app.is-dragging { z-index: 6; transition: none; transform-origin: center center; pointer-events: none; box-shadow: 0 16px 34px rgba(26,37,54,.22); border-color: #c9a55a; }
.portal-app.is-settling { z-index: 6; transition: none; }
html.portal-dragging, html.portal-dragging * { cursor: grabbing !important; }
.portal-app-name { margin-top: .5rem; font-size: .875rem; color: #1a2536; overflow-wrap: anywhere; }
.portal-app-cat { margin-top: .15rem; font-size: .75rem; color: #8a8478; }
.portal-app-pinned, .portal-app-pin { position: absolute; top: .4rem; right: .4rem; z-index: 2; width: 22px; height: 22px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; }
.portal-app-pinned { background: #c9a55a; color: #fff; }
.portal-app-pin { border: 0; background: rgba(255,255,255,.94); color: #b7b1a6; box-shadow: 0 1px 4px rgba(26,37,54,.16); }
.portal-app[data-pinned="1"] .portal-app-pin { background: #c9a55a; color: #fff; }
.portal-app-move { position: absolute; inset: 0; border: 0; background: transparent; cursor: grab; }
.portal-kv { display: flex; justify-content: space-between; gap: 1rem; padding: .75rem 0; border-bottom: 1px solid #f3f0eb; }
.portal-kv:last-child { border-bottom: 0; }
.portal-kv .k { flex: none; font-size: .875rem; color: #8a8478; }
.portal-kv .v { min-width: 0; text-align: right; font-size: .875rem; color: #1a2536; overflow-wrap: anywhere; }

/* 标签多选：输入框内放已选标签，下拉可搜索 */
.tagselect-box { display: flex; flex-wrap: wrap; align-items: center; gap: .375rem; min-height: 2.625rem; padding: .375rem .5rem; cursor: text; }
.tagselect-box:focus-within { border-color: #c9a55a; }
.tagselect-chips { display: contents; }
.tagselect-input { flex: 1 1 7rem; min-width: 7rem; border: 0; padding: .25rem; background: transparent; font-size: .875rem; outline: none; }
.tagselect-chip { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; padding: 2px 4px 2px 10px; border-radius: 999px; background: #eff6ff; color: #1d4ed8; font-size: 12px; font-weight: 500; line-height: 1.4; }
.tagselect-chip.is-off { background: #f3f4f6; color: #6b7280; }
.tagselect-chip button { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 999px; color: inherit; opacity: .7; }
.tagselect-chip button:hover { opacity: 1; background: rgba(0,0,0,.06); }
.tagselect-menu { position: fixed; z-index: 100; background: #fff; border: 1px solid #e8e4dd; border-radius: .5rem; box-shadow: 0 8px 24px rgba(26,37,54,.12); max-height: 13rem; overflow-y: auto; padding: .25rem; }
.tagselect-menu.is-tree { max-height: 18rem; }
.tagselect-opt { display: flex; align-items: center; gap: .5rem; width: 100%; text-align: left; padding: .45rem .6rem; border-radius: .375rem; font-size: .875rem; color: #1a2536; cursor: pointer; }
.tagselect-opt.has-tree { align-items: stretch; gap: 0; padding-top: 0; padding-bottom: 0; border-radius: .25rem; }
.tagselect-opt.has-tree .tick { align-self: center; margin-right: .5rem; }
.org-guides { display: flex; align-self: stretch; flex: none; }
.org-guide { position: relative; width: 18px; flex: none; }
.org-guide.pass::before, .org-guide.branch::before { content: ''; position: absolute; left: 8px; top: -1px; bottom: -1px; border-left: 1px solid #c4b49a; }
.org-guide.elbow::before { content: ''; position: absolute; left: 8px; top: -1px; height: calc(50% + 1px); border-left: 1px solid #c4b49a; }
.org-guide.branch::after, .org-guide.elbow::after { content: ''; position: absolute; left: 8px; top: 50%; width: 10px; border-top: 1px solid #c4b49a; }
.org-label { min-width: 0; flex: 1; display: flex; flex-direction: column; justify-content: center; line-height: 1.35; }
.tagselect-opt.has-tree .org-label { padding: .4rem 0 .4rem .2rem; }
.org-name, .org-path { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-path { font-size: 11px; color: #9aa3b2; line-height: 1.3; }
.tagselect-opt:hover, .tagselect-opt.is-active { background: #faf8f5; }
.tagselect-opt.is-off { color: #9aa3b2; cursor: not-allowed; }
.tagselect-opt .tick { width: 1rem; height: 1rem; border-radius: .25rem; border: 1px solid #d9d3c8; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; color: transparent; }
.tagselect-opt.is-on .tick { background: #c9a55a; border-color: #c9a55a; color: #fff; }
.tagselect-empty { padding: .6rem .75rem; font-size: .8125rem; color: #9aa3b2; }
.account-filter { display: flex; flex-direction: column; gap: .375rem; flex: 1 1 11rem; min-width: 11rem; max-width: 16rem; }
.account-filter-wide { flex-basis: 14rem; min-width: 14rem; max-width: 20rem; }
.account-keyword { position: relative; width: 100%; }
.account-filter .tagselect-filter { width: 100%; min-width: 0; max-width: none; flex: none; }
