:root {
  color-scheme: light;
  --bg: #eef3f9;
  --sidebar: #31425b;
  --sidebar-accent: #4d93ff;
  --panel: #ffffff;
  --panel-soft: #f7faff;
  --text: #172334;
  --muted: #6e7f95;
  --line: #dbe5f2;
  --accent: #2f87f6;
  --accent-dark: #1f67bf;
  --danger: #b43d30;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "PingFang SC", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #f8fbff 0%, #eef3f9 100%);
}

.landing-body,
.auth-body,
.admin-body {
  min-height: 100vh;
}

.landing-shell,
.auth-shell {
  width: min(1120px, calc(100% - 32px));
  min-height: 100vh;
  display: grid;
  place-items: center;
  margin: 0 auto;
  padding: 32px 0 48px;
}

.landing-card,
.auth-card,
.module-card,
.placeholder-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 24px 70px rgba(31, 56, 88, 0.08);
}

.landing-card {
  width: min(840px, 100%);
  padding: 40px 32px;
}

.auth-card {
  width: min(960px, 100%);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  overflow: hidden;
}

.auth-copy,
.auth-form-wrap {
  padding: 32px;
}

.auth-copy {
  background: linear-gradient(135deg, #f7fbff 0%, #e9f2ff 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.eyebrow,
.brand-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 6px 12px;
  border-radius: 999px;
  background: #e3efff;
  color: var(--accent-dark);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1, h2, p { margin: 0; }

.landing-card h1,
.auth-copy h1 {
  margin-top: 18px;
  font-size: clamp(38px, 5vw, 56px);
  letter-spacing: -0.04em;
}

.landing-card p,
.auth-copy p,
.hero-copy {
  margin-top: 14px;
  color: var(--muted);
  line-height: 1.7;
  font-size: 17px;
}

.actions {
  margin-top: 24px;
}

.button-link,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 148px;
  height: 52px;
  padding: 0 18px;
  border: 0;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

button.secondary {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.wide {
  width: 100%;
}

.auth-form {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
}

.auth-form label,
.stack-form label {
  display: block;
}

.auth-form span,
.stack-form span {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
}

input,
textarea {
  width: 100%;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  font-size: 16px;
  background: #fff;
  color: var(--text);
}

input {
  height: 52px;
}

textarea {
  padding: 14px;
  resize: vertical;
  font-family: inherit;
}

.error {
  color: var(--danger);
  font-size: 14px;
}

.hidden {
  display: none;
}

.wecom-shell {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: 100vh;
}

.wecom-sidebar {
  background: var(--sidebar);
  color: #fff;
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.wecom-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-badge {
  min-width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #ff8a4c 0%, #ff4279 100%);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
}

.wecom-brand h1 {
  font-size: 30px;
  line-height: 1.2;
}

.wecom-brand p {
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
}

.wecom-nav {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.wecom-nav-item {
  width: 100%;
  min-width: 0;
  height: auto;
  padding: 18px 18px 18px 20px;
  border-radius: 16px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  justify-content: flex-start;
  align-items: flex-start;
  text-align: left;
  color: rgba(255, 255, 255, 0.82);
}

.wecom-nav-item.active {
  background: rgba(77, 147, 255, 0.18);
  border-color: rgba(77, 147, 255, 0.6);
  color: #fff;
}

.wecom-nav-title {
  display: block;
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
}

.wecom-nav-item small {
  display: block;
  font-size: 13px;
  color: inherit;
  opacity: 0.82;
}

.wecom-content {
  padding: 28px 30px 40px;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.page-head {
  padding: 24px 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  box-shadow: 0 20px 50px rgba(31, 56, 88, 0.06);
}

.hero-label {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.page-head h2 {
  margin-top: 10px;
  font-size: clamp(34px, 4vw, 48px);
  letter-spacing: -0.04em;
}

.module-card {
  margin-top: 20px;
  padding: 28px;
}

.stack-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 720px;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
}

.save-status {
  color: var(--accent-dark);
  background: #e9f3ff;
  border: 1px solid #cfe1fb;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
}

.placeholder-card {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
}

.placeholder-card strong {
  color: var(--text);
  font-size: 22px;
}

.broadcast-grid {
  display: grid;
  gap: 18px;
}

.broadcast-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-soft);
}

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

.block-copy {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.light {
  background: #edf5ff;
  color: var(--accent-dark);
  border: 1px solid #cfe1fb;
}

.contact-list {
  display: grid;
  gap: 12px;
  max-height: 360px;
  overflow: auto;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
}

.contact-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.contact-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.contact-meta strong {
  font-size: 15px;
}

.contact-meta small {
  color: var(--muted);
  font-size: 13px;
}

.log-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  align-items: end;
}

.align-end {
  align-self: end;
}

.log-list {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.log-item {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  background: var(--panel-soft);
}

.log-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.log-item p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.6;
  word-break: break-all;
}

.log-item details {
  margin-top: 14px;
}

.log-item summary {
  cursor: pointer;
  font-weight: 600;
}

.log-item pre {
  margin-top: 10px;
  white-space: pre-wrap;
  word-break: break-word;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  font-size: 13px;
  line-height: 1.6;
}

.empty-state {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.error-text {
  color: var(--danger);
}

@media (max-width: 960px) {
  .auth-card,
  .wecom-shell {
    grid-template-columns: 1fr;
  }

  .wecom-sidebar {
    min-height: auto;
  }

  .page-head {
    flex-direction: column;
  }

  .log-filter-grid {
    grid-template-columns: 1fr;
  }
}
