/* 金秋网络工作台 */
:root {
  --bg: #f3f3f8;
  --text: #131d2e;
  --muted: #828892;
  --line: #e8eaef;
  --white: #ffffff;
  --teal: #03aba0;
  --teal-dark: #02968c;
  --nav-h: 52px;
  --page-x: 48px;
  --radius: 10px;
  --shadow: rgba(19, 29, 46, 0.02) 0 0 2px 0, rgba(19, 29, 46, 0.06) 0 1px 4px 0;
  --font: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
#app { min-height: 100vh; background: var(--bg); }

/* ===== Login ===== */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 480px;
  background: #f5f6f8;
}
.login-hero {
  display: flex; flex-direction: column;
  padding: 28px 48px 40px;
  background:
    radial-gradient(ellipse at 28% 38%, #e7f6ff 0%, transparent 55%),
    linear-gradient(180deg, #f7fbff 0%, #eef3f8 100%);
}
.login-hero .brand-row {
  display: flex; align-items: center; gap: 10px;
  font-size: 18px; font-weight: 600;
}
.login-hero .brand-mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, #1fc8a8, #03aba0);
}
.login-hero .illus { flex: 1; display: grid; place-items: center; }
.login-hero .illus-box {
  width: min(520px, 90%); aspect-ratio: 4/3; border-radius: 16px;
  background: linear-gradient(145deg, #fff 0%, #e8f4ff 45%, #d9ecff 100%);
  box-shadow: 0 20px 50px rgba(40, 90, 140, .12);
  position: relative; overflow: hidden;
}
.login-hero .illus-box::before {
  content: "业务数据看板";
  position: absolute; left: 28px; top: 28px;
  font-size: 18px; font-weight: 600; color: #2b4a66;
}
.login-hero .illus-box::after {
  content: "";
  position: absolute; right: 40px; bottom: 36px;
  width: 180px; height: 120px; border-radius: 12px;
  background: linear-gradient(180deg, #7ec8ff, #4aa3e8); opacity: .85;
}
.login-card-wrap {
  display: flex; align-items: center; justify-content: center;
  background: #fff; padding: 32px;
}
.login-card { width: 100%; max-width: 340px; }
.login-card h2 { margin: 0 0 6px; font-size: 28px; font-weight: 600; }
.login-card .sub { color: var(--muted); margin-bottom: 28px; font-size: 13px; }
.field { margin-bottom: 16px; }
.field input {
  width: 100%; height: 44px; border: 1px solid #d9dde5;
  border-radius: 8px; padding: 0 14px; outline: none; background: #fff;
}
.field input:focus { border-color: var(--teal); box-shadow: 0 0 0 2px rgba(3,171,160,.15); }
.btn-login {
  width: 100%; height: 44px; border: 0; border-radius: 8px;
  background: var(--teal); color: #fff; font-size: 16px; font-weight: 600; cursor: pointer;
}
.btn-login:hover { background: var(--teal-dark); }
.login-error { color: #e4574d; font-size: 13px; min-height: 18px; margin-top: 10px; }
.login-alt { margin-top: 16px; text-align: center; }
.login-alt a { color: var(--teal); }

/* ===== Top nav（工作台导航） ===== */
.jdy-nav {
  height: var(--nav-h);
  background: #fff;
  border-bottom: 1px solid #eef0f4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 0 14px;
  position: sticky; top: 0; z-index: 50;
}
.jdy-nav .left, .jdy-nav .right {
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  z-index: 2;
  min-width: 0;
}
.jdy-nav .left { justify-content: flex-start; }
.jdy-nav .right { justify-content: flex-end; margin-left: auto; }
.nav-apps {
  width: 18px; height: 18px; display: grid;
  grid-template-columns: repeat(3, 1fr); gap: 2px; cursor: pointer;
}
.nav-apps i { display: block; background: #5c6775; border-radius: 1px; aspect-ratio: 1; }
.nav-brand {
  display: flex; align-items: center; gap: 8px;
  font-size: 16px; font-weight: 600; color: var(--text);
  cursor: pointer;
}
.nav-back-home {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  margin: 0;
  font-weight: 700;
  font-size: 15px;
  color: #2f7deb !important;
  height: 32px;
  padding: 0 12px;
}
.nav-brand .mark {
  width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(145deg, #3ad4b4 0%, #03aba0 70%);
  position: relative; flex: 0 0 auto;
}
.nav-brand .mark::before {
  content: ""; position: absolute; left: 5px; right: 5px; top: 6px; height: 8px;
  border: 2px solid #fff; border-bottom: 0; border-radius: 10px 10px 0 0;
}
.nav-brand .mark::after {
  content: ""; position: absolute; left: 7px; right: 7px; bottom: 5px; height: 5px;
  border: 2px solid #fff; border-top: 0; border-radius: 0 0 8px 8px;
}
.nav-link-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 2px; border: 0; background: transparent;
  color: #445066; font-size: 14px; cursor: pointer;
  white-space: nowrap;
}
.nav-link-btn:hover, .nav-link-btn a:hover { color: var(--teal); }
.nav-admin-link {
  font-weight: 500;
  padding: 0 8px;
  color: var(--text);
}
.nav-ico { width: 18px; height: 18px; display: inline-block; color: #5c6775; }
.nav-ico svg { width: 18px; height: 18px; display: block; }
.nav-login-btn {
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: #1aa58f;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  line-height: 28px;
}
.nav-login-btn:hover { filter: brightness(1.05); }
.nav-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: #1aa58f; color: #fff;
  display: grid; place-items: center; font-size: 12px; font-weight: 600;
  cursor: pointer; border: 0;
}

/* ===== Workbench ===== */
.wb-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px var(--page-x) 48px;
}
.wb-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  overflow: hidden;
}
.comp { padding: 16px 20px 18px; }
.comp-title {
  font-size: 16px; font-weight: 600; color: var(--text);
  margin: 0 0 8px; display: flex; align-items: center; gap: 8px;
  min-height: 28px;
}
.comp-title .add-link {
  display: inline-flex; align-items: center; gap: 2px;
  font-size: 14px; font-weight: 400; color: var(--teal);
  border: 0; background: transparent; cursor: pointer; padding: 0;
}
.comp-title .gear {
  width: 18px; height: 18px; color: #9aa3af; cursor: pointer; margin-left: 2px;
}

/* greeting */
.fx-greeting {
  display: flex; align-items: center; gap: 16px;
  height: 68px; min-height: 68px; padding-right: 20px;
}
.fx-greeting .logo-box {
  width: 68px; height: 68px; border-radius: 10px 0 0 10px;
  background-size: cover; background-position: center; flex: 0 0 auto;
}
.fx-greeting .user-name { font-size: 16px; font-weight: 600; line-height: 1.35; }
.fx-greeting .greeting-text { font-size: 14px; margin-top: 2px; color: var(--text); }

/* recent / favorite list */
.list-view { display: flex; flex-wrap: wrap; }
.list-item {
  display: flex; align-items: center; gap: 10px;
  width: 225px; max-width: 100%;
  padding: 10px 12px; border-radius: 4px; cursor: pointer;
  color: var(--text);
}
.list-item:hover { background: #f7f8fb; }
.list-item .entry-icon {
  width: 20px; height: 20px; flex: 0 0 auto;
}
.list-item .entry-name {
  font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* todo */
.my-todo {
  display: flex; align-items: stretch; min-height: 112px;
}
.todo-wrapper {
  display: flex; align-items: center; gap: 14px;
  width: 220px; flex: 0 0 220px; padding: 20px 24px;
}
.todo-image {
  width: 64px; height: 64px; flex: 0 0 auto;
  background: url("/assets/todo-sprite.png") 0 0 / 384px 64px no-repeat;
}
.todo-count-text { font-size: 14px; }
.todo-count-number { font-size: 28px; font-weight: 600; line-height: 1.15; margin-top: 2px; }
.wrapper-divider {
  width: 1px; background: var(--line); align-self: stretch; margin: 16px 0;
}
.flow-steps {
  flex: 1; display: grid; grid-template-columns: repeat(5, 1fr);
  align-items: center; padding: 12px 8px;
}
.step-wrapper {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 8px 4px; cursor: pointer; border-radius: 8px;
}
.step-wrapper:hover { background: #f7f8fb; }
.step-image {
  width: 40px; height: 40px;
  background-image: url("/assets/todo-sprite.png");
  background-size: 240px 40px;
  background-repeat: no-repeat;
}
.step-image.flow-create { background-position: -40px 0; }
.step-image.flow-transactors { background-position: -80px 0; }
.step-image.flow-ccusers { background-position: -120px 0; }
.step-image.flow-new { background-position: -160px 0; }
.step-image.flow-delegation { background-position: -200px 0; }
.step-text { font-size: 13px; color: var(--text); }

/* apps */
.apps-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 4px;
}
.apps-head .left { display: flex; align-items: center; gap: 6px; }
.apps-head h3,
.apps-head .section-title {
  margin: 0; font-size: 16px; font-weight: 600; color: var(--text);
}
.apps-head .app-item-name-wrap {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  width: auto;
}
.apps-head .app-rename-btn { font-size: 13px; }
.apps-tools { display: flex; align-items: center; gap: 10px; }
.apps-search {
  height: 32px; width: 220px; border: 1px solid #d9dde5; border-radius: 6px;
  padding: 0 10px 0 30px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239aa3af' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3-3'/%3E%3C/svg%3E") 10px 50% no-repeat;
  outline: none;
}
.apps-search:focus { border-color: var(--teal); }
.btn-create-app {
  height: 32px; border: 0; border-radius: 6px; padding: 0 14px;
  background: var(--teal); color: #fff; cursor: pointer; font-weight: 500;
  display: inline-flex; align-items: center; gap: 4px;
}
.btn-create-app:hover { background: var(--teal-dark); }
.app-group-title {
  color: var(--muted); font-size: 13px; margin: 10px 0 8px;
  display: flex; align-items: center; gap: 4px; cursor: default;
}
.app-grid {
  display: flex; flex-wrap: wrap; gap: 4px 8px;
}
.fx-app-item {
  width: 160px; padding: 16px 8px; border-radius: 8px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.fx-app-item:hover { background: #f7f8fb; }
.app-icon-wrapper { width: 48px; height: 48px; }
.x-biz-app-icon {
  width: 48px; height: 48px; border-radius: 12px; overflow: hidden;
  background: #eef1f6;
}
.x-biz-app-icon .icon-cover {
  width: 100%; height: 100%; background-size: cover; background-position: center;
}
.x-biz-app-icon.preset {
  display: grid; place-items: center;
  background: linear-gradient(145deg, #ffb84d, #f59e0b);
}
.x-biz-app-icon.preset svg { width: 28px; height: 28px; }
.x-biz-app-icon.entry-tile-icon {
  display: grid; place-items: center; background: transparent;
}
.x-biz-app-icon.entry-tile-icon .entry-icon,
.x-biz-app-icon.entry-tile-icon > svg {
  width: 48px; height: 48px; display: block;
}
.app-item-name { font-size: 14px; text-align: center; }

.empty-soft {
  color: #a0a7b3; text-align: center; padding: 40px 12px; font-size: 14px;
}

.dash-stat-page { padding-bottom: 24px; }
.cat-overview {
  margin-bottom: 8px;
  padding: 12px;
  background: #f7f9fc;
  border-radius: 8px;
}
.cat-overview-summary {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}
.cat-stat-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}
.cat-stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 96px;
  padding: 16px 14px;
  border: 1px solid #d8dde6;
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
  cursor: pointer;
  text-align: center;
  transition: border-color .15s, box-shadow .15s;
}
.cat-stat-card:hover {
  border-color: #9db7f0;
  box-shadow: 0 2px 10px rgba(47, 100, 210, .10);
}
.cat-stat-card.active {
  border-color: #2f7deb;
  box-shadow: 0 0 0 1px #2f7deb;
}
.cat-stat-name {
  font-size: 14px;
  font-weight: 600;
  color: #4b5563;
  line-height: 1.35;
  word-break: break-all;
  max-width: 100%;
  order: 0;
}
.cat-stat-count {
  order: 1;
  display: block;
}
.cat-stat-count b {
  display: block;
  font-size: 24px;
  font-weight: 600;
  color: var(--teal);
  line-height: 1.1;
}
.cat-stat-count span { display: none; }
.cat-pager { margin-top: 14px; justify-content: center; }
.cat-group { margin-bottom: 16px; }
.cat-group-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}
.cat-group-head h3 {
  margin: 0;
  font-size: 15px;
  color: #2f6ad2;
}
.cat-group-head .cat-export-btn { margin-left: auto; }
.cat-group-meta { font-size: 12px; color: var(--muted); }
.cat-group-meta b { color: #7b5cff; }

.fx-app-item { position: relative; }
.fx-app-item[draggable="true"] { cursor: grab; }
.fx-app-item[draggable="true"]:active { cursor: grabbing; }
.fx-app-item.wb-dragging { opacity: .45; }
.wb-card[data-drop-zone].wb-drop-ready,
.wb-subcard[data-drop-zone].wb-drop-ready,
.app-grid[data-drop-zone].wb-drop-ready {
  outline: 1px dashed transparent;
  outline-offset: 2px;
  transition: outline-color .15s, background .15s;
}
.wb-card[data-drop-zone].wb-drop-over,
.wb-subcard[data-drop-zone].wb-drop-over,
.app-grid[data-drop-zone].wb-drop-over {
  outline: 2px dashed #2f7deb;
  background: #f3f8ff;
  border-radius: 10px;
}
.wb-place-btn {
  position: absolute;
  top: 0;
  right: 0;
  height: 22px;
  padding: 0 6px;
  border: 0;
  border-radius: 4px;
  background: rgba(47, 125, 235, .92);
  color: #fff;
  font-size: 11px;
  cursor: pointer;
  z-index: 2;
}
.wb-place-btn:hover { filter: brightness(1.05); }
.wb-subcard {
  margin-top: 16px;
  padding: 14px 12px 8px;
  border: 1px dashed #d7deea;
  border-radius: 10px;
  background: #f8fafc;
}
.wb-place-pop { width: 168px; }
.member-account-table .jdy-input {
  height: 32px;
  min-width: 88px;
  font-size: 13px;
}
.member-account-table .mem-password {
  min-width: 110px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.jq-dialog-mask {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(19, 29, 46, .45);
  display: grid;
  place-items: center;
  padding: 16px;
}
.jq-dialog {
  width: min(860px, 100%);
  max-height: min(80vh, 720px);
  overflow: auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(19, 29, 46, .22);
  padding: 16px 18px;
}
.jq-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.jq-dialog-head h3 { margin: 0; font-size: 17px; }
.jq-dialog-close {
  border: 0;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  padding: 4px 8px;
}
.jq-dialog-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}
.jq-dialog-wide {
  width: min(1100px, 100%);
  max-height: min(88vh, 900px);
}
.daily-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: end;
  margin: 8px 0 10px;
}
.daily-date-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}
.daily-date-label input,
.daily-date-label select {
  height: 34px;
  border: 1px solid #d9dde5;
  border-radius: 6px;
  padding: 0 8px;
  min-width: 160px;
  background: #fff;
  color: #1f2a37;
  font-size: 14px;
}
.daily-summary-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-bottom: 10px;
  font-size: 13px;
  color: #445066;
}
.daily-summary-bar .num { color: #7b5cff; }
.daily-cat-grid { margin-bottom: 12px; }
.cat-stat-card.static { cursor: default; }
.row-actions {
  white-space: nowrap;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.btn-sm {
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
}
.edit-event-form {
  max-height: min(70vh, 640px);
  overflow: auto;
  padding-right: 4px;
}

.dash-banner {
  height: 72px; border-radius: 8px; margin-bottom: 12px;
  background-size: cover; background-position: center;
  display: grid; place-items: center;
  border: 1px solid #e8edf4;
}
.dash-banner-title {
  color: #eb5050; font-weight: 700; font-size: 16px;
  text-decoration: underline; background: rgba(255,255,255,.72);
  padding: 4px 14px; border-radius: 4px;
}
.dash-filters {
  display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end;
  margin-bottom: 12px; padding: 12px; background: #f7f9fc; border-radius: 8px;
}
.dash-filters label {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 12px; color: var(--muted);
}
.dash-filters select, .dash-filters input[type="text"], .dash-filters input[type="date"] {
  height: 32px; border: 1px solid #d9dde5; border-radius: 6px;
  padding: 0 8px; min-width: 140px; background: #fff;
}
.dash-filters .date-range { display: flex; align-items: center; gap: 6px; }
.dash-table-wrap { max-height: 62vh; overflow: auto; }
.dash-data-table { min-width: 1100px; }
.dash-data-table th { white-space: nowrap; position: sticky; top: 0; background: #f3f6fa; z-index: 1; }
.form-data-wrap {
  max-height: 70vh;
  overflow: auto;
}
.form-data-table {
  table-layout: fixed;
  width: max-content;
  min-width: 100%;
}
.form-data-table th {
  position: relative;
  user-select: none;
  cursor: grab;
  background: #f5f7fb;
  white-space: nowrap;
  padding-right: 14px !important;
}
.form-data-table th.col-dragging { opacity: .55; }
.form-data-table th.col-drag-over {
  box-shadow: inset 2px 0 0 #2f7deb;
}
.form-data-table .col-label {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}
.form-data-table .col-resizer {
  position: absolute;
  top: 0;
  right: 0;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  z-index: 2;
}
.form-data-table .col-resizer:hover,
.form-data-table .col-resizer:active {
  background: rgba(47, 125, 235, .25);
}
.form-data-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}
.media-cell { display: flex; flex-wrap: wrap; gap: 4px; }
.media-thumb {
  width: 96px; height: 96px; object-fit: cover; border-radius: 6px;
  border: 1px solid #e5e8ef; display: block;
  image-rendering: auto;
}
.media-file { font-size: 12px; color: var(--teal); }
.media-miss { color: #b0b6c0; font-size: 12px; }
.dash-pager {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin-top: 12px; color: var(--muted); font-size: 13px;
}
.dash-pager .btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ===== App / admin pages ===== */
.app-layout { display: grid; grid-template-columns: 260px 1fr; min-height: calc(100vh - var(--nav-h)); }
.app-side { background: #f7f8fa; color: #1f2329; padding: 12px 10px; border-right: 1px solid #e8eaed; }
.app-side .app-name { color: #1f2329; font-weight: 600; padding: 8px 10px 12px; font-size: 15px; }
.app-side-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px 12px;
}
.app-side-search {
  flex: 1;
  height: 34px;
  border: 1px solid #dfe3e8;
  border-radius: 6px;
  padding: 0 10px;
  background: #fff;
  font-size: 13px;
  color: #8a9199;
}
.app-side-plus {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #2f7deb;
  color: #fff;
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  flex: 0 0 34px;
}
.app-side-plus:hover { background: #1d6ad1; color: #fff; }
.side-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px; color: #3c4450; margin-bottom: 2px;
}
.side-item:hover, .side-item.active { background: #eef3fb; color: #1f2329; }
.side-entry-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 2px;
  border-radius: 8px;
}
.side-entry-row.active {
  background: #eef3fb;
}
.side-entry-row .side-item {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}
.side-entry-row.active .side-item {
  background: transparent;
}
.side-place-btn {
  flex: 0 0 auto;
  position: static;
  opacity: 0.85;
  margin-right: 4px;
}
.side-entry-row:hover .side-place-btn,
.side-entry-row.active .side-place-btn {
  opacity: 1;
}
.side-entry-ico {
  width: 28px; height: 28px; border-radius: 8px; flex: 0 0 28px;
  background: #2f7deb center/18px no-repeat;
}
.side-entry-ico.dash { background-color: #7b61ff; }
.side-entry-ico.form { background-color: #2f7deb; }
.app-side .back-home {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
  min-height: 48px;
  padding: 12px;
  border: 2px solid #2f7deb;
  border-radius: 10px;
  background: #eaf2ff;
  color: #2f7deb;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
}
.app-side .back-home:hover {
  background: #d6e8ff;
  color: #1d6ad1;
  border-color: #1d6ad1;
}

/* Form designer — 对齐简道云：左侧拖到画布指定位置 */
.fd-page {
  min-height: 100vh;
  background: #f0f2f5;
  display: flex;
  flex-direction: column;
}
.fd-top {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 48px;
  padding: 0 16px;
  background: #fff;
  border-bottom: 1px solid #e5e6eb;
  flex: 0 0 auto;
}
.fd-back {
  color: #1f2329;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  font-size: 14px;
}
.fd-tabs { display: flex; gap: 28px; flex: 1; height: 100%; align-items: stretch; }
.fd-tab {
  display: inline-flex;
  align-items: center;
  color: #646a73;
  border-bottom: 2px solid transparent;
  text-decoration: none;
  font-size: 14px;
  cursor: default;
}
.fd-tab.active {
  color: #14c2b0;
  border-bottom-color: #14c2b0;
  font-weight: 600;
}
.fd-tab.muted { opacity: .55; }
a.fd-tab { cursor: pointer; }
.fd-top-actions { display: flex; gap: 8px; }
.fd-save-btn { background: #14c2b0 !important; border-color: #14c2b0 !important; color: #fff !important; }
.fd-action-box {
  margin-top: 28px;
  padding: 16px 20px;
  border: 2px solid #3370ff;
  border-radius: 8px;
  background: #f7f9ff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  max-width: 360px;
}
.fd-action-box .btn {
  min-width: 100px;
}
.fd-body {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr) 300px;
  flex: 1;
  min-height: 0;
}
.fd-left {
  background: #fff;
  border-right: 1px solid #e5e6eb;
  padding: 8px 10px 24px;
  overflow: auto;
}
.fd-group { margin-bottom: 14px; }
.fd-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #8f959e;
  margin: 6px 4px 8px;
  font-weight: 600;
}
.fd-ai-badge {
  border: 0;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  color: #fff;
  font-size: 11px;
  border-radius: 999px;
  padding: 2px 8px;
  cursor: pointer;
}
.fd-palette {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.fd-palette-item {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #e5e6eb;
  border-radius: 4px;
  background: #fff;
  padding: 8px 6px;
  font-size: 12px;
  color: #1f2329;
  cursor: grab;
  text-align: left;
  min-height: 36px;
  user-select: none;
}
.fd-palette-item:active { cursor: grabbing; }
.fd-palette-item:hover {
  border-color: #3370ff;
  color: #3370ff;
  background: #f0f4ff;
}
.fd-palette-item.dragging { opacity: .55; }
.fd-pal-ico {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  border-radius: 2px;
  background: #3370ff;
  opacity: .85;
  position: relative;
}
.fd-pal-ico::before {
  content: '';
  position: absolute;
  inset: 4px;
  border: 1.5px solid #fff;
  border-radius: 1px;
}
.fd-canvas {
  padding: 16px 18px 40px;
  overflow: auto;
  background: #f0f2f5;
}
.fd-canvas-sheet {
  background: #fff;
  border-radius: 4px;
  min-height: calc(100vh - 96px);
  padding: 12px 16px 40px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.fd-drop-hint {
  color: #8f959e;
  font-size: 12px;
  margin-bottom: 12px;
}
.fd-canvas-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px 12px;
  align-items: start;
  min-height: 120px;
}
.fd-canvas-grid.drop-active {
  outline: 2px dashed #3370ff;
  outline-offset: 4px;
  border-radius: 4px;
  background: #f7f9ff;
}
.fd-canvas-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: #8f959e;
  padding: 80px 20px;
  border: 1px dashed #d0d3d9;
  border-radius: 6px;
}
.fd-canvas-empty.drop-active {
  border-color: #3370ff;
  color: #3370ff;
  background: #f0f4ff;
}
.fd-widget {
  position: relative;
  border: 1px solid transparent;
  border-radius: 2px;
  padding: 6px 8px 8px;
  cursor: grab;
  background: #fff;
  min-width: 0;
}
.fd-widget:active { cursor: grabbing; }
.fd-widget:hover { background: #fafbfd; }
.fd-widget.active {
  border-color: #3370ff;
  box-shadow: 0 0 0 1px #3370ff;
  background: #f7f9ff;
}
.fd-widget.dragging { opacity: .4; }
.fd-widget.drop-before::before,
.fd-widget.drop-after::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: #3370ff;
  border-radius: 2px;
  z-index: 3;
}
.fd-widget.drop-before::before { top: -8px; }
.fd-widget.drop-after::after { bottom: -8px; }
.fd-widget.col-1 { grid-column: span 1; }
.fd-widget.col-2 { grid-column: span 2; }
.fd-widget.col-3 { grid-column: span 3; }
.fd-widget.col-4 { grid-column: span 4; }
.fd-widget.is-sep { padding-top: 10px; }
.fd-widget-del {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: #e4574d;
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: none;
  z-index: 2;
}
.fd-widget.active .fd-widget-del,
.fd-widget:hover .fd-widget-del { display: grid; place-items: center; }
.fdw-label {
  font-size: 13px;
  color: #1f2329;
  margin-bottom: 6px;
  font-weight: 500;
  line-height: 1.3;
}
.fdw-req { color: #f54a45; margin-right: 2px; }
.fdw-input,
.fdw-area,
.fdw-upload {
  border: 1px solid #d0d3d9;
  border-radius: 4px;
  background: #fff;
  color: #8f959e;
  font-size: 12px;
  min-height: 32px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
}
.fdw-area { min-height: 72px; align-items: flex-start; }
.fdw-select { justify-content: space-between; }
.fdw-select::after { content: '▾'; color: #8f959e; font-size: 11px; }
.fdw-date { justify-content: space-between; }
.fdw-cal { opacity: .7; font-size: 12px; }
.fdw-locked { background: #f5f6f7; }
.fdw-upload {
  border-style: dashed;
  color: #646a73;
  gap: 4px;
  flex-wrap: wrap;
  min-height: 40px;
}
.fdw-upload a { color: #3370ff; text-decoration: none; pointer-events: none; }
.fdw-addr { display: flex; flex-direction: column; gap: 6px; }
.fdw-sep {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #3370ff;
  font-weight: 600;
  font-size: 14px;
  width: 100%;
  padding: 4px 0 2px;
}
.fdw-sep i {
  flex: 1;
  height: 0;
  border-top: 1px dashed #f54a45;
}
.fd-right {
  background: #fff;
  border-left: 1px solid #e5e6eb;
  padding: 14px 14px 24px;
  overflow: auto;
}
.fd-props-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #1f2329;
}
.fd-props label {
  display: block;
  font-size: 12px;
  color: #646a73;
  margin: 12px 0 6px;
}
.fd-props input,
.fd-props select,
.fd-props textarea {
  width: 100%;
  border: 1px solid #d0d3d9;
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 13px;
  background: #fff;
}
.fd-check {
  display: flex !important;
  align-items: center;
  gap: 8px;
  margin-top: 14px !important;
  color: #1f2329 !important;
  font-size: 13px !important;
}
.fd-check input { width: auto; }
.fd-props-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
.fd-props-empty {
  color: #8f959e;
  font-size: 13px;
  padding: 24px 8px;
  text-align: center;
  line-height: 1.6;
}
#fd-msg { padding: 6px 16px; min-height: 20px; font-size: 13px; }

@media (max-width: 1100px) {
  .fd-body { grid-template-columns: 220px minmax(0, 1fr); }
  .fd-right { display: none; }
}
@media (max-width: 720px) {
  .fd-body { grid-template-columns: 1fr; }
  .fd-left { max-height: 240px; border-right: 0; border-bottom: 1px solid #e5e6eb; }
  .fd-canvas-grid { grid-template-columns: 1fr 1fr; }
  .fd-widget.col-3, .fd-widget.col-4 { grid-column: span 2; }
}

.admin-side .back-home {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
  min-height: 56px;
  padding: 16px 12px;
  border: 2px solid #2f7deb;
  border-radius: 10px;
  background: #eaf2ff;
  color: #2f7deb !important;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
}
.admin-side .back-home:hover {
  background: #d6e8ff;
  color: #1d6ad1 !important;
  border-color: #1d6ad1;
}
.app-side .text-edit-link {
  color: #7dd3c7 !important;
  margin-top: 8px;
}
.muted-key {
  display: block;
  font-size: 11px;
  color: #a0a7b3;
  font-weight: 400;
  margin-top: 2px;
}
.x-biz-app-icon.text-settings-icon {
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #3b82f6, #2563eb);
  color: #fff;
  font-size: 22px;
  font-weight: 700;
}
.app-icon-edit {
  position: relative;
  width: 48px;
  height: 48px;
}
.app-icon-edit .icon-edit-btn {
  position: absolute;
  right: -6px;
  top: -6px;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: #2f7deb;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  line-height: 22px;
  padding: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.app-icon-edit .icon-edit-btn:hover { background: #1d6ad1; }
.app-item-name-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
}
.app-rename-btn {
  border: 0;
  background: transparent;
  color: var(--teal);
  font-size: 12px;
  cursor: pointer;
  padding: 0 4px;
}
.app-rename-btn:hover { text-decoration: underline; }
.app-rename-input {
  width: 100%;
  max-width: 140px;
  height: 30px;
  border: 1px solid #d9dde5;
  border-radius: 6px;
  padding: 0 8px;
  font-size: 13px;
  outline: none;
}
.app-rename-input:focus { border-color: var(--teal); }
.app-rename-actions {
  display: flex;
  gap: 6px;
}
.app-rename-actions .btn {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
}
.icon-change-pop {
  position: fixed;
  z-index: 200;
  width: 156px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(19,29,46,.16);
  overflow: hidden;
  border: 1px solid #eef0f4;
}
.icon-change-pop button {
  display: block;
  width: 100%;
  border: 0;
  background: #fff;
  text-align: left;
  padding: 12px 14px;
  font-size: 14px;
  cursor: pointer;
  color: var(--text);
}
.icon-change-pop button:hover { background: #f5f7fb; }
.icon-change-pop button[data-act="cancel"] { color: var(--muted); border-top: 1px solid #eef0f4; }
.text-edit-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.text-edit-line input {
  flex: 1 1 220px;
  min-width: 160px;
}
.text-edit-line .btn,
.text-edit-line .btn.ghost {
  height: 36px;
  flex: 0 0 auto;
  white-space: nowrap;
}
.app-main { padding: 20px 24px 40px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; }
.toolbar h2 { margin: 0; font-size: 18px; font-weight: 600; }
.toolbar .actions { display: flex; gap: 8px; }
.form-panel {
  background: #fff; border-radius: 10px; box-shadow: var(--shadow);
  padding: 20px; max-width: 860px;
}

/* ===== 添加事件 · 简道云风格 ===== */
.jdy-form-page {
  max-width: 1180px;
  margin: 0 auto;
}
.jdy-form-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -4px 0 14px;
}
.jdy-form-top-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.jdy-split-btn {
  display: inline-flex;
  border-radius: 6px;
  overflow: hidden;
}
.jdy-split-btn .jdy-primary {
  border-radius: 0;
  background: #2f7deb;
}
.jdy-split-btn .jdy-primary:first-child { border-radius: 6px 0 0 6px; }
.jdy-split-btn .jdy-caret {
  border-radius: 0 6px 6px 0;
  padding: 0 10px;
  border-left: 1px solid rgba(255,255,255,.25);
  background: #2f7deb;
}
.jdy-ico { margin-right: 4px; opacity: .75; }
.jdy-form-body { display: block; }
.jdy-card {
  background: #fff;
  border: 1px solid #e8edf4;
  border-radius: 8px;
  padding: 16px 18px 8px;
  margin-bottom: 14px;
  box-shadow: 0 1px 2px rgba(19,29,46,.04);
}
.jdy-section-title {
  margin: 0 0 14px;
  padding-bottom: 8px;
  font-size: 15px;
  font-weight: 600;
  color: #1f2a37;
  border-bottom: 2px solid #e4574d;
  display: inline-block;
  min-width: 64px;
}
.jdy-grid {
  display: grid;
  gap: 14px 16px;
  margin-bottom: 14px;
}
.jdy-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.jdy-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.jdy-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.jdy-field { min-width: 0; }
.jdy-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}
.jdy-label .req { color: #e4574d; margin-right: 2px; }
.jdy-input {
  width: 100%;
  height: 36px;
  border: 1px solid #d9dde5;
  border-radius: 6px;
  padding: 0 10px;
  background: #fff;
  outline: none;
  font-size: 14px;
  color: #1f2a37;
  box-sizing: border-box;
}
.jdy-input:focus { border-color: #2f7deb; box-shadow: 0 0 0 3px rgba(47,125,235,.12); }
.jdy-textarea {
  height: auto;
  min-height: 140px;
  padding: 10px;
  resize: vertical;
}
.jdy-date-wrap { max-width: 280px; }
.jdy-address { display: grid; gap: 8px; }
.jdy-upload-box {
  min-height: 76px;
  border: 1px dashed #cfd6e2;
  border-radius: 6px;
  background: #fafbfd;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  position: relative;
}
.jdy-upload-select {
  border: 0;
  background: transparent;
  color: #2f7deb;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
.jdy-upload-hint {
  color: #98a2b3;
  font-size: 12px;
  flex: 1;
}
.jdy-upload-cam {
  border: 0;
  background: transparent;
  color: #667085;
  cursor: pointer;
  padding: 4px;
  display: grid;
  place-items: center;
}
.jdy-upload .media-picker-preview { margin-top: 8px; }
.jdy-tabs-card { padding-top: 0; }
.jdy-tabs {
  display: flex;
  gap: 18px;
  border-bottom: 1px solid #e8edf4;
  margin: 0 -18px 14px;
  padding: 0 18px;
}
.jdy-tab {
  border: 0;
  background: transparent;
  height: 42px;
  padding: 0 2px;
  font-size: 14px;
  color: #667085;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.jdy-tab.active {
  color: #2f7deb;
  font-weight: 600;
  border-bottom-color: #2f7deb;
}
.jdy-meta-row {
  background: #fff;
  border: 1px solid #e8edf4;
  border-radius: 8px;
  padding: 12px 18px;
  margin-bottom: 12px;
}
.jdy-meta-row .form-row { margin-bottom: 10px; }
.jdy-form-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

@media (max-width: 960px) {
  .jdy-grid-3, .jdy-grid-4, .jdy-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .jdy-grid-3, .jdy-grid-4, .jdy-grid-2 {
    grid-template-columns: 1fr;
  }
  .jdy-date-wrap { max-width: none; }
}
.form-row { margin-bottom: 16px; }
.form-row label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 13px; }
.form-row label .req { color: #e4574d; }
.form-row input, .form-row select, .form-row textarea {
  width: 100%; border: 1px solid #d9dde5; border-radius: 8px; padding: 10px 12px; outline: none;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus { border-color: var(--teal); }
.form-row textarea { min-height: 88px; resize: vertical; }
.readonly-input {
  background: #f3f5f8 !important;
  color: #445066 !important;
  cursor: not-allowed;
}
.field-note {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}
.sales-form-page .sales-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  max-width: 920px;
}
.sales-form-page .sales-form > .sep,
.sales-form-page .sales-form > .jdy-meta-row,
.sales-form-page .sales-form > .error,
.sales-form-page .sales-form > div[style*="display:flex"] {
  grid-column: 1 / -1;
}
.sales-form-page .sales-form .form-row:has(textarea) {
  grid-column: 1 / -1;
}
.sales-stats .stat.highlight {
  background: linear-gradient(145deg, #ecfdf5, #d1fae5);
  border-color: #6ee7b7;
}
.sales-table td.num,
.sales-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 720px) {
  .sales-form-page .sales-form {
    grid-template-columns: 1fr;
  }
}
.purch-form-page .purch-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  max-width: 960px;
}
.purch-form-page .purch-form > .sep,
.purch-form-page .purch-form > .jdy-meta-row,
.purch-form-page .purch-form > .error,
.purch-form-page .purch-form > div[style*="display:flex"] {
  grid-column: 1 / -1;
}
.purch-form-page .purch-form .form-row:has(textarea),
.purch-form-page .purch-form .form-row:has(.media-picker) {
  grid-column: 1 / -1;
}
.purch-dash .purch-table .media-cell {
  max-width: 120px;
}
@media (max-width: 720px) {
  .purch-form-page .purch-form {
    grid-template-columns: 1fr;
  }
}
.staff-form-page .staff-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  max-width: 980px;
}
.staff-form-page .staff-form > .sep,
.staff-form-page .staff-form > .jdy-meta-row,
.staff-form-page .staff-form > .error,
.staff-form-page .staff-form > .staff-certs-block,
.staff-form-page .staff-form > div[style*="display:flex"] {
  grid-column: 1 / -1;
}
.staff-form-page .staff-form .form-row:has(textarea),
.staff-form-page .staff-form .form-row:has(.media-picker) {
  grid-column: 1 / -1;
}
.staff-ocr-status {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--muted);
  min-height: 1.2em;
}
.staff-ocr-status.pending { color: #2563eb; }
.staff-ocr-status.ok { color: #0d9488; }
.staff-ocr-status.warn { color: #c2410c; }
.staff-ocr-status.err { color: #b91c1c; }
.visit-ocr-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: -4px 0 12px;
}
.staff-id-ocr-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.staff-ocr-btn {
  flex: 0 0 auto;
}
.staff-form-page .media-picker-preview,
.staff-certs-table .media-picker-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  min-height: 8px;
}
.staff-form-page .media-preview-item,
.staff-certs-table .media-preview-item {
  position: relative;
  width: 96px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  background: #f8fafc;
}
.staff-form-page .media-preview-item img,
.staff-certs-table .media-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.staff-certs-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}
.staff-certs-table th,
.staff-certs-table td {
  border: 1px solid #e5e7eb;
  padding: 8px;
  vertical-align: top;
}
.staff-certs-table th {
  background: #f8fafc;
  font-weight: 600;
  font-size: 13px;
}
.staff-certs-table .cert-name {
  width: 100%;
  border: 1px solid #d9dde5;
  border-radius: 8px;
  padding: 8px 10px;
}
.staff-certs-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.staff-cert-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 6px;
}
.staff-cert-cell b { font-size: 12px; }
.staff-dash .staff-table .media-cell { max-width: 110px; }
.public-staff-page {
  min-height: 100vh;
  background: linear-gradient(180deg, #eff6ff 0%, #f8fafc 40%, #fff 100%);
}
.public-staff-head {
  padding: 28px 20px 12px;
  text-align: center;
}
.public-staff-brand {
  font-size: 22px;
  font-weight: 700;
  color: #1e3a8a;
  margin-bottom: 6px;
}
.public-staff-head p {
  margin: 0;
  color: #64748b;
  font-size: 14px;
}
.public-staff-main {
  max-width: 920px;
  margin: 0 auto;
  padding: 8px 16px 40px;
}
.public-staff-done {
  max-width: 480px;
  margin: 80px auto;
  text-align: center;
  padding: 32px 20px;
}
.public-staff-done h2 {
  color: #0d9488;
  margin-bottom: 8px;
}
.staff-qr-body {
  text-align: center;
}
.staff-qr-box {
  display: flex;
  justify-content: center;
  margin: 16px 0;
  padding: 12px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
}
.staff-qr-url {
  font-size: 12px;
  color: #64748b;
  word-break: break-all;
  margin-bottom: 12px;
}
.staff-qr-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.period-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 8px 0 4px;
}
.period-tabs {
  display: inline-flex;
  border: 1px solid #dbe3f0;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.period-tab {
  border: 0;
  background: transparent;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 13px;
  color: #445066;
}
.period-tab.active {
  background: #2563eb;
  color: #fff;
}
.attend-form-page .attend-form {
  max-width: 640px;
  display: grid;
  gap: 12px;
}
@media (max-width: 720px) {
  .staff-form-page .staff-form {
    grid-template-columns: 1fr;
  }
}
.media-picker-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.media-picker-hint {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}
.media-picker-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.media-preview-item {
  position: relative;
  width: 88px;
  height: 88px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e5e8ef;
  background: #f7f8fb;
}
.media-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.media-preview-item.media-preview-video {
  width: 160px;
  height: 100px;
}
.media-preview-item video,
.media-thumb-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #111;
}
.media-video-link {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 96px;
  text-decoration: none;
  color: var(--teal, #0d9488);
  font-size: 12px;
}
.media-video-link .media-thumb-video {
  width: 96px;
  height: 64px;
  border-radius: 6px;
  border: 1px solid #e5e8ef;
}
.media-remove-one {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: rgba(0,0,0,.55);
  color: #fff;
  cursor: pointer;
  line-height: 22px;
  padding: 0;
  font-size: 14px;
}
.sep {
  margin: 4px 0 16px; padding-bottom: 8px; border-bottom: 2px solid var(--teal);
  color: var(--teal); font-weight: 600;
}
.btn { height: 36px; border: 0; border-radius: 6px; padding: 0 14px; cursor: pointer; background: var(--teal); color: #fff; font-weight: 500; }
.btn.ghost { background: #fff; border: 1px solid #d9dde5; color: var(--text); }
.btn.danger { background: #e4574d; }
.btn.block { width: 100%; }
.error { color: #e4574d; font-size: 13px; margin-top: 8px; min-height: 18px; }
.stats { display: flex; gap: 12px; flex-wrap: wrap; }
.stat {
  background: #fff; border-radius: 10px; box-shadow: var(--shadow);
  padding: 16px 20px; min-width: 120px;
}
.stat b { display: block; font-size: 24px; font-weight: 600; color: var(--teal); }
.stat span { color: var(--muted); font-size: 13px; }
.table-wrap { overflow: auto; background: #fff; border-radius: 10px; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { background: #f7f8fb; color: var(--muted); font-weight: 600; }
.dash-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.dash-card { background: #fff; border-radius: 10px; box-shadow: var(--shadow); padding: 18px; }
.dash-card .num { font-size: 28px; font-weight: 600; color: var(--teal); }
.dash-card .label { color: var(--muted); margin-top: 4px; font-size: 13px; }
.bar-list { display: flex; flex-direction: column; gap: 8px; }
.bar-item { display: grid; grid-template-columns: 90px 1fr 40px; gap: 8px; align-items: center; font-size: 13px; }
.bar { height: 8px; background: #e8eef4; border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--teal); }
.admin-layout { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - var(--nav-h)); }
.admin-side { background: #fff; border-right: 1px solid var(--line); padding: 16px; }
.admin-side .title { font-weight: 600; margin-bottom: 12px; color: var(--text); }
.admin-side .side-item {
  color: #e4574d;
  font-weight: 500;
}
.admin-side .side-item:hover {
  background: #fff5f4;
  color: #e4574d;
}
.admin-side .side-item.active {
  background: #eef5ff;
  color: #2f7deb;
  font-weight: 600;
}
.nav-admin-link .nav-text-short { display: none; }
.nav-text-label { margin-left: 2px; }

.empty { color: var(--muted); padding: 24px; text-align: center; }
.card { background: #fff; border-radius: 10px; box-shadow: var(--shadow); padding: 16px; }

/* ===== Tablet ===== */
@media (max-width: 900px) {
  :root { --page-x: 16px; }
  .login-page { grid-template-columns: 1fr; }
  .login-hero { display: none; }
  .login-card-wrap { padding: 24px 16px; }
  .wb-page { padding: 12px var(--page-x) 32px; }
  .cat-stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .todo-wrapper { width: auto; flex: 1 1 auto; }
  .my-todo { flex-direction: column; }
  .wrapper-divider { width: auto; height: 1px; margin: 0 16px; }
  .flow-steps { grid-template-columns: repeat(3, 1fr); }
  .list-item { width: 50%; }
  .dash-grid { grid-template-columns: 1fr 1fr; }
}

/* ===== Phone ===== */
@media (max-width: 768px) {
  :root {
    --page-x: 12px;
    --nav-h: 48px;
    --radius: 8px;
  }
  body { font-size: 15px; }

  /* Top nav */
  .jdy-nav {
    height: auto;
    min-height: var(--nav-h);
    padding: 8px 10px;
    gap: 8px;
  }
  .jdy-nav .left, .jdy-nav .right { gap: 8px; }
  .nav-brand { font-size: 15px; }
  .nav-brand span:last-child { max-width: 4.5em; overflow: hidden; text-overflow: ellipsis; }
  .nav-admin-link .nav-text-full { display: none; }
  .nav-admin-link .nav-text-short { display: inline; }
  .nav-text-label { display: none; }
  .nav-link-btn { height: 36px; padding: 0 4px; }
  .nav-avatar { width: 32px; height: 32px; }
  .nav-login-btn { height: 32px; line-height: 32px; padding: 0 12px; }

  /* Workbench cards */
  .wb-page { padding: 10px 12px 28px; max-width: 100%; }
  .wb-card { margin-bottom: 12px; border-radius: 8px; }
  .comp { padding: 12px; }
  .apps-head { margin-bottom: 8px; gap: 6px; }
  .apps-head h3, .comp-title { font-size: 15px; }
  .apps-hint { font-size: 11px; line-height: 1.3; max-width: 46%; text-align: right; }

  /* App grid: 3 columns on phone */
  .app-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
  }
  .fx-app-item {
    width: auto;
    padding: 12px 4px 10px;
    gap: 8px;
  }
  .app-item-name {
    font-size: 12px;
    line-height: 1.35;
    word-break: break-word;
    white-space: normal;
  }
  .app-rename-btn { font-size: 11px; }
  .app-rename-input { max-width: 100%; }
  .app-icon-wrapper,
  .x-biz-app-icon,
  .app-icon-edit,
  .x-biz-app-icon.entry-tile-icon > svg,
  .x-biz-app-icon.entry-tile-icon .entry-icon {
    width: 44px; height: 44px;
  }

  /* App / admin shell: sidebar becomes top chips */
  .app-layout,
  .admin-layout {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - var(--nav-h));
    grid-template-columns: none;
  }
  .app-side,
  .admin-side {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    border-right: 0;
    border-bottom: 1px solid rgba(255,255,255,.08);
  }
  .admin-side {
    background: #fff;
    border-bottom: 1px solid var(--line);
  }
  .app-side .app-name,
  .admin-side .title {
    display: none;
  }
  .side-item {
    flex: 0 0 auto;
    margin: 0;
    padding: 8px 12px;
    white-space: nowrap;
    font-size: 13px;
  }
  .app-side .back-home,
  .admin-side .back-home {
    margin: 0;
    min-height: 36px;
    padding: 8px 12px;
    font-size: 13px;
    border-width: 1.5px;
    border-radius: 8px;
  }
  .app-main {
    padding: 12px 10px 28px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  /* Toolbar / forms */
  .toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 12px;
  }
  .toolbar h2 { font-size: 16px; }
  .toolbar .actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .toolbar .actions .btn,
  .toolbar .actions a.btn {
    text-align: center;
    justify-content: center;
    display: inline-flex;
    align-items: center;
  }
  .form-panel {
    max-width: 100%;
    padding: 14px 12px;
    border-radius: 8px;
  }
  .form-row { margin-bottom: 14px; }
  .form-row input,
  .form-row select,
  .form-row textarea {
    padding: 12px;
    font-size: 16px; /* avoid iOS zoom */
  }
  .btn { min-height: 40px; padding: 0 12px; }

  /* Stats */
  .stats { gap: 8px; }
  .stat {
    min-width: calc(50% - 4px);
    flex: 1 1 calc(50% - 4px);
    padding: 12px;
  }
  .stat b { font-size: 20px; }

  /* Dash filters */
  .dash-banner { height: 56px; margin-bottom: 10px; }
  .dash-banner-title { font-size: 14px; padding: 3px 10px; }
  .dash-filters {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 10px;
  }
  .dash-filters label { width: 100%; }
  .dash-filters select,
  .dash-filters input[type="text"],
  .dash-filters input[type="date"] {
    width: 100%;
    min-width: 0;
    height: 40px;
    font-size: 16px;
  }
  .dash-filters .date-range { width: 100%; }
  .dash-filters .date-range input { flex: 1; min-width: 0; }
  .dash-filters .btn { width: 100%; }
  .dash-table-wrap {
    max-height: none;
    margin: 0 -2px;
    border-radius: 8px;
  }
  .dash-data-table { min-width: 860px; }
  .media-thumb { width: 88px; height: 88px; }
  .dash-pager {
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
  }
  .dash-pager .btn { flex: 1 1 40%; min-height: 40px; }

  /* Tables */
  .table-wrap { -webkit-overflow-scrolling: touch; }
  th, td { padding: 8px 10px; font-size: 12px; }

  /* Text settings */
  .text-edit-line {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .text-edit-line input {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    font-size: 16px;
    height: 40px;
  }
  .text-edit-line .btn,
  .text-edit-line .btn.ghost {
    width: 100%;
    height: 40px;
  }

  .page-wide { padding: 0; }
  .list-item { width: 100%; }
  .dash-grid { grid-template-columns: 1fr; }
  .flow-steps { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 380px) {
  .app-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-brand span:last-child { display: none; }
}

/* 车辆证照到期 */
.exp-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.exp-overdue { background: #fee2e2; color: #b91c1c; }
.exp-d7 { background: #ffedd5; color: #c2410c; }
.exp-d30 { background: #fef3c7; color: #a16207; }
.exp-d90 { background: #e0e7ff; color: #4338ca; }
.exp-ok { background: #dcfce7; color: #15803d; }
.exp-unknown { background: #f3f4f6; color: #6b7280; }
.exp-stat-overdue b { color: #b91c1c; }
.exp-stat-d7 b { color: #c2410c; }
.exp-stat-d30 b { color: #a16207; }
.exp-row-overdue td { background: #fff5f5; }
.exp-row-d7 td { background: #fffaf0; }


.tools-editor {
  padding: 12px;
  margin-bottom: 12px;
  border: 1px dashed #d7deea;
  border-radius: 10px;
  background: #fbfcfe;
}

.ass-rate-dialog {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(15, 23, 42, 0.45);
  display: grid;
  place-items: center;
  padding: 16px;
}
.ass-rate-dialog[hidden] { display: none !important; }
.ass-rate-card {
  width: min(480px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.2);
}

.ct-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 12px 16px 40px;
  background: #fff;
  min-height: calc(100vh - 56px);
}
.ct-head, .ct-subhead {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.ct-head h1, .ct-subhead h2 {
  margin: 0;
  font-size: 22px;
  flex: 1;
}
.ct-head-actions { display: flex; gap: 8px; align-items: center; }
.ct-icon-btn {
  width: 36px; height: 36px; border: 0; border-radius: 10px;
  background: #f3f4f6; cursor: pointer; font-size: 16px;
}
.ct-back {
  font-size: 24px; text-decoration: none; color: #334155; line-height: 1; padding: 0 4px;
}
.ct-company {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 4px 16px; font-weight: 600; color: #1e293b;
}
.ct-org-badge {
  width: 36px; height: 36px; border-radius: 50%;
  background: #3b82f6; color: #fff; display: grid; place-items: center; font-weight: 700;
}
.ct-menu { display: flex; flex-direction: column; }
.ct-menu-item, .ct-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 4px; border-bottom: 1px solid #f1f5f9;
  text-decoration: none; color: inherit;
}
.ct-menu-sub { padding-left: 28px; }
.ct-menu-elbow {
  width: 14px; height: 14px; border-left: 2px solid #cbd5e1; border-bottom: 2px solid #cbd5e1;
  margin-right: 2px; align-self: flex-start; margin-top: 4px;
}
.ct-menu-ico, .ct-dept-ico {
  width: 36px; height: 36px; border-radius: 50%; flex: 0 0 auto;
  background: #3b82f6 center/18px no-repeat;
}
.ct-ico-org { background-color: #3b82f6; }
.ct-ico-ext { background-color: #8b5cf6; }
.ct-ico-perm { background-color: #f59e0b; }
.ct-ico-admin { background-color: #ef4444; }
.ct-dept-ico {
  background-image: none;
  background: #3b82f6;
  position: relative;
}
.ct-dept-ico::after {
  content: "";
  position: absolute; inset: 10px;
  border: 2px solid #fff; border-radius: 2px;
}
.ct-menu-text, .ct-row-main { flex: 1; min-width: 0; }
.ct-menu-count, .ct-muted, .ct-sub { color: #94a3b8; font-size: 13px; }
.ct-chevron { color: #cbd5e1; font-size: 20px; }
.ct-search-bar { margin-bottom: 10px; }
.ct-search-bar input {
  width: 100%; border: 0; background: #f1f5f9; border-radius: 10px;
  padding: 10px 12px; font-size: 14px;
}
.ct-crumb { font-size: 12px; color: #64748b; margin-bottom: 8px; }
.ct-crumb a { color: #3b82f6; text-decoration: none; }
.ct-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: 0 0 auto;
  background: #e2e8f0 center/cover no-repeat;
}
.ct-avatar-text {
  display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 700;
}
.ct-name-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-weight: 600; }
.ct-tag {
  font-size: 11px; font-weight: 600; color: #1d4ed8; background: #dbeafe;
  border-radius: 4px; padding: 1px 6px;
}
.ct-tag.soft { color: #64748b; background: #f1f5f9; }
.ct-check { display: grid; place-items: center; }
.ct-batch-bar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  margin-bottom: 8px; padding: 8px 0;
}
.ct-dialog {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(15, 23, 42, 0.45);
  display: grid; place-items: center; padding: 16px;
}
.ct-dialog[hidden] { display: none !important; }
.ct-dialog-card {
  width: min(560px, 100%); max-height: 90vh; overflow: auto;
  background: #fff; border-radius: 12px; padding: 16px;
  box-shadow: 0 16px 40px rgba(15,23,42,.2);
}
.ct-perm-card {
  border: 1px solid #e2e8f0; border-radius: 10px; padding: 12px; margin-bottom: 12px;
}
.ct-perm-head {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px;
}
.ct-perm-apps {
  display: flex; flex-wrap: wrap; gap: 8px 12px;
}
.ct-perm-app {
  display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: #334155;
}
.jdy-nav .nav-link-btn.active { color: #2563eb; font-weight: 700; }

.global-flash {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 120;
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 14px;
  box-shadow: 0 8px 24px rgba(15,23,42,.25);
  max-width: min(90vw, 420px);
}
.global-flash[hidden] { display: none !important; }
