:root {
  --ink: #15171a;
  --muted: #68707c;
  --line: #d8dee8;
  --paper: #eef2f6;
  --panel: #fbfcfd;
  --panel-soft: #f6f8fa;
  --accent: #0f766e;
  --accent-dark: #0c4f49;
  --amber: #b7791f;
  --danger: #b42318;
  --shadow: 0 18px 48px rgba(25, 33, 44, 0.12);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(21, 23, 26, 0.045) 1px, transparent 1px),
    linear-gradient(rgba(21, 23, 26, 0.04) 1px, transparent 1px),
    var(--paper);
  background-size: 30px 30px;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button,
.ghost-link {
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, color 150ms ease;
}

button {
  min-height: 40px;
  border: 1px solid var(--accent-dark);
  border-radius: 6px;
  padding: 0 14px;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
  font-weight: 750;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.05;
  letter-spacing: 0;
}

h2 {
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.15;
  letter-spacing: 0;
}

.app-shell {
  min-height: 100vh;
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 12px;
  font-weight: 850;
}

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

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(440px, 100%);
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  display: grid;
  gap: 18px;
}

.login-copy {
  color: var(--muted);
  line-height: 1.7;
}

.login-panel button[type="submit"] {
  width: 100%;
}

.form-error {
  color: var(--danger);
  font-weight: 750;
}

.dashboard-view {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 82px;
  padding: 18px clamp(18px, 3vw, 36px);
  border-bottom: 1px solid var(--line);
  background: rgba(251, 252, 253, 0.94);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand-block {
  min-width: 220px;
}

.top-status {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.status-pill,
.ghost-link,
.ghost-button,
.user-chip {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  text-decoration: none;
  font-weight: 750;
}

.status-pill {
  color: var(--accent-dark);
  background: #effaf8;
  border-color: #b7ddd8;
  font-size: 13px;
}

.user-chip {
  padding-right: 4px;
}

.user-chip button {
  min-height: 30px;
  padding: 0 10px;
  background: var(--ink);
  border-color: var(--ink);
}

.workspace {
  width: min(1540px, 100%);
  margin: 0 auto;
  padding: 22px clamp(14px, 2vw, 28px) 36px;
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 18px;
}

.filters-panel,
.content-panel {
  min-width: 0;
}

.filters-panel {
  display: grid;
  gap: 14px;
  align-content: start;
}

.panel-block,
.quick-stats,
.content-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(251, 252, 253, 0.92);
  box-shadow: 0 10px 28px rgba(25, 33, 44, 0.06);
}

.panel-block {
  padding: 16px;
  display: grid;
  gap: 14px;
}

.panel-block h2,
.panel-title-row h2 {
  font-size: 18px;
}

.panel-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.quick-stats {
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.quick-stats article {
  min-height: 76px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  display: grid;
  align-content: space-between;
  gap: 8px;
}

.quick-stats span {
  color: var(--muted);
  font-size: 13px;
}

.quick-stats strong {
  font-size: 24px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.channel-list {
  display: grid;
  gap: 8px;
  max-height: 420px;
  overflow: auto;
  padding-right: 2px;
}

.channel-item {
  width: 100%;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 10px;
  text-align: left;
}

.channel-item span,
.channel-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-item strong {
  grid-row: span 2;
  align-self: center;
  color: var(--accent-dark);
  font-variant-numeric: tabular-nums;
}

.channel-item small {
  color: var(--muted);
}

.channel-item.active {
  border-color: var(--accent);
  background: #effaf8;
}

.content-panel {
  overflow: hidden;
}

.view-tabs {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
  display: flex;
  gap: 8px;
}

.tab-button {
  color: var(--ink);
  background: #fff;
  border-color: var(--line);
}

.tab-button.active {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

.view-panel {
  padding: 18px 20px 22px;
}

.content-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--ink);
}

.pager {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.pager button {
  background: var(--ink);
  border-color: var(--ink);
}

#pageInfo {
  min-width: 92px;
  text-align: center;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.messages {
  display: grid;
}

.user-list {
  display: grid;
  gap: 12px;
  padding-top: 16px;
}

.user-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
  display: grid;
  gap: 12px;
}

.user-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.user-name {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.user-name strong,
.user-name span {
  overflow-wrap: anywhere;
}

.user-name span,
.user-foot {
  color: var(--muted);
  font-size: 13px;
}

.username-pill {
  max-width: 260px;
  min-height: 30px;
  border: 1px solid #b7ddd8;
  border-radius: 6px;
  background: #effaf8;
  color: var(--accent-dark);
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-bio {
  color: var(--ink);
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.message {
  display: grid;
  grid-template-columns: minmax(140px, 220px) minmax(0, 1fr) 176px;
  gap: 18px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.sender {
  font-weight: 800;
  overflow-wrap: anywhere;
}

.message-body {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.text {
  margin: 0;
  line-height: 1.72;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.message-meta,
.date {
  color: var(--muted);
  font-size: 13px;
}

.date {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.progress-list {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  display: grid;
}

.progress-row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) minmax(170px, 260px);
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.progress-row:last-child {
  border-bottom: 0;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--amber);
}

.status-dot.ok {
  background: var(--accent);
}

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

.progress-main strong,
.progress-main span,
.progress-counts span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-main span,
.progress-counts span {
  color: var(--muted);
  font-size: 13px;
}

.progress-counts {
  display: grid;
  gap: 4px;
  text-align: right;
}

.progress-counts strong {
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.empty {
  color: var(--danger);
  padding: 16px 0;
}

.empty.compact {
  padding: 10px;
}

.shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 30px 26px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.content {
  min-width: 0;
  padding: 32px clamp(18px, 4vw, 56px);
}

.toolbar,
.section-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-end;
}

.toolbar {
  padding-bottom: 24px;
  border-bottom: 2px solid var(--ink);
}

.nav-link,
.link-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.workflow {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.workflow h2 {
  font-size: 18px;
}

.workflow ol {
  margin: 12px 0 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.7;
  font-size: 14px;
}

.price-list {
  display: grid;
  gap: 14px;
  padding-top: 22px;
}

.price-card {
  border-bottom: 1px solid var(--line);
  padding: 0 0 20px;
}

.price-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
}

.price-head span,
.price-meta,
.price-foot {
  color: var(--muted);
}

.price-head strong {
  font-size: 22px;
}

.price-value {
  color: var(--accent-dark);
  font-size: 24px;
  font-weight: 800;
  white-space: nowrap;
}

.price-meta {
  margin: 8px 0 12px;
  font-size: 14px;
}

.price-foot {
  margin-top: 12px;
  font-size: 13px;
  overflow-wrap: anywhere;
}

@media (max-width: 1080px) {
  .app-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-status {
    justify-content: flex-start;
  }

  .workspace,
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }
}

@media (max-width: 760px) {
  .login-panel {
    padding: 24px;
  }

  .workspace {
    padding: 14px;
  }

  .quick-stats {
    grid-template-columns: 1fr;
  }

  .search-row {
    grid-template-columns: 1fr;
  }

  .content-head,
  .toolbar,
  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .message,
  .progress-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .user-card-head {
    flex-direction: column;
  }

  .date,
  .progress-counts {
    text-align: left;
  }

  .price-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
}
