:root {
  color-scheme: light dark;
  --bg: #f5f7fb;
  --surface: #fff;
  --surface-2: #f9fafb;
  --text: #182230;
  --muted: #667085;
  --line: #e4e7ec;
  --brand: #5b63f6;
  --brand-2: #8d54ea;
  --ok: #079455;
  --warn: #b54708;
  --danger: #d92d20;
  --shadow: 0 12px 38px rgba(16, 24, 40, 0.08);
  --radius: 18px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
* {
  box-sizing: border-box;
}
html {
  background: var(--bg);
  scroll-behavior: smooth;
}
body {
  margin: 0;
  color: var(--text);
  background: radial-gradient(
      circle at 85% 0,
      rgba(91, 99, 246, 0.12),
      transparent 30rem
    ),
    var(--bg);
  min-width: 0;
  overflow-x: hidden;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a {
  touch-action: manipulation;
}
.skip-link {
  position: fixed;
  left: 12px;
  top: -60px;
  z-index: 100;
  background: var(--surface);
  padding: 12px;
  border-radius: 8px;
}
.skip-link:focus {
  top: 12px;
}
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.header-inner {
  max-width: 1180px;
  min-height: 68px;
  margin: auto;
  padding: 8px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  min-width: 184px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 13px;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 8px 20px rgba(91, 99, 246, 0.28);
}
.brand strong,
.brand small {
  display: block;
}
.brand small {
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}
.main-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1;
}
.main-nav a,
.back-link {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 0 15px;
  border-radius: 12px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}
.main-nav a:hover,
.main-nav a.active {
  color: var(--brand);
  background: rgba(91, 99, 246, 0.09);
}
.back-link {
  border: 1px solid var(--line);
  color: var(--text);
}
.page-shell {
  width: min(1180px, calc(100% - 40px));
  margin: auto;
  padding: 42px 0 max(48px, env(safe-area-inset-bottom));
}
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 26px;
  align-items: stretch;
}
.hero-copy {
  padding: 28px 6px;
}
.eyebrow {
  display: block;
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
}
.hero h1 {
  max-width: 760px;
  margin: 12px 0;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.12;
  letter-spacing: -0.035em;
}
.hero p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}
.account-card,
.panel,
.stat-card,
.post-card,
.message-card,
.task-card {
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--line) 86%, transparent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.account-card {
  padding: 22px;
  min-height: 194px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.account-profile {
  display: flex;
  align-items: center;
  gap: 14px;
}
.account-profile > div,
.message-author > div {
  min-width: 0;
}
.avatar {
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  border-radius: 16px;
  object-fit: cover;
  background: linear-gradient(135deg, #d9ddff, #eee2ff);
}
.account-profile h2 {
  font-size: 18px;
  margin: 0 0 4px;
  overflow-wrap: anywhere;
}
.account-profile p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.status-line {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 16px 0;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
}
.status-dot.ok {
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(7, 148, 85, 0.12);
}
.button-row {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}
.button {
  min-height: 44px;
  padding: 0 17px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
}
.button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.button.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 7px 18px rgba(91, 99, 246, 0.24);
}
.button.secondary {
  color: var(--brand);
  background: rgba(91, 99, 246, 0.1);
}
.button.ghost {
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.button.danger {
  color: var(--danger);
  background: rgba(217, 45, 32, 0.08);
}
.button.small {
  min-height: 38px;
  padding: 0 13px;
  font-size: 13px;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 28px 0;
}
.stat-card {
  padding: 18px;
}
.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.stat-card strong {
  display: block;
  margin-top: 6px;
  font-size: 27px;
  letter-spacing: -0.03em;
}
.notice {
  margin: 18px 0;
  padding: 14px 16px;
  border: 1px solid rgba(181, 71, 8, 0.24);
  border-radius: 14px;
  background: rgba(254, 240, 199, 0.55);
  color: var(--warn);
  line-height: 1.6;
}
.view {
  min-height: 360px;
}
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 28px 0 16px;
}
.section-head h2 {
  margin: 3px 0 0;
  font-size: 24px;
}
.section-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 14px;
}
.action-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.action-card {
  padding: 22px;
}
.action-card h3 {
  margin: 10px 0 5px;
}
.action-card p {
  min-height: 48px;
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
}
.recommended {
  border-color: rgba(91, 99, 246, 0.35);
  background: linear-gradient(155deg, var(--surface), rgba(91, 99, 246, 0.06));
}
.filter-bar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 105px 105px 130px auto;
  gap: 10px;
  padding: 14px;
  margin-bottom: 15px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.filter-bar input,
.filter-bar select,
label input,
label select,
label textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: none;
}
.filter-bar input:focus,
.filter-bar select:focus,
label input:focus,
label select:focus,
label textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(91, 99, 246, 0.12);
}
.timeline,
.message-list,
.task-list {
  display: grid;
  gap: 14px;
}
.post-card,
.message-card,
.task-card {
  padding: 20px;
  min-width: 0;
}
.card-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
  flex-wrap: wrap;
}
.post-content,
.message-content {
  margin: 14px 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.75;
}
.post-content.collapsed {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 6;
  overflow: hidden;
}
.link-button {
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--brand);
  cursor: pointer;
  font-weight: 700;
}
.image-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}
.image-grid.one {
  grid-template-columns: minmax(0, 520px);
}
.image-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.image-grid button {
  padding: 0;
  border: 0;
  border-radius: 13px;
  overflow: hidden;
  background: var(--surface-2);
  cursor: zoom-in;
  aspect-ratio: 1;
}
.image-grid.one button {
  aspect-ratio: auto;
  max-height: 520px;
}
.image-grid img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 130px;
  object-fit: cover;
}
.engagement {
  display: flex;
  gap: 18px;
  margin-top: 15px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
.message-author {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.message-author strong {
  overflow-wrap: anywhere;
}
.mini-avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 12px;
  object-fit: cover;
  background: var(--surface-2);
}
.reply-box,
.comment-item {
  margin-top: 12px;
  padding: 12px 14px;
  border-left: 3px solid var(--brand);
  border-radius: 0 10px 10px 0;
  background: var(--surface-2);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.65;
}
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 22px 0;
}
.empty,
.error-panel,
.loading-panel,
.login-panel {
  display: grid;
  place-items: center;
  text-align: center;
  min-height: 300px;
  padding: 34px;
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}
.empty h3,
.error-panel h3,
.login-panel h2 {
  margin: 14px 0 6px;
}
.empty p,
.error-panel p,
.login-panel p {
  max-width: 530px;
  color: var(--muted);
  line-height: 1.65;
}
.empty-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: rgba(91, 99, 246, 0.1);
  color: var(--brand);
  font-size: 28px;
}
.spinner {
  width: 30px;
  height: 30px;
  border: 3px solid var(--line);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.skeleton-block {
  position: relative;
  overflow: hidden;
}
.skeleton-block:empty:after {
  content: "";
  position: absolute;
  inset: 20px;
  background: linear-gradient(
    90deg,
    var(--surface-2),
    var(--line),
    var(--surface-2)
  );
  background-size: 200% 100%;
  border-radius: 12px;
  animation: shimmer 1.2s infinite;
}
@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}
.task-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.task-status {
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 11px;
  font-weight: 800;
}
.task-status.COMPLETED {
  color: var(--ok);
  background: rgba(7, 148, 85, 0.1);
}
.task-status.FAILED,
.task-status.PARTIAL {
  color: var(--danger);
  background: rgba(217, 45, 32, 0.08);
}
.progress {
  display: block;
  width: 100%;
  height: 7px;
  margin: 14px 0;
  border: 0;
  border-radius: 99px;
  background: var(--line);
  overflow: hidden;
  appearance: none;
  -webkit-appearance: none;
}
.progress::-webkit-progress-bar {
  background: var(--line);
  border-radius: 99px;
}
.progress::-webkit-progress-value,
.progress::-moz-progress-bar {
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  border-radius: 99px;
}
.task-numbers {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}
.log-list {
  max-height: 300px;
  overflow: auto;
  margin-top: 12px;
  padding: 8px;
  background: #101828;
  color: #d0d5dd;
  border-radius: 12px;
  font:
    12px/1.6 ui-monospace,
    monospace;
}
.modal {
  width: min(620px, calc(100% - 24px));
  max-height: min(88vh, 780px);
  padding: 0;
  color: var(--text);
  background: var(--surface);
  border: 0;
  border-radius: 22px;
  box-shadow: 0 28px 80px rgba(16, 24, 40, 0.3);
  overflow: auto;
}
.modal::backdrop,
.image-modal::backdrop {
  background: rgba(16, 24, 40, 0.62);
  backdrop-filter: blur(4px);
}
.modal form,
.detail-modal > div {
  padding: 24px;
}
.modal-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}
.modal h2 {
  margin: 5px 0 16px;
}
.icon-button {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  color: var(--muted);
  background: var(--surface-2);
  font-size: 25px;
  cursor: pointer;
}
.modal label {
  display: block;
  margin: 14px 0 7px;
  font-size: 13px;
  font-weight: 700;
}
.modal textarea {
  resize: vertical;
  line-height: 1.55;
}
.modal-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin: 22px -4px -4px;
  padding-top: 14px;
  background: var(--surface);
}
.warning-box {
  padding: 14px;
  border-radius: 13px;
  color: var(--warn);
  background: rgba(254, 240, 199, 0.55);
  font-size: 13px;
  line-height: 1.6;
}
.warning-box p {
  margin: 4px 0 0;
}
.field-help {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.file-drop {
  padding: 22px;
  text-align: center;
  border: 1px dashed var(--brand) !important;
  border-radius: 14px;
  background: rgba(91, 99, 246, 0.05);
}
.file-drop input {
  margin-top: 12px;
}
.file-drop small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}
fieldset {
  margin: 14px 0;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
}
.check {
  display: flex !important;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  margin: 0 !important;
}
.check input {
  width: 18px !important;
  min-height: 18px !important;
}
.image-modal {
  max-width: 95vw;
  max-height: 95vh;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}
.image-modal img {
  display: block;
  max-width: 92vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 12px;
}
.image-close {
  position: absolute;
  right: -8px;
  top: -45px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  font-size: 24px;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  cursor: pointer;
}
.toast {
  position: fixed;
  z-index: 80;
  left: 50%;
  bottom: max(22px, env(safe-area-inset-bottom));
  transform: translate(-50%, 30px);
  max-width: min(520px, calc(100% - 28px));
  padding: 12px 18px;
  border-radius: 12px;
  color: #fff;
  background: #101828;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: 0.2s;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.toast.error {
  background: #b42318;
}
.noscript {
  padding: 20px;
  text-align: center;
  background: #fee4e2;
  color: #b42318;
}
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .hero-copy {
    padding-bottom: 4px;
  }
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .action-grid {
    grid-template-columns: 1fr;
  }
  .filter-bar {
    grid-template-columns: 1fr 1fr 1fr;
  }
  .filter-bar input:first-child {
    grid-column: 1/-1;
  }
  .filter-bar .button {
    grid-column: 1/-1;
  }
  .back-link {
    display: none;
  }
  .header-inner {
    gap: 12px;
  }
  .brand {
    min-width: 0;
  }
  .brand > span:last-child {
    display: none;
  }
}
@media (max-width: 620px) {
  .site-header {
    position: relative;
  }
  .header-inner {
    padding: 10px 14px;
    flex-wrap: wrap;
  }
  .brand {
    flex: 1;
  }
  .main-nav {
    order: 2;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 3px;
  }
  .main-nav a {
    justify-content: center;
    padding: 0 4px;
    font-size: 12px;
  }
  .page-shell {
    width: min(100% - 24px, 1180px);
    padding-top: 22px;
  }
  .hero-copy {
    padding: 12px 2px;
  }
  .hero h1 {
    font-size: 30px;
  }
  .hero p {
    font-size: 14px;
  }
  .account-card {
    min-height: 176px;
    padding: 17px;
  }
  .stats-grid {
    gap: 9px;
    margin: 18px 0;
  }
  .stat-card {
    padding: 14px;
  }
  .stat-card strong {
    font-size: 22px;
  }
  .section-head {
    align-items: start;
    flex-direction: column;
  }
  .section-head .button-row {
    width: 100%;
  }
  .section-head .button-row .button {
    flex: 1;
  }
  .filter-bar {
    grid-template-columns: 1fr 1fr;
    padding: 10px;
  }
  .filter-bar input:first-child,
  .filter-bar .button {
    grid-column: 1/-1;
  }
  .post-card,
  .message-card,
  .task-card {
    padding: 15px;
  }
  .image-grid {
    gap: 5px;
  }
  .image-grid img {
    min-height: 90px;
  }
  .modal form,
  .detail-modal > div {
    padding: 18px;
  }
  .field-grid {
    grid-template-columns: 1fr;
  }
  .modal-actions .button {
    flex: 1;
  }
  .task-top {
    align-items: start;
  }
  .pagination {
    justify-content: space-between;
  }
  .pagination .button {
    flex: 1;
  }
  .page-info {
    font-size: 12px;
    white-space: nowrap;
  }
}
@media (max-width: 350px) {
  .page-shell {
    width: calc(100% - 16px);
  }
  .header-inner {
    padding-inline: 8px;
  }
  .main-nav a {
    font-size: 11px;
  }
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
  .stat-card span {
    font-size: 11px;
  }
  .stat-card strong {
    font-size: 20px;
  }
  .button {
    padding-inline: 12px;
  }
  .image-grid img {
    min-height: 74px;
  }
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c111d;
    --surface: #161d2b;
    --surface-2: #1d2939;
    --text: #f2f4f7;
    --muted: #98a2b3;
    --line: #344054;
    --shadow: 0 12px 38px rgba(0, 0, 0, 0.25);
  }
  body {
    background: radial-gradient(
        circle at 85% 0,
        rgba(91, 99, 246, 0.18),
        transparent 30rem
      ),
      var(--bg);
  }
  .notice,
  .warning-box {
    background: rgba(181, 71, 8, 0.15);
  }
  .site-header {
    background: rgba(22, 29, 43, 0.88);
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
