:root {
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  color: #1d2433;
  background: #f5f7fb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

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

button {
  border: 0;
  border-radius: 6px;
  background: #1f6feb;
  color: #fff;
  padding: 10px 16px;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

button.secondary {
  background: #eef2f8;
  color: #263244;
}

button.danger {
  color: #c62828;
}

#app.hidden {
  display: none;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(31, 111, 235, 0.1), transparent 34%),
    linear-gradient(315deg, rgba(30, 41, 59, 0.1), transparent 32%),
    #f5f7fb;
}

.login-panel {
  width: min(420px, 100%);
  display: grid;
  gap: 22px;
  padding: 30px;
  border: 1px solid #e1e6ef;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(16, 24, 38, 0.12);
}

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

.login-brand h1,
.login-brand p {
  margin: 0;
}

.login-brand h1 {
  font-size: 22px;
}

.login-brand p {
  color: #6b7688;
  font-size: 13px;
  margin-top: 4px;
}

.login-fields {
  display: grid;
  gap: 14px;
}

.login-fields span {
  display: block;
  color: #4a5568;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 7px;
}

.login-fields input {
  width: 100%;
  height: 42px;
  border: 1px solid #d7deea;
  border-radius: 6px;
  padding: 0 11px;
  outline: none;
}

.login-fields input:focus {
  border-color: #1f6feb;
  box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.12);
}

.login-panel button {
  height: 42px;
}

#app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.sidebar {
  background: #101826;
  color: #fff;
  padding: 24px 18px;
}

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

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #2d7ff9;
  font-weight: 800;
}

.brand h1,
.brand p {
  margin: 0;
}

.brand h1 {
  font-size: 18px;
}

.brand p {
  color: #9aa8bd;
  font-size: 12px;
  margin-top: 4px;
}

.user-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
  padding: 10px;
  border: 1px solid #2d3a4f;
  border-radius: 8px;
  background: #0b1220;
}

.user-box span {
  color: #aebbd0;
  font-size: 13px;
  font-weight: 700;
}

.user-box button {
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 12px;
}

nav {
  display: grid;
  gap: 6px;
}

.nav-btn {
  width: 100%;
  text-align: left;
  background: transparent;
  color: #c4cede;
  padding: 11px 12px;
}

.nav-btn.active {
  background: #243149;
  color: #fff;
}

.main {
  min-width: 0;
  padding: 26px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.topbar p,
.topbar h2 {
  margin: 0;
}

.topbar p {
  color: #6a7485;
  font-size: 13px;
  margin-bottom: 4px;
}

.topbar h2 {
  font-size: 28px;
}

.actions,
.form-actions {
  display: flex;
  gap: 10px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 420px) 1fr;
  gap: 18px;
}

.panel,
.list-panel,
.detail-panel {
  background: #fff;
  border: 1px solid #e1e6ef;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(16, 24, 38, 0.06);
}

.panel,
.detail-panel {
  padding: 18px;
}

.list-head {
  height: 48px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #6b7688;
  border-bottom: 1px solid #edf0f5;
  font-size: 13px;
}

.store-type-filter {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid #edf0f5;
}

.store-type-btn {
  height: 38px;
  padding: 0 10px;
  border-radius: 6px;
  background: #eef2f8;
  color: #263244;
  font-weight: 700;
}

.store-type-btn.active {
  background: #1f6feb;
  color: #fff;
}

.item-list {
  max-height: calc(100vh - 150px);
  overflow: auto;
}

.item-card {
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 12px;
  width: 100%;
  color: #1d2433;
  background: #fff;
  border-bottom: 1px solid #edf0f5;
  border-radius: 0;
  padding: 12px 14px;
  text-align: left;
}

.item-card.active {
  background: #eef5ff;
}

.item-thumb {
  width: 62px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  background: #eef2f8;
}

.item-title {
  display: block;
  font-weight: 700;
  margin-bottom: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-meta {
  color: #687386;
  font-size: 12px;
}

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

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

.field label {
  display: block;
  color: #4a5568;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 7px;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid #d7deea;
  border-radius: 6px;
  padding: 10px 11px;
  outline: none;
  background: #fff;
}

.field textarea {
  min-height: 110px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: #1f6feb;
  box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.12);
}

.upload-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.upload-row input[type="file"] {
  padding: 8px;
}

.video-preview {
  display: block;
  width: 100%;
  max-height: 360px;
  margin-top: 10px;
  border-radius: 8px;
  background: #101826;
}

.operation-media-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr;
  gap: 14px;
}

.operation-upload-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #e1e6ef;
  border-radius: 8px;
  background: #f8fafc;
}

.operation-upload-card span {
  color: #4a5568;
  font-size: 13px;
  font-weight: 800;
}

.operation-cover-preview {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  object-fit: cover;
  background: #eef2f8;
}

.operation-carousel-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.operation-carousel-item {
  overflow: hidden;
  border: 1px solid #e1e6ef;
  border-radius: 6px;
  background: #fff;
}

.operation-carousel-item img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #eef2f8;
}

.operation-carousel-item button {
  width: 100%;
  border-radius: 0;
  padding: 7px 8px;
}

.form-actions {
  margin-top: 18px;
  justify-content: flex-end;
}

.cos-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 320px) 1fr auto auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 16px;
}

.cos-toolbar label {
  display: grid;
  gap: 7px;
  color: #4a5568;
  font-size: 13px;
  font-weight: 700;
}

.cos-toolbar input,
.cos-toolbar select {
  border: 1px solid #d7deea;
  border-radius: 6px;
  padding: 10px 11px;
}

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

.cos-card {
  border: 1px solid #e1e6ef;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.cos-preview {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #eef2f8;
  object-fit: cover;
  display: block;
}

.cos-file-body {
  padding: 10px;
}

.cos-file-name {
  font-weight: 700;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  margin-bottom: 6px;
}

.cos-file-meta {
  color: #687386;
  font-size: 12px;
  margin-bottom: 10px;
}

.cos-file-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.cos-file-actions button {
  padding: 8px 10px;
}

.carousel-toolbar {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  margin-bottom: 12px;
}

.carousel-toolbar input[type="file"] {
  padding: 8px;
}

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

.carousel-card {
  overflow: hidden;
  border: 1px solid #e1e6ef;
  border-radius: 8px;
  background: #fff;
}

.carousel-preview {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #eef2f8;
}

.carousel-body {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.carousel-index {
  color: #4a5568;
  font-size: 12px;
  font-weight: 700;
}

.carousel-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.carousel-actions button {
  padding: 8px 10px;
}

.inline-tools {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.inline-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

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

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #d7deea;
  background: #f8fafc;
  border-radius: 6px;
  padding: 7px 9px;
  color: #263244;
  font-size: 12px;
}

.chip button {
  padding: 2px 6px;
  background: #eef2f8;
  color: #c62828;
}

.hidden {
  display: none !important;
}

.toast {
  position: fixed;
  right: 26px;
  bottom: 26px;
  background: #101826;
  color: #fff;
  padding: 12px 16px;
  border-radius: 7px;
  box-shadow: 0 12px 40px rgba(16, 24, 38, 0.22);
}

@media (max-width: 960px) {
  #app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

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

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

  .cos-toolbar {
    grid-template-columns: 1fr;
  }

  .carousel-toolbar {
    grid-template-columns: 1fr;
  }
}
