* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, "Microsoft YaHei", sans-serif;
  background: linear-gradient(180deg, #eef4ff 0%, #f7f9fc 36%, #f5f7fb 100%);
  color: #1f2937;
}

body.auth-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent 36%),
    radial-gradient(circle at bottom right, rgba(15, 23, 42, 0.08), transparent 28%),
    #f5f7fb;
}

body.account-page {
  min-height: 100vh;
  background: #f3f4f6;
}

a {
  color: #2563eb;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  background: #2563eb;
  color: #fff;
  cursor: pointer;
}

button:disabled {
  background: #94a3b8;
  cursor: not-allowed;
}

button.danger-button {
  background: #ef4444;
  color: #fff;
}

button.danger-button:hover {
  background: #dc2626;
}

input,
select {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}

.app-shell {
  padding: 20px 24px 28px;
}

.site-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 18px 12px 4px;
  color: #64748b;
  font-size: 13px;
}

.site-footer a {
  color: #64748b;
  text-decoration: none;
}

.site-footer a:hover {
  color: #2563eb;
  text-decoration: underline;
}

.auth-footer,
.account-footer {
  padding-bottom: 24px;
}

.static-page {
  min-height: 100vh;
  background: #f5f7fb;
}

.static-shell {
  display: grid;
  justify-items: center;
  padding: 72px 24px 24px;
}

.static-card {
  width: min(100%, 760px);
  padding: 34px;
  border: 1px solid #e2e8f0;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.08);
}

.static-card h1 {
  margin: 18px 0 16px;
  color: #0f172a;
  font-size: 28px;
}

.static-card p {
  margin: 0 0 12px;
  color: #475569;
  line-height: 1.8;
}

.static-back-link {
  color: #2563eb;
  text-decoration: none;
  font-size: 14px;
}

.static-back-link:hover {
  text-decoration: underline;
}

.contact-methods {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.contact-method {
  display: grid;
  gap: 8px;
}

.contact-label {
  color: #64748b;
  font-size: 14px;
}

.contact-value {
  color: #0f172a;
  font-size: 20px;
  font-weight: 700;
}

.contact-wechat-qr {
  width: min(100%, 280px);
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  background: #fff;
}

.contact-note {
  margin-top: 22px !important;
  padding: 14px 16px;
  border-radius: 14px;
  background: #eff6ff;
  color: #1d4ed8 !important;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  justify-items: center;
  max-width: none;
  margin: 0 auto;
  padding: 36px 28px;
}

.auth-hero {
  display: grid;
  gap: 20px;
  align-content: center;
  padding-right: 24px;
}

.auth-hero-links {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.auth-home-link {
  color: #1d4ed8;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
}

.auth-home-link:hover {
  text-decoration: underline;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  text-decoration: none;
}

.auth-hero-title {
  margin: 0;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.08;
  color: #0f172a;
  letter-spacing: -0.04em;
}

.auth-hero-text {
  max-width: 520px;
  margin: 0;
  color: #64748b;
  font-size: 16px;
  line-height: 1.85;
}

.auth-card {
  width: min(50vw, 760px);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(226, 232, 240, 0.96);
  border-radius: 28px;
  padding: 28px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.1);
  backdrop-filter: blur(18px);
}

.auth-card-header {
  display: grid;
  gap: 10px;
  margin-bottom: 24px;
}

.auth-card-title {
  font-size: 28px;
  font-weight: 700;
  color: #0f172a;
}

.auth-card-title.auth-login-method-title {
  font-size: 20px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0;
  color: #1f2937;
}

.auth-card-subtitle {
  color: #64748b;
  line-height: 1.75;
}

.auth-form .message {
  margin-bottom: 0;
}

.auth-form .auth-card-header {
  margin-top: 16px;
  margin-bottom: 10px;
}

.auth-login-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 28px;
  align-items: start;
}

.auth-code-button {
  min-width: 116px;
}

.auth-submit-button {
  min-height: 52px;
  border-radius: 16px;
  font-weight: 700;
}

.auth-agreement {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 2px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.8;
}

.auth-agreement input {
  width: auto;
  margin: 3px 0 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  flex: 0 0 auto;
}

.auth-agreement a {
  color: #2563eb;
  text-decoration: none;
}

.auth-agreement a:hover {
  text-decoration: underline;
}

.auth-divider {
  position: relative;
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
}

.auth-divider::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: #e2e8f0;
}

.auth-divider span {
  position: relative;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.96);
}

.auth-wechat-button {
  min-height: 48px;
  border-radius: 16px;
}

.auth-extra-hint {
  font-size: 13px;
  color: #64748b;
  line-height: 1.7;
}

.auth-qr-login {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 16px 0 4px;
}

.auth-qr-title {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}

.auth-qr-box {
  width: 300px;
  min-height: auto;
  display: grid;
  place-items: center;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}

.auth-qr-box iframe {
  max-width: none;
}

.auth-mobile-wechat-box {
  width: 100%;
  min-height: auto;
}

.auth-mobile-wechat-box .auth-submit-button {
  width: 100%;
}

.account-wechat-open-qr {
  width: 300px;
  max-width: 100%;
  min-height: 360px;
}

.auth-callback-shell {
  grid-template-columns: minmax(320px, 460px);
  justify-content: center;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 8px;
  padding: 2px 4px 2px;
}

.topbar-actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-topbar-left {
  display: flex;
  align-items: center;
  gap: 36px;
  min-width: 0;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  width: auto;
  justify-content: flex-start;
}

.topbar-left .ghost-link-button,
.topbar-actions .ghost-link-button {
  align-self: center;
}

.home-link {
  display: inline-flex;
  align-items: center;
  color: #1d4ed8;
  text-decoration: none;
  font-size: 16px;
  font-weight: 700;
}

.home-link:hover {
  text-decoration: underline;
}

.nav-topbar-title {
  display: inline-flex;
  align-items: center;
  color: #0f172a;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}

.nav-topbar-title:hover {
  color: #1d4ed8;
}

.new-chat-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: #111827;
  font-size: 15px;
  font-weight: 500;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
  text-decoration: none;
}

.new-chat-button:hover {
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
}

.new-chat-icon {
  font-size: 16px;
  line-height: 1;
}

.auth-user-panel {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-user-name {
  color: #334155;
  font-size: 14px;
  font-weight: 600;
}

.bind-wechat-hint {
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.topbar-hidden-account-meta {
  display: none !important;
}

.mobile-menu-button {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  padding: 0;
}

.mobile-menu-button span {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.mobile-menu-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 4px;
  z-index: 60;
  display: grid;
  min-width: 150px;
  padding: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.14);
}

.mobile-menu-item {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #0f172a;
  text-align: left;
  text-decoration: none;
  font-size: 14px;
}

.mobile-menu-item:hover {
  background: #eff6ff;
  color: #1d4ed8;
}

.account-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 18px;
}

.account-card {
  width: min(96vw, 980px);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #e5e7eb;
  border-radius: 26px;
  padding: 26px 30px 10px;
  box-shadow: 0 18px 60px rgba(15, 23, 42, 0.1);
}

.account-card-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 10px;
}

.account-card-title {
  font-size: 28px;
  font-weight: 700;
  color: #111827;
}

.account-card-subtitle {
  margin-top: 8px;
  color: #6b7280;
  line-height: 1.7;
}

.account-close-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  color: #111827;
  font-size: 30px;
  line-height: 1;
  text-decoration: none;
}

.account-close-button:hover {
  background: #f3f4f6;
}

.account-section {
  display: grid;
}

.account-row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  min-height: 74px;
  padding: 0 4px;
  border-bottom: 1px solid #e5e7eb;
}

.account-action-section .account-row {
  min-height: 82px;
}

.account-label {
  color: #111827;
  font-size: 15px;
  font-weight: 600;
}

.account-value-block {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.account-value {
  color: #111827;
  font-size: 15px;
  word-break: break-word;
}

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

/* ---------- 监控健康总览 ---------- */
.overview-shell {
  place-items: start center;
}

.overview-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 22px;
}

.overview-metric {
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 14px 16px;
  background: #f8fafc;
}

.overview-metric-value {
  font-size: 26px;
  font-weight: 700;
  color: #111827;
  line-height: 1.2;
}

.overview-metric-label {
  margin-top: 6px;
  font-size: 14px;
  color: #111827;
}

.overview-metric-hint {
  margin-top: 4px;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.5;
}

/* 只有真的有值的告警指标（通知失败 / 异常 / 即将到期 / 长时间未成功）才高亮。 */
.overview-metric.is-alerting {
  border-color: #fecaca;
  background: #fef2f2;
}

.overview-metric.is-alerting .overview-metric-value {
  color: #b91c1c;
}

.overview-attention-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.overview-attention-list {
  display: grid;
  gap: 10px;
}

.overview-attention-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.overview-attention-item:hover {
  border-color: #bfdbfe;
  background: #f8fbff;
}

.overview-attention-main {
  display: block;
  min-width: 0;
}

.overview-attention-name {
  display: block;
  font-weight: 600;
  color: #0f172a;
  overflow-wrap: anywhere;
}

.overview-attention-detail {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: #64748b;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.overview-attention-reason {
  flex: 0 0 auto;
  padding: 3px 10px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-size: 12px;
  white-space: nowrap;
}

.overview-generated-at {
  margin-top: 14px;
  margin-bottom: 16px;
  font-size: 13px;
  line-height: 1.6;
}

@media (max-width: 640px) {
  .overview-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .overview-attention-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  /* 纵向堆叠时胶囊不能被拉伸成整行。 */
  .overview-attention-reason {
    align-self: flex-start;
  }
}

.plan-purchase-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.plan-purchase-bar select {
  flex: 1 1 180px;
  min-width: 0;
}

.plan-purchase-bar button {
  flex: none;
  white-space: nowrap;
}

.plan-promo-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 10px;
}

.plan-promo-bar input {
  flex: 1 1 180px;
  min-width: 0;
}

.plan-promo-bar button {
  flex: none;
  white-space: nowrap;
}

#plan-promo-hint {
  margin-top: 6px;
}

#plan-promo-hint.plan-promo-error {
  color: #b91c1c;
}

/* ---------- 自动续费（会员页） ---------- */
.plan-auto-renew-block {
  display: grid;
  gap: 8px;
}

.plan-auto-renew-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #0f172a;
  cursor: pointer;
  user-select: none;
}

.plan-auto-renew-toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #2563eb;
  cursor: pointer;
}

.plan-auto-renew-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.plan-auto-renew-controls select {
  flex: 1 1 180px;
  min-width: 0;
}

.plan-auto-renew-controls button {
  flex: none;
  white-space: nowrap;
}

/* 消费记录里的待支付订单操作区 */
.invoice-item-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.invoice-item-actions button {
  white-space: nowrap;
}

@media (max-width: 640px) {
  .plan-auto-renew-controls select {
    flex: 1 1 100%;
  }
}

/* 套餐费用突出显示：购买栏合计价与支付弹窗订单金额加大加粗 */
#plan-purchase-hint {
  font-size: 17px;
  font-weight: 600;
  color: #c2410c;
  margin-top: 6px;
}

#plan-pay-amount-text {
  font-size: 20px;
  font-weight: 700;
  color: #c2410c;
}

/* 会员情况页移动端补充：购买控件加大触控热区、下拉字号 16px 避免 iOS 聚焦自动放大。 */
@media (max-width: 640px) {
  .plan-purchase-bar select {
    font-size: 16px;
    min-height: 44px;
  }

  #create-plan-order-button {
    min-height: 44px;
    font-size: 16px;
  }

  /* 到期提醒条窄屏下允许换行，操作链接独占一行更易点。 */
  .plan-alert {
    flex-wrap: wrap;
  }

  .plan-alert-action {
    width: 100%;
    text-align: center;
  }
}

/* ---------- 任务模板 ---------- */
.template-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
}

.template-item-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.template-item-name {
  color: #111827;
  font-size: 15px;
  font-weight: 600;
  word-break: break-word;
}

.template-item-meta {
  color: #64748b;
  font-size: 13px;
  line-height: 1.5;
}

.template-item-url {
  color: #94a3b8;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.template-item-actions {
  display: flex;
  gap: 8px;
  flex: none;
  flex-wrap: wrap;
  justify-content: flex-end;
}

@media (max-width: 640px) {
  .template-item {
    flex-direction: column;
    align-items: stretch;
  }

  .template-item-actions {
    justify-content: flex-start;
  }

  .template-item-actions button {
    flex: 1 1 auto;
  }
}

/* ---------- 套餐权益与到期提醒 ---------- */
.plan-purchase-block {
  display: grid;
  gap: 10px;
  width: 100%;
  min-width: 0;
}

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

.plan-benefit-item {
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #f8fafc;
}

.plan-benefit-label {
  color: #64748b;
  font-size: 12px;
}

.plan-benefit-value {
  margin-top: 2px;
  color: #0f172a;
  font-size: 14px;
  overflow-wrap: anywhere;
}

/* 通知渠道按渠道分行展示（微信服务号 / 企业微信 / 钉钉 / 飞书），行距收一点避免单格过高。 */
.plan-benefit-line {
  display: block;
  line-height: 1.5;
}

.plan-benefit-line + .plan-benefit-line {
  margin-top: 2px;
}

/* 到期前置提醒：会员不足 7 天（或已到期）时出现在套餐区顶部。 */
.plan-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid #fcd34d;
  border-radius: 12px;
  background: #fffbeb;
  color: #92400e;
  font-size: 14px;
  line-height: 1.6;
}

.plan-alert.is-expired {
  border-color: #fca5a5;
  background: #fef2f2;
  color: #b91c1c;
}

.plan-alert-action {
  flex: none;
  padding: 6px 14px;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font-size: 13px;
  white-space: nowrap;
}

.plan-alert-action:hover {
  background: rgba(0, 0, 0, 0.06);
}

@media (max-width: 640px) {
  .plan-benefit-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.account-link-button {
  padding: 0;
  background: transparent;
  color: #2563eb;
  border-radius: 0;
  text-decoration: none;
}

.account-link-button:hover {
  background: transparent;
  color: #1d4ed8;
  text-decoration: underline;
}

.account-outline-danger-button {
  min-width: 92px;
  padding: 9px 22px;
  border: 1px solid #ef4444;
  border-radius: 999px;
  background: #fff;
  color: #ef4444;
}

.account-outline-danger-button:hover:enabled {
  background: #fff5f5;
}

.account-outline-danger-button:disabled {
  border-color: #fca5a5;
  background: #fff;
  color: #f87171;
  cursor: not-allowed;
}

.api-config-form {
  display: grid;
  gap: 8px;
  min-width: 280px;
}

.mobile-only {
  display: none;
}

.message {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #e0f2fe;
  color: #075985;
}

.message.error {
  background: #fee2e2;
  color: #991b1b;
}

.wechat-bind-dialog {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
}

.wechat-bind-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.46);
}

.wechat-bind-dialog-card {
  position: relative;
  z-index: 1;
  width: min(92vw, 420px);
  padding: 20px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.2);
}

.wechat-bind-dialog-body {
  display: grid;
  justify-items: center;
  gap: 12px;
}

.wechat-bind-qr-image {
  width: min(72vw, 280px);
  height: min(72vw, 280px);
  object-fit: contain;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  background: #fff;
}

.notify-bind-guide {
  justify-self: stretch;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  font-size: 13px;
  color: #475569;
}

.notify-bind-guide > summary {
  cursor: pointer;
  color: #2563eb;
}

.notify-bind-guide-steps {
  margin: 8px 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
  line-height: 1.6;
  word-break: break-all;
}

.wechat-bind-dialog-actions {
  display: flex;
  justify-content: center;
}

.bind-phone-dialog-body {
  justify-items: stretch;
}

.bind-phone-field,
.bind-phone-code-field {
  width: 100%;
}

/* 「绑定通知渠道」弹窗的 body 同样会把子项收窄到内容宽度，Webhook / 密钥输入框被压得很短；
   与上面的手机号弹窗保持一致，让输入行占满整行。 */
#notify-bind-dialog .field {
  width: 100%;
}

.hidden {
  display: none !important;
}

.layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 16px;
  align-items: start;
}

.panel {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 20px;
  padding: 16px;
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(14px);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.panel-header h2,
.panel h3 {
  margin: 0;
}

.sidebar .panel-header h2 {
  font-size: 16px;
}

.sidebar-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.sidebar-title-row h2 {
  min-width: 0;
}

.sidebar-title-row .ghost-link-button {
  flex-shrink: 0;
}

.task-list,
.stack-list {
  display: grid;
  gap: 12px;
}

.sidebar {
  position: sticky;
  top: 18px;
}

.sidebar .panel-header .inline-actions {
  align-items: center;
}

.task-sidebar-tools {
  display: grid;
  gap: 10px;
  margin: 4px 0 14px;
}

.task-search-input {
  width: 100%;
}

.task-status-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.task-filter-chip {
  min-height: 32px;
  padding: 6px 12px;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 600;
}

.task-filter-chip.is-active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

/* 侧栏任务配额行：默认走 muted 配色，升级链接沿用全局样式。 */
.task-quota-line {
  font-size: 12px;
  line-height: 1.5;
}

.task-quota-line .inline-upgrade-link {
  font-weight: 600;
}

/* 批量导入：入口按钮 + 弹窗内的文本域与逐条结果列表。 */
.batch-import-entry {
  margin-top: 8px;
  width: 100%;
}

.batch-import-textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 140px;
  padding: 10px 12px;
  border: 1px solid var(--border-color, #d0d7de);
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
}

.batch-import-result {
  margin-top: 10px;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--border-color, #d0d7de);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
}

.batch-import-summary {
  margin-bottom: 8px;
  font-weight: 600;
}

.batch-import-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 3px 0;
}

.batch-import-row.is-fail .batch-import-status,
.batch-import-row.is-fail .batch-import-message {
  color: #d92d20;
}

.batch-import-row.is-ok .batch-import-status {
  color: #12805c;
}

.batch-import-url {
  flex: 1 1 auto;
  overflow-wrap: anywhere;
}

.batch-import-message {
  flex: 0 0 auto;
  color: #57606a;
  text-align: right;
}

/* 详情页关键词过滤卡片：开关、输入框、匹配方式与保存按钮纵向排布。 */
.keyword-filter-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.keyword-filter-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.keyword-filter-input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid var(--border-color, #d0d7de);
  border-radius: 8px;
  font-size: 13px;
}

.keyword-filter-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid var(--border-color, #d0d7de);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  min-height: 72px;
}

/* 详情页免打扰与数值监控：复用关键词过滤的排布，只补时间区间与锁定态。 */
.quiet-hours-box,
.value-monitor-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.quiet-hours-range {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.quiet-hours-range input[type="time"] {
  padding: 6px 8px;
  border: 1px solid var(--border-color, #d0d7de);
  border-radius: 8px;
  font-size: 13px;
}

/* 全局 input{width:100%} 会把复选框拉成整行宽（勾选图标显示在框中央）、
   说明文字被挤到最右。开关行里的复选框锁回固定尺寸靠左，文字紧随其后。 */
.keyword-filter-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
  accent-color: #2563eb;
}

.keyword-filter-toggle span {
  flex: 1 1 auto;
  min-width: 0;
  color: #475569;
}

/* 免打扰时间框锁宽，「开始 至 结束 保存」保持在同一行紧凑排列。 */
.quiet-hours-range input[type="time"] {
  width: auto;
  flex: 0 0 120px;
}

.quiet-hours-range button {
  flex: 0 0 auto;
}

@media (max-width: 640px) {
  .quiet-hours-range {
    gap: 6px;
  }

  .quiet-hours-range input[type="time"] {
    flex: 1 1 40%;
  }
}

.task-list-section {
  display: grid;
  gap: 10px;
}

.task-list-section-title {
  margin: 0;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  z-index: 40;
}

/* PC 端（>980px）任务列表：面板高度锁定在视口内，任务过多时列表内部滚动。移动端抽屉侧栏不受影响。 */
@media (min-width: 981px) {
  .sidebar {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 36px);
    overflow: hidden;
  }

  .sidebar .panel-header,
  .sidebar .task-sidebar-tools,
  .sidebar .task-batch-bar {
    flex: none;
  }

  .sidebar .task-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 6px;
    margin-right: -6px;
  }

  .sidebar .task-list::-webkit-scrollbar {
    width: 6px;
  }

  .sidebar .task-list::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: #cbd5e1;
  }

  .sidebar .task-list::-webkit-scrollbar-track {
    background: transparent;
  }
}

.home-view,
.login-view,
.detail-view {
  display: grid;
  gap: 16px;
}

.login-view {
  min-height: calc(100vh - 120px);
  align-content: center;
  justify-items: center;
}

.login-card {
  width: min(520px, 100%);
  padding: 28px 24px;
}

.login-title {
  font-size: 24px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 10px;
}

.login-subtitle {
  color: #64748b;
  line-height: 1.7;
  margin-bottom: 20px;
}

.login-form {
  display: grid;
  gap: 14px;
}

.code-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.code-input-wrap {
  display: grid;
  gap: 8px;
}

.phone-input-group {
  display: flex;
  align-items: stretch;
}

.phone-input-group input {
  min-width: 0;
}

.phone-input-prefix {
  display: flex;
  align-items: center;
  flex: none;
  padding: 0 12px;
  margin-right: 8px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f1f5f9;
  color: #334155;
  font-weight: 600;
}

.home-view {
  min-height: inherit;
}

.hero {
  display: grid;
  justify-items: center;
  gap: 18px;
  min-height: 100%;
  align-content: center;
  padding: 16px 0;
}

.hero-title {
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  max-width: 760px;
  text-align: center;
  color: #64748b;
  line-height: 1.8;
  font-size: 16px;
}

.detail-page {
  min-height: calc(100vh - 170px);
}

.detail-header-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detail-header-block h2 {
  font-size: 16px;
  margin: 0;
}

.ghost-button {
  align-self: flex-start;
  background: #eff6ff;
  color: #1d4ed8;
}

.ghost-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  min-height: 36px;
  padding: 8px 14px;
  border-radius: 10px;
  background: #eff6ff;
  color: #1d4ed8;
  text-decoration: none;
  font-weight: 600;
}

.ghost-button:hover {
  background: #dbeafe;
}

.ghost-link-button:hover {
  background: #dbeafe;
}

.task-card,
.stack-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}

.task-thread {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  width: 100%;
  text-align: left;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  box-shadow: none;
  padding: 12px;
}

.task-thread:hover {
  background: rgba(37, 99, 235, 0.04);
}

.task-thread.selection-mode {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
}

.task-thread.active {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.12);
}

.task-thread.selecting {
  background: rgba(37, 99, 235, 0.05);
}

.task-thread-checkbox {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 2px;
}

.task-thread-checkbox input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #2563eb;
}

.task-thread.pinned-task .task-thread-title::before {
  content: "置顶";
  display: inline-flex;
  align-items: center;
  margin-right: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 700;
  vertical-align: middle;
}

.icon-toggle-button {
  min-width: 36px;
  min-height: 36px;
  padding: 8px;
  border-radius: 10px;
}

.icon-toggle-button.is-active {
  background: #dbeafe;
}

.icon-toggle-lines {
  position: relative;
  display: inline-grid;
  gap: 4px;
}

.icon-toggle-lines span {
  display: block;
  width: 12px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.task-batch-bar {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 10px;
  padding-top: 12px;
  margin-top: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.95) 32%);
}

.task-batch-bar button {
  flex: 1;
  min-height: 40px;
  font-size: 14px;
  white-space: nowrap;
}

.task-thread-body {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.task-thread-top,
.task-thread-bottom {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.task-thread-time {
  color: #94a3b8;
  font-size: 12px;
  white-space: nowrap;
}

.task-thread-title {
  margin-bottom: 0;
  font-size: 14px;
  line-height: 1.5;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  flex: 1;
}

.thread-status {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  font-size: 12px;
}

.thread-status.active {
  background: #dbeafe;
  color: #1d4ed8;
}

.thread-status.error {
  background: #fee2e2;
  color: #b91c1c;
}

.thread-status.paused {
  background: #fef3c7;
  color: #92400e;
}

.thread-status.resuming {
  background: #dcfce7;
  color: #166534;
}

.thread-status.expired {
  background: #ffedd5;
  color: #c2410c;
}

.stack-card.compact {
  padding: 10px 12px;
}

.section-option-card {
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.section-option-card:hover,
.section-option-card:focus-visible {
  border-color: rgba(37, 99, 235, 0.28);
  background: #eff6ff;
  transform: translateY(-1px);
  outline: none;
}

.section-option-card.is-disabled {
  cursor: not-allowed;
  color: #94a3b8;
  background: #f8fafc;
  border-color: #e2e8f0;
  box-shadow: none;
}

.section-option-card.is-disabled .stack-card-title,
.section-option-card.is-disabled .muted {
  color: #94a3b8;
}

.section-option-card.is-disabled:hover,
.section-option-card.is-disabled:focus-visible {
  background: #f8fafc;
  border-color: #e2e8f0;
  transform: none;
}

.task-card.active {
  border-color: #2563eb;
  background: #eff6ff;
}

.task-card-title,
.stack-card-title {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

.task-card-meta,
.muted {
  color: #64748b;
  font-size: 13px;
}

/* AI 一句话摘要：事件卡片里的一行高亮概括，比普通 muted 文案更醒目。 */
.event-ai-summary {
  margin: 0 0 8px;
  padding: 6px 10px;
  border-left: 3px solid #6366f1;
  border-radius: 6px;
  background: #f5f3ff;
  color: #4338ca;
  font-size: 13px;
  line-height: 1.5;
}

.content {
  display: grid;
  gap: 16px;
  min-height: calc(100vh - 80px);
}

.form-grid {
  display: grid;
  gap: 14px;
}

.chat-thread {
  display: grid;
  gap: 14px;
  width: min(100%, 920px);
  min-height: 220px;
  max-height: 520px;
  overflow: auto;
  padding: 6px 2px;
}

.chat-message {
  display: grid;
  gap: 6px;
}

.chat-message.user {
  justify-items: end;
}

.chat-role {
  font-size: 12px;
  color: #64748b;
}

.chat-bubble {
  width: min(100%, 760px);
  border-radius: 22px;
  padding: 16px 18px;
  background: rgba(248, 250, 252, 0.92);
  border: 1px solid #e2e8f0;
  line-height: 1.75;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
}

.chat-message.user .chat-bubble {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.chat-message.pending .chat-bubble {
  color: #64748b;
}

/* 「重新分析当前网址」引导消息里的步骤列表。 */
.chat-guidance-list {
  margin: 8px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
  font-size: 13px;
  line-height: 1.6;
  color: #334155;
}

.chat-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  margin-top: 8px;
  align-items: center;
  width: min(50vw, 760px);
}

.chat-input-stack {
  display: grid;
  gap: 10px;
}

.chat-composer-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding-left: 6px;
  color: #475569;
  font-size: 14px;
}

/* 表单选项行右端的「应用场景」入口，靠右与输入框右边缘对齐 */
.composer-scenario-link {
  margin-left: auto;
  color: #2563eb;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}

.composer-scenario-link:hover {
  text-decoration: underline;
}

.chat-composer-options select {
  width: auto;
  min-width: 112px;
  padding: 6px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #ffffff;
  color: #0f172a;
  font-size: 14px;
}

/* ---------- 监控时长上限提示 ---------- */
.duration-limit-hint {
  padding-left: 6px;
  color: #b45309;
  font-size: 13px;
  line-height: 1.6;
}

/* 一句话建任务：输入框下方的用法提示 */
.chat-intent-hint {
  padding-left: 6px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.6;
}

.chat-composer textarea {
  width: 100%;
  min-height: 112px;
  max-height: 220px;
  resize: vertical;
  border: 1px solid #dbe3f0;
  border-radius: 28px;
  padding: 22px 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 40px rgba(37, 99, 235, 0.08);
  font: inherit;
  color: inherit;
}

.analyze-source-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-left: 6px;
}

.analyze-source-button {
  min-width: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #334155;
  font-size: 14px;
  line-height: 1.4;
}

.analyze-source-button:hover {
  background: transparent;
  color: #1d4ed8;
}

.analyze-source-button.is-active {
  color: #1d4ed8;
  font-weight: 700;
}

.chat-composer button {
  height: 48px;
  padding: 0 20px;
  border-radius: 999px;
}

.wide-centered {
  justify-self: center;
}

.clamp-1,
.clamp-2 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.clamp-1 {
  -webkit-line-clamp: 1;
}

.clamp-2 {
  -webkit-line-clamp: 2;
}

.chat-summary {
  margin-bottom: 12px;
}

.chat-section-title {
  margin-bottom: 10px;
  font-weight: 700;
}

.result-note {
  margin-top: 12px;
  border-radius: 12px;
  padding: 12px 14px;
}

.result-note.success {
  background: #ecfdf5;
  color: #166534;
}

.result-note.warn {
  background: #fff7ed;
  color: #9a3412;
}

.inline-upgrade-link {
  color: #2563eb;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.inline-upgrade-link:hover {
  color: #1d4ed8;
}

/* 截图可视化：缩略图列表与版面对比弹窗 */
.screenshot-card {
  display: grid;
  gap: 8px;
}

.screenshot-thumb-button {
  padding: 0;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  cursor: zoom-in;
}

.screenshot-thumb {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  object-position: top center;
}

.visual-compare-card {
  width: min(94vw, 1080px);
  max-height: 88vh;
  overflow: auto;
}

.visual-compare-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  align-items: start;
}

.visual-compare-figure {
  display: grid;
  gap: 8px;
  margin: 0;
}

.visual-compare-figure figcaption {
  font-size: 13px;
  color: #64748b;
}

.visual-compare-figure img {
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}

.field {
  display: grid;
  gap: 8px;
}

.inline-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.task-name-editor {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.task-name-editor input {
  width: min(420px, 100%);
}

.detail-interval-select {
  width: auto;
  min-width: 112px;
  padding: 6px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #ffffff;
  color: #0f172a;
  font-size: 14px;
}

.small-button {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 999px;
}

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

.detail-grid {
  margin-bottom: 0;
}

.detail-grid > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.detail-grid > div.duration-limit-hint,
.detail-grid > div.duration-limit-hint * {
  display: initial;
  flex-direction: initial;
}

.detail-grid > div strong {
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
}

.detail-hero-card {
  border: 1px solid #dbe4f3;
  border-radius: 16px;
  padding: 20px 22px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #eff6ff 0%, #ffffff 40%);
}

.detail-hero-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
}

.detail-hero-name-wrap {
  min-width: 0;
}

.detail-hero-name-editor {
  align-items: flex-start;
}

.detail-hero-status {
  text-align: right;
}

.detail-hero-label {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 4px;
  letter-spacing: 0.02em;
}

.detail-status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  background: #f1f5f9;
  color: #475569;
  white-space: nowrap;
}

.detail-hero-url {
  margin-bottom: 14px;
  min-width: 0;
}

.detail-hero-url a {
  color: #2563eb;
  font-size: 14px;
  word-break: break-all;
}

.detail-info-card {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 14px;
  background: #ffffff;
}

.detail-section-title {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f1f5f9;
}

.detail-info-hint {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.6;
}

/* 任务设置卡片分组：检查 / 通知 / 高级 三段式，组间用分隔线区分层级。 */
.detail-setting-group + .detail-setting-group {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #f1f5f9;
}

.detail-setting-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.detail-setting-group-title::before {
  content: "";
  width: 3px;
  height: 12px;
  border-radius: 2px;
  background: #2563eb;
}

.detail-setting-group .detail-grid {
  row-gap: 12px;
}

@media (max-width: 640px) {
  .detail-setting-group + .detail-setting-group {
    margin-top: 12px;
    padding-top: 12px;
  }
}

.detail-expired-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff7ed;
  color: #9a3412;
}

.detail-expired-text {
  font-size: 14px;
}

/* 即将到期用更浅的琥珀色区分「已到期」的橙色。 */
.detail-expiring-banner {
  background: #fefce8;
  color: #a16207;
}

.detail-expiring-text {
  font-size: 14px;
}

.renew-area-highlight {
  animation: renew-area-flash 1.2s ease-in-out 2;
}

@keyframes renew-area-flash {
  0%,
  100% {
    box-shadow: none;
  }

  50% {
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.35);
  }
}

.full-row {
  grid-column: 1 / -1;
}

/* 任务详情页的通知渠道勾选：微信服务号免费，其余渠道按套餐开放。 */
.notify-channel-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 6px;
}

.notify-channel-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  flex: 0 0 auto;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  font-size: 13px;
  line-height: 1.2;
  color: #0f172a;
  cursor: pointer;
  white-space: nowrap;
}

.notify-channel-option-name {
  color: inherit;
}

.notify-channel-option-state {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  font-size: 12px;
  line-height: 1.2;
}

.notify-channel-option-state.is-ready {
  background: #dcfce7;
  color: #166534;
}

.notify-channel-option-state.is-pending {
  background: #fef3c7;
  color: #b45309;
}

.notify-channel-option-state.is-locked {
  background: #e2e8f0;
  color: #64748b;
}

.notify-channel-option-state.is-system {
  background: #dbeafe;
  color: #1d4ed8;
}

.notify-channel-option input {
  flex: 0 0 auto;
  width: auto;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

.notify-channel-option.is-disabled {
  color: #94a3b8;
  border-color: #eef2f7;
  background: #f8fafc;
  cursor: not-allowed;
}

/* 账号页的通知渠道：每个渠道一组（渠道行 + 该渠道下已绑定的通知群），组间用发丝线分隔。 */
.notify-binding-list {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.notify-binding-group {
  padding: 12px 0;
}

.notify-binding-group:first-child {
  padding-top: 0;
}

.notify-binding-group:last-child {
  padding-bottom: 0;
}

.notify-binding-group + .notify-binding-group {
  border-top: 1px solid #f1f5f9;
}

.notify-binding-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.notify-binding-name {
  color: #0f172a;
  font-size: 14px;
  font-weight: 500;
}

.notify-binding-status {
  padding: 1px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 12px;
}

.notify-binding-status.is-on {
  background: #dcfce7;
  color: #15803d;
}

.notify-binding-locked {
  padding: 1px 8px;
  border-radius: 999px;
  background: #fef3c7;
  color: #b45309;
  font-size: 12px;
  text-decoration: none;
}
a.notify-binding-locked:hover {
  text-decoration: underline;
}

/* 每行的主操作统一贴到行尾，避免按钮跟在状态胶囊后面显得拥挤。 */
.notify-binding-action {
  margin-left: auto;
  flex: 0 0 auto;
}

.notify-binding-add {
  padding: 4px 12px;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  background: #eff6ff;
  color: #2563eb;
  font-size: 13px;
  line-height: 1.5;
}

.notify-binding-add:hover {
  background: #dbeafe;
  color: #1d4ed8;
}

/* 渠道下已绑定的通知群：小圆点 + 群名称，编辑 / 删除贴右。 */
.notify-target-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}

.notify-target-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.notify-target-name {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  color: #334155;
  word-break: break-all;
}

.notify-target-name::before {
  content: "";
  flex: 0 0 auto;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #cbd5e1;
}

.notify-target-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

/* 通知渠道区块的行较高，标签与内容顶部对齐，并让提示文案单独成行。 */
#account-notify-section .account-row {
  align-items: start;
  padding-top: 18px;
  padding-bottom: 18px;
}

#account-notify-section .account-label {
  padding-top: 1px;
}

#account-notify-section .account-value-block {
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
}

/* 账号页的操作日志：动作 + 时间 + 说明 + 来源信息，去框线扁平展示。 */
.operation-log-section {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.operation-log-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.operation-log-toolbar select {
  width: auto;
  min-width: 140px;
}

.operation-log-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.operation-log-load-more {
  align-self: center;
  margin-top: 4px;
}

.operation-log-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.operation-log-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.operation-log-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.operation-log-action {
  color: #0f172a;
  font-size: 14px;
  font-weight: 600;
}

.operation-log-time,
.operation-log-meta {
  color: #94a3b8;
  font-size: 12px;
  word-break: break-all;
}

.operation-log-summary {
  color: #334155;
  font-size: 14px;
  word-break: break-all;
}

.notify-overview-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.notify-overview-page-main {
  width: min(100%, 1120px);
  margin: 0 auto;
}

.shell-page-panel {
  padding: 22px 24px 24px;
}

.shell-page-panel > .account-card-header,
.shell-page-panel > .panel-header {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e5e7eb;
}

.shell-page-panel .account-card-header {
  align-items: start;
}

.shell-page-panel .account-card-title,
.shell-page-panel > .panel-header h2 {
  color: #0f172a;
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.shell-page-panel .account-card-subtitle,
.shell-page-panel .muted {
  max-width: 820px;
  line-height: 1.7;
}

.shell-page-panel .account-section + .account-section {
  margin-top: 10px;
}

.shell-page-panel .account-row:first-child {
  border-top: 1px solid #e5e7eb;
}

.shell-page-panel .stack-list,
.shell-page-panel .operation-log-list,
.shell-page-panel .nav-sections,
.shell-page-panel .nav-admin-groups {
  width: 100%;
}

.shell-page-panel .empty-inline,
.shell-page-panel .empty-state {
  border-color: #dbe3f0;
  background: #f8fbff;
}

.shell-page-panel .inline-actions {
  gap: 10px;
}

.shell-page-panel .ghost-link-button,
.shell-page-panel .account-link-button,
.shell-page-panel .small-button,
.shell-page-panel .plan-purchase-bar button,
.shell-page-panel .plan-purchase-bar select,
.shell-page-panel .operation-log-toolbar select {
  min-height: 38px;
}

.shell-page-panel .ghost-link-button,
.shell-page-panel .account-link-button,
.shell-page-panel .small-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.shell-static-panel {
  display: grid;
  align-content: start;
}

.notify-overview-page-panel {
  min-height: auto;
}

.notify-overview-generated {
  margin-bottom: 14px;
  color: #64748b;
  font-size: 13px;
}

.shell-static-card {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 4px 2px 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.nav-page-panel {
  min-height: auto;
}

.nav-page-header {
  align-items: start;
}

.nav-page-actions {
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
}

.nav-page-actions .nav-search-input {
  width: 420px;
  flex: 0 0 420px;
}

.nav-page-actions #nav-my-toggle {
  flex-shrink: 0;
  white-space: nowrap;
}

.nav-page-panel .nav-main {
  gap: 22px;
}

.nav-page-panel .nav-hero,
.nav-page-panel .nav-my-panel,
.nav-page-panel .nav-admin-group {
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

.nav-page-panel .nav-hero,
.nav-page-panel .nav-my-panel {
  padding: 18px;
}

.nav-page-panel .nav-sections {
  gap: 14px;
}

.nav-page-panel .nav-my-panel {
  margin-top: 0;
}

.nav-page-panel .nav-search-input {
  background: #fff;
}

.account-page-panel .account-section {
  gap: 0;
}

.account-page-panel .overview-attention-header {
  margin-bottom: 14px;
  padding: 0 4px;
}

.account-page-panel #operation-log-page-section .account-row,
.account-page-panel #account-template-section .account-row,
.account-page-panel #account-log-section .account-row,
.account-page-panel #account-operation-log-section .account-row {
  align-items: start;
  padding-top: 16px;
  padding-bottom: 16px;
}

.account-page-panel .operation-log-toolbar {
  width: 100%;
}

.account-page-panel .operation-log-list {
  width: 100%;
}

.account-page-panel #template-list {
  width: 100%;
}

.account-page-panel .template-item,
.account-page-panel .operation-log-item {
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.account-page-panel .template-item:hover,
.account-page-panel .operation-log-item:hover,
.nav-page-panel .nav-admin-group:hover {
  border-color: #d7e3fb;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.08);
}

.notify-overview-stat {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #f8fafc;
  padding: 14px 16px;
  min-height: 104px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.notify-overview-stat-label {
  color: #64748b;
  font-size: 13px;
}

.notify-overview-stat-value {
  margin-top: 8px;
  color: #0f172a;
  font-size: 26px;
  font-weight: 700;
}

.notify-overview-list {
  display: grid;
  gap: 14px;
  width: 100%;
}

.notify-overview-item {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.notify-overview-item:hover {
  border-color: #d7e3fb;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.08);
  transform: translateY(-1px);
}

.notify-overview-side {
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 8px;
  padding: 16px 12px;
  background: #f8fafc;
  border-right: 1px solid #e2e8f0;
}

.notify-overview-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
}

.notify-overview-icon.is-wechat_service {
  background: linear-gradient(135deg, #22c55e, #16a34a);
}

.notify-overview-icon.is-wecom {
  background: linear-gradient(135deg, #38bdf8, #2563eb);
}

.notify-overview-icon.is-dingtalk {
  background: linear-gradient(135deg, #60a5fa, #1d4ed8);
}

.notify-overview-icon.is-feishu {
  background: linear-gradient(135deg, #06b6d4, #2563eb);
}

.notify-overview-name {
  color: #334155;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  line-height: 1.5;
}

.notify-overview-main {
  display: grid;
  gap: 8px;
  padding: 16px;
  align-content: start;
}

.notify-overview-main-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.notify-overview-head-text {
  min-width: 0;
}

.notify-overview-primary {
  color: #0f172a;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
}

.notify-overview-secondary,
.notify-overview-meta,
.notify-overview-task-name {
  color: #64748b;
  font-size: 13px;
  line-height: 1.6;
  word-break: break-all;
}

.notify-overview-title {
  color: #0f172a;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.7;
  word-break: break-all;
}

.notify-overview-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.notify-overview-badge.is-success {
  background: #dcfce7;
  color: #15803d;
}

.notify-overview-badge.is-warn {
  background: #fef3c7;
  color: #b45309;
}

.notify-overview-badge.is-danger {
  background: #fee2e2;
  color: #b91c1c;
}

.notify-overview-badge.is-idle {
  background: #e2e8f0;
  color: #475569;
}

.notify-overview-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 4px;
  border-top: 1px solid #eef2f7;
}

.notify-overview-task-link {
  white-space: nowrap;
}

.detail-overview-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 18px;
  margin-top: 12px;
  padding-top: 14px;
  border-top: 1px solid #e8eef7;
}

/* 概览统计不再套内框：直接平铺在 Hero 卡片内，靠 label 灰字区分。 */
.detail-overview-card {
  padding: 0;
}

.detail-overview-label {
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.detail-overview-value {
  margin-top: 6px;
  color: #0f172a;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.detail-diagnosis {
  margin-bottom: 14px;
}

.detail-diagnosis-list {
  display: grid;
  gap: 10px;
}

/* 诊断条目不再套内框：外层区块卡片是唯一外框，条目用左侧色条表达语义。 */
.detail-diagnosis-card {
  padding: 4px 0 4px 12px;
  border-left: 3px solid #e2e8f0;
}

.detail-diagnosis-card.is-success {
  border-left-color: #34d399;
}

.detail-diagnosis-card.is-warn {
  border-left-color: #f59e0b;
}

.detail-diagnosis-title {
  color: #0f172a;
  font-size: 14px;
  font-weight: 700;
}

.detail-diagnosis-card.is-success .detail-diagnosis-title {
  color: #166534;
}

.detail-diagnosis-card.is-warn .detail-diagnosis-title {
  color: #9a3412;
}

.detail-diagnosis-body {
  margin-top: 6px;
  color: #475569;
  font-size: 13px;
  line-height: 1.7;
}

.detail-diagnosis-card.is-success .detail-diagnosis-body {
  color: #166534;
}

.detail-diagnosis-card.is-warn .detail-diagnosis-body {
  color: #9a3412;
}

.detail-diagnosis-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.detail-diagnosis-actions .ghost-link-button,
.detail-diagnosis-actions .ghost-button {
  align-self: auto;
}

/* JSON 预览块：浅色底替代深色块，避免在外层卡片内再出现一个沉重的内框。 */
.json-block {
  margin: 6px 0 0;
  padding: 12px;
  border-radius: 10px;
  background: #f6f8fb;
  color: #334155;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.detail-sections {
  display: grid;
  gap: 16px;
}

.detail-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

/* 「规则摘要」标题右侧的一行可读说明：不展开 JSON 也能看懂规则状态。 */
.detail-section-summary {
  flex: 1 1 auto;
  min-width: 0;
  text-align: right;
  font-size: 12px;
  line-height: 1.5;
  color: #64748b;
  overflow-wrap: anywhere;
}

.detail-section-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 13px;
}

.detail-section-toggle::before {
  content: "⌄";
  display: inline-block;
  transition: transform 0.18s ease;
}

.detail-section-toggle.is-expanded::before {
  transform: rotate(180deg);
}

.detail-section-toggle:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.detail-section-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.history-retention-hint {
  margin-top: 8px;
  font-size: 12px;
}

.empty-state {
  padding: 24px;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  color: #64748b;
  text-align: center;
}

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 10px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 12px;
}

.empty-inline {
  padding: 10px 12px;
  border-radius: 10px;
  background: #f8fafc;
  color: #64748b;
}

.admin-layout {
  display: grid;
  gap: 16px;
  padding: 0 16px 20px;
}

.admin-learning-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 16px;
  padding: 0 16px 20px;
  align-items: start;
}

.admin-learning-main-panel {
  min-height: calc(100vh - 150px);
  display: grid;
  grid-template-rows: auto minmax(260px, 1fr) auto;
}

.admin-learning-header {
  align-items: start;
}

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

.admin-learning-header-actions .ghost-button {
  white-space: nowrap;
}

.admin-rule-divider {
  margin-top: 18px;
}

.draft-card-actions {
  margin-top: 10px;
}

.draft-card-actions button {
  white-space: nowrap;
}

.admin-learning-chat {
  width: 100%;
  max-height: none;
  align-content: start;
  padding: 8px 2px 14px;
}

.admin-learning-composer {
  width: 100%;
  margin-top: 12px;
}

.admin-learning-rule-panel {
  position: sticky;
  top: 18px;
  max-height: calc(100vh - 120px);
  overflow: auto;
}

.admin-overview-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

/* ===== 系统设置 ===== */
.admin-system-settings-panel .panel-header {
  margin-bottom: 14px;
}

.admin-settings-help {
  font-size: 13px;
  color: #64748b;
  line-height: 1.7;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  margin-bottom: 16px;
}

.admin-settings-help code {
  background: #e0f2fe;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 13px;
  color: #0369a1;
}

.admin-settings-groups {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.admin-settings-group {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
}

.admin-settings-group-title {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  padding: 10px 16px;
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
}

.admin-settings-group-body {
  display: flex;
  flex-direction: column;
}

.admin-settings-row {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
  align-items: start;
}

.admin-settings-row:last-child {
  border-bottom: none;
}

.admin-settings-label {
  font-size: 14px;
  color: #0f172a;
  font-weight: 500;
}

.admin-settings-key {
  font-size: 12px;
  color: #94a3b8;
  font-family: ui-monospace, SFMono-Regular, monospace;
  margin-top: 4px;
  font-weight: 400;
}

.admin-settings-dirty-marker {
  color: #f59e0b;
  font-size: 12px;
  font-weight: 500;
}

.admin-settings-source-db,
.admin-settings-source-env {
  display: inline-block;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 4px;
  font-weight: 600;
  vertical-align: middle;
}

.admin-settings-source-db {
  background: #dbeafe;
  color: #1d4ed8;
}

.admin-settings-source-env {
  background: #f1f5f9;
  color: #64748b;
}

.admin-settings-value {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-settings-value input[type="text"],
.admin-settings-value input[type="number"] {
  max-width: 420px;
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
}

.admin-settings-value input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.admin-settings-hint {
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.5;
}

.admin-settings-status {
  display: inline-block;
  font-size: 13px;
  font-weight: 500;
}

.admin-settings-status-ok {
  color: #16a34a;
}

.admin-settings-status-warn {
  color: #f59e0b;
}

/* Switch 开关（CSS-only） */
.admin-settings-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.admin-settings-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.admin-settings-switch span {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #cbd5e1;
  border-radius: 999px;
  transition: 0.2s;
}

.admin-settings-switch span::before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.2s;
}

.admin-settings-switch input:checked + span {
  background-color: #3b82f6;
}

.admin-settings-switch input:checked + span::before {
  transform: translateX(20px);
}

@media (max-width: 640px) {
  .admin-settings-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

.admin-stat-card {
  border-radius: 14px;
  background: #f8fafc;
  padding: 16px;
}

.admin-stat-label {
  color: #64748b;
  font-size: 13px;
}

.admin-stat-value {
  margin-top: 8px;
  font-size: 26px;
  font-weight: 700;
  color: #0f172a;
}

.admin-panel-header {
  align-items: start;
  gap: 12px;
}

.admin-search-input {
  min-width: 220px;
  border: 1px solid #d7deea;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
}

.admin-user-list,
.admin-task-list {
  display: grid;
  gap: 12px;
}

.admin-user-item {
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px 16px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  cursor: pointer;
}

.admin-user-item.is-selected {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.08);
}

.admin-user-main,
.admin-user-side {
  display: grid;
  gap: 6px;
}

.admin-user-side {
  justify-items: end;
}

.admin-user-name-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.admin-user-name {
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
}

.admin-user-meta,
.admin-user-task-count,
.admin-selected-user-summary,
.admin-task-url,
.admin-task-time {
  color: #64748b;
  font-size: 13px;
}

.admin-task-card {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px 16px;
  background: #fff;
  display: grid;
  gap: 10px;
}

.admin-plan-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
}

.admin-plan-label {
  color: #475569;
  font-size: 13px;
}

/* 运营看板：按用户 / 任务 / 收入 / 通知 / 产出分组展示核心指标。 */
.admin-dashboard-groups {
  display: grid;
  gap: 18px;
}

.admin-kpi-group {
  display: grid;
  gap: 10px;
}

.admin-kpi-group-title {
  color: #334155;
  font-size: 14px;
  font-weight: 600;
}

.admin-kpi-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.admin-stat-hint {
  margin-top: 6px;
  color: #94a3b8;
  font-size: 12px;
}

.admin-plan-distribution {
  display: grid;
  gap: 14px;
}

.admin-plan-row {
  display: grid;
  gap: 6px;
}

.admin-plan-row-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.admin-plan-row-name {
  color: #0f172a;
  font-size: 14px;
  font-weight: 600;
}

.admin-plan-row-value {
  color: #64748b;
  font-size: 13px;
}

.admin-plan-track {
  height: 8px;
  border-radius: 999px;
  background: #eef2f7;
  overflow: hidden;
}

.admin-plan-fill {
  height: 100%;
  border-radius: 999px;
  background: #2563eb;
}

.admin-status-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 8px 14px;
  background: #fff;
  color: #475569;
  font-size: 13px;
  white-space: nowrap;
}

.admin-status-chip strong {
  color: #0f172a;
  font-size: 15px;
}

/* 看板里的用户卡片只是展示，不需要列表页那样的可点击态。 */
.admin-attention-item {
  cursor: default;
}

.admin-plan-bar select {
  width: auto;
  min-width: 140px;
}

.admin-plan-quota-input {
  width: 180px;
}

#admin-user-plan-summary {
  flex: 1 1 200px;
  min-width: 0;
}

.admin-task-tools {
  display: grid;
  gap: 12px;
}

.admin-task-edit-field label {
  font-size: 13px;
  color: #475569;
}

.admin-inline-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.admin-task-name-input,
.admin-task-owner-select {
  min-width: 220px;
  border: 1px solid #d7deea;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
}

.admin-task-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.admin-task-title {
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
}

.admin-task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.admin-task-notifications {
  display: grid;
  gap: 10px;
  border-top: 1px solid #e2e8f0;
  padding-top: 12px;
}

.admin-rule-learning-form,
.admin-rule-list,
.admin-rule-learn-result {
  display: grid;
  gap: 12px;
}

.admin-rule-learning-form {
  margin-bottom: 14px;
}

.admin-rule-input,
.admin-rule-note {
  width: 100%;
  border: 1px solid #d7deea;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
}

.admin-rule-note {
  resize: vertical;
  min-height: 96px;
  line-height: 1.6;
}

.admin-rule-card,
.admin-rule-result-card {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px 16px;
  background: #fff;
  display: grid;
  gap: 10px;
}

.admin-rule-result-card {
  background: #f8fafc;
}

.admin-rule-sections {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-notify-item {
  display: grid;
  gap: 8px;
  border-radius: 12px;
  background: #f8fafc;
  padding: 12px;
}

.admin-notify-head {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.admin-notify-title {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
}

.admin-notify-body {
  font-size: 13px;
  line-height: 1.6;
  color: #334155;
  white-space: pre-wrap;
  word-break: break-word;
}

.admin-rule-groups {
  display: grid;
  gap: 22px;
}

.admin-rule-group {
  display: grid;
  gap: 10px;
}

.admin-rule-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-rule-group-header h3 {
  margin: 0;
  font-size: 16px;
  color: #0f172a;
}

.admin-rule-detail > summary {
  cursor: pointer;
  font-size: 13px;
  color: #2563eb;
}

.admin-rule-json {
  margin: 10px 0 0;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 360px;
  overflow: auto;
}

@media (max-width: 980px) {
  body {
    background: #f6f8fb;
  }

  body.auth-page {
    background: #f6f8fb;
  }

  .auth-shell {
    grid-template-columns: 1fr;
    align-items: start;
    padding: 20px 16px 32px;
  }

  .auth-card {
    width: min(100%, 760px);
  }

  .auth-login-split {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .auth-qr-login {
    display: none;
  }

  .admin-overview-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-user-item,
  .admin-task-header {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-inline-form {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-user-side {
    justify-items: start;
  }

  .admin-learning-layout {
    grid-template-columns: 1fr;
  }

  .admin-learning-rule-panel {
    position: static;
    max-height: none;
  }

  .account-card {
    width: min(100%, 920px);
  }

  .account-row {
    grid-template-columns: 140px minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .admin-overview-cards {
    grid-template-columns: 1fr;
  }

  .admin-learning-layout {
    padding: 0 0 20px;
  }

  .admin-learning-main-panel {
    min-height: auto;
  }

  .admin-learning-composer {
    position: static;
    grid-template-columns: 1fr;
    padding: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .admin-learning-composer button {
    width: 100%;
  }


  .auth-hero-title {
    font-size: 30px;
    line-height: 1.15;
  }

  .auth-hero-text {
    font-size: 14px;
    line-height: 1.75;
  }

  .auth-card {
    padding: 20px 16px;
    border-radius: 24px;
  }

  .auth-agreement {
    font-size: 12px;
    line-height: 1.7;
  }

  .auth-card-title {
    font-size: 24px;
  }

  .mobile-only {
    display: inline-flex;
  }

  .app-shell {
    padding: 12px 12px calc(118px + env(safe-area-inset-bottom, 0px));
  }

  .topbar-left {
    gap: 8px;
    width: auto;
    justify-content: flex-start;
    /* 「首页 / 网址导航 / 开启新对话」三个入口都不折行，窄屏（或系统字体放大）时会一起顶出屏幕、整页横向滚动。 */
    flex-wrap: wrap;
  }

  .home-link {
    font-size: 15px;
  }

  .new-chat-button {
    min-width: auto;
    min-height: 36px;
    padding: 0 12px;
    font-size: 13px;
  }

  .layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    flex-direction: row;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 4px 6px;
    background: rgba(246, 248, 251, 0.92);
    backdrop-filter: blur(14px);
  }

  .topbar-actions > .auth-user-panel,
  .topbar-actions > #mobile-sidebar-button {
    display: none !important;
  }

  .mobile-menu-button {
    display: inline-flex;
  }

  .api-config-form {
    width: 100%;
    min-width: 0;
  }

  .analysis-summary,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .topbar-actions {
    gap: 8px;
  }

  .nav-topbar-left {
    gap: 14px;
  }

  .nav-topbar-search {
    flex-basis: 280px;
    width: min(100%, 280px);
  }

  .nav-topbar-title {
    font-size: 20px;
  }

  .auth-user-panel {
    flex-wrap: wrap;
    gap: 8px;
  }

  .login-view {
    min-height: auto;
    align-content: start;
  }

  .login-card {
    padding: 20px 16px;
  }

  .login-title {
    font-size: 20px;
    line-height: 1.35;
  }

  .code-field {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(84vw, 360px);
    border-radius: 0 24px 24px 0;
    transform: translateX(-104%);
    transition: transform 0.24s ease;
    z-index: 50;
    overflow: auto;
  }

  .task-sidebar-tools {
    margin-bottom: 12px;
  }

  .sidebar.sidebar-open {
    transform: translateX(0);
  }

  .content {
    gap: 12px;
    min-height: auto;
  }

  .chat-composer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    width: auto;
    /* 单列：输入框、选项、提示、发送按钮依次向下堆叠。 */
    grid-template-columns: 1fr;
    row-gap: 8px;
    column-gap: 12px;
    /* 手机上让底部输入区直接贴齐屏幕左右边缘，避免两侧留白。 */
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
    border-radius: 20px 20px 0 0;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
  }

  /* 手机端改成单列堆叠：输入框 → 两行「标签 + 下拉」→ 应用场景 → 提示 → 发送按钮。
     之前把 options 放在 grid 第二列里，列宽被发送按钮挤到只剩几十像素，
     中文标签被压成一字一行。 */
  .chat-input-stack {
    display: contents;
  }

  .chat-composer textarea {
    grid-column: 1;
  }

  /* 手机端「监控类型 / 监控时长 / 应用场景」压在同一行：
     两个下拉各占一份弹性宽度，文字标签缩小到 12px 不换行。 */
  .chat-composer-options {
    grid-column: 1;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    padding-left: 0;
    font-size: 12px;
    line-height: 1.4;
  }

  .chat-composer-options label {
    color: #94a3b8;
    font-size: 12px;
    white-space: nowrap;
    flex: 0 0 auto;
  }

  /* 两个下拉平分剩余宽度，窄屏也不换行、不溢出。 */
  .chat-composer-options select {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    padding: 6px 8px;
    border-radius: 10px;
  }

  .composer-scenario-link {
    flex: 0 0 auto;
    margin-left: 0;
    font-size: 12px;
    white-space: nowrap;
  }

  .chat-input-stack > .duration-limit-hint,
  .chat-intent-hint {
    grid-column: 1;
    padding-left: 0;
  }

  /* 首页表单还挂着 .wide-centered，会把组件继续往中间收；手机端这里强制拉满。 */
  .chat-composer.wide-centered {
    justify-self: stretch;
    width: 100%;
    max-width: none;
  }

  .hero {
    min-height: auto;
    /* 底部输入区是 fixed 定位，留够空间避免 hero 标题被遮住。 */
    padding: 28px 0 210px;
    gap: 18px;
    align-content: start;
  }

  .hero-title {
    width: 100%;
    max-width: 360px;
    padding: 18px 18px;
    border: 1px solid #e2e8f0;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 14px 42px rgba(15, 23, 42, 0.06);
    font-size: 19px;
    line-height: 1.55;
    letter-spacing: 0;
  }

  .hero-subtitle {
    font-size: 14px;
    line-height: 1.7;
  }

  .chat-thread {
    width: 100%;
    min-height: 160px;
    max-height: none;
    padding-bottom: 8px;
  }

  .chat-bubble {
    width: 100%;
  }

  .chat-composer textarea {
    min-height: 64px;
    max-height: 140px;
    padding: 12px 14px;
    border-radius: 16px;
  }

  .chat-composer button {
    grid-column: 1;
    width: 100%;
    height: 44px;
    padding: 0 16px;
    font-size: 15px;
  }

  .site-footer {
    display: none;
  }

  .detail-page {
    min-height: 100dvh;
  }

  .panel {
    border-radius: 18px;
    padding: 14px;
  }

  .panel-header {
    align-items: flex-start;
    /* 窄屏下标题与右侧操作区容易互相挤压，允许换行。 */
    flex-wrap: wrap;
  }

  /* 任务详情顶部有 4 个操作按钮（暂停监控 / 手动执行一次 / 存为模板 / 刷新详情）。
     窄屏 flex-wrap 会让按钮高度不一致或排列混乱，改为 2×2 grid 更整齐。 */
  .detail-page > .panel-header > .inline-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .detail-page > .panel-header > .inline-actions button {
    width: 100%;
    white-space: nowrap;
  }

  /* 到期提示条在手机上改为上下排，避免长文案把续期按钮挤到不可见。 */
  .detail-expired-banner {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .detail-expired-banner .small-button {
    align-self: flex-start;
  }

  .detail-sections {
    gap: 12px;
  }

  .detail-grid .detail-interval-select {
    width: 100%;
    max-width: 100%;
  }

  .detail-section-header {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .detail-section-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .detail-overview-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .notify-channel-picker {
    gap: 8px 10px;
    align-items: flex-start;
  }

  .notify-channel-option {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    width: auto;
    max-width: none;
    min-width: max-content;
    white-space: nowrap;
  }

  .notify-channel-option span {
    display: inline-block;
    white-space: nowrap;
  }

  .task-thread {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px;
  }

  .task-thread-top,
  .task-thread-bottom {
    flex-wrap: wrap;
  }

  .task-thread-time {
    white-space: normal;
  }

  .account-shell {
    padding: 12px;
    align-items: start;
  }

  .account-card {
    width: 100%;
    padding: 18px 16px 8px;
    border-radius: 20px;
  }

  .account-card-header {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .account-card-title {
    font-size: 24px;
  }

  .account-card-subtitle {
    font-size: 14px;
  }

  .account-close-button {
    width: 32px;
    height: 32px;
    font-size: 26px;
  }

  .account-row {
    grid-template-columns: 1fr;
    gap: 8px;
    align-items: start;
    padding: 14px 2px;
    min-height: 0;
  }

  .account-value-block {
    flex-direction: column;
    align-items: flex-start;
  }

  .account-inline-actions {
    justify-content: flex-start;
  }

  .plan-purchase-bar {
    width: 100%;
  }

  .plan-purchase-bar select,
  .plan-purchase-bar button {
    width: 100%;
  }

  .notify-binding-row {
    align-items: flex-start;
  }

  .operation-log-toolbar {
    width: 100%;
  }

  .operation-log-toolbar select {
    width: 100%;
  }

  .account-outline-danger-button {
    width: 100%;
  }

  .wechat-bind-dialog-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .wechat-bind-dialog-actions button {
    width: 100%;
  }

  #plan-pay-dialog .wechat-bind-dialog-body,
  #notify-bind-dialog .wechat-bind-dialog-body {
    justify-items: stretch;
  }

  #wechat-open-bind-dialog .account-wechat-open-qr {
    width: 100%;
    min-height: 300px;
  }

  #wechat-open-bind-dialog .auth-qr-box iframe,
  #wechat-open-bind-dialog #wechat-open-bind-qrcode {
    max-width: 100%;
  }

  #wechat-bind-status-text,
  #wechat-bind-expire-text,
  #wechat-open-bind-status-text,
  #plan-pay-status-text,
  #plan-pay-amount-text,
  #plan-pay-order-text,
  #notify-bind-dialog-hint,
  .notify-bind-guide-body,
  .notify-bind-guide-body .muted {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}

/* ---------- 公开网址导航页 ---------- */

.nav-main {
  display: grid;
  gap: 20px;
  padding: 0 16px 24px;
}

.nav-hero {
  display: grid;
  gap: 10px;
  padding: 28px 24px;
  border: 1px solid #e2e8f0;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(255, 255, 255, 0.96));
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.06);
}

.nav-search-input {
  width: min(100%, 420px);
  border: 1px solid #d7deea;
  border-radius: 999px;
  padding: 12px 18px;
  background: #fff;
  font-size: 15px;
}

.nav-topbar-search {
  flex: 0 1 380px;
  width: min(100%, 380px);
  margin-left: auto;
}

/* ---------- 导航页：地区横向筛选 ---------- */

.nav-region-filter {
  display: grid;
  gap: 10px;
  padding: 0;
  border-radius: 0;
  background: transparent;
}

.nav-admin-region-filter {
  margin-bottom: 14px;
}

.nav-region-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.nav-region-label {
  padding-top: 6px;
  color: #64748b;
  font-size: 14px;
}

.nav-region-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
}

.nav-region-chip {
  padding: 5px 10px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #0f172a;
  font-size: 14px;
  font-weight: 400;
}

.nav-region-chip:hover {
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
}

.nav-region-chip.is-active {
  color: #2563eb;
  font-weight: 700;
}

/* 移动端省份/城市行的「更多/收起」按钮，桌面端不显示 */
.nav-region-toggle {
  display: none;
}

/* ---------- 导航页：行业标签筛选栏 ---------- */

.nav-tag-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nav-tag-filter:empty {
  display: none;
}

.nav-tag-chip {
  padding: 5px 12px;
  border: 1px solid #dbe4f3;
  border-radius: 999px;
  background: #fff;
  color: #475569;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.nav-tag-chip:hover {
  border-color: #2563eb;
  color: #1d4ed8;
}

.nav-tag-chip.is-active {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}

.nav-sections {
  display: grid;
  gap: 22px;
}

.nav-section {
  scroll-margin-top: 96px;
  padding: 18px;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.05);
}

.nav-section-flat {
  padding: 14px;
}

.nav-link-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-link-card {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 10px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.nav-link-card:hover {
  border-color: #2563eb;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.1);
}

.nav-link-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 320px;
  text-decoration: none;
}

.nav-link-name {
  color: #0f172a;
  font-size: 14px;
  font-weight: 600;
  word-break: break-word;
}

.nav-link-host {
  color: #94a3b8;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-link-chips {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  gap: 6px;
}

.nav-chip {
  padding: 2px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 11px;
  line-height: 1.6;
}

.nav-chip.is-monitored {
  background: #dcfce7;
  color: #15803d;
}

.nav-chip.is-updated {
  background: #fef3c7;
  color: #b45309;
}

.nav-chip.is-tag {
  background: #eff6ff;
  color: #1d4ed8;
}

/* ---------- 导航页：网站行里的监控栏目 ---------- */

.nav-link-columns {
  display: flex;
  flex: 1 1 320px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px 10px;
  padding-left: 14px;
  border-left: 1px dashed #e2e8f0;
}

.nav-column-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 3px 6px 3px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #f8fafc;
}

.nav-column-name {
  min-width: 0;
  max-width: 180px;
  color: #334155;
  font-size: 12px;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-column-name:hover {
  color: #2563eb;
  text-decoration: underline;
}

.nav-column-action {
  flex: none;
  padding: 2px 7px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #2563eb;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}

.nav-column-action:hover:not(:disabled) {
  background: #2563eb;
  color: #fff;
}

.nav-column-action.is-ghost {
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #64748b;
}

.nav-column-action.is-ghost:hover {
  background: #e2e8f0;
  color: #334155;
}

.nav-column-action.is-done {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}

.nav-column-action.is-done:hover {
  background: #dcfce7;
  color: #15803d;
}

.nav-column-empty {
  flex: 1 1 auto;
  color: #94a3b8;
  font-size: 12px;
  text-align: right;
}

/* ---------- 后台套餐管理 ---------- */

.admin-plan-tip {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f8fafc;
  color: #475569;
  font-size: 13px;
  line-height: 1.7;
}

.admin-plan-list {
  display: grid;
  gap: 16px;
}

.admin-plan-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #fff;
}

.admin-plan-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-plan-card-header h3 {
  margin: 0;
  font-size: 16px;
}

.admin-plan-meta {
  margin-top: 4px;
  font-size: 12px;
}

.admin-plan-enabled,
.admin-plan-interval {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #475569;
  font-size: 13px;
}

.admin-plan-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.admin-plan-field {
  display: grid;
  gap: 6px;
  color: #475569;
  font-size: 13px;
}

.admin-plan-field-wide {
  grid-column: 1 / -1;
}

.admin-plan-field input[type="text"],
.admin-plan-field input[type="number"] {
  width: 100%;
}

.admin-plan-intervals {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.admin-plan-notify-channels {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.admin-plan-notify-channel {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #0f172a;
}

.admin-plan-actions {
  align-items: center;
}

/* ---------- 后台网址导航管理 ---------- */

.nav-admin-groups {
  display: grid;
  gap: 16px;
}

.nav-admin-editing-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #eff6ff;
  color: #475569;
  font-size: 14px;
}

.nav-admin-editing-header strong {
  color: #1d4ed8;
  font-size: 15px;
}

.nav-admin-group {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #fff;
}

.nav-admin-group-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.nav-admin-category-name {
  flex: 1 1 220px;
  min-width: 160px;
  color: #0f172a;
  font-size: 15px;
  font-weight: 600;
}

.nav-admin-links {
  display: grid;
  gap: 8px;
}

.nav-admin-link-row {
  display: grid;
  grid-template-columns: minmax(0, 180px) minmax(0, 1fr) minmax(0, 160px) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 12px;
  background: #f8fafc;
}

.nav-admin-add-link {
  display: grid;
  grid-template-columns: minmax(0, 180px) minmax(0, 1fr) minmax(0, 160px) auto;
  gap: 8px;
  align-items: center;
}

/* ---------- 后台：地区下的二级地市 ---------- */

.nav-admin-subgroup {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-left: 3px solid #93c5fd;
  border-radius: 12px;
  background: #fbfdff;
}

.nav-admin-subgroup-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.nav-admin-subgroup-mark {
  flex: none;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
}

.nav-admin-add-subgroup {
  grid-template-columns: minmax(0, 220px) minmax(0, 1fr) auto;
}

.nav-admin-subgroup-hint {
  color: #94a3b8;
  font-size: 12px;
}

/* ---------- 导航页：我的分类里的二级子分类 ---------- */

.nav-my-subgroups {
  display: grid;
  gap: 10px;
}

.nav-my-subgroup {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-left: 3px solid #93c5fd;
  border-radius: 12px;
  background: #fbfdff;
}

.nav-my-add-subgroup {
  display: grid;
  grid-template-columns: minmax(0, 220px) auto;
  gap: 8px;
  align-items: center;
}

/* ---------- 后台：网站下的监控栏目 ---------- */

.nav-admin-site {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
}

.nav-admin-columns {
  display: grid;
  gap: 8px;
  padding-left: 10px;
  border-left: 3px solid #bfdbfe;
}

.nav-admin-columns-title {
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
}

.nav-admin-column-row {
  display: grid;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  background: #f8fafc;
}

.nav-admin-column-main {
  display: grid;
  grid-template-columns: minmax(0, 180px) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.nav-admin-add-column {
  display: grid;
  grid-template-columns: minmax(0, 180px) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.nav-admin-monitor-row {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding-top: 8px;
  border-top: 1px dashed #e2e8f0;
}

.nav-admin-monitor-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #334155;
  font-size: 13px;
  white-space: nowrap;
}

.nav-admin-monitor-toggle input {
  width: auto;
}

.nav-admin-monitor-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #64748b;
  font-size: 13px;
  white-space: nowrap;
}

.nav-admin-monitor-field select {
  max-width: 200px;
}

.nav-admin-monitor-field.is-wide select {
  max-width: 320px;
}

/* ---------- 导航页「我的分类」面板 ---------- */

.nav-my-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 20px;
  padding: 18px;
  border: 1px solid #dbe4f3;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
}

.nav-my-panel-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: space-between;
}

.nav-my-panel-header .nav-search-input {
  width: min(100%, 220px);
}

.nav-my-hint {
  margin: 0;
  color: #64748b;
  font-size: 13px;
}

#nav-my-toggle.is-active {
  background: #1d4ed8;
  color: #fff;
}

@media (max-width: 980px) {
  .nav-admin-group-header {
    align-items: stretch;
  }

  .nav-admin-link-row,
  .nav-admin-add-link,
  .nav-my-add-subgroup {
    grid-template-columns: 1fr;
  }

  .nav-page-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .nav-page-actions .nav-search-input {
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 640px) {
  .nav-main {
    padding: 0 0 24px;
  }

  .nav-hero {
    padding: 20px 16px;
    border-radius: 18px;
  }

  .nav-topbar-title {
    font-size: 18px;
  }

  .nav-topbar-search {
    order: 3;
    flex: 1 1 100%;
    width: 100%;
    margin-left: 0;
  }

  .nav-region-row {
    grid-template-columns: 1fr;
    gap: 6px;
    position: relative;
  }

  .nav-region-label {
    padding-top: 0;
    font-size: 13px;
  }

  /* 省份/城市筛选默认折叠成一行，右侧「更多」按钮展开全部 */
  .nav-region-row:not(.is-expanded) .nav-region-options {
    max-height: 32px;
    overflow: hidden;
    padding-right: 72px;
  }

  .nav-region-toggle {
    position: absolute;
    top: -3px;
    right: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border: 1px solid #dbe4f3;
    border-radius: 999px;
    background: #ffffff;
    color: #2563eb;
    font-size: 12px;
    cursor: pointer;
  }

  .nav-region-toggle::after {
    content: "";
    width: 6px;
    height: 6px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    margin-top: -2px;
  }

  .nav-region-row.is-expanded .nav-region-toggle::after {
    transform: rotate(-135deg);
    margin-top: 2px;
  }

  /* 窄屏下网站行改成上下两块：上面是网站，下面是它的栏目。 */
  .nav-link-card {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .nav-link-title {
    max-width: 100%;
  }

  .nav-link-columns {
    flex: 1 1 auto;
    justify-content: flex-start;
    padding-top: 8px;
    padding-left: 0;
    border-top: 1px dashed #e2e8f0;
    border-left: none;
  }

  .nav-column-empty {
    text-align: left;
  }
}

/* 手机端公共基线：只补跨页面的通用兜底，不改动桌面端布局。 */
@media (max-width: 980px) {
  html {
    /* 手机浏览器会按设备宽度重新换算字号，这里固定为标准的 100%，避免字被放大。 */
    -webkit-text-size-adjust: 100%;
  }

  /* 手机浏览器地址栏收起时 100vh 会把底部内容顶出屏幕，这几个整屏页面改用动态视口单位；
     不支持 dvh 的浏览器会忽略该声明，仍走上面的 100vh 兜底。 */
  body.auth-page,
  .static-page,
  .auth-shell,
  .account-shell {
    min-height: 100dvh;
  }
}

/* 手机端用户主链路补充：弹窗尺寸与点击热区。 */
@media (max-width: 640px) {
  /* 弹窗容器左右各有 20px 内边距，卡片再按 92vw 定宽，两者相加在 500px 以下的屏宽会超出屏幕、左右被裁切。 */
  .wechat-bind-dialog {
    padding: 12px;
  }

  .wechat-bind-dialog-card {
    width: 100%;
    /* 原来没有高度上限：内容较高的弹窗（如绑定通知渠道）在手机上会上下溢出，顶部标题和关闭按钮点不到。
       这里限制在视口内并允许卡片内部滚动；不支持 dvh 的浏览器会忽略第二条声明，仍走 100vh 兜底。 */
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
    padding: 16px;
    border-radius: 18px;
  }

  /* 普通弹窗保留 420px 上限，避免在大屏手机上过宽；版面对比要左右并排看图，不受此限制。 */
  .wechat-bind-dialog-card:not(.visual-compare-card) {
    max-width: 420px;
  }

  /* 手机上这几个按钮原本只有 26~32px 高，抬高到便于手指点按的尺寸。 */
  .small-button,
  .detail-section-toggle,
  .notify-channel-option {
    min-height: 36px;
  }

  /* 变更事件里的条目列表是裸 ul/li，且条目名与链接没有断行点，窄屏下会顶出卡片外。 */
  .stack-card ul {
    margin: 6px 0 0;
    padding-left: 18px;
  }

  .stack-card li {
    margin-bottom: 4px;
    /* 长链接或超长标题没有空格可断，允许在任意字符处换行。 */
    overflow-wrap: anywhere;
  }

  .stack-card a {
    overflow-wrap: anywhere;
  }

  /* 任务详情里的目标网址是完整长链接，没有断行点，窄屏下会横向溢出。 */
  #detail-url {
    overflow-wrap: anywhere;
  }

  /* iOS Safari 聚焦字号小于 16px 的输入框时会自动放大整页，导致后续内容错位。
     这几个用户侧表单控件都继承/声明了 15px 以下的字号，统一兜到 16px。 */
  .nav-search-input,
  .detail-interval-select,
  .chat-composer-options select {
    font-size: 16px;
  }
}

/* ---------- PWA：添加到主屏幕引导条 ---------- */

/* 层级取 70：高于顶部栏与移动菜单，低于 80 的弹窗，弹窗打开时会自动被盖住。 */
.pwa-install-bar {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(560px, calc(100vw - 24px));
  padding: 12px 14px;
  transform: translateX(-50%);
  border: 1px solid #dbe4f3;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
  font-size: 13px;
  line-height: 1.6;
}

.pwa-install-text {
  flex: 1 1 auto;
  min-width: 0;
  color: #334155;
  overflow-wrap: anywhere;
}

.pwa-install-action {
  flex: none;
  padding: 8px 14px;
  border: none;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
}

.pwa-install-action:hover {
  background: #1d4ed8;
}

.pwa-install-close {
  flex: none;
  width: 26px;
  height: 26px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #f1f5f9;
  color: #64748b;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

.pwa-install-close:hover {
  background: #e2e8f0;
  color: #334155;
}

@media (max-width: 640px) {
  /* 窄屏下按钮与关闭键会挤压文案，改成文案独占一行、按钮同行右对齐。 */
  .pwa-install-bar {
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
  }

  .pwa-install-text {
    flex: 1 1 100%;
  }

  .pwa-install-action {
    flex: 1 1 auto;
    min-height: 36px;
  }
}

@media (max-width: 900px) {
  .notify-overview-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .notify-overview-summary {
    grid-template-columns: 1fr;
  }

  .notify-overview-item {
    grid-template-columns: 1fr;
  }

  .notify-overview-side {
    grid-template-columns: auto 1fr;
    align-items: center;
    justify-items: start;
    border-right: none;
    border-bottom: 1px solid #e2e8f0;
  }

  .notify-overview-name {
    text-align: left;
  }

  .notify-overview-primary {
    font-size: 18px;
  }

  .shell-page-panel {
    padding: 16px 14px 18px;
  }

  .shell-page-panel > .account-card-header,
  .shell-page-panel > .panel-header {
    margin-bottom: 14px;
    padding-bottom: 12px;
  }

  .shell-page-panel .account-card-title,
  .shell-page-panel > .panel-header h2 {
    font-size: 24px;
  }

  .shell-page-panel .account-card-subtitle,
  .shell-page-panel .muted {
    font-size: 13px;
    line-height: 1.7;
  }

  .detail-hero-card {
    padding: 16px 14px;
    border-radius: 14px;
  }

  .detail-hero-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .detail-hero-status {
    text-align: left;
  }

  .detail-overview-cards {
    grid-template-columns: 1fr;
  }

  .detail-info-card {
    padding: 14px;
  }

  .shell-page-panel .inline-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .account-page-panel .account-row {
    grid-template-columns: 1fr;
    gap: 8px;
    align-items: start;
    min-height: 0;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .account-page-panel .account-inline-actions,
  .account-page-panel .account-value-block {
    justify-content: flex-start;
  }

  .account-page-panel .operation-log-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .account-page-panel .operation-log-toolbar-actions {
    width: 100%;
  }

  .account-page-panel .plan-purchase-bar {
    flex-direction: column;
    align-items: stretch;
  }

  /* 竖排后必须把横向用的 flex-basis 180px 清掉，否则它会变成高度把下拉撑出大片空白。 */
  .account-page-panel .plan-purchase-bar label,
  .account-page-panel .plan-purchase-bar select,
  .account-page-panel .plan-purchase-bar button {
    flex: 0 0 auto;
  }

  .account-page-panel .plan-purchase-bar select,
  .account-page-panel .plan-purchase-bar button {
    width: 100%;
  }

  .nav-page-header {
    gap: 14px;
  }

  .nav-page-panel .nav-hero,
  .nav-page-panel .nav-my-panel {
    padding: 14px;
    border-radius: 16px;
  }

  .notify-overview-footer {
    align-items: flex-start;
  }

  .notify-overview-task-link {
    white-space: normal;
  }
}

/* ---------- 发票管理（用户端） ---------- */
.invoice-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.invoice-toolbar select {
  flex: 1 1 200px;
  min-width: 0;
}

.invoice-toolbar button {
  flex: none;
  white-space: nowrap;
}

.invoice-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.invoice-item {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 14px;
  background: #fbfcfe;
}

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

.invoice-item-title {
  font-weight: 600;
  color: #0f172a;
  word-break: break-all;
}

.invoice-item-head .result-note {
  margin-top: 0;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  white-space: nowrap;
}

.result-note.pending {
  background: #eff6ff;
  color: #1d4ed8;
}

.invoice-item-meta {
  margin-top: 4px;
  color: #64748b;
  font-size: 13px;
}

.invoice-item-lines {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.invoice-item-line {
  font-size: 13px;
  color: #374151;
  word-break: break-all;
}

.invoice-item-foot {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #94a3b8;
}

.invoice-file-link {
  color: #2563eb;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.invoice-apply-body .field {
  margin-bottom: 10px;
}

.invoice-special-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px dashed #d7deea;
  border-radius: 12px;
  background: #f8fafc;
}

/* 可开票订单勾选列表 + 页内开票表单 */
.invoice-picker-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 14px;
  background: #fbfcfe;
}

.invoice-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.invoice-select-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #334155;
  cursor: pointer;
}

.invoice-select-all input {
  width: auto;
  margin: 0;
}

.invoice-selection-summary {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
}

.invoice-order-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.invoice-order-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid #eef2f7;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}

.invoice-order-row input {
  width: auto;
  margin: 0;
  flex: none;
}

.invoice-order-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.invoice-order-title {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
}

.invoice-order-meta {
  font-size: 12px;
  color: #64748b;
  word-break: break-all;
}

.invoice-order-amount {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
}

.invoice-picker-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.invoice-picker-foot button {
  white-space: nowrap;
}

.invoice-apply-inline {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
}

.invoice-apply-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.invoice-apply-head h3 {
  margin: 0 0 4px;
  font-size: 15px;
  color: #0f172a;
}

.invoice-apply-body {
  margin-top: 12px;
  display: grid;
  gap: 12px;
}

.invoice-apply-actions {
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 640px) {
  .invoice-order-row {
    flex-wrap: wrap;
  }

  .invoice-order-amount {
    width: 100%;
    text-align: right;
  }

  .invoice-apply-head {
    flex-direction: column;
  }
}

/* ---------- 发票处理（管理端） ---------- */
.admin-invoice-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.admin-invoice-item {
  gap: 10px;
}

.admin-invoice-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.admin-invoice-head-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.admin-invoice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 6px 16px;
  font-size: 13px;
  color: #475569;
}

.admin-invoice-grid span {
  word-break: break-all;
}

.admin-invoice-extra {
  padding: 8px 12px;
  border-radius: 10px;
  background: #f8fafc;
  font-size: 13px;
  color: #475569;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 6px 16px;
}

.admin-invoice-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-invoice-foot .admin-invoice-no {
  font-size: 12px;
  color: #94a3b8;
}

.admin-invoice-dialog-body .field {
  margin-bottom: 10px;
}

.admin-invoice-dialog-hint {
  font-size: 13px;
  color: #64748b;
}

/* ---------- 优惠码（管理端） ---------- */
.admin-promo-redemption-row {
  margin-bottom: 8px;
}

@media (max-width: 980px) {
  .admin-promo-redemption-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .invoice-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .invoice-toolbar select,
  .invoice-toolbar button {
    width: 100%;
  }

  .admin-invoice-grid,
  .admin-invoice-extra {
    grid-template-columns: 1fr;
  }

  .admin-invoice-foot {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-invoice-foot .inline-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

/* ---------- 管理后台左侧菜单布局 ---------- */
.admin-shell {
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
  gap: 16px;
  padding: 0 16px 20px;
  align-items: start;
}

/* 内容区被移入 shell 后由 shell 统一控制内边距，避免重复留白 */
.admin-shell > main {
  padding: 0;
  min-width: 0;
}

.admin-sidebar {
  position: sticky;
  top: 12px;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fbfcfe;
}

.admin-sidebar-title {
  display: block;
  padding: 2px 10px 10px;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  text-decoration: none;
}

.admin-sidebar-title:hover {
  color: #1d4ed8;
}

.admin-sidebar-nav {
  display: grid;
  gap: 4px;
}

.admin-sidebar-link {
  display: block;
  padding: 9px 12px;
  border-radius: 10px;
  color: #334155;
  font-size: 14px;
  line-height: 1.35;
  text-decoration: none;
  word-break: break-word;
  transition: background 0.15s ease, color 0.15s ease;
}

.admin-sidebar-link:hover {
  background: #eff6ff;
  color: #1d4ed8;
}

.admin-sidebar-link.active {
  background: #2563eb;
  color: #ffffff;
  font-weight: 600;
}

.admin-sidebar-divider {
  height: 1px;
  margin: 8px 4px;
  background: #e2e8f0;
}

.account-sidebar-footer {
  display: grid;
  gap: 8px;
  padding: 8px 4px 2px;
}

.account-sidebar-footer .admin-sidebar-divider {
  margin: 0 4px;
}

.account-sidebar-footer-button {
  width: 100%;
  min-width: 0;
  padding: 7px 14px;
  font-size: 13px;
  text-align: center;
  box-sizing: border-box;
}

/* 用户中心侧栏：桌面端常驻左侧，移动端收进顶栏汉堡按钮弹出的浮层（见下方 980px 断点） */

@media (max-width: 980px) {
  .admin-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-sidebar {
    position: static;
  }

  .admin-sidebar-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-sidebar-divider {
    grid-column: 1 / -1;
  }

  /* 用户中心菜单移动端收进顶栏：顶栏「登录」右侧的汉堡按钮控制弹出，页面内不再保留下拉条 */
  .topbar-actions > #account-menu-button {
    display: inline-flex;
  }

  /* 浮层铺满可视宽度，菜单 5 列一行、共三行：监控 / 通知与记录 / 账号与费用 */
  .account-sidebar {
    position: fixed;
    top: 64px; /* 实际位置由 account_menu.js 按汉堡按钮底边动态覆盖 */
    left: 12px;
    right: 12px;
    z-index: 60;
    display: none;
    max-height: calc(100vh - 96px);
    overflow-y: auto;
    padding: 10px;
    background: #ffffff;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.16);
  }

  .account-sidebar.is-open {
    display: block;
  }

  .account-sidebar .admin-sidebar-nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
  }

  .account-sidebar .admin-sidebar-link {
    padding: 8px 2px;
    font-size: 12px;
    line-height: 1.35;
    text-align: center;
  }

  /* 管理后台单独占满一行，与上面三组区分开 */
  .account-sidebar .admin-sidebar-link.admin-wide {
    grid-column: 1 / -1;
    margin-top: 2px;
    padding: 9px 2px;
  }

  /* 底部「退出 / 注销账号」并排，避免在浮层里再占两行 */
  .account-sidebar-footer {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  /* 管理后台菜单同样收进顶栏：顶栏「退出登录」右侧的汉堡按钮控制弹出 */
  .topbar-actions > #admin-menu-button {
    display: inline-flex;
  }

  .admin-menu-sidebar {
    position: fixed;
    top: 64px; /* 实际位置由 admin_menu.js 按汉堡按钮底边动态覆盖 */
    left: 12px;
    right: 12px;
    z-index: 60;
    display: none;
    max-height: calc(100vh - 96px);
    overflow-y: auto;
    padding: 10px;
    background: #ffffff;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.16);
  }

  .admin-menu-sidebar.is-open {
    display: block;
  }

  /* 浮层里不再重复「管理后台」标题，直接给菜单项 */
  .admin-menu-sidebar .admin-sidebar-title {
    display: none;
  }

  .admin-menu-sidebar .admin-sidebar-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .admin-menu-sidebar .admin-sidebar-link {
    padding: 9px 10px;
    font-size: 12.5px;
    text-align: left;
  }
}

@media (max-width: 640px) {
  .admin-sidebar-link {
    padding: 10px 10px;
    font-size: 13px;
  }

  /* 小屏兜底：5 列浮层菜单在 320~360px 宽度下缩小字号与内边距，保证每项单行不折行 */
  .account-sidebar .admin-sidebar-link {
    padding: 8px 0;
    font-size: 11.5px;
  }
}

/* ===== 团队协作空间 ===== */
.workspace-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.workspace-empty {
  padding: 48px 16px;
  text-align: center;
  border: 1px dashed #d1d5db;
  border-radius: 12px;
}
.workspace-empty-title {
  font-size: 16px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}
.workspace-card {
  padding: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
  background: #fff;
}
.workspace-card:hover {
  border-color: #2563eb;
  box-shadow: 0 2px 8px rgba(37, 99, 235, .08);
}
.workspace-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.workspace-card-title {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
}
.workspace-card-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  flex-shrink: 0;
}
.badge-owner { background: #fef3c7; color: #92400e; }
.badge-admin { background: #dbeafe; color: #1d4ed8; }
.badge-member { background: #e5e7eb; color: #4b5563; }
.workspace-card-desc {
  font-size: 13px;
  margin-bottom: 8px;
}
.workspace-card-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: #6b7280;
}

/* 详情视图 */
.workspace-section-header {
  margin: 24px 0 12px;
}
.workspace-section-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 2px;
}
.workspace-invite-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.workspace-invite-code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 14px;
  padding: 6px 10px;
  background: #f3f4f6;
  border-radius: 6px;
  letter-spacing: 1px;
}
.workspace-member-list,
.workspace-task-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.workspace-member-row,
.workspace-task-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid #f3f4f6;
  border-radius: 8px;
  background: #fff;
}
.workspace-member-info,
.workspace-task-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.workspace-member-name {
  font-weight: 500;
  color: #111827;
}
.workspace-member-role {
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 10px;
  background: #f3f4f6;
  color: #6b7280;
}
.workspace-member-actions {
  display: flex;
  gap: 6px;
}
.workspace-member-action {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #374151;
  cursor: pointer;
}
.workspace-member-action:hover { border-color: #2563eb; color: #2563eb; }
.workspace-member-action.danger { color: #dc2626; border-color: #fecaca; }
.workspace-member-action.danger:hover { border-color: #dc2626; background: #fef2f2; }
.workspace-task-link {
  color: #111827;
  text-decoration: none;
  font-weight: 500;
}
.workspace-task-link:hover { color: #2563eb; }
.workspace-task-status {
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 10px;
}

@media (max-width: 640px) {
  .workspace-list {
    grid-template-columns: 1fr;
  }
  .workspace-member-row {
    flex-wrap: wrap;
  }
  .workspace-member-actions {
    margin-top: 6px;
  }
}

/* ===== 资讯聚合 ===== */
.feed-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.feed-panel-header {
  align-items: flex-start;
}
.feed-search-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.feed-search-input {
  flex: 1 1 320px;
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid #d0d7de;
  border-radius: 10px;
  font-size: 14px;
}
.feed-search-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.feed-today-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #475569;
  white-space: nowrap;
  cursor: pointer;
}
.feed-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr) 190px;
  gap: 16px;
  align-items: start;
}
.feed-sidebar,
.feed-stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.feed-sidebar-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.feed-sidebar-title {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}
.feed-source-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.feed-source-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #f8fafc;
  color: #475569;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
}
.feed-source-item:hover {
  border-color: #bfdbfe;
  color: #1d4ed8;
}
.feed-source-item.is-active {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 600;
}
.feed-source-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.feed-source-count {
  flex-shrink: 0;
  font-size: 12px;
  color: #64748b;
}
.feed-main {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.feed-summary-bar {
  font-size: 13px;
  color: #64748b;
}
.feed-item-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.feed-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #eef2f7;
  border-radius: 10px;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.feed-item:hover {
  border-color: #bfdbfe;
  box-shadow: 0 2px 8px rgba(37, 99, 235, .06);
}
.feed-item-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.feed-item-title {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  text-decoration: none;
  line-height: 1.5;
  word-break: break-word;
}
.feed-item-title:hover {
  color: #1d4ed8;
}
.feed-item-title mark {
  background: #fef08a;
  color: inherit;
  padding: 0 2px;
  border-radius: 3px;
}
.feed-item-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.feed-tag {
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 10px;
  background: #f1f5f9;
  color: #475569;
  white-space: nowrap;
}
.feed-tag-dup {
  background: #dbeafe;
  color: #1d4ed8;
}
.feed-tag-type {
  background: #ede9fe;
  color: #6d28d9;
}
.feed-tag-date {
  background: #ecfdf5;
  color: #047857;
}
.feed-tag-stale {
  background: #fef2f2;
  color: #b91c1c;
}
.feed-item-time {
  font-size: 12px;
  color: #94a3b8;
}
.feed-item-summary {
  font-size: 12px;
  line-height: 1.6;
  word-break: break-word;
}
.feed-item-side {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.feed-bookmark-star {
  border: none;
  background: none;
  padding: 0 2px;
  font-size: 17px;
  line-height: 1;
  color: #cbd5e1;
  cursor: pointer;
}
.feed-bookmark-star:hover {
  color: #f59e0b;
}
.feed-bookmark-star.is-active {
  color: #f59e0b;
}
.feed-bookmark-panel {
  border: 1px solid #eef2f7;
  border-radius: 10px;
  background: #fffdf5;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.feed-bookmark-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}
.feed-bookmark-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.feed-book-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
}
.feed-book-title {
  color: #1f2937;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.feed-book-title:hover {
  color: #1d4ed8;
}
.feed-link-button {
  border: none;
  background: none;
  padding: 0;
  font-size: 12px;
  color: #94a3b8;
  cursor: pointer;
  flex-shrink: 0;
}
.feed-link-button:hover {
  color: #2563eb;
}
.feed-book-empty,
.feed-sub-empty {
  font-size: 12px;
  line-height: 1.6;
}
.feed-subscription-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.feed-sub-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: #475569;
}
.feed-sub-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.feed-item-open {
  font-size: 12px;
  color: #2563eb;
  text-decoration: none;
  white-space: nowrap;
}
.feed-item-open:hover {
  text-decoration: underline;
}
.feed-load-more-wrap {
  display: flex;
  justify-content: center;
  padding: 8px 0 4px;
}
.feed-empty {
  padding: 48px 16px;
  text-align: center;
  border: 1px dashed #d1d5db;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.feed-empty-title {
  font-size: 16px;
  font-weight: 600;
  color: #374151;
}
.feed-stat-card {
  padding: 12px;
  border: 1px solid #eef2f7;
  border-radius: 10px;
  background: #f8fafc;
}
.feed-stat-label {
  font-size: 12px;
  color: #64748b;
}
.feed-stat-value {
  font-size: 20px;
  font-weight: 700;
  color: #111827;
}
.feed-stat-link {
  font-size: 12px;
  color: #2563eb;
  text-decoration: none;
}
.feed-stat-link:hover {
  text-decoration: underline;
}
.feed-disclaimer {
  font-size: 12px;
  line-height: 1.6;
  border-top: 1px dashed #e5e7eb;
  padding-top: 10px;
}

@media (max-width: 980px) {
  .feed-layout {
    grid-template-columns: 1fr;
  }
  .feed-stats {
    order: -1;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .feed-stat-card {
    flex: 1 1 120px;
  }
  .feed-sidebar {
    order: -1;
  }
  .feed-source-list {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .feed-source-item {
    flex: 1 1 auto;
  }
}

/* ===== 移动端兜底：任务详情等监控页面防横向溢出（置于文件末尾确保优先生效） ===== */
@media (max-width: 640px) {
  /* grid 的 1fr 实际是 minmax(auto,1fr)：页面里任何不可断行的长内容（长网址、
     日志文本）都会把整列撑得比屏幕宽，连带 width:100% 的按钮区一起溢出。
     显式 minmax(0,1fr) 把列宽锁死在视口内。 */
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .detail-page,
  .panel {
    min-width: 0;
    max-width: 100%;
  }

  /* 顶部 4 个操作按钮 2×2 等宽排列，置后声明避免被旧规则冲掉。 */
  .detail-page > .panel-header > .inline-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .detail-page > .panel-header > .inline-actions button {
    width: 100%;
    padding-left: 8px;
    padding-right: 8px;
    white-space: nowrap;
  }

  /* 长网址 / 长任务名 / 检查日志等允许在任意字符处断行，不再撑宽页面。 */
  .detail-page a,
  .detail-page span,
  .detail-page dd,
  .detail-hero-url,
  .detail-card,
  .stack-card {
    overflow-wrap: anywhere;
  }
}

/* ---------- 站内消息中心 ---------- */
.message-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 4px 14px;
  border-bottom: 1px solid #e5e7eb;
}

.message-filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.message-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}

.message-toolbar-actions button {
  white-space: nowrap;
}

.message-unread-badge {
  display: inline-block;
  min-width: 18px;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #ef4444;
  color: #ffffff;
  font-size: 11px;
  line-height: 16px;
  text-align: center;
}

.message-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.message-empty {
  padding: 36px 12px;
  text-align: center;
  color: #94a3b8;
  font-size: 14px;
}

.message-item {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 14px;
  background: #fbfcfe;
}

.message-item.is-unread {
  border-color: #bfdbfe;
  background: #f8fbff;
}

.message-item.is-clickable {
  cursor: pointer;
}

.message-item.is-clickable:hover {
  border-color: #93c5fd;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.08);
}

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

.message-category {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: #eef2ff;
  color: #4338ca;
  white-space: nowrap;
}

.message-item-update .message-category {
  background: #eff6ff;
  color: #1d4ed8;
}

.message-item-plan .message-category {
  background: #fff7ed;
  color: #c2410c;
}

.message-item-payment .message-category {
  background: #ecfdf5;
  color: #047857;
}

.message-item-time {
  color: #94a3b8;
  font-size: 12px;
  white-space: nowrap;
}

.message-item-title {
  margin-top: 8px;
  font-weight: 600;
  color: #0f172a;
  word-break: break-word;
}

.message-unread-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 8px;
  border-radius: 50%;
  background: #ef4444;
  vertical-align: middle;
}

.message-item-body {
  margin-top: 6px;
  color: #475569;
  font-size: 14px;
  line-height: 1.55;
  word-break: break-word;
}

.message-item-foot {
  margin-top: 8px;
  color: #2563eb;
  font-size: 13px;
  font-weight: 600;
}

.message-list-footer {
  display: flex;
  justify-content: center;
  padding: 14px 0 4px;
}

@media (max-width: 640px) {
  .message-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .message-toolbar-actions {
    margin-left: 0;
    justify-content: flex-end;
  }

  .message-item-head {
    flex-wrap: wrap;
  }
}

/* ============================================================
   任务详情页整页改版（仅作用于 .detail-page，不改 DOM 与 JS 绑定）
   设计语言：白色卡片 + 细边框 + 轻投影，统一圆角与间距节奏，
   主操作蓝色实心、次操作浅色描边，状态用彩色胶囊徽章区分。
   ============================================================ */

/* ---------- 顶部标题与操作按钮 ---------- */
.detail-page .panel-header {
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e8ecf3;
  margin-bottom: 18px;
}

.detail-page .panel-header h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: 0.2px;
  color: #0f172a;
}

.detail-page .panel-header .inline-actions button {
  height: 34px;
  padding: 0 14px;
  border: 1px solid #dbe2ec;
  border-radius: 9px;
  background: #fff;
  color: #334155;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 0.15s, background 0.15s, color 0.15s, box-shadow 0.15s;
}

.detail-page .panel-header .inline-actions button:hover:not(:disabled) {
  border-color: #b9c6da;
  background: #f8fafc;
  color: #0f172a;
}

.detail-page .panel-header .inline-actions button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.detail-page .panel-header .inline-actions #run-task-button {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.detail-page .panel-header .inline-actions #run-task-button:hover:not(:disabled) {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
}

/* ---------- 到期提示条 ---------- */
.detail-page .detail-expired-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

.detail-page .detail-expiring-banner {
  background: #fffbeb;
  border-color: #fde68a;
  color: #b45309;
}

/* ---------- 顶部核心卡片（Hero） ---------- */
.detail-page .detail-hero-card {
  background: linear-gradient(180deg, #f7faff 0%, #ffffff 72%);
  border: 1px solid #e3eaf6;
  border-radius: 14px;
  padding: 18px 20px 16px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.detail-page .detail-hero-label {
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
  letter-spacing: 0.3px;
  margin-bottom: 4px;
}

.detail-page #detail-name {
  font-size: 18px;
  font-weight: 650;
  color: #0f172a;
}

.detail-page #detail-url {
  font-size: 14px;
  color: #2563eb;
  word-break: break-all;
}

.detail-page .detail-overview-cards {
  gap: 12px;
}

/* 概览统计不套内框：平铺在 Hero 卡片内，仅保留排版。 */
.detail-page .detail-overview-card {
  padding: 0;
}

.detail-page .detail-overview-label {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 3px;
}

.detail-page .detail-overview-value {
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
}

/* 状态胶囊：app.js 会写入 is-active / is-paused / is-expired / is-resuming */
.detail-page .detail-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  background: #eef2f7;
  color: #475569;
}

.detail-page .detail-status-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.85;
}

.detail-status-badge.is-active {
  background: #ecfdf5;
  color: #047857;
}

.detail-status-badge.is-paused {
  background: #fffbeb;
  color: #b45309;
}

.detail-status-badge.is-expired {
  background: #fef2f2;
  color: #b91c1c;
}

.detail-status-badge.is-resuming {
  background: #eff6ff;
  color: #1d4ed8;
}

/* ---------- 设置卡片 ---------- */
.detail-page .detail-info-card {
  border: 1px solid #e6ebf4;
  border-radius: 14px;
  padding: 18px 20px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.detail-page .detail-section-title {
  font-size: 15px;
  font-weight: 650;
  color: #0f172a;
}

.detail-page .detail-setting-group {
  border-top: 1px dashed #e8ecf3;
  padding-top: 14px;
  margin-top: 14px;
}

.detail-page .detail-setting-group:first-of-type {
  border-top: 0;
  padding-top: 8px;
  margin-top: 8px;
}

.detail-page .detail-setting-group-title {
  font-size: 12px;
  font-weight: 600;
  color: #2563eb;
  letter-spacing: 0.8px;
}

.detail-page .detail-grid strong {
  font-size: 13px;
  font-weight: 500;
  color: #475569;
}

/* 详情页内输入控件统一高度与聚焦态 */
.detail-page select,
.detail-page input[type="text"],
.detail-page input[type="number"],
.detail-page input[type="time"],
.detail-page input[type="url"] {
  height: 36px;
  padding: 0 11px;
  border: 1px solid #d9dfe9;
  border-radius: 9px;
  background: #fff;
  font-size: 13.5px;
  color: #0f172a;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.detail-page select:focus,
.detail-page input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.detail-page .muted,
.detail-page .history-retention-hint,
.detail-page .detail-info-hint {
  color: #94a3b8;
  font-size: 12.5px;
}

/* ---------- 诊断与历史区块：独立卡片 ---------- */
.detail-page .detail-sections section,
.detail-page .detail-diagnosis {
  background: #fff;
  border: 1px solid #e6ebf4;
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.detail-page .detail-section-header {
  border-bottom: 0;
  padding: 0 0 12px;
}

.detail-page .detail-section-header h3 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 650;
  color: #0f172a;
}

/* ---------- 历史列表条目：不再套内框，条目间用发丝线分隔 ---------- */
.detail-page .stack-list {
  gap: 0;
}

.detail-page .stack-card {
  border: 0;
  border-radius: 0;
  padding: 12px 0;
  background: transparent;
}

.detail-page .stack-card:first-child {
  padding-top: 2px;
}

.detail-page .stack-card + .stack-card {
  border-top: 1px solid #eef2f7;
}

.detail-page .stack-card-title {
  font-weight: 600;
  color: #0f172a;
}

/* ---------- 诊断卡片 ---------- */
.detail-page .detail-diagnosis-list {
  gap: 10px;
}

/* ---------- 窄屏 ---------- */
@media (max-width: 640px) {
  .detail-page .detail-hero-card,
  .detail-page .detail-info-card,
  .detail-page .detail-sections section,
  .detail-page .detail-diagnosis {
    padding: 14px;
    border-radius: 12px;
  }

  .detail-page .panel-header .inline-actions button {
    height: 32px;
    padding: 0 11px;
  }
}

/* ============================================================
   任务清单（表格视图）：任务很多时用一张表替代左侧长列表，
   主区占满整行，搜索 / 筛选 / 排序 / 分页固定在表格上方。
   ============================================================ */

/* 清单视图下主区独占整行（左侧由用户中心菜单占位）。 */
.task-table-panel {
  padding: 18px 20px 16px;
}

.task-table-header {
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid #e8ecf3;
}

.task-table-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  min-width: 0;
}

.task-table-heading h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 650;
  color: #0f172a;
}

#task-table-count {
  font-size: 12.5px;
}

.task-table-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.task-table-search {
  flex: 0 1 300px;
  min-width: 180px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid #d9dfe9;
  border-radius: 9px;
  background: #fff;
  font-size: 13.5px;
  color: #0f172a;
}

.task-table-search:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.task-table-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}

.task-table-toolbar-right select {
  width: auto;
  flex: 0 0 auto;
  height: 36px;
  padding: 0 10px;
  border: 1px solid #d9dfe9;
  border-radius: 9px;
  background: #fff;
  font-size: 13px;
  color: #0f172a;
}

.task-table-toolbar-right select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.task-table-scroll {
  overflow-x: auto;
  border: 1px solid #e8ecf3;
  border-radius: 12px;
}

.task-table {
  width: 100%;
  min-width: 940px;
  border-collapse: collapse;
  font-size: 13.5px;
}

.task-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px 12px;
  border-bottom: 1px solid #e8ecf3;
  background: #f8fafc;
  color: #64748b;
  font-size: 12.5px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

.task-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  color: #334155;
}

.task-table tbody tr:last-child td {
  border-bottom: 0;
}

.task-table-row {
  cursor: pointer;
  transition: background 0.15s;
}

.task-table-row:hover {
  background: #f8fafc;
}

.task-table-row.is-current {
  background: #eff6ff;
}

.task-table-col-status {
  width: 104px;
}

.task-table-col-name {
  min-width: 190px;
}

.task-table-col-url {
  max-width: 320px;
}

.task-table-col-interval,
.task-table-col-last,
.task-table-col-next {
  white-space: nowrap;
  font-size: 13px;
  color: #475569;
}

.task-table-col-actions {
  width: 244px;
  text-align: right;
  white-space: nowrap;
}

.task-table-col-actions button {
  white-space: nowrap;
}

/* 删除是破坏性操作，用描边红与其它操作区分，避免误点 */
.task-table-delete-button {
  border-color: #fecaca;
  color: #dc2626;
}

.task-table-delete-button:hover:enabled {
  border-color: #fca5a5;
  background: #fff5f5;
}

/* 批量导入入口从侧栏移入清单头部后不再占满整行。 */
.inline-actions .batch-import-entry {
  width: auto;
  margin-top: 0;
}

.task-table-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef2f7;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.task-table-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.task-table-status.is-active {
  background: #ecfdf5;
  color: #047857;
}

.task-table-status.is-paused {
  background: #fffbeb;
  color: #b45309;
}

.task-table-status.is-expired,
.task-table-status.is-error {
  background: #fef2f2;
  color: #b91c1c;
}

.task-table-status.is-resuming {
  background: #eff6ff;
  color: #1d4ed8;
}

.task-table-name {
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  color: #0f172a;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.task-table-name:hover {
  color: #2563eb;
}

.task-table-pin-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 700;
  vertical-align: middle;
}

.task-table-url {
  display: block;
  max-width: 320px;
  overflow: hidden;
  color: #2563eb;
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 12px;
}

.task-table-pager {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.task-table-pager button {
  white-space: nowrap;
}

.task-table-view .empty-inline {
  padding: 24px 12px;
  text-align: center;
}

@media (max-width: 1100px) {
  .task-table-col-last {
    display: none;
  }

  .task-table {
    min-width: 820px;
  }
}

@media (max-width: 900px) {
  .task-table-col-url,
  .task-table-col-interval {
    display: none;
  }

  .task-table {
    min-width: 620px;
  }
}

@media (max-width: 1100px), (pointer: coarse) {
  /* 外壳左右内距统一压到 12px，配合下面 .panel 的负边距实现「方框通栏」。
     这里同时用 pointer: coarse 兜底：只要设备是触摸屏（手机/平板），
     不管视口被「桌面版网站」放大到多少，一律按移动端布局走。 */
  .app-shell {
    padding-left: 12px;
    padding-right: 12px;
  }

  .topbar {
    padding-left: 0;
    padding-right: 0;
  }

  .task-table-panel {
    padding: 12px;
  }

  /* 标题与按钮改为上下两段，操作按钮均分整行，避免挤成一排小按钮 */
  .task-table-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding-bottom: 12px;
    margin-bottom: 12px;
  }

  /* 移动端所有页面的方框（.panel）贴齐屏幕左右边缘：
     外壳仍保留 12px 内距，用负边距把面板撑出去，内容内距收敛为 14px。 */
  .panel {
    margin-left: -12px;
    margin-right: -12px;
    border-radius: 0;
    padding-left: 14px;
    padding-right: 14px;
  }

  /* 抽屉式侧边栏是浮层，不跟着贴边。 */
  .panel.sidebar {
    margin-left: 0;
    margin-right: 0;
  }

  /* 4 个按钮改成 2×2 网格：一行挤 4 个会把「批量导入任务」压成两行小字 */
  .task-table-header .inline-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
  }

  .task-table-header .inline-actions > button {
    width: 100%;
    min-height: 44px;
    padding: 0 10px;
    font-size: 13px;
    white-space: nowrap;
  }

  .task-table-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 10px;
  }

  .task-table-search {
    flex: 1 1 auto;
    max-width: none;
    width: 100%;
    height: 44px;
    font-size: 15px;
  }

  /* 状态筛选胶囊横向滑动，避免折成多行占满首屏 */
  .task-status-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .task-status-filters::-webkit-scrollbar {
    display: none;
  }

  .task-filter-chip {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 0 14px;
  }

  .task-table-toolbar-right {
    margin-left: 0;
    gap: 8px;
  }

  .task-table-toolbar-right select {
    flex: 1 1 0;
    min-width: 0;
    height: 40px;
    font-size: 15px;
  }

  /* ===== 表格卡片化：隐藏表头，一条任务一张卡，彻底去掉横向滚动 ===== */
  .task-table-scroll {
    overflow-x: visible;
    border: 0;
    border-radius: 0;
  }

  .task-table {
    display: block;
    width: 100%;
    min-width: 0;
    font-size: 13px;
  }

  .task-table thead {
    display: none;
  }

  .task-table tbody {
    display: block;
  }

  .task-table tbody td {
    padding: 0;
    border-bottom: 0;
  }

  .task-table-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    padding: 12px;
    margin-bottom: 10px;
    border: 1px solid #e8ecf3;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  }

  .task-table-row:last-child {
    margin-bottom: 0;
  }

  .task-table-row:hover {
    background: #ffffff;
  }

  .task-table-row.is-current,
  .task-table-row.is-current:hover {
    border-color: #bfdbfe;
    background: #eff6ff;
  }

  /* 第一行：任务名称（左）+ 状态（右） */
  .task-table-col-name {
    order: 1;
    flex: 1 1 0;
    width: auto;
    min-width: 0;
  }

  .task-table-name {
    display: block;
    width: 100%;
    font-size: 14.5px;
    line-height: 1.4;
    white-space: normal;
    text-align: left;
  }

  .task-table-col-status {
    order: 2;
    flex: 0 0 auto;
    width: auto;
    margin-left: auto;
  }

  /* 第二行：监控网址，单行省略号 */
  .task-table-col-url {
    order: 3;
    display: block;
    flex: 1 1 100%;
    min-width: 0;
    max-width: none;
  }

  .task-table-url {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* 第三行：频率 / 上次 / 下次，横向排列，过长自动换行 */
  .task-table-col-interval,
  .task-table-col-last,
  .task-table-col-next {
    order: 4;
    display: block;
    flex: 0 0 auto;
    font-size: 12px;
    color: #64748b;
  }

  .task-table-col-interval::before {
    content: "频率 ";
  }

  .task-table-col-last::before {
    content: "上次 ";
  }

  .task-table-col-next::before {
    content: "下次 ";
  }

  .task-table-col-interval::before,
  .task-table-col-last::before,
  .task-table-col-next::before {
    color: #94a3b8;
  }

  /* 第四行：执行 / 暂停恢复 / 置顶 / 删除 排成 2×2，每个按钮 40px 高 */
  .task-table-col-actions {
    order: 5;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    flex: 1 1 100%;
    width: auto;
    gap: 8px;
    text-align: left;
  }

  .task-table-col-actions button {
    width: 100%;
    min-height: 40px;
    font-size: 13px;
    white-space: nowrap;
  }

  .task-table-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .task-table-pager {
    width: 100%;
    justify-content: space-between;
  }

  .task-table-pager button {
    flex: 1 1 0;
    min-height: 40px;
  }
}

/* 条目截止日期倒计时徽标 */
.deadline-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  line-height: 20px;
  vertical-align: middle;
  white-space: nowrap;
}
.deadline-badge-normal {
  background: #eef4ff;
  color: #2f6fed;
}
.deadline-badge-soon {
  background: #fff4e5;
  color: #d9730d;
}
.deadline-badge-urgent {
  background: #ffecec;
  color: #d63030;
}
.deadline-badge-past {
  background: #f1f2f4;
  color: #8a8f99;
}

/* 关键词全网订阅条 */
.nav-keyword-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
}
.nav-keyword-bar .nav-search-input {
  flex: 1;
  min-width: 0;
}
.nav-keyword-bar button {
  flex-shrink: 0;
  white-space: nowrap;
}
.nav-keyword-hint {
  margin: 0 0 10px;
  font-size: 13px;
  color: #8a8f99;
  line-height: 1.6;
}
.nav-keyword-hint a {
  color: #2563eb;
}

/* AI 采集面板 */
.nav-discovery-panel {
  margin: 0 0 12px;
  padding: 12px 14px;
  border: 1px solid #dbe4f0;
  border-radius: 10px;
  background: #f7faff;
}
.nav-discovery-desc {
  font-size: 13px;
  color: #5c6470;
  line-height: 1.7;
  margin-bottom: 10px;
}
.nav-discovery-controls {
  display: flex;
  gap: 8px;
}
.nav-discovery-controls .admin-search-input {
  flex: 1;
  min-width: 0;
}
.nav-discovery-status {
  margin-top: 10px;
  font-size: 13px;
  color: #3a4250;
  line-height: 1.7;
  white-space: pre-wrap;
}

.nav-discovery-divider {
  margin: 12px 0 8px;
  padding-top: 10px;
  border-top: 1px dashed #dbe4f0;
  font-size: 12px;
  color: #8a93a5;
}

/* ============================================================
   移动端强制兜底（放在文件最末 + !important）
   目的：无论旧的同优先级规则、内联样式怎么排，触摸设备一律走
   「表格卡片化 + 方框通栏」，避免再出现“改了没生效”。
   ============================================================ */
@media (max-width: 1100px), (pointer: coarse) {
  .task-table {
    display: block !important;
    min-width: 0 !important;
  }

  .task-table thead,
  .task-table colgroup {
    display: none !important;
  }

  .task-table tbody {
    display: block !important;
  }

  .task-table tbody tr {
    display: flex !important;
    flex-wrap: wrap !important;
  }

  /* 去掉最外层卡片本身的「方框」：无边框、无圆角、无阴影、背景透明，
     内容直接铺在页面底色上，配合负边距做到左右满屏。 */
  .panel {
    margin-left: -12px !important;
    margin-right: -12px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  /* 抽屉侧边栏是浮层，保留自己的白底和阴影，否则会透出页面内容。 */
  .panel.sidebar {
    margin-left: 0 !important;
    margin-right: 0 !important;
    background: #ffffff !important;
    border-radius: 16px !important;
    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.12) !important;
  }
}


/* ============================================================
/* ============================================================
/* ============================================================
/* ============================================================
/* ============================================================
   以下为 mobile.css 的镜像副本（内容完全一致）。
   修改移动端样式时必须两边同步。
   ============================================================ */
/* ============================================================
   移动端样式（独立文件，必须最后加载）
   ------------------------------------------------------------
   目的：把移动端布局从 styles.css 里那几个互相重叠的媒体查询块中
   独立出来，只保留一份权威定义，避免"改了 A 块被 B 块覆盖"。
   生效条件：视口 ≤1100px，或者设备是触摸屏（pointer: coarse）。
   ============================================================ */

@media (max-width: 1100px), (pointer: coarse) {
  /* ---------- 1. 外壳：左右不再留白，内容直接满屏 ---------- */
  .app-shell {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .topbar {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* 关键修复：.content 是 display:grid，隐式单列默认宽度为 auto（minmax(auto,1fr)），
     子元素的最小内容宽度会把整列撑宽，页面就必须左右滑动才能看全卡片。
     这里显式改成 minmax(0, 1fr)，并清零所有直接子项的最小宽度。 */
  .content {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .content > * {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  /* ---------- 2. 最外层卡片去掉方框，内容铺满屏幕 ---------- */
  .panel {
    margin-left: 0 !important;
    margin-right: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    /* 左右内距清零：内容直接贴到屏幕两边，不再留白。 */
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* 抽屉侧边栏是浮层，必须保留白底和阴影，否则盖不住页面内容。 */
  .panel.sidebar {
    margin-left: 0 !important;
    margin-right: 0 !important;
    background: #ffffff !important;
    border-radius: 16px !important;
    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.12) !important;
  }

  /* ---------- 2.5 账号 / 登录 / 静态页的外层卡片同样去掉两侧空白 ---------- */
  /* 这些页面不用 .panel，而是 .account-card / .auth-card / .static-card，
     原先各自带 18~30px 的外壳与卡片内距，手机上两侧空白明显，一并压到最小。 */
  .account-shell,
  .auth-shell,
  .static-shell {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .account-card,
  .auth-card,
  .static-card {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding-left: 4px !important;
    padding-right: 4px !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  /* ---------- 2.6 通知总览：四个统计卡片在手机上排成一行 ---------- */
  /* 断点表里 ≤640px 原本是 1 列（四张大卡片竖着堆），这里强制改成 4 列并压缩字号。 */
  .notify-overview-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 6px !important;
  }

  .notify-overview-stat {
    min-height: 0 !important;
    padding: 10px 6px !important;
    border-radius: 10px !important;
  }

  .notify-overview-stat-label {
    font-size: 10.5px !important;
    line-height: 1.3 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .notify-overview-stat-value {
    margin-top: 4px !important;
    font-size: 18px !important;
    line-height: 1.2 !important;
  }

  /* ---------- 3. 任务清单：表格转卡片 ---------- */
  /* 外框已经满屏，卡片左右不再留内距，直接贴到屏幕边缘。 */
  .task-table-panel {
    padding: 12px 0 !important;
  }

  .task-table-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding-bottom: 12px;
    margin-bottom: 12px;
  }

  /* 顶部四个按钮 2×2，每个 44px 高，文字不换行 */
  .task-table-header .inline-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
  }

  .task-table-header .inline-actions > button {
    width: 100%;
    min-height: 44px;
    padding: 0 10px;
    font-size: 13px;
    white-space: nowrap;
  }

  .task-table-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 10px;
  }

  .task-table-search {
    flex: 1 1 auto;
    max-width: none;
    width: 100%;
    height: 44px;
    font-size: 15px;
  }

  /* 状态筛选胶囊横向滑动，不折行占满首屏 */
  .task-status-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .task-status-filters::-webkit-scrollbar {
    display: none;
  }

  .task-filter-chip {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 0 14px;
  }

  .task-table-toolbar-right {
    margin-left: 0;
    gap: 8px;
  }

  .task-table-toolbar-right select {
    flex: 1 1 0;
    min-width: 0;
    height: 40px;
    font-size: 15px;
  }

  /* 去掉横向滚动容器，表格本身改成块级 */
  .task-table-scroll {
    overflow: hidden !important;
    border: 0 !important;
    border-radius: 0 !important;
  }

  .task-table {
    display: block !important;
    width: 100%;
    min-width: 0 !important;
    font-size: 13px;
  }

  .task-table thead,
  .task-table colgroup {
    display: none !important;
  }

  .task-table tbody {
    display: block !important;
  }

  .task-table tbody td {
    padding: 0;
    border-bottom: 0;
  }

  /* 一条任务 = 一张卡 */
  .task-table tbody tr,
  .task-table-row {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center;
    gap: 6px 10px;
    padding: 12px;
    margin-bottom: 10px;
    border: 1px solid #e8ecf3;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  }

  .task-table-row:last-child {
    margin-bottom: 0;
  }

  .task-table-row:hover {
    background: #ffffff;
  }

  .task-table-row.is-current,
  .task-table-row.is-current:hover {
    border-color: #bfdbfe;
    background: #eff6ff;
  }

  /* 第一行：任务名称（左）+ 状态（右） */
  .task-table-col-name {
    order: 1;
    flex: 1 1 0;
    width: auto;
    min-width: 0;
  }

  .task-table-name {
    display: block;
    width: 100%;
    font-size: 14.5px;
    line-height: 1.4;
    white-space: normal;
    text-align: left;
  }

  .task-table-col-status {
    order: 2;
    flex: 0 0 auto;
    width: auto;
    margin-left: auto;
  }

  /* 第二行：监控网址，单行省略 */
  .task-table-col-url {
    order: 3;
    display: block !important;
    flex: 1 1 100%;
    min-width: 0;
    max-width: none;
  }

  .task-table-url {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* 第三行：频率 / 上次 / 下次 */
  .task-table-col-interval,
  .task-table-col-last,
  .task-table-col-next {
    order: 4;
    display: block !important;
    flex: 0 0 auto;
    font-size: 12px;
    color: #64748b;
  }

  .task-table-col-interval::before {
    content: "频率 ";
  }

  .task-table-col-last::before {
    content: "上次 ";
  }

  .task-table-col-next::before {
    content: "下次 ";
  }

  .task-table-col-interval::before,
  .task-table-col-last::before,
  .task-table-col-next::before {
    color: #94a3b8;
  }

  /* 第四行：执行 / 暂停恢复 / 置顶 / 删除，2×2 */
  .task-table-col-actions {
    order: 5;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    flex: 1 1 100%;
    width: auto;
    gap: 8px;
    text-align: left;
  }

  .task-table-col-actions button {
    width: 100%;
    min-height: 40px;
    font-size: 13px;
    white-space: nowrap;
  }

  /* 底部分页 */
  .task-table-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .task-table-pager {
    width: 100%;
    justify-content: space-between;
  }

  .task-table-pager button {
    flex: 1 1 0;
    min-height: 40px;
  }
}

/* ============================================================
   兜底：清单页在任何情况下都不允许回退成「横向宽表格」。
   放在文件最后，确保优先级和声明顺序都压过 styles.css。
   ============================================================ */
@media (max-width: 1100px), (pointer: coarse) {
  .task-table,
  .task-table tbody {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    table-layout: auto !important;
  }

  .task-table thead,
  .task-table colgroup {
    display: none !important;
  }

  .task-table tbody tr,
  .task-table-row {
    display: flex !important;
    flex-wrap: wrap !important;
    width: auto !important;
    min-width: 0 !important;
  }

  .task-table tbody td,
  .task-table-row > * {
    min-width: 0 !important;
  }

  /* 宽度兜底：清单相关的每一层都不允许超出屏幕宽度，避免出现横向滑动。 */
  .task-table-view,
  .task-table-panel,
  .task-table-scroll,
  .task-table,
  .task-table tbody,
  .task-table tbody tr,
  .task-table-row {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .task-table-panel {
    overflow-x: hidden !important;
  }

  html,
  body {
    overflow-x: hidden !important;
  }
}
