:root {
  --primary: #07c160;
  --primary-hover: #06ad56;
  --primary-light: #f0faf4;
  --bg-page: #f5f7fa;
  --bg-card: #ffffff;
  --border: #eaecef;
  --text-main: #1d1d1f;
  --text-secondary: #86909c;
  --radius-base: 8px;
  --radius-card: 12px;
  --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.04);
  --shadow-header: 0 1px 0 rgba(0, 0, 0, 0.04);
  --shadow-aside: 1px 0 0 rgba(0, 0, 0, 0.04);
  --success: #07c160;
  --warning: #e6a23c;
  --danger: #f56c6c;
  --aside-width: 220px;
  --header-h: 56px;
  /* 终端 Mac 灯 */
  --mac-dot-red: #ff5f57;
  --mac-dot-yellow: #ffbd2e;
  --mac-dot-green: #28ca42;
  --terminal-bg: #1e1e1e;
  --terminal-head-bg: #2d2d2d;
  --terminal-head-fg: #a9b7c6;
  --terminal-fg: #a6e22e;
  --terminal-fg-muted: #f8f8f2;
}

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

html,
body {
  height: 100%;
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
    sans-serif;
  font-size: 14px;
  color: var(--text-main);
  background: var(--bg-page);
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.22) transparent;
}

body::-webkit-scrollbar,
.layout-main::-webkit-scrollbar,
.profile-log-body::-webkit-scrollbar,
.webhook-terminal::-webkit-scrollbar,
.contacts-list-body::-webkit-scrollbar,
.sns-feed-list::-webkit-scrollbar,
.lf-cards::-webkit-scrollbar,
*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

body::-webkit-scrollbar-track,
.layout-main::-webkit-scrollbar-track,
.profile-log-body::-webkit-scrollbar-track,
.webhook-terminal::-webkit-scrollbar-track,
.contacts-list-body::-webkit-scrollbar-track,
.sns-feed-list::-webkit-scrollbar-track,
.lf-cards::-webkit-scrollbar-track,
*::-webkit-scrollbar-track {
  background: transparent;
}

body::-webkit-scrollbar-thumb,
.layout-main::-webkit-scrollbar-thumb,
.profile-log-body::-webkit-scrollbar-thumb,
.webhook-terminal::-webkit-scrollbar-thumb,
.contacts-list-body::-webkit-scrollbar-thumb,
.sns-feed-list::-webkit-scrollbar-thumb,
.lf-cards::-webkit-scrollbar-thumb,
*::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.22);
  border-radius: 6px;
}

body::-webkit-scrollbar-thumb:hover,
*::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.32);
}

input[type='text'],
input[type='url'],
input[type='number'],
input[type='password'],
select,
textarea {
  background: #f7f8fa;
  border: 1px solid var(--border);
  border-radius: var(--radius-base);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type='text']:focus,
input[type='url']:focus,
input[type='number']:focus,
input[type='password']:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.15);
}

.layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.layout-header {
  height: var(--header-h);
  padding: 0 16px;
  display: flex;
  align-items: center;
  border-bottom: none;
  background: var(--bg-card);
  flex-shrink: 0;
  box-shadow: var(--shadow-header);
}

.header-inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  font-weight: 600;
  white-space: nowrap;
  color: var(--text-main);
}

.header-brand-cluster {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.header-quick-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

a.btn-header-link,
button.btn-header-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-sizing: border-box;
}

button.btn-header-link {
  font: inherit;
}

.btn-header-link {
  padding: 6px 12px;
  font-size: 13px;
  white-space: nowrap;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: flex-end;
  min-width: 280px;
  flex-wrap: wrap;
}

.header-meta-cluster {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  padding-left: 8px;
  margin-left: 4px;
  border-left: 1px solid var(--border);
}

.header-nick-tag {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 6px 12px;
  background: #f7f8fa;
  color: var(--text-main);
  border-radius: var(--radius-base);
  font-size: 13px;
  font-weight: 500;
}

.btn-header-clear {
  padding: 7px 14px;
  font-size: 13px;
}

.field-label {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.token-input {
  width: min(420px, 40vw);
  min-width: 160px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-base);
}

.app-id-tag {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 6px 12px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-base);
  font-size: 12px;
  white-space: nowrap;
  font-weight: 500;
}

.layout-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.layout-aside {
  width: var(--aside-width);
  flex-shrink: 0;
  border-right: none;
  background: var(--bg-card);
  overflow-y: auto;
  box-shadow: var(--shadow-aside);
}

.side-menu {
  list-style: none;
  margin: 0;
  padding: 12px 10px;
}

.side-menu a {
  display: block;
  padding: 11px 14px;
  margin: 0 4px 4px;
  color: var(--text-secondary);
  text-decoration: none;
  border-left: none;
  border-radius: var(--radius-base);
  font-weight: 500;
  transition: background 0.2s ease, color 0.2s ease;
}

.side-menu a:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-main);
}

.side-menu a.active {
  color: var(--primary);
  background: var(--primary-light);
  border-left: none;
  font-weight: 700;
}

.layout-main {
  flex: 1;
  padding: 16px;
  overflow: auto;
  background: var(--bg-page);
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

/* 登录模块：左右分栏 */
.login-module.login-split {
  display: flex;
  align-items: flex-start;
  gap: 0;
  max-width: 1320px;
  min-height: min(70vh, 720px);
}

.login-col-left {
  flex: 1;
  min-width: 0;
  padding-right: 24px;
}

.login-col-right {
  flex: 0 0 360px;
  width: 360px;
  padding-left: 24px;
  border-left: 1px solid var(--border);
  align-self: stretch;
}

.login-right-heading {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--text-main);
}

.login-right-subhint {
  margin: 0 0 16px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.login-right-waiting {
  border: 1px dashed var(--border);
  border-radius: var(--radius-card);
  padding: 28px 16px;
  text-align: center;
  background: var(--bg-card);
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-card);
}

.login-right-waiting.hidden {
  display: none;
}

.login-right-waiting-title {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.login-right-success.success-block.visible {
  display: block;
}

.success-appid-block {
  padding: 12px 14px;
  margin-bottom: 14px;
  background: var(--primary-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-base);
}

.success-appid-label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.success-appid-value {
  margin: 0;
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  word-break: break-all;
  line-height: 1.45;
  color: var(--text-main);
}

.actions-col {
  flex-direction: column;
  align-items: stretch;
}

.actions-col .btn {
  width: 100%;
  text-align: center;
}

.login-api-log-block {
  margin-top: 20px;
}

.login-api-log-body {
  max-height: 240px;
  min-height: 100px;
}

@media (max-width: 960px) {
  .login-module.login-split {
    flex-direction: column;
    min-height: auto;
  }

  .login-col-left {
    padding-right: 0;
  }

  .login-col-right {
    flex: none;
    width: 100%;
    padding-left: 0;
    padding-top: 20px;
    margin-top: 8px;
    border-left: none;
    border-top: 1px solid var(--border);
  }
}

.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 16px;
  padding-bottom: 0;
  border-bottom: none;
}

.section-block {
  background: var(--bg-card);
  border: none;
  border-radius: var(--radius-card);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.25s ease;
}

.section-block:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
}

.form-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.form-row label {
  width: 120px;
  flex-shrink: 0;
  padding-top: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

.form-row .field-body {
  flex: 1;
  min-width: 200px;
}

.form-row input[type='text'],
.form-row select {
  width: 100%;
  max-width: 400px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-base);
}

.radio-group {
  display: flex;
  gap: 20px;
  align-items: center;
  padding-top: 4px;
}

.radio-group label {
  width: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding-top: 0;
}

.hint {
  margin: 0;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
  align-items: center;
}

.btn {
  padding: 9px 18px;
  border: none;
  border-radius: var(--radius-base);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition:
    transform 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease;
}

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

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-default {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-main);
}

.btn-default:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover:not(:disabled) {
  filter: brightness(0.95);
}

.qr-row {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: flex-start;
}

.qr-preview {
  text-align: center;
}

.qr-preview .sub {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--text-secondary);
}

.qr-img {
  max-width: 260px;
  width: 100%;
  height: auto;
  border: none;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.poll-panel {
  flex: 1;
  min-width: 220px;
}

.poll-status {
  font-size: 13px;
  margin-bottom: 8px;
  color: var(--text-main);
}

.poll-status.polling {
  color: var(--primary);
}

.poll-count {
  font-size: 12px;
  color: var(--text-secondary);
}

.error-banner {
  display: none;
  padding: 12px 14px;
  background: #fef0f0;
  border: 1px solid #fde2e2;
  color: #c45656;
  border-radius: var(--radius-base);
  font-size: 13px;
  line-height: 1.5;
  margin-top: 12px;
}

.error-banner.visible {
  display: block;
}

.success-block {
  display: none;
}

.success-block.visible {
  display: block;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--primary-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  margin-bottom: 16px;
}

.profile-card img {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--border);
}

.profile-meta .name {
  font-weight: 600;
  font-size: 16px;
  margin: 0 0 4px;
  color: var(--text-main);
}

.profile-meta .wxid {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
  word-break: break-all;
}

.post-login-actions .form-row label {
  width: 100px;
}

.post-login-actions {
  margin-top: 0;
}

.login-right-success .post-login-actions {
  margin-top: 4px;
}

.placeholder-box {
  padding: 24px;
  background: var(--bg-card);
  border-radius: var(--radius-card);
  border: 1px dashed var(--border);
  max-width: 560px;
  box-shadow: var(--shadow-card);
}

.placeholder-box .title {
  margin: 0 0 8px;
  font-size: 16px;
  color: var(--text-main);
}

.placeholder-box .desc {
  margin: 0;
  color: var(--text-secondary);
}

#toast {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 9998;
  max-width: 360px;
  padding: 10px 14px;
  border-radius: var(--radius-base);
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}

#toast.show {
  opacity: 1;
  transform: translateY(0);
}

#toast.success {
  background: var(--primary-light);
  border: 1px solid rgba(7, 193, 96, 0.25);
  color: var(--primary-hover);
}

#toast.error {
  background: #fef0f0;
  border: 1px solid #fde2e2;
  color: #c45656;
}

#toast.info {
  background: #f0f9ff;
  border: 1px solid #d9ecff;
  color: #337ecc;
}

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.show {
  display: flex;
}

.modal-box {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  max-width: 400px;
  width: 100%;
  padding: 24px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
}

.modal-box h3 {
  margin: 0 0 12px;
  font-size: 16px;
  color: var(--text-main);
}

.modal-box p {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
  color: var(--text-main);
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.reuse-appid-modal {
  max-width: 440px;
}

.reuse-appid-desc {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-secondary);
}

.reuse-appid-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}

.reuse-appid-field .field-label {
  font-size: 12px;
  color: var(--text-secondary);
}

.reuse-appid-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-base);
  font-size: 14px;
  color: var(--text-main);
  background: var(--bg-card);
}

.reuse-appid-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(103, 194, 58, 0.15);
}

.clear-cache-modal {
  max-width: 440px;
}

.clear-cache-body p {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-main);
}

.clear-cache-body p:last-child {
  margin-bottom: 0;
}

.clear-cache-alt {
  color: var(--text-secondary) !important;
  font-size: 13px !important;
}

.modal-actions--triple {
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* 接口运行日志页 */
.api-log-page {
  max-width: 1200px;
}

.api-log-page-title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
}

.api-log-intro {
  margin-bottom: 16px;
  max-width: 900px;
}

.api-log-intro code {
  font-size: 12px;
  padding: 1px 4px;
  background: #f0f2f5;
  border-radius: 4px;
}

.api-log-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.api-log-table-wrap {
  overflow: auto;
  border: none;
  border-radius: var(--radius-card);
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
}

.api-log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.api-log-table th,
.api-log-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.api-log-table th {
  background: #f7f8fa;
  font-weight: 600;
  white-space: nowrap;
  color: var(--text-secondary);
}

.api-log-table tbody tr:last-child td {
  border-bottom: none;
}

.api-log-time {
  white-space: nowrap;
  color: var(--text-secondary);
  font-size: 12px;
}

.api-log-path code {
  font-size: 12px;
  word-break: break-all;
}

.api-log-err {
  color: var(--danger);
  font-size: 12px;
}

.api-log-empty {
  text-align: center;
  color: var(--text-secondary);
  padding: 32px 16px !important;
}

/* ---------- 个人信息模块（左右分栏，对齐登录模块） ---------- */
.profile-page.profile-split {
  display: flex;
  align-items: flex-start;
  gap: 0;
  max-width: 1320px;
  min-height: min(70vh, 720px);
}

.profile-col-left {
  flex: 1;
  min-width: 0;
  padding-right: 24px;
}

.profile-col-right {
  flex: 0 0 400px;
  width: 400px;
  padding-left: 24px;
  border-left: 1px solid var(--border);
  align-self: stretch;
}

.profile-subtitle {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}

.profile-warn {
  color: var(--warning);
}

.form-row textarea {
  width: 100%;
  max-width: 400px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-base);
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
}

.inline-check {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding-top: 6px;
  font-size: 13px;
}

.profile-card-panel {
  margin-bottom: 16px;
}

.profile-card-title {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 700;
  padding-bottom: 0;
  border-bottom: none;
  color: var(--text-main);
}

.profile-card-empty {
  text-align: center;
  color: var(--text-secondary);
  padding: 28px 12px;
  font-size: 13px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-base);
}

.profile-card-body {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  background: linear-gradient(180deg, var(--primary-light) 0%, #fff 48%);
  box-shadow: var(--shadow-card);
}

.profile-card-hero {
  display: flex;
  gap: 16px;
  padding: 16px;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.profile-card-hero img {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: #eee;
}

.profile-card-name {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-main);
}

.profile-card-sub {
  margin: 0;
  font-size: 12px;
  color: var(--text-secondary);
  word-break: break-all;
}

.profile-dl {
  margin: 0;
  padding: 12px 16px 16px;
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 8px 12px;
  font-size: 13px;
}

.profile-dl dt {
  margin: 0;
  color: var(--text-secondary);
}

.profile-dl dd {
  margin: 0;
  word-break: break-word;
  color: var(--text-main);
}

.profile-json-log {
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.profile-json-log-head,
.webhook-terminal-head {
  position: relative;
  padding: 12px 16px 12px 72px;
  font-size: 13px;
  font-weight: 600;
  border-bottom: none;
  background: var(--terminal-head-bg);
  color: var(--terminal-head-fg);
  display: flex;
  align-items: center;
  min-height: 44px;
}

.webhook-terminal-head {
  justify-content: space-between;
}

.profile-json-log-head::before,
.webhook-terminal-head::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--mac-dot-red);
  box-shadow:
    20px 0 0 var(--mac-dot-yellow),
    40px 0 0 var(--mac-dot-green);
}

.profile-log-body {
  min-height: 220px;
  max-height: 420px;
  overflow: auto;
  padding: 14px 16px;
  background: var(--terminal-bg);
  color: var(--terminal-fg);
  font-family: Consolas, ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  line-height: 1.65;
}

.profile-log-entry {
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid #333;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--terminal-fg-muted);
}

.profile-log-entry:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.pf-qrcode-wrap {
  margin-top: 12px;
}

.pf-qrcode-img {
  max-width: 220px;
  width: 100%;
  height: auto;
  border: none;
  border-radius: 12px;
  display: block;
  box-shadow: var(--shadow-card);
}

.pf-table-wrap {
  margin-top: 12px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-base);
  max-height: 280px;
}

.pf-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.pf-data-table th,
.pf-data-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.pf-data-table th {
  background: #f7f8fa;
  font-weight: 600;
  position: sticky;
  top: 0;
}

.pf-data-table tbody tr:last-child td {
  border-bottom: none;
}

.pf-cell-mono {
  font-family: ui-monospace, monospace;
  word-break: break-all;
  max-width: 160px;
}

@media (max-width: 960px) {
  .profile-page.profile-split {
    flex-direction: column;
  }

  .profile-col-left {
    padding-right: 0;
  }

  .profile-col-right {
    flex: none;
    width: 100%;
    padding-left: 0;
    padding-top: 20px;
    border-left: none;
    border-top: 1px solid var(--border);
  }
}

/* ---------- 联系人模块 ---------- */
.contacts-page.contacts-split {
  display: flex;
  align-items: flex-start;
  gap: 0;
  max-width: 1320px;
  min-height: min(70vh, 720px);
}

.contacts-col-left {
  flex: 1;
  min-width: 0;
  padding-right: 24px;
}

.contacts-col-right {
  flex: 0 0 400px;
  width: 400px;
  padding-left: 24px;
  border-left: 1px solid var(--border);
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.contacts-col-right .section-block {
  margin-bottom: 16px;
}

.contacts-col-right .contacts-module-log {
  margin-top: auto;
  margin-bottom: 0;
}

.contacts-page .form-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.contacts-page .form-grid label.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.contacts-page .form-grid input[type='text'],
.contacts-page .form-grid select {
  width: 100%;
  max-width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-base);
  font-size: 14px;
}

.contacts-add-grid {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}

.contacts-target-banner {
  padding: 10px 14px;
  margin-bottom: 12px;
  border-radius: var(--radius-base);
  border: 1px solid rgba(7, 193, 96, 0.35);
  background: var(--primary-light);
  color: var(--primary-hover);
  font-size: 13px;
  font-weight: 500;
  word-break: break-all;
}

.contacts-api-block .hint {
  margin-top: 0;
}

.contacts-api-block .contacts-perm-check {
  margin-top: 6px;
}

.contacts-inline-response {
  display: block;
  box-sizing: border-box;
  width: 100%;
  margin-top: 12px;
  padding: 10px 12px;
  max-height: 280px;
  overflow: auto;
  font-family: Consolas, ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  line-height: 1.45;
  background: #f7f8fa;
  border: 1px solid var(--border);
  border-radius: var(--radius-base);
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-main);
}

.contacts-tab-desc {
  margin: 6px 0 10px;
}

.contacts-detail-status {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: var(--radius-base);
  background: var(--primary-light);
  border: 1px solid rgba(7, 193, 96, 0.25);
  color: var(--text-main);
}

.contacts-list-block {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.contacts-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.contacts-tab {
  padding: 8px 16px;
  font-size: 13px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-family: inherit;
}

.contacts-tab:hover {
  color: var(--text-main);
}

.contacts-tab.active {
  color: var(--primary);
  font-weight: 600;
  border-bottom-color: var(--primary);
}

/* hidden 属性必须生效：否则 display:flex 会覆盖浏览器默认的 hidden，三个 Tab 列表会同时堆叠显示 */
.contacts-tab-panel[hidden] {
  display: none !important;
}

.contacts-tab-panel:not([hidden]) {
  display: flex;
  flex-direction: column;
}

.contacts-tab-panel {
  flex: 1;
  min-height: 120px;
  max-height: 360px;
  overflow: hidden;
}

.contacts-list-body {
  overflow: auto;
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius-base);
  background: #f7f8fa;
  padding: 8px;
}

.contacts-list-empty {
  margin: 0;
  padding: 20px 12px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
}

.contacts-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  background: #fff;
  border-radius: var(--radius-base);
  margin-bottom: 6px;
}

.contacts-list-main {
  flex: 1;
  min-width: 0;
}

.contacts-list-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  word-break: break-word;
  line-height: 1.35;
}

.contacts-list-sub {
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.4;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--text-secondary);
  word-break: break-all;
}

.contacts-list-row:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.contacts-list-row--target-lock {
  background: linear-gradient(90deg, rgba(7, 193, 96, 0.14) 0%, rgba(7, 193, 96, 0.04) 100%);
  border-left: 3px solid var(--primary);
  padding-left: 9px;
  margin-left: -1px;
}

.contacts-list-row--target-lock .contacts-list-title {
  font-weight: 600;
  color: var(--text-main);
}

.contacts-list-wxid {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  word-break: break-all;
  flex: 1;
  min-width: 0;
}

.contacts-list-btn {
  flex-shrink: 0;
  padding: 4px 10px;
  font-size: 12px;
}

.btn-row-wrap {
  flex-wrap: wrap;
}

.contacts-module-log .profile-log-body {
  min-height: 140px;
  max-height: 260px;
}

@media (max-width: 960px) {
  .contacts-page.contacts-split {
    flex-direction: column;
  }

  .contacts-col-left {
    padding-right: 0;
  }

  .contacts-col-right {
    flex: none;
    width: 100%;
    padding-left: 0;
    padding-top: 20px;
    border-left: none;
    border-top: 1px solid var(--border);
  }
}

/* —— 消息模块 —— */
.messages-page.messages-split {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  min-height: 64vh;
}

.messages-col-left {
  flex: 1;
  min-width: 0;
}

.messages-col-right {
  flex: 0 0 440px;
  width: 440px;
  position: sticky;
  top: 16px;
  align-self: flex-start;
}

.messages-target-block .field-body input[type='text'] {
  width: 100%;
  max-width: 560px;
}

.messages-target-actions {
  margin-top: 8px;
}

.messages-target-hint {
  margin: 8px 0 0;
  font-size: 13px;
  font-weight: 500;
}

.messages-target-hint--locked {
  color: var(--primary);
}

.messages-target-hint--muted {
  color: var(--text-secondary);
}

.messages-target-display {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-main);
  padding: 8px 10px;
  background: var(--primary-light);
  border: 1px solid rgba(7, 193, 96, 0.25);
  border-radius: var(--radius-base);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  word-break: break-all;
}

.messages-type-select {
  max-width: 420px;
  width: 100%;
}

.messages-form-panel {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.messages-cdn-details {
  margin-top: 24px;
  padding: 12px 14px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-card);
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
}

.messages-cdn-summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  user-select: none;
  color: var(--text-main);
}

.messages-log-card {
  border: none;
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.messages-log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.messages-api-log-body {
  min-height: 280px;
  max-height: min(70vh, 640px);
}

.messages-log-meta {
  margin-bottom: 10px;
  font-size: 12px;
}

.messages-log-dt {
  color: #9cdcfe;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 10px 0 4px;
}

.messages-log-dt.messages-log-err {
  color: #f87171;
}

.messages-pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  font-size: inherit;
  line-height: 1.5;
}

.messages-pre-err {
  color: #fca5a5;
}

.messages-log-syntax .json-t {
  color: #dcdcaa;
}

.messages-log-syntax .json-p {
  color: #4ec9b0;
}

.messages-log-syntax .json-k {
  color: #9cdcfe;
}

.messages-log-syntax .json-s {
  color: #ce9178;
}

.messages-log-syntax .json-n {
  color: #b5cea8;
}

.messages-log-syntax .json-b {
  color: #569cd6;
}

@media (max-width: 960px) {
  .messages-page.messages-split {
    flex-direction: column;
  }

  .messages-col-right {
    flex: none;
    width: 100%;
    position: static;
  }
}

/* —— 朋友圈 SNS —— */
.sns-catalog {
  margin-bottom: 14px;
  padding: 14px 16px;
  border: none;
  border-radius: var(--radius-card);
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
}

.sns-catalog-summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  user-select: none;
  color: var(--text-main);
}

.sns-catalog-list {
  margin: 10px 0 0;
  padding-left: 1.25rem;
  font-size: 12px;
  line-height: 1.65;
  color: var(--text-secondary);
}

.sns-catalog-list code {
  font-size: 11px;
}

.sns-subblock {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}

.sns-page.sns-split {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  min-height: 64vh;
}

.sns-col-left {
  flex: 0 0 380px;
  width: 380px;
}

.sns-col-right {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sns-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.sns-tab {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-base);
  background: var(--bg-card);
  font-size: 13px;
  cursor: pointer;
  color: var(--text-secondary);
  transition:
    border-color 0.2s,
    color 0.2s,
    background 0.2s;
}

.sns-tab.active {
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
  background: var(--primary-light);
}

.sns-tab-panel {
  margin-top: 4px;
}

.sns-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sns-cursor-hint {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 8px 0;
  word-break: break-all;
  line-height: 1.45;
}

.sns-feed-wrap {
  border: none;
  border-radius: var(--radius-card);
  background: #f7f8fa;
  padding: 12px 14px 16px;
  max-height: min(62vh, 720px);
  display: flex;
  flex-direction: column;
  min-height: 200px;
  box-shadow: var(--shadow-card);
}

.sns-feed-title {
  margin: 0 0 10px;
}

.sns-feed-list {
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.sns-feed-empty {
  margin: 12px 0 0;
}

.sns-card {
  background: transparent;
  border-radius: 0;
  border: none;
  border-bottom: 1px solid var(--border);
  box-shadow: none;
  padding: 14px 4px;
}

.sns-card:last-child {
  border-bottom: none;
}

.sns-card--error {
  border-bottom-color: #fecaca;
  background: #fef2f2;
  border-radius: var(--radius-base);
  padding: 12px;
  margin-bottom: 8px;
  font-size: 12px;
  color: #b91c1c;
}

.sns-card-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.sns-card-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #07c160, #06ad56);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}

.sns-card-meta {
  flex: 1;
  min-width: 0;
}

.sns-card-nick {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.4;
  word-break: break-word;
}

.sns-card-time {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.sns-card-body {
  margin-bottom: 10px;
}

.sns-card-text {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-main);
  white-space: pre-wrap;
  word-break: break-word;
}

.sns-card-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.sns-card-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--radius-base);
  border: 1px solid var(--border);
}

.sns-card-stat {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 8px;
}

.sns-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.sns-card-action-btn {
  font-size: 13px;
}

.sns-log-card {
  border: none;
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.sns-log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sns-api-log-body {
  min-height: 160px;
  max-height: 280px;
}

@media (max-width: 960px) {
  .sns-page.sns-split {
    flex-direction: column;
  }

  .sns-col-left {
    flex: none;
    width: 100%;
  }
}

/* —— 标签 / 收藏夹：左右 4 : 6 —— */
.labels-page.labels-split,
.favorites-page.favorites-split {
  display: flex;
  gap: 24px;
  align-items: stretch;
  min-height: 64vh;
}

.labels-col-left,
.favorites-col-left {
  flex: 0 0 40%;
  max-width: 40%;
  min-width: 0;
}

.labels-col-right,
.favorites-col-right {
  flex: 1 1 60%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.lf-api-catalog {
  margin: 12px 0 16px;
  padding: 14px 16px;
  border: none;
  border-radius: var(--radius-card);
  background: #f7f8fa;
  font-size: 12px;
  box-shadow: var(--shadow-card);
}

.lf-api-catalog summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text-main);
}

.lf-api-catalog ol {
  margin: 8px 0 0;
  padding-left: 1.25rem;
  line-height: 1.65;
  color: var(--text-secondary);
}

.lf-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lf-sync-hint {
  font-size: 12px;
  color: var(--text-secondary);
  word-break: break-all;
  margin: 8px 0;
}

.lf-log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.lf-cards-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: #f7f8fa;
  padding: 12px 14px;
  flex: 1;
  min-height: 200px;
  max-height: min(52vh, 640px);
  display: flex;
  flex-direction: column;
}

.favor-cards-wrap {
  max-height: min(46vh, 560px);
}

.lf-cards {
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lf-feed-empty {
  margin: 8px 0 0;
}

.lf-card {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px;
  justify-content: space-between;
  background: var(--bg-card);
  border: none;
  border-radius: var(--radius-card);
  padding: 14px 16px;
  box-shadow: var(--shadow-card);
}

.lf-card-main {
  flex: 1;
  min-width: 200px;
}

.lf-card-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 8px;
  word-break: break-word;
  color: var(--text-main);
}

.lf-card-sub {
  font-size: 12px;
  color: var(--text-secondary);
  word-break: break-all;
}

.lf-favor-meta {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-main);
}

.lf-favor-meta > div {
  margin-bottom: 4px;
}

.lf-favor-desc {
  word-break: break-word;
  white-space: pre-wrap;
}

.lf-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.lf-badge-deleted {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  color: #b45309;
  background: #fffbeb;
  border-radius: var(--radius-base);
  vertical-align: middle;
}

@media (max-width: 960px) {
  .labels-page.labels-split,
  .favorites-page.favorites-split {
    flex-direction: column;
  }

  .labels-col-left,
  .favorites-col-left {
    flex: none;
    max-width: 100%;
    width: 100%;
  }
}

/* —— Webhook 推送解析：上配置 / 下终端 —— */
.webhook-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: calc(100vh - var(--header-h) - 48px);
  max-width: 1200px;
}

.webhook-top {
  flex-shrink: 0;
}

.webhook-hint-muted {
  color: var(--text-secondary);
  font-size: 13px;
}

.webhook-textarea-row .field-body {
  width: 100%;
}

.webhook-json-textarea {
  width: 100%;
  min-height: 160px;
  padding: 10px 12px;
  font-family: Consolas, ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  line-height: 1.45;
  border: 1px solid var(--border);
  border-radius: var(--radius-base);
  resize: vertical;
}

.webhook-bottom {
  flex: 1;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--terminal-bg);
  box-shadow: var(--shadow-card);
}

.webhook-terminal-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--terminal-head-fg);
}

.webhook-terminal-hint {
  font-size: 11px;
  color: rgba(169, 183, 198, 0.75);
}

#webhook-terminal,
.webhook-terminal {
  flex: 1;
  min-height: 240px;
  max-height: min(52vh, 560px);
  overflow: auto;
  padding: 14px 16px;
  background: var(--terminal-bg);
  color: var(--terminal-fg);
  font-family: Consolas, ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  line-height: 1.65;
}

.webhook-terminal-line {
  margin-bottom: 6px;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--terminal-fg-muted);
}

.webhook-line-ts {
  color: rgba(169, 183, 198, 0.9);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px dashed #3d3d3d;
}

.webhook-line-meta {
  color: #9ed49e;
}

.webhook-line-event {
  color: #ff8a80;
}

.webhook-line-private {
  color: #b9f6ca;
}

.webhook-line-group {
  color: #fff59d;
}

.webhook-line-self {
  color: #80deea;
}

.webhook-line-err {
  color: #ffab91;
}

.webhook-terminal-fold {
  margin: 10px 0 14px;
  padding: 8px 10px;
  background: #252526;
  border: 1px solid #3d3d3d;
  border-radius: var(--radius-base);
  color: #c3e88d;
}

.webhook-terminal-fold summary {
  cursor: pointer;
  color: #a9b7c6;
  user-select: none;
  font-weight: 600;
}

.webhook-terminal-pre {
  margin: 10px 0 0;
  padding: 10px;
  background: #1a1a1a;
  color: var(--terminal-fg-muted);
  font-size: 11px;
  line-height: 1.5;
  overflow: auto;
  max-height: 240px;
  border-radius: 4px;
  font-family: Consolas, ui-monospace, monospace;
}
