* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

:root {
  --blue: #2f39ff;
  --bg: #f4f2ff;
  --panel: #ffffff;
  --line: #e7e9f1;
  --text: #202633;
  --muted: #8a91a3;
  --soft: #f7f8fc;
}

body {
  margin: 0;
  min-width: 1280px;
  min-height: 100vh;
  color: var(--text);
  background:
    linear-gradient(105deg, rgba(243, 236, 255, 0.9), rgba(249, 245, 252, 0.78) 54%, rgba(235, 232, 255, 0.95)),
    var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

.side-nav {
  position: fixed;
  inset: 0 auto 0 0;
  width: 148px;
  padding: 18px 12px;
  background: rgba(255, 255, 255, 0.72);
  border-right: 1px solid rgba(215, 219, 233, 0.8);
}

.logo {
  margin: 4px 8px 28px;
  font-weight: 800;
  font-size: 17px;
}

.side-item,
.side-link {
  width: 100%;
  height: 42px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  margin-bottom: 8px;
  color: #3d4353;
  background: transparent;
  border: 0;
  border-radius: 8px;
  text-decoration: none;
  font-size: 15px;
}

.side-item.active,
.side-item:hover,
.side-link:hover {
  color: var(--blue);
  background: #ffffff;
}

.app-shell {
  margin-left: 148px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding: 18px 28px;
}

.topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.topbar h1 {
  font-size: 20px;
}

.topbar p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

#saveStatus {
  color: #516079;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 12px;
}

#saveStatus[data-type="success"] {
  color: #16875f;
  border-color: #c9efdd;
  background: #eaf8f2;
}

#saveStatus[data-type="error"] {
  color: #c52b2b;
  border-color: #ffd5d5;
  background: #fff0f0;
}

.primary-button,
.ghost-button,
.link-button,
.back-button,
.toolbar button,
.search-box button {
  height: 34px;
  border-radius: 6px;
  padding: 0 16px;
  font-weight: 600;
}

.primary-button {
  color: #ffffff;
  background: var(--blue);
  border: 1px solid var(--blue);
}

.ghost-button,
.toolbar button,
.search-box button {
  color: #283044;
  background: #ffffff;
  border: 1px solid var(--line);
}

.danger-button {
  color: #283044;
}

.small-button {
  height: 30px;
  padding: 0 12px;
  font-size: 13px;
}

.secondary-button {
  color: #283044;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-weight: 600;
}

.secondary-button.danger-button {
  color: #c52b2b;
  border-color: #ffd1d1;
}

.link-button,
.back-button {
  color: var(--blue);
  background: transparent;
  border: 0;
}

.table-link {
  height: auto;
  padding: 0;
  color: var(--blue);
  background: transparent;
  border: 0;
  font-weight: 600;
}

.hidden {
  display: none !important;
}

.toolbar {
  flex: 0 0 auto;
  min-height: 78px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  background: var(--panel);
  border-radius: 4px;
}

.list-view,
.knowledge-view,
.content-view,
.placeholder-view {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.toolbar .primary-button {
  min-width: 132px;
}

select,
input,
textarea {
  border: 1px solid #dfe3ee;
  border-radius: 5px;
  background: #ffffff;
  color: var(--text);
  outline: none;
}

select,
input {
  height: 34px;
  padding: 0 12px;
}

textarea {
  min-height: 108px;
  padding: 12px;
  resize: none;
  line-height: 1.6;
  font-size: 14px;
}

.search-box {
  display: flex;
  align-items: center;
}

.search-box input {
  width: 260px;
  border-radius: 5px 0 0 5px;
}

.search-box button {
  border-left: 0;
  border-radius: 0 5px 5px 0;
}

.quota {
  margin-left: auto;
  color: #727a8f;
}

.agent-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(280px, 1fr));
  gap: 18px;
  padding: 22px 0;
}

.agent-card {
  min-height: 206px;
  display: grid;
  grid-template-columns: 68px 1fr 40px;
  gap: 16px;
  padding: 22px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.agent-card:hover {
  border-color: #c5cbff;
  box-shadow: 0 14px 36px rgba(48, 57, 255, 0.08);
}

.agent-card img {
  width: 62px;
  height: 62px;
  object-fit: cover;
  object-position: top center;
  border-radius: 50%;
}

.agent-card h3 {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
}

.agent-card .price {
  margin-top: 10px;
  color: #ff3b30;
  font-size: 14px;
}

.agent-card .desc {
  min-height: 44px;
  margin-top: 18px;
  color: var(--muted);
  line-height: 1.5;
}

.card-tags {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.tag {
  color: #647086;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 3px 7px;
  font-size: 12px;
}

.tag.published {
  color: #16875f;
  background: #eaf8f2;
  border-color: #c9efdd;
}

.empty-state {
  grid-column: 1 / -1;
  min-height: 180px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.card-footer {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 14px;
  color: #b0b6c5;
  border-top: 1px solid var(--line);
}

.channel-link {
  color: var(--blue);
}

.more-button {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 8px;
  background: #f3f5fa;
  color: #4f596d;
  font-weight: 800;
}

.detail-view {
  width: 100%;
  margin: 0 auto;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.crumb-tabs {
  flex: 0 0 auto;
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.crumb-tabs button {
  height: 34px;
  padding: 0 16px;
  color: #2e3547;
  background: #ffffff;
  border: 0;
  border-radius: 10px;
  font-weight: 700;
}

.crumb-tabs button strong {
  margin-left: 8px;
  font-size: 16px;
}

.crumb-tabs button.active {
  color: var(--blue);
}

.agent-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 14px 22px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 4px 4px 0 0;
}

.agent-title-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.agent-title-group img {
  width: 46px;
  height: 46px;
  object-fit: cover;
  object-position: top center;
  border-radius: 50%;
}

.back-button {
  margin: 0 0 14px -14px;
  font-size: 20px;
}

.detail-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.hero-card {
  display: grid;
  grid-template-columns: 78px 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 24px;
}

.hero-card img {
  width: 58px;
  height: 58px;
  object-fit: cover;
  object-position: top center;
  border-radius: 50%;
}

.title-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.title-line h2 {
  font-size: 18px;
}

.hero-card p {
  margin-top: 8px;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  gap: 8px;
}

.status-pill {
  color: #647086;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 3px 7px;
  font-size: 13px;
}

.status-pill.published {
  color: #16875f;
  background: #eaf8f2;
  border-color: #c9efdd;
}

.detail-tabs {
  display: flex;
  gap: 38px;
  margin-top: 18px;
  padding: 0 18px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.agent-page-tabs {
  flex: 0 0 auto;
  display: flex;
  gap: 36px;
  height: 48px;
  padding: 0 24px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-top: 0;
}

.agent-page-tab,
.config-tab {
  color: #2e3547;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  font-size: 15px;
}

.agent-page-tab.active,
.config-tab.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

.agent-page {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

#appPage {
  display: flex;
  flex-direction: column;
}

#appPage.hidden {
  display: none !important;
}

.creator-layout {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(360px, 31%) minmax(420px, 1fr) 360px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-top: 0;
}

.prompt-column,
.config-column,
.preview-column {
  min-width: 0;
  min-height: 0;
  padding: 12px 16px 8px;
  border-right: 1px solid var(--line);
}

.preview-column {
  overflow: hidden;
}

.prompt-column {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.config-column {
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.preview-column {
  border-right: 0;
}

.model-row {
  display: grid;
  grid-template-columns: 1fr 220px;
  align-items: center;
  position: relative;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.model-picker {
  position: relative;
}

.model-trigger {
  width: 100%;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  color: #263047;
  background: #ffffff;
  border: 1px solid #dfe3ee;
  border-radius: 5px;
  font-size: 14px;
}

.model-trigger-arrow {
  color: #a5abba;
  font-size: 18px;
}

.model-popover {
  position: absolute;
  z-index: 30;
  top: calc(100% + 12px);
  right: 0;
  width: 360px;
  padding: 18px;
  background: #ffffff;
  border: 1px solid #e4e8f1;
  border-radius: 6px;
  box-shadow: 0 18px 48px rgba(20, 28, 48, 0.16);
}

.model-popover::before {
  content: "";
  position: absolute;
  top: -7px;
  right: 78px;
  width: 12px;
  height: 12px;
  background: #ffffff;
  border-left: 1px solid #e4e8f1;
  border-top: 1px solid #e4e8f1;
  transform: rotate(45deg);
}

.model-popover h3 {
  margin-bottom: 14px;
  font-size: 18px;
}

.model-popover label {
  display: grid;
  gap: 8px;
}

.model-popover select {
  height: 34px;
}

.model-diversity {
  display: grid;
  grid-template-columns: 1fr 92px;
  gap: 10px 12px;
  padding: 18px 0 0;
}

.prompt-column > .model-row + .model-diversity,
.prompt-column > .model-diversity {
  display: none !important;
}

.model-popover .model-diversity {
  display: grid !important;
}

.model-diversity > div {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: baseline;
}

.model-diversity strong {
  font-size: 14px;
  white-space: nowrap;
}

.model-diversity p {
  margin-top: 0;
  color: var(--muted);
  line-height: 1.2;
  font-size: 13px;
}

.model-diversity input[type="range"] {
  grid-column: 1;
  width: 100%;
  padding: 0;
  align-self: center;
}

.model-diversity input[type="number"] {
  grid-column: 2;
  width: 92px;
  height: 32px;
}

.panel-title,
.setting-title,
.inline-title,
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-title {
  flex: 0 0 auto;
  margin: 8px 0 6px;
}

.panel-title h3,
.setting-title strong,
.model-row strong,
.preview-column > h3 {
  font-size: 16px;
}

.prompt-textarea {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  height: auto;
  max-height: none;
  background: #f2f4fa;
  border: 0;
  border-radius: 8px;
  overflow-y: auto;
}

.char-counter {
  flex: 0 0 auto;
  margin-top: -6px;
  color: #b0b5c3;
  font-size: 13px;
  text-align: right;
}

.agreement-line {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  color: #334052;
}

.agreement-line input {
  width: 16px;
  height: 16px;
}

.config-tabs {
  display: flex;
  gap: 34px;
  height: 38px;
  border-bottom: 1px solid var(--line);
}

.config-panel {
  padding-top: 16px;
}

.setting-block {
  display: grid;
  gap: 10px;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.setting-title span,
.muted-text {
  color: var(--muted);
}

.switch-line {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--blue);
}

.setting-title .switch-line:has(#knowledgeEnabledInput) {
  display: none;
}

.inline-add {
  width: fit-content;
  color: var(--blue);
  background: transparent;
  border: 0;
}

.danger-link {
  color: #f04d4f;
}

.quick-button-list,
.phone-quick-buttons,
.knowledge-bindings {
  display: grid;
  gap: 10px;
}

.quick-button-row {
  display: grid;
  grid-template-columns: 1fr 70px;
  gap: 10px;
}

.opening-question-list {
  display: grid;
  gap: 10px;
}

.opening-question-row {
  display: grid;
  grid-template-columns: 1fr 70px;
  gap: 10px;
}

.opening-question-row .icon-button:disabled {
  color: #b8becb;
  cursor: not-allowed;
}

.icon-button {
  color: #4a5368;
  background: #f4f6fb;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.kb-binding {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: #f8f9fd;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.kb-binding .check-line span {
  color: var(--muted);
}

.kb-binding-head {
  cursor: default;
}

.kb-binding-head .kb-enabled {
  display: none;
}

.kb-binding-head .upload-bound-kb {
  display: none;
}

.kb-binding-head {
  gap: 12px;
}

.kb-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: 12px;
}

.kb-controls label {
  display: grid;
  gap: 8px;
  font-size: 13px;
}

.kb-controls select,
.kb-controls input {
  width: 100%;
  height: 40px;
}

.disabled-block {
  color: var(--muted);
  background: #f8f9fd;
  padding: 14px;
  border-radius: 8px;
}

.skill-card {
  background: #ffffff;
}

.add-kb-inline {
  height: 42px;
  color: var(--blue);
  background: #f5f6fb;
  border: 0;
  border-radius: 6px;
  font-weight: 700;
}

.chat-bg-upload {
  width: 104px;
  height: 104px;
  display: grid;
  place-items: center;
  color: #8d93a2;
  background: #f7f8fc;
  border: 1px solid #d8deeb;
  border-radius: 8px;
  cursor: pointer;
  overflow: hidden;
  text-align: center;
}

.chat-bg-actions {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  margin-top: -2px;
}

.chat-bg-upload.has-image {
  border-style: solid;
}

.chat-bg-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bottom-save-bar {
  flex: 0 0 auto;
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: center;
  padding: 10px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-top: 0;
}

.simple-editor-card,
.placeholder-card,
.knowledge-view {
  padding: 24px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.simple-editor-card {
  display: grid;
  gap: 18px;
  max-width: 900px;
}

.knowledge-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 18px;
  margin-top: 18px;
}

.folder-list,
.knowledge-table-card {
  background: #f8f9fd;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.folder-item {
  width: 100%;
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  padding: 12px;
  color: #30384a;
  background: #ffffff;
  border: 1px solid transparent;
  border-radius: 6px;
}

.folder-item.active {
  color: var(--blue);
  border-color: #c5cbff;
}

.table-title {
  margin-bottom: 12px;
  font-weight: 800;
}

.knowledge-file-list,
.kb-row,
.file-row {
  display: grid;
  gap: 8px;
}

.kb-row,
.file-row {
  padding: 12px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-bottom: 8px;
}

.kb-row {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.kb-row > div {
  display: grid;
  gap: 8px;
}

.file-row {
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
}

.kb-row span,
.kb-row em,
.file-row em {
  color: var(--muted);
  font-style: normal;
}

.detail-tab {
  height: 50px;
  padding: 0;
  color: #2e3547;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
}

.detail-tab.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 310px;
  gap: 18px;
  margin-top: 18px;
}

.editor-column,
.editor-column {
  min-height: 560px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 24px;
}

.tab-panel {
  display: grid;
  gap: 18px;
}

.tab-panel h3 {
  font-size: 19px;
}

label {
  display: grid;
  gap: 8px;
  color: #30384a;
}

.form-note {
  color: var(--muted);
  background: var(--soft);
  border-radius: 6px;
  padding: 12px;
  line-height: 1.6;
}

.radio-grid {
  display: flex;
  gap: 26px;
}

.radio-grid label,
.check-line {
  display: flex;
  align-items: center;
  gap: 9px;
}

.radio-grid input,
.check-line input {
  width: 16px;
  height: 16px;
  padding: 0;
}

.channel-preview {
  padding: 16px;
  background: var(--soft);
  border-radius: 8px;
  line-height: 1.8;
}

.channel-preview p {
  color: var(--muted);
}

.phone {
  width: min(330px, 100%);
  max-width: 330px;
  min-height: 0;
  height: min(560px, calc(100vh - 300px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  border-radius: 24px;
  background:
    radial-gradient(circle at 22% 10%, rgba(255, 255, 255, 0.9), transparent 26%),
    linear-gradient(160deg, #f5eaf4 0%, #dfe2ff 44%, #c8d5ff 100%);
  background-size: cover;
  background-position: center;
  border: 1px solid #dfe4f0;
  margin: 16px auto 0;
}

.phone-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 14px 14px;
  scrollbar-gutter: stable;
}

.phone-scroll::-webkit-scrollbar {
  width: 6px;
}

.phone-scroll::-webkit-scrollbar-thumb {
  background: rgba(74, 82, 112, 0.34);
  border-radius: 999px;
}

.phone-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.phone-top span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(30, 36, 50, 0.25);
}

.phone img {
  display: block;
  width: 70px;
  height: 70px;
  object-fit: cover;
  object-position: top center;
  margin: 30px auto 16px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.72);
}

.phone-card {
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.24);
}

.phone-card h4 {
  text-align: center;
  margin-bottom: 12px;
  font-size: 16px;
}

.phone-card p {
  color: #333b4f;
  line-height: 1.6;
  font-size: 14px;
}

.quick-tip {
  width: fit-content;
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  background: #ffffff;
  color: #536078;
}

.phone-input {
  flex: 0 0 auto;
  height: 42px;
  margin: 10px 14px 14px;
  padding-left: 16px;
  display: flex;
  align-items: center;
  color: #a0a7b5;
  background: #ffffff;
  border-radius: 22px;
}

.preview-column .full {
  width: 100%;
  margin-top: 14px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.42);
}

.modal-card {
  width: min(980px, calc(100vw - 80px));
  max-height: calc(100vh - 80px);
  overflow: auto;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.22);
}

.model-edit-dialog {
  width: min(560px, calc(100vw - 40px)) !important;
}

.wide-modal {
  width: min(1400px, calc(100vw - 80px));
}

.knowledge-modal-card {
  width: min(900px, calc(100vw - 80px));
}

.service-modal-card {
  width: min(820px, calc(100vw - 80px));
}

.chat-bg-modal-card {
  width: min(1360px, calc(100vw - 80px));
}

.chat-bg-preview-grid {
  display: grid;
  grid-template-columns: minmax(560px, 1fr) 360px;
  gap: 20px;
  padding: 24px;
}

.chat-bg-web-preview,
.chat-bg-mobile-preview {
  position: relative;
  min-height: 560px;
  overflow: hidden;
  border-radius: 8px;
  background-color: #f5e5d8;
  background-size: cover;
  background-position: center;
}

.chat-bg-mobile-preview {
  max-width: 360px;
}

.chat-bg-web-preview > span,
.chat-bg-mobile-preview > span,
.bg-preview-tag {
  position: absolute;
  left: 18px;
  top: 18px;
  z-index: 2;
  padding: 7px 10px;
  color: #ffffff;
  background: rgba(35, 31, 28, 0.52);
  border-radius: 4px;
  font-weight: 700;
}

.bg-preview-tag {
  top: 104px;
}

.bg-preview-card,
.bg-preview-pill {
  position: absolute;
  z-index: 1;
  background: rgba(255, 255, 255, 0.86);
  border-radius: 14px;
  backdrop-filter: blur(4px);
}

.large-card {
  left: 26px;
  top: 118px;
  width: 82%;
  height: 150px;
}

.wide-pill {
  right: 22px;
  top: 304px;
  width: 44%;
  height: 48px;
  background: rgba(70, 66, 60, 0.32);
  border-radius: 18px;
}

.small-card {
  left: 26px;
  bottom: 178px;
  width: 47%;
  height: 50px;
}

.mobile-card {
  left: 30px;
  top: 112px;
  width: 76%;
  height: 172px;
}

.mobile-small-card {
  left: 28px;
  bottom: 182px;
  width: 52%;
  height: 54px;
}

.split-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.split-actions > div {
  display: flex;
  gap: 12px;
}

.confirm-modal-card {
  width: min(640px, calc(100vw - 80px));
  padding-bottom: 16px;
}

.confirm-body {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 26px 24px 10px;
  font-size: 18px;
}

.warning-dot {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  color: #ffffff;
  background: #ffad1f;
  border-radius: 50%;
  font-weight: 800;
}

.modal-title {
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
}

.modal-title h2 {
  font-size: 20px;
}

.modal-close {
  width: 34px;
  height: 34px;
  color: #8b91a0;
  background: transparent;
  border: 0;
  font-size: 28px;
  line-height: 1;
}

.basic-form {
  display: grid;
  gap: 26px;
  padding: 26px 32px 40px;
}

.basic-form label {
  display: grid;
  grid-template-columns: 130px 1fr;
  align-items: start;
  gap: 18px;
}

.basic-form em {
  color: #ff3b30;
  font-style: normal;
}

.avatar-desc-line {
  grid-template-columns: 130px 120px 1fr !important;
}

.avatar-upload { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.avatar-upload input[type="text"] { flex: 1; min-width: 180px; }
.avatar-old {
  height: 120px;
  display: grid;
  place-items: center;
  align-content: center;
  color: #8d93a2;
  background: #f3f5fa;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.avatar-upload input {
  width: 100%;
  height: 0;
  opacity: 0;
  padding: 0;
  border: 0;
}

.avatar-upload strong {
  font-size: 28px;
  font-weight: 300;
}

.basic-form textarea {
  min-height: 120px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 18px 24px 24px;
}

.modal-actions.split-actions {
  justify-content: space-between;
}

.left-actions {
  justify-content: flex-start;
  padding-left: 180px;
}

.knowledge-modal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
}

.new-kb-form {
  display: grid;
  grid-template-columns: 1fr 1fr 1.4fr auto;
  gap: 12px;
  padding: 0 24px 18px;
}

.knowledge-picker-table {
  margin: 0 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.table-head,
.picker-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 150px;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
}

.table-head {
  background: #f6f7fb;
}

.picker-row {
  border-top: 1px solid var(--line);
}

.picker-row input {
  width: 16px;
  height: 16px;
}

.picker-row {
  grid-template-columns: 24px 1.2fr 1fr 150px;
}

.picker-row em {
  color: var(--blue);
  font-style: normal;
}

.picker-row em {
  display: flex;
  align-items: center;
  gap: 8px;
}

.knowledge-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-top: 1px solid var(--line);
  background: #ffffff;
}

.knowledge-detail-head > div:first-child {
  display: grid;
  gap: 6px;
}

.knowledge-detail-head span {
  color: var(--muted);
}

.knowledge-detail-head > div:last-child {
  display: flex;
  gap: 10px;
}

.kb-file-row {
  grid-template-columns: 1.3fr 1fr 180px;
}

.service-modal-card {
  padding-bottom: 34px;
}

.service-modal-card > label {
  grid-template-columns: 120px 360px;
  align-items: center;
  margin: 26px 80px 0;
}

.qr-upload {
  width: 140px;
  height: 140px;
  display: grid;
  place-items: center;
  margin: 26px 0 0 198px;
  color: #8d93a2;
  border: 1px dashed #d5dae6;
  border-radius: 8px;
  cursor: pointer;
  overflow: hidden;
}

.qr-upload input {
  width: 100%;
  height: 0;
  opacity: 0;
  padding: 0;
  border: 0;
}

.qr-preview {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
  background: #fff;
}

@media (max-width: 1500px) {
  .agent-card-grid {
    grid-template-columns: repeat(2, minmax(280px, 1fr));
  }
}
#dataPage > .simple-editor-card {
  display: none;
}

.memory-admin-panel {
  height: 100%;
  padding: 24px;
  overflow: hidden;
  background: #fff;
  display: grid;
  grid-template-columns: 410px minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 14px 16px;
}

.memory-admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 0;
  grid-column: 1 / -1;
}

.memory-admin-head h3 {
  margin: 0 0 6px;
  font-size: 18px;
  color: #111827;
}

.memory-stat-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 0;
  grid-column: 1;
  grid-row: 2;
}

.memory-stat-grid div {
  padding: 12px 14px;
  border: 1px solid #e6e8f0;
  background: #f8f9fc;
  border-radius: 8px;
}

.memory-stat-grid strong {
  display: block;
  font-size: 20px;
  line-height: 1.2;
  color: #111827;
}

.memory-stat-grid span {
  color: #7d8798;
  font-size: 13px;
}

.memory-layout {
  display: contents;
}

.memory-layout .memory-list {
  grid-column: 1;
  grid-row: 3;
  min-height: 0;
}

.memory-layout .memory-thread {
  grid-column: 2;
  grid-row: 2 / 4;
  min-height: 0;
}

.memory-list,
.memory-thread {
  min-height: 0;
  overflow: auto;
  border: 1px solid #e6e8f0;
  border-radius: 8px;
  background: #fff;
}

.memory-item {
  padding: 16px;
  border-bottom: 1px solid #edf0f5;
  cursor: default;
}

.memory-item.active {
  background: #eef5ff;
  box-shadow: inset 3px 0 0 #2338ff;
}

.memory-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.memory-item-head strong {
  font-size: 15px;
  color: #111827;
}

.memory-item-head span,
.memory-thread-head span,
.memory-meta {
  font-size: 12px;
  color: #8a94a6;
}

.memory-summary-preview {
  margin: 0 0 12px;
  color: #4b5565;
  line-height: 1.6;
  font-size: 13px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.memory-actions {
  display: flex;
  gap: 14px;
}

.memory-thread-head {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #f8f9fc;
  border-bottom: 1px solid #e6e8f0;
}

.memory-message-list {
  padding: 16px;
}

.memory-message {
  margin-bottom: 14px;
  max-width: 88%;
}

.memory-message.user {
  margin-left: auto;
  text-align: right;
}

.memory-message strong {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  color: #8a94a6;
}

.memory-message p {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  line-height: 1.6;
  font-size: 13px;
  white-space: pre-wrap;
  text-align: left;
  background: #f2f4f8;
}

.memory-message.user p {
  color: #fff;
  background: #2338ff;
}

.empty-memory {
  padding: 30px;
  color: #8a94a6;
  text-align: center;
}

.memory-modal-card {
  width: min(760px, calc(100vw - 80px));
}

.memory-modal-card textarea {
  width: 100%;
  height: 360px;
  resize: none;
  border: 1px solid #dce2ee;
  border-radius: 8px;
  padding: 14px;
  line-height: 1.7;
  font-size: 14px;
 outline: none;
 background: #f8f9fc;
}

/* ===== Leads Management ===== */
.leads-panel { padding: 0 24px 24px; }
.leads-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.leads-head h3 { font-size: 18px; margin: 0 0 4px 0; }
.leads-stage-filter { display: flex; gap: 8px; margin-bottom: 16px; }
.stage-pill { padding: 4px 14px; border-radius: 14px; border: 1px solid #d9dce6; background: #fff; font-size: 13px; color: #555; cursor: pointer; }
.stage-pill.active { background: #3b82f6; color: #fff; border-color: #3b82f6; }
.leads-list { display: flex; flex-direction: column; gap: 10px; }
.lead-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 14px 16px; cursor: pointer; transition: box-shadow .15s; }
.lead-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.lead-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.lead-user { font-weight: 600; font-size: 14px; color: #1a1a2e; }
.lead-stage { font-size: 12px; padding: 2px 8px; border-radius: 10px; font-weight: 500; }
.stage-new { background: #fef3c7; color: #92400e; }
.stage-contacted { background: #dbeafe; color: #1e40af; }
.stage-qualified { background: #e0e7ff; color: #3730a3; }
.stage-proposal { background: #ede9fe; color: #5b21b6; }
.stage-negotiation { background: #fce7f3; color: #9d174d; }
.stage-won { background: #d1fae5; color: #065f46; }
.stage-lost { background: #f3f4f6; color: #6b7280; }
.lead-need { font-size: 13px; color: #555; margin-bottom: 4px; }
.lead-meta { font-size: 12px; color: #999; }
.leads-detail.hidden { display: none; }
.back-link { background: none; border: none; color: #3b82f6; font-size: 14px; cursor: pointer; margin-bottom: 12px; padding: 0; }
.lead-detail-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 20px; }
.lead-detail-row { display: flex; justify-content: space-between; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid #f0f0f0; font-size: 14px; }
.lead-detail-row:last-child { border-bottom: none; }
.lead-detail-row strong { color: #333; min-width: 80px; }
.lead-detail-row span { color: #666; text-align: right; flex: 1; }
.lead-stage-select { border: 1px solid #d9dce6; border-radius: 6px; padding: 2px 8px; font-size: 13px; }

/* Sale Settings */
.save-inline-button { width: auto; padding: 6px 20px; font-size: 13px; }
.sale-metered-config { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.sale-metered-config.hidden { display: none; }
.sale-metered-config label { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.sale-metered-config input[type="number"] { width: 80px; padding: 4px 8px; border: 1px solid #d9dce6; border-radius: 4px; font-size: 13px; }
.model-tag { display: inline-block; padding: 2px 10px; background: #eef2ff; border-radius: 4px; font-weight: 600; font-size: 13px; color: #3730a3; }

.model-pricing-list { display: flex; flex-direction: column; gap: 10px; padding: 8px 0; }
.pricing-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; background: #f8f9fc; border-radius: 6px; font-size: 13px; }
.pricing-row span { font-weight: 600; color: #3730a3; }
.pricing-row input[type="number"] { width: 80px; padding: 4px 8px; border: 1px solid #d9dce6; border-radius: 4px; font-size: 13px; }


/* Models Management */
.models-table-card { display: flex; flex-direction: column; gap: 10px; min-height: 80px; }
.model-edit-form { display: flex; flex-direction: column; gap: 12px; }
.model-edit-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: #444; }
.model-edit-form label input,
.model-edit-form label select { padding: 6px 10px; border: 1px solid #d9dce6; border-radius: 6px; font-size: 13px; }

.model-detail-panel { padding: 16px; min-height: 200px; }


/* ===== Models Management ===== */
  display: flex;
  flex-direction: column;
  gap: 12px;
}
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px 20px;
  margin: 0;
}
  border-color: #c7d2fe;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
  font-size: 15px;
  color: #1a1a2e;
}
  font-size: 12px;
  color: #888;
  margin-bottom: 10px;
  word-break: break-all;
}
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
  font-size: 12px;
  color: #555;
  background: #f3f4f6;
  padding: 3px 10px;
  border-radius: 4px;
}
  background: #eef2ff;
  color: #3730a3;
  font-weight: 600;
}
  display: flex;
  gap: 8px;
}
  padding: 4px 14px;
  font-size: 12px;
}

/* ===== Models Management ===== */
.models-view { padding: 0 24px 24px; }
.models-view #modelsList {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.models-view .model-card {
  min-height: 120px;
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 16px;
  padding: 20px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  min-height: 100px;
}
.models-view .model-card:hover {
  border-color: #c5cbff;
  box-shadow: 0 8px 24px rgba(48, 57, 255, 0.06);
}
.model-card-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
}
.model-card-body h3 {
  font-size: 15px;
  margin: 0 0 4px 0;
  color: #1a1a2e;
}
.model-card-provider {
  font-size: 12px;
  color: #888;
  margin-bottom: 6px;
}
.model-card-endpoint {
  font-size: 12px;
  color: #999;
  margin: 0 0 10px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 400px;
}
.model-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.model-tag-chip {
  color: #647086;
  border: 1px solid #e5e7eb;
  border-radius: 5px;
  padding: 2px 8px;
  font-size: 11px;
  background: #f9fafb;
}
.model-tag-cost {
  background: #eef2ff;
  color: #3730a3;
  border-color: #c7d2fe;
  font-weight: 600;
}
.model-card-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.model-card-actions .ghost-button {
  padding: 4px 12px;
  font-size: 12px;
  white-space: nowrap;
}

.models-view #modelsList {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.models-view .model-card {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 14px;
  padding: 18px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  min-height: 100px;
}
.models-view .model-card:hover {
  border-color: #c5cbff;
  box-shadow: 0 8px 24px rgba(48, 57, 255, 0.06);
}
.model-card-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}
.model-card-name-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.model-card-name-row h3 {
  font-size: 15px;
  margin: 0;
  color: #1a1a2e;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 60%;
}
.model-status {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}
.model-status-on { background: #d1fae5; color: #065f46; }
.model-status-off { background: #f3f4f6; color: #9ca3af; }
.model-card-provider {
  font-size: 12px;
  color: #888;
  margin-bottom: 6px;
}
.model-card-endpoint {
  font-size: 11px;
  color: #aaa;
  margin: 0 0 8px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.model-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.model-tag-chip {
  color: #647086;
  border: 1px solid #e5e7eb;
  border-radius: 5px;
  padding: 2px 8px;
  font-size: 11px;
  background: #f9fafb;
}
.model-tag-cost {
  background: #eef2ff;
  color: #3730a3;
  border-color: #c7d2fe;
  font-weight: 600;
}
.models-view .model-card-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.models-view .model-card-actions .ghost-button {
  padding: 4px 10px;
  font-size: 11px;
  white-space: nowrap;
}
.folder-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.folder-row:hover { background: #f3f4f6; }
.folder-row.active { background: #eef2ff; color: #3730a3; font-weight: 600; }
.folder-name { flex: 1; }
.folder-name span { font-size: 11px; color: #888; margin-left: 8px; }
.folder-delete-btn { border: none; background: none; color: #ef4444; font-size: 16px; cursor: pointer; padding: 0 4px; line-height: 1; opacity: 0; }
.folder-row:hover .folder-delete-btn { opacity: 1; }

.folder-row .folder-name { cursor: pointer; }

.search-config-card {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: 18px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  margin: 16px 0 16px 0;
}
.search-config-fields { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.search-config-fields label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: #888; }
.search-config-fields label input,
.search-config-fields label select { padding: 5px 8px; border: 1px solid #d9dce6; border-radius: 5px; font-size: 12px; min-width: 180px; }

.tenant-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 0; margin-bottom: 22px; }
.tenant-toolbar .search-box input { width: 220px; }
.tenant-actions { display: flex; align-items: center; gap: 10px; }
.tenant-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 0; }
.tenant-card { position: relative; min-height: 156px; display: grid; grid-template-columns: 62px 1fr; gap: 16px; padding: 22px; background: #fff; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.tenant-card:hover { border-color: #c5cbff; box-shadow: 0 14px 36px rgba(48,57,255,.08); }
.tenant-card.selected { border-color: #3139ff; box-shadow: 0 14px 36px rgba(48,57,255,.12); }
.tenant-select-box { position: absolute; top: 12px; right: 12px; width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.tenant-select-box input { width: 16px; height: 16px; accent-color: #3139ff; cursor: pointer; }
.tenant-card-avatar { width: 58px; height: 58px; border-radius: 50%; background: #eef2ff; color: #3730a3; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 20px; flex-shrink: 0; }
.tenant-card-body { overflow: hidden; }
.tenant-card-body h3 { font-size: 16px; margin: 0 0 6px 0; color: #1a1a2e; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }
.tenant-number { font-size: 12px; color: #888; font-weight: 400; margin-left: 4px; }
.tenant-card-desc { font-size: 13px; color: #999; margin: 0 0 12px 0; }
.tenant-card-tags { display: flex; gap: 8px; }
.tenant-card-tags .tag { color: #647086; border: 1px solid var(--line); border-radius: 5px; padding: 3px 7px; font-size: 12px; }
.tenant-card-tags .tag-blue { background: #eef2ff; color: #3730a3; border-color: #c7d2fe; font-weight: 600; }
.content-back-row { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding: 0 24px; }
.tenant-title { font-size: 16px; font-weight: 600; color: #1a1a2e; }

.content-view {
  padding: 0 24px 24px;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.content-view .section-head { flex: 0 0 auto; min-height: 60px; display: flex; align-items: center; gap: 14px; padding: 20px 0 0; margin-bottom: 20px; }
#contentSections {
  padding-bottom: 64px;
}
.content-section-block {
  margin-bottom: 22px;
  padding: 20px;
  border: 1px solid #e7e9f2;
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, #fbfcff);
  box-shadow: 0 12px 34px rgba(20, 28, 55, .04);
}
.content-section-title {
  margin-bottom: 14px;
  font-size: 16px;
  line-height: 1.4;
  font-weight: 700;
  color: #111827;
}
.content-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.content-card {
  padding: 18px;
  border: 1px solid #e4e7f0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .04);
}
.content-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid #f0f2f7;
}
.content-card-head strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
  line-height: 1.35;
  color: #111827;
}
.content-card-head p {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: #7b8497;
}
.content-card-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.content-card-fields label,
.content-image-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  font-size: 12px;
  color: #667085;
}
.content-image-hint {
  margin: -2px 0 2px;
  font-size: 12px;
  line-height: 1.45;
  color: #8a94a6;
}
.content-card-fields input,
.content-card-fields textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d9ddea;
  border-radius: 6px;
  padding: 9px 10px;
  font-size: 13px;
  color: #111827;
  outline: none;
  resize: vertical;
}
.content-card-fields input:focus,
.content-card-fields textarea:focus {
  border-color: #3139ff;
  box-shadow: 0 0 0 3px rgba(49,57,255,.08);
}
.content-card-fields .wide-field,
.content-image-field {
  grid-column: 1 / -1;
}
.content-card-img {
  width: 180px;
  max-width: 100%;
  height: 84px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #e5e7ef;
  background: #f6f7fb;
}
.content-card-img.qr {
  width: 220px;
  height: 128px;
}
.content-card-img.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #98a2b3;
  font-size: 12px;
}
.content-field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.legal-settings-block {
  margin-bottom: 48px;
}

.legal-template-block {
  margin-top: 18px;
}

.legal-settings-desc {
  margin: -4px 0 14px;
  font-size: 13px;
  line-height: 1.6;
  color: #667085;
}

.legal-template-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.legal-template-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border: 1px solid #e4e7f0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .04);
}

.legal-template-card strong {
  display: block;
  font-size: 15px;
  color: #111827;
}

.legal-template-card p {
  margin: 7px 0 5px;
  font-size: 13px;
  color: #667085;
}

.legal-template-card span {
  font-size: 12px;
  color: #98a2b3;
}

.legal-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.legal-card {
  padding: 16px;
  border: 1px solid #e4e7f0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .04);
}

.legal-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid #f0f2f7;
}

.legal-card-head strong {
  font-size: 14px;
  color: #111827;
}

.legal-card-head span,
.legal-template-tip {
  font-size: 12px;
  line-height: 1.45;
  color: #8a94a6;
}

.legal-card label,
.legal-custom-fields {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.legal-card label {
  margin-bottom: 12px;
  font-size: 12px;
  color: #667085;
}

.legal-card input,
.legal-card select,
.legal-card textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d9ddea;
  border-radius: 6px;
  padding: 9px 10px;
  font-size: 13px;
  color: #111827;
  background: #fff;
  outline: none;
}

.legal-card textarea {
  resize: vertical;
  line-height: 1.6;
}

.legal-card input:focus,
.legal-card select:focus,
.legal-card textarea:focus {
  border-color: #3139ff;
  box-shadow: 0 0 0 3px rgba(49,57,255,.08);
}

.legal-template-tip {
  margin: 0;
}

.recycle-view {
  padding: 26px;
  overflow-y: auto;
}

.recycle-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.recycle-card {
  padding: 20px;
  border: 1px solid #e4e7f0;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .05);
}

.recycle-card-head,
.recycle-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.recycle-card-head {
  margin-bottom: 16px;
}

.recycle-card-head h3 {
  margin: 0;
  font-size: 18px;
  color: #111827;
}

.recycle-card-head span {
  font-size: 13px;
  color: #667085;
}

.recycle-list,
.service-log-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.recycle-item,
.service-log-row {
  padding: 14px;
  border: 1px solid #eef1f7;
  border-radius: 8px;
  background: #fafbff;
}

.recycle-main {
  min-width: 0;
}

.recycle-item strong {
  font-size: 15px;
  color: #111827;
}

.recycle-item p {
  margin: 5px 0 0;
  font-size: 13px;
  color: #667085;
}

.recycle-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: right;
  font-size: 12px;
  color: #8a94a6;
}

.recycle-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.service-log-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 420px) auto 1fr;
  gap: 10px;
  align-items: center;
  margin: 0 0 12px;
}

.service-log-toolbar input {
  height: 34px;
  padding: 0 12px;
  border: 1px solid #d9deea;
  border-radius: 6px;
  color: #111827;
  background: #ffffff;
}

.service-log-toolbar input:focus {
  border-color: #3139ff;
  outline: none;
  box-shadow: 0 0 0 3px rgba(49, 57, 255, .08);
}

.service-log-toolbar span {
  justify-self: end;
  font-size: 13px;
  color: #8a94a6;
}

.service-log-row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) 120px;
  gap: 12px;
  align-items: center;
  font-size: 13px;
}

.service-log-row span,
.service-log-row em {
  color: #8a94a6;
  font-style: normal;
}

.service-log-row strong {
  color: #111827;
  font-weight: 600;
}
