* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: #07131f;
  color: #eef3f8;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: default;
  opacity: 0.7;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.2;
}

h2 {
  font-size: 17px;
  line-height: 1.25;
}

p,
.panel-head span {
  margin-top: 6px;
  color: #98a8ba;
  font-size: 13px;
}

.hidden {
  display: none !important;
}

.login-view {
  display: flex;
  width: 100%;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 420px;
  max-width: 100%;
  padding: 26px;
  border: 1px solid rgba(118, 140, 164, 0.24);
  border-radius: 8px;
  background: #102235;
}

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

.brand-mark {
  display: flex;
  flex: 0 0 54px;
  width: 54px;
  height: 54px;
  align-items: center;
  justify-content: center;
  margin-right: 14px;
  border-radius: 8px;
  background: #dca947;
  color: #132033;
  font-weight: 900;
}

.login-form {
  margin-top: 8px;
}

.login-btn {
  width: 100%;
  margin-top: 4px;
}

.login-hint {
  min-height: 20px;
  margin-top: 12px;
  color: #98a8ba;
  font-size: 13px;
  line-height: 1.45;
}

.shell {
  width: 100%;
  max-width: 1260px;
  margin: 0 auto;
  padding: 20px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border: 1px solid rgba(118, 140, 164, 0.22);
  border-radius: 8px;
  background: #102235;
}

.session-box {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  margin-left: 20px;
}

.session-label {
  display: block;
  margin-right: 12px;
  color: #f2c45d;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.tabs {
  display: flex;
  margin-top: 14px;
  padding: 6px;
  border: 1px solid rgba(118, 140, 164, 0.2);
  border-radius: 8px;
  background: rgba(16, 34, 53, 0.86);
}

.tab {
  height: 38px;
  min-width: 104px;
  margin-right: 6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #aab8c8;
  font-weight: 700;
}

.tab.active {
  background: rgba(242, 196, 93, 0.13);
  color: #f2c45d;
}

.workspace {
  display: flex;
  align-items: flex-start;
  margin-top: 14px;
}

.panel {
  border: 1px solid rgba(112, 136, 164, 0.26);
  border-radius: 8px;
  background: #102235;
}

.list-panel {
  flex: 0 0 40%;
  margin-right: 14px;
}

.form-panel {
  flex: 1;
  min-width: 0;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(118, 140, 164, 0.16);
}

.list {
  max-height: calc(100vh - 190px);
  overflow-y: auto;
  padding: 10px;
}

.row-card {
  display: flex;
  align-items: center;
  width: 100%;
  margin-bottom: 9px;
  padding: 9px;
  border: 1px solid rgba(112, 136, 164, 0.22);
  border-radius: 8px;
  background: #0b1b2c;
  color: inherit;
  text-align: left;
}

.row-card.active {
  border-color: rgba(242, 196, 93, 0.62);
  background: rgba(242, 196, 93, 0.08);
}

.thumb {
  flex: 0 0 92px;
  width: 92px;
  height: 56px;
  margin-right: 12px;
  border-radius: 6px;
  object-fit: contain;
  background: #07131f;
}

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

.row-title {
  display: block;
  overflow: hidden;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-meta,
.empty-row {
  display: block;
  margin-top: 6px;
  color: #98a8ba;
  font-size: 13px;
}

.empty-row {
  padding: 30px 12px;
  margin-top: 0;
  text-align: center;
}

.status-dot {
  flex: 0 0 auto;
  margin-left: 10px;
  color: #f2c45d;
  font-size: 12px;
  font-weight: 700;
}

.status-dot.off {
  color: #8d9aad;
}

.editor {
  padding: 16px;
}

.form-grid {
  display: flex;
  flex-wrap: wrap;
  margin-right: -6px;
  margin-left: -6px;
}

.form-grid .field {
  flex: 0 0 50%;
  width: 50%;
  padding-right: 6px;
  padding-left: 6px;
}

.field {
  display: block;
  margin-bottom: 14px;
}

.field span {
  display: block;
  margin-bottom: 7px;
  color: #98a8ba;
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid rgba(118, 140, 164, 0.28);
  border-radius: 7px;
  background: #0b1b2c;
  color: #eef3f8;
  outline: none;
}

.field input:focus,
.field textarea:focus {
  border-color: rgba(242, 196, 93, 0.48);
}

.field input {
  height: 40px;
  padding: 0 12px;
}

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

.upload-grid {
  display: flex;
  margin-right: -6px;
  margin-bottom: 14px;
  margin-left: -6px;
}

.upload-field {
  flex: 0 0 50%;
  width: 50%;
  padding-right: 6px;
  padding-left: 6px;
}

.upload-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
  color: #98a8ba;
  font-size: 13px;
  font-weight: 700;
}

.upload-head span:last-child {
  color: #f2c45d;
  font-size: 12px;
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.upload-box {
  display: flex;
  width: 100%;
  height: 142px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px dashed rgba(118, 140, 164, 0.38);
  border-radius: 7px;
  background: #0b1b2c;
  cursor: pointer;
}

.upload-box:hover {
  border-color: rgba(242, 196, 93, 0.52);
  background: #0e2135;
}

.upload-preview {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.upload-placeholder {
  display: block;
  color: #98a8ba;
  font-size: 13px;
  font-weight: 700;
}

.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.switch {
  display: flex;
  align-items: center;
  color: #d5deea;
}

.switch input {
  width: 18px;
  height: 18px;
  margin-right: 8px;
}

.actions {
  display: flex;
  flex: 0 0 260px;
  margin-left: 16px;
}

.actions button {
  flex: 1;
  margin-left: 10px;
}

.actions button:first-child {
  margin-left: 0;
}

.primary-btn,
.quiet-btn,
.danger-btn {
  height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 7px;
  font-weight: 800;
}

.primary-btn {
  background: #dca947;
  color: #132033;
}

.quiet-btn {
  border: 1px solid rgba(242, 196, 93, 0.34);
  background: rgba(242, 196, 93, 0.08);
  color: #f2c45d;
}

.danger-btn {
  background: rgba(220, 87, 87, 0.15);
  color: #ff8d8d;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 20;
  min-width: 180px;
  padding: 10px 16px;
  border-radius: 8px;
  background: rgba(11, 23, 37, 0.96);
  color: #eef3f8;
  text-align: center;
  transform: translateX(-50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease;
}

.toast.show {
  opacity: 1;
}

@media (max-width: 920px) {
  .topbar,
  .workspace,
  .form-footer {
    display: block;
  }

  .session-box {
    margin-top: 14px;
    margin-left: 0;
  }

  .list-panel {
    margin-right: 0;
    margin-bottom: 14px;
  }

  .list {
    max-height: none;
  }

  .form-grid .field {
    flex-basis: 100%;
    width: 100%;
  }

  .upload-grid {
    display: block;
    margin-right: 0;
    margin-left: 0;
  }

  .upload-field {
    width: 100%;
    padding-right: 0;
    padding-left: 0;
  }

  .actions {
    width: 100%;
    margin-top: 14px;
    margin-left: 0;
  }
}
