:root {
  color-scheme: light;
  --bg: #f6fbfd;
  --card: rgba(255, 255, 255, 0.94);
  --card-strong: #ffffff;
  --line: #dbe9ef;
  --text: #183043;
  --muted: #6b8090;
  --primary: #67b7c9;
  --primary-deep: #4aa0b4;
  --success: #2fa67e;
  --warning: #f2a85f;
  --sidebar: #eef7fa;
  --sidebar-soft: #dceff4;
  --shadow: 0 18px 34px rgba(54, 98, 120, 0.08);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(103, 183, 201, 0.15), transparent 28%),
    radial-gradient(circle at top right, rgba(185, 230, 236, 0.42), transparent 24%),
    var(--bg);
}

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

button {
  cursor: pointer;
  border: none;
}

.hidden {
  display: none !important;
}

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

.login-card {
  width: min(560px, 100%);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 28px;
  padding: 36px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.login-badge {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  background: #e8f6f9;
  color: var(--primary-deep);
  font-weight: 700;
  font-size: 13px;
}

.login-card h1 {
  margin: 18px 0 12px;
  font-size: 34px;
}

.login-desc {
  margin: 0 0 28px;
  color: var(--muted);
  line-height: 1.7;
}

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

.login-form label,
.field {
  display: grid;
  gap: 8px;
}

.login-form span,
.field label,
.textarea-label {
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
}

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

textarea {
  min-height: 120px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(103, 183, 201, 0.55);
  box-shadow: 0 0 0 4px rgba(103, 183, 201, 0.14);
}

.login-form button,
.primary-btn,
.ghost-btn {
  padding: 13px 18px;
  border-radius: 14px;
  font-weight: 700;
}

.login-form button,
.primary-btn {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
  box-shadow: 0 12px 24px rgba(74, 160, 180, 0.22);
}

.ghost-btn {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--text);
}

.ghost-btn:disabled,
.primary-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.login-tips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.login-security-note {
  margin-top: 18px;
}

.security-box {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #f8fcfd;
  color: var(--muted);
  line-height: 1.7;
}

.login-tips span {
  padding: 7px 12px;
  border-radius: 999px;
  background: #eef8fb;
  color: #4f8391;
  font-size: 13px;
}

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

.sidebar {
  background: linear-gradient(180deg, var(--sidebar), #e7f2f6);
  color: var(--text);
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  border-right: 1px solid rgba(219, 233, 239, 0.9);
}

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

.brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #79bfd0, #8fd8cf);
}

.brand h2 {
  margin: 0;
  font-size: 20px;
}

.brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

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

.nav-item {
  text-align: left;
  padding: 14px 16px;
  border-radius: 16px;
  background: transparent;
  color: #4e6676;
}

.nav-item.active,
.nav-item:hover {
  background: var(--sidebar-soft);
  color: var(--text);
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 12px;
}

.status-card {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(219, 233, 239, 0.9);
  font-size: 14px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #56c69b;
  box-shadow: 0 0 0 4px rgba(86, 198, 155, 0.16);
}

.main-content {
  padding: 28px;
}

.notice-banner {
  display: grid;
  gap: 6px;
  margin-bottom: 22px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(103, 183, 201, 0.24);
  background: linear-gradient(135deg, rgba(103, 183, 201, 0.14), rgba(143, 216, 207, 0.12));
  box-shadow: 0 10px 24px rgba(74, 160, 180, 0.08);
}

.notice-banner strong {
  font-size: 15px;
}

.notice-banner span {
  color: var(--muted);
  line-height: 1.7;
}

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

.topbar h1 {
  margin: 0 0 8px;
  font-size: 30px;
}

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

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

.admin-tag {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--line);
  font-weight: 600;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.stats-grid,
.card-grid,
.review-grid {
  display: grid;
  gap: 18px;
}

.stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 22px;
}

.stat-card,
.panel,
.theme-card,
.review-card {
  background: var(--card);
  border: 1px solid rgba(219, 233, 239, 0.78);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.stat-card {
  padding: 22px;
}

.stat-card span,
.stat-card small {
  display: block;
}

.stat-card span {
  color: var(--muted);
  font-size: 14px;
}

.stat-card strong {
  display: block;
  margin: 10px 0 8px;
  font-size: 34px;
}

.stat-card small {
  color: var(--muted);
}

.stat-card.warning strong {
  color: var(--warning);
}

.content-grid.two-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.panel {
  padding: 22px;
}

.panel-section {
  margin-top: 18px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.panel-head h3 {
  margin: 0 0 6px;
  font-size: 20px;
}

.panel-head.compact {
  margin-bottom: 12px;
}

.panel-head span {
  color: var(--muted);
  font-size: 14px;
}

.steps-list,
.safe-list {
  margin: 0;
  padding-left: 20px;
  line-height: 1.9;
  color: var(--text);
}

.task-running-card {
  display: grid;
  gap: 16px;
  padding: 18px;
  border-radius: 18px;
  background: #f2fbfd;
  border: 1px solid #d7ecf2;
}

.task-running-card p {
  margin: 6px 0 0;
  color: var(--muted);
}

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

.progress-line {
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: #dceff4;
  overflow: hidden;
}

.progress-value {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--primary), #8fd8cf);
}

.mini-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.mini-list div,
.setting-item,
.row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.mini-list span,
.setting-item span,
.row span:first-child {
  color: var(--muted);
}

.tag-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}

.tag-list li {
  padding: 14px 16px;
  border-radius: 16px;
  background: #f7fbfd;
  border: 1px solid var(--line);
}

.card-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 8px;
}

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

.field-full,
.form-actions {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-start;
}

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

.filter-input,
.filter-select {
  max-width: 260px;
}

.stack-list {
  display: grid;
  gap: 14px;
}

.list-card {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: #f9fcfd;
}

.list-card-main {
  min-width: 0;
  flex: 1;
}

.list-card-main p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.list-card-title {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status-pill.is-enabled {
  background: #eaf8f1;
  color: #2f8f6d;
}

.status-pill.is-disabled {
  background: #eef4f7;
  color: #6b8090;
}

.card-actions,
.inline-actions,
.copy-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.small-btn {
  padding: 9px 12px;
  border-radius: 12px;
  font-weight: 600;
}

.danger-btn {
  color: #b45555;
}

.copy-main {
  display: grid;
  gap: 6px;
}

.copy-main small,
.row small {
  color: var(--muted);
  font-size: 12px;
}

.theme-card {
  padding: 20px;
}

.theme-card h4 {
  margin: 0 0 10px;
}

.theme-card p,
.review-body p,
.preview-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.theme-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.theme-tags span {
  padding: 7px 12px;
  border-radius: 999px;
  background: #edf8fb;
  color: #4d8191;
  font-size: 13px;
  font-weight: 600;
}

.mini-table {
  display: grid;
}

.row {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.row.head {
  font-weight: 700;
}

.row.head span {
  color: var(--text);
}

.copy-list {
  display: grid;
  gap: 12px;
}

.copy-item {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #f8fcfd;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.copy-item em {
  font-style: normal;
  color: #5e8591;
  background: #edf8fb;
  border-radius: 999px;
  padding: 6px 10px;
}

.textarea-preview {
  margin-top: 16px;
}

.textarea-box {
  margin-top: 10px;
  min-height: 140px;
  border-radius: 18px;
  background: #f8fcfd;
  border: 1px dashed #cfd9e8;
  padding: 16px;
  color: var(--muted);
  line-height: 1.8;
}

.template-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
}

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

.preview-card {
  padding: 20px;
  border-radius: 22px;
  background: linear-gradient(180deg, #f8fdfe, #eef8fb);
  border: 1px solid #d9edf2;
}

.preview-card h4 {
  margin: 0 0 12px;
}

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

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

.suite-spec-inline span {
  padding: 8px 12px;
  border-radius: 999px;
  background: #eef8fb;
  color: #4d8191;
  font-size: 13px;
  font-weight: 600;
}

.success-text {
  color: var(--success) !important;
}

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

.review-trash-note {
  margin: 12px 0 18px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f7fbfd;
  border: 1px solid var(--line);
  color: var(--muted);
}

.suite-detail-bar {
  margin: 12px 0 18px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid #d9edf2;
  background: linear-gradient(180deg, #f8fdfe, #eef8fb);
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.suite-detail-bar p {
  margin: 6px 0 0;
  color: var(--muted);
}

.review-card {
  overflow: hidden;
  position: relative;
}

.review-spec-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.spec-card {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #f8fcfd;
}

.spec-card span,
.spec-card small {
  display: block;
  color: var(--muted);
}

.spec-card strong {
  display: block;
  margin: 10px 0 8px;
  font-size: 24px;
}

.suite-card {
  padding: 20px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.suite-cover-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.suite-cover-card {
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.suite-cover-media {
  min-height: 240px;
  background: #edf6f9;
}

.suite-cover-media img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  display: block;
}

.suite-cover-body {
  padding: 18px;
  display: grid;
  gap: 14px;
}

.suite-cover-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.suite-cover-head h4 {
  margin: 0 0 6px;
  font-size: 20px;
}

.suite-cover-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.suite-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.suite-head h4 {
  margin: 0 0 6px;
  font-size: 20px;
}

.suite-head p,
.suite-meta span {
  color: var(--muted);
}

.suite-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.suite-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 16px 0;
}

.suite-meta span {
  padding: 7px 12px;
  border-radius: 999px;
  background: #eef8fb;
  font-size: 13px;
}

.suite-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.suite-layout {
  display: grid;
  gap: 20px;
}

.suite-section {
  padding: 18px;
  border-radius: 20px;
  background: #fbfeff;
  border: 1px solid #e3eef2;
}

.suite-section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.suite-section-head h5 {
  margin: 0 0 4px;
  font-size: 16px;
}

.suite-section-head span {
  color: var(--muted);
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.asset-card {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #fff;
}

.asset-card-placeholder {
  background: #fbfdfe;
}

.asset-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.asset-card-head span,
.asset-card p,
.asset-card small {
  color: var(--muted);
}

.asset-preview {
  border-radius: 16px;
  overflow: hidden;
  background: #edf6f9;
  min-height: 180px;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
}

.asset-preview img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.asset-placeholder {
  min-height: 180px;
  display: grid;
  place-items: center;
  color: #79a3af;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  padding: 20px;
}

.image-check {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

.image-check input {
  width: 14px;
  height: 14px;
  margin: 0;
}

.review-image {
  min-height: 180px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  overflow: hidden;
}

.review-image img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.review-image.rose {
  background: linear-gradient(135deg, #79bfd0, #a6ddd4);
}

.review-image.gold {
  background: linear-gradient(135deg, #8dbfc7, #b7dde4);
}

.review-image.night {
  background: linear-gradient(135deg, #7caecc, #9ac4d9);
}

.review-body {
  padding: 18px;
}

.review-body strong {
  display: block;
  margin-bottom: 8px;
}

.tag-button {
  padding: 7px 12px;
  border-radius: 999px;
  background: #eef8fb;
  color: #4d8191;
  font-size: 13px;
  font-weight: 600;
}

.danger-tag-button {
  background: #fff1f1;
  color: #b45555;
}

.settings-list,
.ai-card {
  display: grid;
  gap: 14px;
}

.setting-item {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #f8fcfd;
  align-items: center;
}

.setting-item input {
  max-width: 180px;
  padding: 10px 12px;
}

.row-actions > span {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.empty-state {
  padding: 26px 18px;
  border-radius: 18px;
  border: 1px dashed #cadce4;
  background: #fbfeff;
  color: var(--muted);
  text-align: center;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  padding: 14px 18px;
  border-radius: 16px;
  background: rgba(24, 48, 67, 0.92);
  color: #fff;
  box-shadow: 0 18px 40px rgba(24, 48, 67, 0.24);
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.modal-shell {
  position: fixed;
  inset: 0;
  background: rgba(22, 34, 47, 0.42);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 30;
}

.modal-card {
  width: min(760px, 100%);
  padding: 24px;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(23, 48, 67, 0.28);
}

.modal-card textarea {
  min-height: 220px;
}

@media (max-width: 1200px) {
  .stats-grid,
  .card-grid,
  .suite-cover-grid,
  .review-grid,
  .suite-grid,
  .review-spec-grid,
  .asset-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .template-layout,
  .content-grid.two-columns {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 920px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    padding-bottom: 20px;
  }

  .main-content {
    padding: 20px;
  }

  .stats-grid,
  .card-grid,
  .suite-cover-grid,
  .review-grid,
  .suite-grid,
  .review-spec-grid,
  .asset-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
  }

  .suite-detail-bar {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .login-card,
  .panel,
  .stat-card {
    padding: 18px;
  }

  .copy-item,
  .setting-item,
  .row,
  .panel-head,
  .list-card,
  .suite-head,
  .suite-cover-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-input,
  .filter-select {
    max-width: none;
  }
}
