:root {
  --bg: #0c0f14;
  --surface: #141a24;
  --surface-2: #1a2230;
  --border: rgba(255, 255, 255, 0.08);
  --text: #e8ecf2;
  --muted: #8b96a8;
  --accent: #3d8bfd;
  --accent-dim: rgba(61, 139, 253, 0.12);
  --success: #34d399;
  --warning: #f59e0b;
  --radius: 12px;
  --font: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 40px;
  min-height: 100vh;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

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

.brand img {
  width: 32px;
  height: 32px;
}

.brand h1 {
  margin: 0;
  font-size: 1.1rem;
}

.crumb {
  font-size: 0.875rem;
  color: var(--muted);
}

.main {
  display: grid;
  gap: 20px;
  margin-top: 24px;
}

.hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.hero h2 {
  margin: 0 0 8px;
  font-size: clamp(1.35rem, 3vw, 1.85rem);
}

.lead {
  margin: 0;
  color: var(--muted);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

.section-title {
  margin: 0 0 12px;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  display: block;
  color: inherit;
}

.card:hover {
  border-color: rgba(61, 139, 253, 0.4);
  text-decoration: none;
}

.card h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.tag {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.75rem;
  color: var(--success);
  background: rgba(52, 211, 153, 0.12);
  padding: 2px 8px;
  border-radius: 999px;
}

.metric-list {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}

.metric {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
}

.metric .name {
  color: var(--muted);
  font-size: 0.75rem;
}

.metric .value {
  font-size: 1.2rem;
  font-weight: 700;
  margin-top: 4px;
}

.nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}

.footer {
  margin-top: 28px;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}

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

.btn {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
}

.btn:hover {
  border-color: rgba(61, 139, 253, 0.35);
}

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

.status {
  color: var(--warning);
  font-size: 0.85rem;
}

body[data-page="daocloud-shell"] {
  min-height: 100vh;
  overflow: hidden;
  background: #eef1f5;
  color: #1f2933;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  line-height: 1.4;
}

body[data-page="daocloud-shell"] button,
body[data-page="daocloud-shell"] input {
  font: inherit;
}

.shell-layout {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #eef1f5;
}

.shell-topbar {
  height: 42px;
  flex: 0 0 42px;
  background: #252a31;
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  z-index: 10;
}

.shell-icon-button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #d5dde8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.shell-icon-button:hover,
.shell-user:hover {
  background: #313842;
}

.shell-menu-toggle {
  margin-right: 10px;
  color: #cbd5e1;
  font-size: 20px;
}

.shell-brand {
  width: 160px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  text-decoration: none;
}

.shell-brand:hover {
  text-decoration: none;
}

.shell-brand img {
  width: 24px;
  height: 24px;
  border-radius: 6px;
}

.shell-brand span {
  font-size: 18px;
  font-weight: 700;
}

.shell-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.shell-copilot-action {
  width: auto;
  min-width: 82px;
  gap: 7px;
  padding: 0 8px;
  color: #eef3fa;
}

.shell-copilot-label {
  color: #eef3fa;
  font-size: 13px;
  font-weight: 700;
}

.shell-user {
  height: 32px;
  border: 0;
  border-radius: 4px;
  padding: 0 6px;
  background: transparent;
  color: #d8dee8;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 12px;
}

.shell-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #d8dee8;
  color: #252a31;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.shell-main {
  position: relative;
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.shell-sidebar {
  width: 164px;
  flex: 0 0 164px;
  overflow-y: auto;
  padding: 8px 0 16px;
  background: #252a31;
  color: #fff;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  transition: width 0.18s ease, flex-basis 0.18s ease;
}

.shell-layout.is-collapsed .shell-sidebar {
  width: 0;
  flex-basis: 0;
  border-right: 0;
}

.shell-menu-group {
  margin-top: 8px;
}

.shell-group-title {
  padding: 8px 14px 5px;
  color: #aab5c3;
  font-size: 12px;
  font-weight: 600;
}

.shell-menu-item {
  position: relative;
  height: 38px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  border-left: 3px solid transparent;
  color: #e6edf5;
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
}

.shell-menu-item:hover {
  background: #313842;
  text-decoration: none;
}

.shell-menu-item.is-active {
  background: #1e242c;
  border-left-color: #0f7cff;
  color: #fff;
}

.shell-menu-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border-radius: 50%;
  background: #3b4450;
  color: #cbd5e1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.shell-menu-item.is-active .shell-menu-icon {
  background: #0f7cff;
  color: #fff;
}

.shell-menu-item > span:nth-child(2) {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shell-optional {
  margin-left: 2px;
  color: #cbd5e1;
  font-size: 11px;
  opacity: 0.9;
}

.shell-arrow {
  color: #9aa6b2;
  font-size: 13px;
}

.shell-more {
  width: 100%;
  height: 32px;
  margin-top: 4px;
  border: 0;
  padding: 0 14px;
  background: transparent;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.shell-more:hover {
  background: #313842;
}

.shell-chevron {
  width: 8px;
  height: 8px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(45deg) translateY(-2px);
}

.shell-content {
  flex: 1;
  min-width: 0;
  overflow: auto;
  padding: 14px;
  background: #eef1f5;
}

.management-card {
  min-width: 920px;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(31, 41, 51, 0.12);
  overflow: hidden;
}

.management-toolbar {
  min-height: 40px;
  background: #f7f9fb;
  border-bottom: 1px solid #dfe5ec;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 5px 14px;
}

.management-page-name {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #263746;
}

.management-page-name h1 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.management-hex {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 2px solid #20384b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.management-btn {
  height: 30px;
  border: 0;
  border-radius: 4px;
  padding: 0 14px;
  font-size: 12px;
  cursor: pointer;
}

.management-btn.is-secondary {
  background: #e1e6ee;
  color: #34495e;
}

.management-btn.is-primary {
  background: #006be6;
  color: #fff;
}

.model-board {
  min-height: 560px;
  padding: 16px;
  background: #eef1f5;
}

.model-directory {
  min-width: 1540px;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(31, 41, 51, 0.14);
  overflow: hidden;
}

.directory-toolbar {
  height: 52px;
  border-bottom: 1px solid #d9e0e8;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 12px;
}

.directory-search {
  width: 420px;
  height: 30px;
  border-radius: 16px;
  background: #eef2f6;
  color: #8b96a8;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  font-size: 12px;
}

.directory-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #263746;
}

.directory-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.directory-icon-btn {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #183247;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 19px;
}

.directory-icon-btn:hover {
  background: #eef2f6;
}

.directory-table {
  color: #313b47;
  font-size: 12px;
}

.directory-row {
  min-height: 42px;
  display: grid;
  grid-template-columns: 210px 210px 210px 210px 210px 210px 180px 34px;
  align-items: center;
  border-bottom: 1px solid #dde4ec;
}

.directory-row > span {
  min-width: 0;
  padding: 0 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.directory-head {
  min-height: 30px;
  background: #f6f8fb;
  color: #7b8794;
  font-weight: 600;
}

.directory-head i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #9aa6b2;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-style: normal;
}

.directory-head b {
  color: #006be6;
  font-size: 15px;
}

.model-logo {
  width: 18px;
  height: 18px;
  margin-right: 8px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.logo-gray {
  background: #d7e0ea;
  color: #243447;
}

.logo-deepseek,
.logo-qwen {
  background: #eef0ff;
  color: #4d5cff;
}

.logo-kimi {
  background: #fff;
  color: #05070a;
  font-size: 16px;
}

.logo-mini {
  background: #ff4f6d;
  color: #fff;
}

.logo-dzoo {
  background: #effff2;
  color: #00bf63;
}

.status-online,
.status-offline {
  width: 9px;
  height: 9px;
  margin-right: 9px;
  border-radius: 50%;
  display: inline-block;
  vertical-align: middle;
  background: transparent;
}

.status-online {
  background: #09bd72;
}

.status-offline {
  background: #a7b0ba;
}

.tag-blue,
.tag-green,
.tag-orange {
  min-width: 58px;
  height: 20px;
  margin-right: 5px;
  border-radius: 4px;
  padding: 2px 8px;
  color: #263746;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
}

.tag-blue {
  background: #d7e1ec;
}

.tag-green {
  background: #cfe6e2;
}

.tag-orange {
  background: #efd7bf;
}

.row-menu {
  color: #183247;
  font-size: 22px;
  text-align: center;
}

.directory-footer {
  min-height: 38px;
  color: #7b8794;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 12px;
  font-size: 12px;
}

.directory-pagination {
  display: flex;
  align-items: center;
  gap: 10px;
}

.directory-pagination button,
.directory-pagination span {
  min-width: 32px;
  height: 26px;
  border: 1px solid #d3dbe5;
  border-radius: 4px;
  background: #fff;
  color: #7b8794;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.directory-pagination span:nth-child(3) {
  min-width: 20px;
  border: 0;
}

.directory-pagination button:last-child {
  min-width: 98px;
  justify-content: space-between;
  padding: 0 12px;
}

.board-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.board-kicker {
  color: #006be6;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.board-summary h2 {
  margin: 5px 0 8px;
  color: #1f2933;
  font-size: 24px;
  letter-spacing: 0;
}

.board-summary p {
  max-width: 620px;
  margin: 0;
  color: #657386;
  font-size: 13px;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.board-metric {
  min-height: 82px;
  padding: 14px;
  border: 1px solid #dfe5ec;
  border-radius: 4px;
  background: #fff;
}

.board-metric span {
  display: block;
  color: #6b7788;
  font-size: 12px;
}

.board-metric strong {
  display: block;
  margin-top: 8px;
  color: #243447;
  font-size: 26px;
}

.board-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.8fr);
  gap: 14px;
}

.model-panel {
  border: 1px solid #dfe5ec;
  border-radius: 4px;
  background: #fff;
  overflow: hidden;
}

.panel-head {
  min-height: 42px;
  padding: 0 14px;
  border-bottom: 1px solid #e7ecf2;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-head h3 {
  margin: 0;
  color: #263746;
  font-size: 14px;
}

.panel-head span {
  color: #7b8794;
  font-size: 12px;
}

.model-table {
  font-size: 12px;
}

.model-row {
  min-height: 44px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 0.9fr 0.8fr;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border-bottom: 1px solid #edf1f5;
}

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

.model-row-head {
  min-height: 34px;
  color: #7b8794;
  background: #f8fafc;
  font-weight: 600;
}

.model-row mark {
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  background: transparent;
}

.state-ok {
  color: #0f7a4f;
  background: #dff7eb !important;
}

.state-warn {
  color: #8a5a00;
  background: #fff2c9 !important;
}

.state-idle {
  color: #667085;
  background: #edf1f5 !important;
}

.task-list {
  margin: 0;
  padding: 10px 14px 14px;
  list-style: none;
}

.task-list li {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #edf1f5;
  color: #34495e;
  font-size: 13px;
}

.task-list li:last-child {
  border-bottom: 0;
}

.task-list strong {
  color: #006be6;
}

@media (max-width: 960px) {
  body[data-page="daocloud-shell"] {
    overflow: auto;
  }

  .shell-layout {
    min-height: 100vh;
    height: auto;
  }

  .shell-main {
    min-height: calc(100vh - 42px);
  }

  .shell-sidebar {
    width: 148px;
    flex-basis: 148px;
  }

  .shell-brand {
    width: 130px;
  }

  .shell-brand span {
    font-size: 15px;
  }

  .shell-actions {
    gap: 4px;
  }

  .shell-user span:not(.shell-avatar) {
    display: none;
  }

  .management-card {
    min-width: 760px;
  }

  .metric-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .board-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .shell-topbar {
    gap: 6px;
    padding: 0 8px;
  }

  .shell-menu-toggle {
    margin-right: 0;
  }

  .shell-brand {
    width: auto;
    min-width: 0;
    flex: 1;
  }

  .shell-actions .shell-icon-button:not(.shell-bell) {
    display: none;
  }

  .shell-sidebar {
    width: 148px;
    flex-basis: 148px;
  }

  .shell-content {
    padding: 14px 10px;
  }

}
