:root {
  --el-color-primary: #409eff;
  --el-color-primary-light-3: #79bbff;
  --el-color-primary-light-5: #a0cfff;
  --el-color-primary-light-8: #d9ecff;
  --el-color-primary-light-9: #ecf5ff;
  --el-color-success: #67c23a;
  --el-color-success-light-9: #f0f9eb;
  --el-color-warning: #e6a23c;
  --el-color-warning-light-9: #fdf6ec;
  --el-color-danger: #f56c6c;
  --el-color-danger-light-9: #fef0f0;
  --el-color-info: #909399;
  --el-bg-color: #fff;
  --el-bg-color-page: #f2f3f5;
  --el-fill-color-light: #f5f7fa;
  --el-fill-color-lighter: #fafafa;
  --el-text-color-primary: #303133;
  --el-text-color-regular: #606266;
  --el-text-color-secondary: #909399;
  --el-border-color: #dcdfe6;
  --el-border-color-light: #e4e7ed;
  --el-border-color-lighter: #ebeef5;
  --el-border-radius-base: 4px;
  --el-box-shadow-light: 0 0 12px rgba(0, 0, 0, 0.12);
  --el-transition-duration: 0.3s;
  --el-transition-duration-fast: 0.2s;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--el-bg-color-page);
  color: var(--el-text-color-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

button,
a,
input,
textarea,
select {
  transition: color var(--el-transition-duration-fast), border-color var(--el-transition-duration-fast), background-color var(--el-transition-duration-fast), box-shadow var(--el-transition-duration-fast), opacity var(--el-transition-duration-fast), transform var(--el-transition-duration-fast);
}

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

a:hover {
  color: var(--el-color-primary-light-3);
}

.hidden {
  display: none !important;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #f5f7fa 0%, #ecf5ff 100%);
}

.login-card,
.card {
  background: var(--el-bg-color);
  border: 1px solid var(--el-border-color-lighter);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.login-card {
  width: 400px;
  display: grid;
  gap: 18px;
  padding: 30px;
  box-shadow: var(--el-box-shadow-light);
  animation: el-zoom-in 0.28s ease-out;
}

.login-card h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
}

.login-card p,
.section-head p,
.muted {
  margin: 5px 0 0;
  color: var(--el-text-color-secondary);
  font-size: 13px;
  line-height: 1.6;
}

.login-card label,
.form-grid label {
  display: grid;
  gap: 8px;
  color: var(--el-text-color-regular);
  font-size: 14px;
}

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

input,
textarea,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--el-border-color);
  border-radius: var(--el-border-radius-base);
  padding: 8px 11px;
  color: var(--el-text-color-regular);
  background-color: var(--el-bg-color);
  outline: none;
}

input:hover,
textarea:hover,
select:hover {
  border-color: #c0c4cc;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--el-color-primary);
  box-shadow: 0 0 0 1px var(--el-color-primary) inset;
}

input::placeholder,
textarea::placeholder {
  color: #a8abb2;
}

input:disabled,
textarea:disabled,
select:disabled {
  cursor: not-allowed;
  color: #a8abb2;
  background: var(--el-fill-color-light);
}

input[type="file"] {
  padding: 6px 8px;
  color: var(--el-text-color-secondary);
}

input[type="file"]::file-selector-button {
  height: 26px;
  margin-right: 8px;
  border: 1px solid var(--el-border-color);
  border-radius: 3px;
  color: var(--el-text-color-regular);
  background: #fff;
  cursor: pointer;
}

textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.5;
}

select {
  cursor: pointer;
}

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

.sidebar {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--el-bg-color);
  border-right: 1px solid var(--el-border-color-lighter);
}

.sidebar-body {
  flex: 0 0 auto;
}

.sidebar-spacer {
  flex: 1 1 auto;
  min-height: 0;
}

.brand {
  height: 68px;
  padding: 12px 20px;
  display: grid;
  align-content: center;
  border-bottom: 1px solid var(--el-border-color-lighter);
}

.brand strong {
  font-size: 17px;
  font-weight: 600;
}

.brand span {
  margin-top: 4px;
  color: var(--el-text-color-secondary);
  font-size: 12px;
}

.menu {
  padding: 8px 0;
  display: flex;
  flex-direction: column;
}

.sidebar-footer {
  flex: 0 0 auto;
  padding: 8px 0 12px;
  border-top: 1px solid var(--el-border-color-lighter);
}

.sidebar-logout-btn {
  width: 100%;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 0;
  padding: 0 20px;
  color: var(--el-text-color-regular);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.sidebar-logout-btn:hover {
  color: var(--el-color-danger);
  background: var(--el-color-danger-light-9);
}

.menu button {
  position: relative;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 0;
  padding: 0 20px;
  color: var(--el-text-color-regular);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.menu button::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  width: 3px;
  height: 0;
  border-radius: 2px 0 0 2px;
  background: var(--el-color-primary);
  transform: translateY(-50%);
  transition: height var(--el-transition-duration-fast);
}

.menu button:hover {
  color: var(--el-color-primary);
  background: var(--el-color-primary-light-9);
}

.menu button.active {
  color: var(--el-color-primary);
  background: var(--el-color-primary-light-9);
  font-weight: 500;
}

.menu button.active::after {
  height: 100%;
}

.menu-icon {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  color: inherit;
}

.menu-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.main-col {
  min-width: 0;
}

.content {
  padding: 20px;
}

.content:has(#view-live-console:not(.hidden)) {
  box-sizing: border-box;
  height: 100vh;
  overflow: hidden;
}

#view-live-console {
  height: 100%;
  overflow: hidden;
}

#view-live-console .live-console {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

#view-live-console .live-ops-card,
#view-live-console .live-comments-card {
  margin-bottom: 0;
  box-sizing: border-box;
}

.view.is-entering {
  animation: el-fade-in 0.24s ease-out;
}

.card {
  margin-bottom: 16px;
  padding: 20px;
}

.card h2 {
  margin: 0 0 16px;
  font-size: 17px;
  font-weight: 600;
}

.admin-actions-card .section-head {
  margin-bottom: 16px;
}

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

.admin-action-grid button {
  min-height: 44px;
}

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

.account-entry-card {
  display: grid;
  gap: 8px;
  padding: 20px;
  border: 1px solid var(--el-border-color-lighter);
  border-radius: 8px;
  background: var(--el-fill-color-lighter);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--el-transition-duration), box-shadow var(--el-transition-duration), transform var(--el-transition-duration);
}

.account-entry-card:hover {
  border-color: var(--el-color-primary-light-5);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}

.account-entry-card strong {
  font-size: 18px;
  color: var(--el-text-color-primary);
}

.account-entry-desc {
  font-size: 13px;
  color: var(--el-text-color-secondary);
  line-height: 1.5;
}

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

.list-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 88px;
  gap: 12px;
  margin-bottom: 16px;
}

.list-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 16px;
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--el-border-color-lighter);
  background: #fff;
}

.wechat-settings-grid {
  max-width: 520px;
}

.wechat-oauth-hint {
  margin: -4px 0 0;
  line-height: 1.6;
}

.wechat-oauth-hint strong {
  color: var(--el-color-primary);
  word-break: break-all;
}

.pay-config-status {
  margin: 0 0 4px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f5f7fa;
  color: #606266;
  line-height: 1.5;
}

.pay-config-status.is-ready {
  background: #f0f9eb;
  color: #67c23a;
}

.pay-config-status.is-warning {
  background: #fdf6ec;
  color: #e6a23c;
}

.voucher-verify-bar {
  display: flex;
  gap: 10px;
  margin: 12px 0;
}

.voucher-verify-bar input {
  flex: 1;
  min-width: 0;
}

.voucher-verify-result {
  min-height: 24px;
}

.voucher-verify-success {
  padding: 12px 14px;
  border-radius: 10px;
  background: #f0f9eb;
  color: #3a7a34;
  line-height: 1.6;
}

.voucher-verify-success p,
.voucher-verify-error {
  margin: 4px 0 0;
}

.voucher-verify-error {
  padding: 12px 14px;
  border-radius: 10px;
  background: #fef0f0;
  color: #c45656;
}

.modal-form-box {
  width: min(460px, calc(100vw - 32px));
  display: block;
  grid-template-columns: 1fr;
}

.modal-form-box h2 {
  margin: 0 0 8px;
}

.modal-form-grid {
  margin-top: 16px;
}

.modal-form-actions {
  grid-column: 1 / -1;
  margin-top: 8px;
}

.admin-form-panel {
  border-color: var(--el-color-primary-light-8);
  background: linear-gradient(180deg, #fff 0%, #fafcff 100%);
}

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

.section-head h2 {
  margin-bottom: 0;
}

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

.stream-form {
  display: flex;
  flex-direction: column;
  margin-top: 6px;
}

.stream-form-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stream-form-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px 24px;
}

.stream-form-divider {
  height: 1px;
  background: var(--el-border-color-lighter);
  margin: 20px 0;
}

.stream-form .stream-field {
  display: grid;
  gap: 8px;
  width: auto;
  margin: 0;
  color: var(--el-text-color-regular);
  font-size: 14px;
}

.stream-form .stream-field-title input {
  width: 360px;
  max-width: 100%;
}

.stream-form .stream-field-status select {
  width: 200px;
  max-width: 100%;
}

.stream-form .stream-field-video {
  flex: 1;
  min-width: 0;
}

.stream-form .video-source-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.stream-form .video-source-tools select {
  width: 360px;
  max-width: 100%;
}

.stream-form .video-source-tools button {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 16px;
}

.stream-form .video-library-hint {
  flex: 1 1 240px;
  min-width: 0;
  color: var(--el-text-color-secondary);
  font-size: 13px;
  line-height: 1.5;
}

.stream-form .stream-field-start input {
  width: 220px;
  max-width: 100%;
}

.stream-form .stream-field-replay input {
  width: 72px;
}

.stream-form-panel-stats {
  gap: 18px;
}

.stream-form-row-stats {
  gap: 12px 20px;
}

.stream-form .stream-field-stat input {
  width: 100px;
}

.stream-form-actions {
  padding-top: 2px;
}

.stream-form-row-template {
  align-items: start;
}

.stream-field-template {
  width: 100%;
  max-width: 520px;
}

.scheduled-template-tools,
.scheduled-template-upload {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.scheduled-template-tools input[type="file"],
.scheduled-template-upload input[type="file"] {
  max-width: 260px;
  font-size: 12px;
}

.template-download-link {
  color: var(--el-color-primary);
  font-size: 12px;
  text-decoration: none;
  white-space: nowrap;
}

.template-download-link:hover {
  text-decoration: underline;
}

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

.room-settings-grid {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: start;
  align-items: start;
  gap: 20px;
}

.room-settings-grid .room-brand-row {
  width: min(360px, 100%);
}

.room-settings-upload-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 28px;
}

.room-settings-grid .room-upload-field {
  width: 156px;
  grid-template-columns: 1fr;
  align-items: start;
}

.room-settings-grid .room-upload-field.with-upload > button {
  grid-column: 1;
  width: 100%;
}

.room-settings-grid .room-image-preview {
  width: 140px;
  height: 140px;
  min-height: 140px;
  padding: 0;
  overflow: hidden;
  display: block;
  border-radius: 8px;
}

.room-settings-grid .room-settings-actions {
  grid-column: 1 / -1;
  padding-top: 4px;
}

.room-settings-grid .room-blocked-keywords-row {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.room-settings-grid .room-blocked-keywords-row textarea {
  width: 100%;
  min-height: 120px;
  padding: 10px 12px;
  border: 1px solid var(--el-border-color);
  border-radius: 8px;
  font: inherit;
  resize: vertical;
}

.room-video-library {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  padding-top: 4px;
}

.room-video-library-head h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.room-video-library-head p {
  margin: 0;
  font-size: 13px;
}

.room-video-form {
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.room-video-form label {
  display: grid;
  gap: 6px;
}

.saved-video-list table {
  width: 100%;
}

.saved-video-url {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--el-text-color-secondary);
  font-size: 13px;
}

.saved-video-preview {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.5;
  word-break: break-all;
}

.stream-form .stream-field-video select {
  width: 100%;
  max-width: 100%;
}

.comment-blocked-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #fff3e0;
  color: #e65100;
  font-size: 12px;
  font-weight: 600;
  vertical-align: middle;
}

.comment-row-blocked {
  border-left: 3px solid #ffb74d;
}

.comment-muted-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #ffebee;
  color: #c62828;
  font-size: 12px;
  font-weight: 600;
  vertical-align: middle;
}

.comment-row-muted {
  border-left: 3px solid #ef9a9a;
}

.form-grid label,
.form-field {
  color: var(--el-text-color-regular);
  font-size: 14px;
}

.field-label {
  color: var(--el-text-color-regular);
  font-size: 14px;
}

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

.with-upload {
  grid-template-columns: minmax(0, 1fr) 88px;
  align-items: end;
}

.with-upload > input:first-of-type {
  grid-column: 1;
}

.with-upload > input[type="file"] {
  position: fixed;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.with-upload > button {
  grid-column: 2;
}

.video-source-field {
  gap: 8px;
}

.video-source-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.video-source-tools select {
  flex: 1 1 260px;
  min-width: 220px;
  max-width: 100%;
}

.video-source-tools button {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 14px;
}

.video-source-tools .danger-text {
  color: var(--el-color-danger);
}

.video-library-hint {
  color: var(--el-text-color-secondary);
  font-size: 13px;
  white-space: nowrap;
}

.selected-video-name {
  min-height: 34px;
  display: flex;
  align-items: center;
  padding: 7px 10px;
  border: 1px dashed var(--el-border-color);
  border-radius: var(--el-border-radius-base);
  color: var(--el-text-color-regular);
  background: var(--el-fill-color-lighter);
  font-size: 13px;
}

.image-upload-field {
  align-items: start;
}

.product-form-grid .image-upload-field.with-upload {
  display: grid;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  grid-template-columns: minmax(0, max-content);
  justify-items: start;
  align-items: start;
}

.product-form-grid .image-upload-field.with-upload > input:first-of-type {
  grid-column: 1;
}

.product-form-grid .image-upload-field.with-upload .image-preview-box:not(.detail-preview-box) {
  width: min(360px, 100%);
}

.product-form-grid .image-upload-field.with-upload > button {
  grid-column: 1;
  justify-self: start;
  width: 88px;
}

.image-preview-box {
  min-height: 88px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px dashed var(--el-border-color);
  border-radius: var(--el-border-radius-base);
  background: var(--el-fill-color-lighter);
}

.image-preview-box:empty::before {
  content: "未上传";
  color: var(--el-text-color-secondary);
  font-size: 13px;
}

.image-preview-box:not(.detail-preview-box) img {
  width: 86px;
  height: 70px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--el-border-color-lighter);
  background: #fff;
}

.image-preview-item {
  position: relative;
  flex: 0 0 auto;
  width: 86px;
  height: 70px;
}

.image-preview-item img {
  display: block;
  width: 100%;
  height: 100%;
}

.product-form-grid .detail-upload-field.with-upload {
  width: 100%;
  max-width: 100%;
  grid-template-columns: minmax(0, 1fr);
}

.product-form-grid .detail-upload-field.with-upload > button {
  grid-column: 1;
  justify-self: start;
  width: 88px;
}

.image-preview-box.detail-preview-box {
  width: 100%;
  max-width: 100%;
  min-height: 88px;
  flex-wrap: nowrap;
  align-items: flex-start;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 10px;
  -webkit-overflow-scrolling: touch;
}

.image-preview-box.detail-preview-box .image-preview-item {
  position: relative;
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  min-width: 72px;
  max-width: 72px;
}

.image-preview-box.detail-preview-box .image-preview-item img {
  display: block;
  width: 72px;
  height: 72px;
  max-width: 72px;
  max-height: 72px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--el-border-color-lighter);
  background: #fff;
}

.image-preview-box.detail-preview-box > img {
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  max-width: 72px;
  max-height: 72px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--el-border-color-lighter);
  background: #fff;
}

.room-settings-grid .room-image-preview img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  border-radius: 8px;
  border: none;
}

.image-preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.image-preview-remove:hover {
  color: #fff;
  background: #f56c6c;
}

.image-preview-remove:active {
  transform: scale(0.94);
}

.compact-preview {
  min-height: 64px;
  padding: 6px;
}

.compact-preview img {
  width: 64px;
  height: 52px;
}

.field-hint {
  color: var(--el-text-color-secondary);
  font-size: 12px;
}

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

.table .row-actions {
  flex-wrap: wrap;
}

.actions {
  padding-top: 4px;
}

button {
  position: relative;
  min-height: 36px;
  border: 1px solid var(--el-border-color);
  border-radius: var(--el-border-radius-base);
  padding: 0 15px;
  color: var(--el-text-color-regular);
  background: var(--el-bg-color);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
}

button:hover {
  color: var(--el-color-primary);
  border-color: var(--el-color-primary-light-5);
  background: var(--el-color-primary-light-9);
}

button:active {
  border-color: var(--el-color-primary);
  transform: translateY(1px);
}

button:focus-visible {
  outline: 2px solid var(--el-color-primary-light-5);
  outline-offset: 2px;
}

button:disabled,
button.is-loading {
  cursor: not-allowed;
  opacity: 0.65;
  transform: none;
}

button.is-loading::before {
  content: "";
  width: 13px;
  height: 13px;
  display: inline-block;
  margin-right: 7px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -2px;
  animation: el-rotate 0.8s linear infinite;
}

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

.primary-btn:hover {
  color: #fff;
  border-color: var(--el-color-primary-light-3);
  background: var(--el-color-primary-light-3);
}

.success-btn,
button.success {
  color: #fff;
  border-color: var(--el-color-success);
  background: var(--el-color-success);
}

.success-btn:hover,
button.success:hover {
  color: #fff;
  border-color: #85ce61;
  background: #85ce61;
}

button.danger {
  color: var(--el-color-danger);
  border-color: #fab6b6;
  background: var(--el-color-danger-light-9);
}

button.danger:hover {
  color: #fff;
  border-color: var(--el-color-danger);
  background: var(--el-color-danger);
}

.ghost-btn.full {
  width: 100%;
  margin-bottom: 10px;
}

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

.card.stat {
  border-top: 3px solid var(--el-color-primary-light-5);
  transition: transform var(--el-transition-duration), box-shadow var(--el-transition-duration);
}

.card.stat:hover {
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.07);
  transform: translateY(-2px);
}

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

.card.stat strong {
  display: block;
  margin-top: 10px;
  font-size: 30px;
  font-weight: 600;
}

.stream-data-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stream-data-view {
  padding: 0 !important;
}

.content:has(.stream-data-view) {
  padding: 12px;
}

.stream-data-shell {
  padding: 14px 16px 16px;
  border-radius: 16px;
  color: #dbeafe;
  background:
    radial-gradient(circle at top right, rgba(99, 102, 241, 0.22), transparent 28%),
    radial-gradient(circle at top left, rgba(14, 165, 233, 0.18), transparent 24%),
    linear-gradient(180deg, #081224 0%, #0b1730 48%, #0a1324 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.stream-data-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  flex-shrink: 0;
}

.stream-data-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.28);
  color: #7dd3fc;
  font-size: 11px;
  margin-bottom: 6px;
}

.stream-data-toolbar h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: #f8fbff;
  letter-spacing: 0.02em;
}

.stream-data-toolbar p {
  margin: 4px 0 0;
  color: rgba(191, 219, 254, 0.72);
  font-size: 12px;
}

.dash-back-btn {
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.55);
  color: #e2e8f0;
  border-radius: 10px;
  padding: 10px 16px;
  cursor: pointer;
}

.dash-back-btn:hover {
  border-color: rgba(125, 211, 252, 0.45);
  color: #fff;
}

.stream-dashboard {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dash-hero {
  display: grid;
  grid-template-columns: minmax(200px, 0.78fr) minmax(0, 1.62fr);
  gap: 14px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid rgba(96, 165, 250, 0.18);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.82), rgba(30, 41, 59, 0.55));
  box-shadow: 0 12px 28px rgba(2, 6, 23, 0.22);
  flex-shrink: 0;
}

.dash-hero-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-right: 12px;
  border-right: 1px solid rgba(148, 163, 184, 0.14);
}

.dash-hero-label {
  color: rgba(191, 219, 254, 0.78);
  font-size: 15px;
}

.dash-hero-value-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 10px;
}

.dash-hero-value {
  font-size: clamp(38px, 4.8vw, 52px);
  line-height: 1;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 0 24px rgba(56, 189, 248, 0.35);
}

.dash-hero-unit {
  color: rgba(191, 219, 254, 0.72);
  font-size: 20px;
}

.dash-hero-sub {
  margin: 10px 0 0;
  color: rgba(148, 163, 184, 0.88);
  font-size: 14px;
}

.dash-hero-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.dash-metric-tile {
  padding: 12px 12px 10px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.dash-metric-label {
  display: block;
  color: rgba(191, 219, 254, 0.72);
  font-size: 13px;
}

.dash-metric-value {
  display: block;
  margin-top: 6px;
  font-size: 22px;
  line-height: 1.1;
  font-weight: 700;
  color: #f8fbff;
}

.dash-metric-sub {
  display: block;
  margin-top: 5px;
  color: rgba(148, 163, 184, 0.78);
  font-size: 11px;
  font-style: normal;
}

.dash-chart-section {
  display: block;
}

.dash-chart-panel {
  padding: 12px 14px 14px;
}

.dash-panel-head-compact p {
  font-size: 11px;
}

.dash-chart-stage {
  position: relative;
  margin-top: 8px;
  cursor: crosshair;
}

.dash-chart-stage .dash-chart-svg {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 960 / 280;
}

.dash-float-tooltip {
  position: absolute;
  z-index: 3;
  min-width: 168px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(248, 251, 255, 0.96);
  color: #1e293b;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.28);
  pointer-events: none;
}

.dash-float-tooltip.hidden,
.dash-crosshair.hidden {
  display: none;
}

.dash-float-tooltip-date {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 8px;
}

.dash-float-tooltip-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #475569;
}

.dash-float-tooltip-row strong {
  margin-left: auto;
  font-size: 18px;
  color: #0284c7;
}

.dash-float-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(90deg, #67e8f9, #6366f1);
  flex-shrink: 0;
}

.dash-float-tooltip-tag {
  margin-top: 6px;
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
  font-size: 11px;
}

.dash-crosshair {
  stroke: rgba(248, 251, 255, 0.72);
  stroke-width: 1;
  stroke-dasharray: 4 4;
  pointer-events: none;
}

.dash-point-dot {
  fill: #93c5fd;
  stroke: #0f172a;
  stroke-width: 2;
  pointer-events: none;
}

.dash-point.is-active .dash-point-dot {
  fill: #67e8f9;
}

.dash-point.is-peak .dash-point-dot {
  fill: #4ade80;
}

.dash-point.is-peak.is-active .dash-point-dot {
  fill: #86efac;
}

.dash-locked-panel {
  min-height: 280px;
  text-align: center;
  gap: 12px;
}

.dash-locked-panel h3 {
  margin: 0;
  color: #f8fbff;
  font-size: 20px;
}

.dash-locked-panel p {
  margin: 0 auto;
  max-width: 420px;
  color: rgba(191, 219, 254, 0.78);
}

.dash-locked-panel .dash-back-btn {
  margin-top: 8px;
}

.dash-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.85fr);
  gap: 16px;
  align-items: stretch;
}

.dash-side-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dash-panel {
  border: 1px solid rgba(96, 165, 250, 0.16);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.88), rgba(15, 23, 42, 0.62));
  padding: 18px 18px 16px;
  box-shadow: 0 14px 32px rgba(2, 6, 23, 0.22);
}

.dash-panel-empty {
  display: grid;
  place-items: center;
  min-height: 260px;
  color: rgba(191, 219, 254, 0.72);
}

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

.dash-panel-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #f8fbff;
}

.dash-panel-head p {
  margin: 6px 0 0;
  font-size: 12px;
  color: rgba(148, 163, 184, 0.86);
}

.dash-legend {
  display: flex;
  gap: 12px;
  color: rgba(191, 219, 254, 0.78);
  font-size: 12px;
}

.dash-legend .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

.dash-legend .dot-online {
  background: linear-gradient(90deg, #67e8f9, #6366f1);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.45);
}

.dash-chart-wrap {
  margin-top: 14px;
}

.dash-chart-svg {
  display: block;
  width: 100%;
  height: auto;
}

.dash-grid-line {
  stroke: rgba(148, 163, 184, 0.14);
  stroke-width: 1;
}

.dash-axis-label {
  fill: rgba(148, 163, 184, 0.78);
  font-size: 11px;
}

.dash-area {
  fill: url(#dashAreaGradient);
}

.dash-line {
  fill: none;
  stroke: url(#dashLineGradient);
  stroke-width: 3;
  stroke-linejoin: round;
  stroke-linecap: round;
  filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.35));
}

.dash-peak-line {
  stroke: rgba(74, 222, 128, 0.45);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.dash-peak-dot {
  fill: #4ade80;
  stroke: #ecfdf5;
  stroke-width: 2;
}

.dash-peak-label {
  fill: #bbf7d0;
  font-size: 12px;
  font-weight: 700;
}

.dash-funnel-list,
.dash-bar-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 16px;
}

.dash-funnel-step,
.dash-bar-row {
  display: grid;
  gap: 6px;
}

.dash-funnel-step-head,
.dash-bar-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: rgba(191, 219, 254, 0.82);
}

.dash-funnel-step-head strong,
.dash-bar-meta strong {
  font-size: 20px;
  font-weight: 700;
  color: #f8fbff;
}

.dash-funnel-step em {
  color: rgba(148, 163, 184, 0.78);
  font-size: 11px;
  font-style: normal;
}

.dash-funnel-bar-wrap,
.dash-bar-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.85);
  overflow: hidden;
}

.dash-funnel-bar,
.dash-bar-fill {
  height: 100%;
  border-radius: inherit;
  transition: width 0.45s ease;
}

.dash-funnel-bar {
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.55), rgba(99, 102, 241, 0.95));
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.25);
}

.dash-bar-fill.tone-cyan {
  background: linear-gradient(90deg, #22d3ee, #0284c7);
}

.dash-bar-fill.tone-pink {
  background: linear-gradient(90deg, #fb7185, #e11d48);
}

.dash-bar-fill.tone-green {
  background: linear-gradient(90deg, #4ade80, #16a34a);
}

.dash-bar-fill.tone-amber {
  background: linear-gradient(90deg, #fbbf24, #d97706);
}

.dash-details {
  border: 1px solid rgba(96, 165, 250, 0.16);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.72);
  padding: 14px 16px;
}

.dash-details summary {
  cursor: pointer;
  font-weight: 600;
  color: rgba(191, 219, 254, 0.88);
  list-style: none;
}

.dash-details summary::-webkit-details-marker {
  display: none;
}

.dash-details .table {
  margin-top: 12px;
  border-color: rgba(148, 163, 184, 0.14);
  color: #e2e8f0;
}

.dash-details .table th {
  background: rgba(15, 23, 42, 0.85);
  color: rgba(191, 219, 254, 0.72);
  border-color: rgba(148, 163, 184, 0.12);
}

.dash-details .table td {
  border-color: rgba(148, 163, 184, 0.12);
}

.dash-details .table tbody tr:hover {
  background: rgba(30, 41, 59, 0.55);
}

.dash-details .table tbody tr.is-peak td {
  background: rgba(34, 197, 94, 0.12);
}

.dash-details .table tbody tr.is-peak td:nth-child(2) {
  font-weight: 700;
  color: #86efac;
}

.stream-data-loading {
  padding: 48px 0;
  text-align: center;
  color: rgba(191, 219, 254, 0.72);
}

.stream-data-note {
  margin: 0;
  color: rgba(148, 163, 184, 0.72);
  font-size: 12px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--el-border-color-lighter);
  font-size: 14px;
}

.table th,
.table td {
  padding: 12px;
  border-bottom: 1px solid var(--el-border-color-lighter);
  text-align: left;
  vertical-align: middle;
  line-height: 1.45;
  white-space: nowrap;
}

.table th {
  color: var(--el-text-color-secondary);
  background: var(--el-fill-color-light);
  font-weight: 600;
}

.table tbody tr {
  transition: background-color var(--el-transition-duration-fast);
}

.table tbody tr:hover {
  background: var(--el-fill-color-lighter);
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.table td:has(.order-voucher-stack) {
  vertical-align: top;
  white-space: normal;
}

.order-voucher-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 96px;
}

.order-voucher-item {
  line-height: 1.35;
}

.order-voucher-item .voucher-code {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--el-fill-color-light);
  font-size: 12px;
  font-family: Consolas, "Courier New", monospace;
}

.order-voucher-item .status-tag {
  height: auto;
  min-height: 24px;
  padding: 2px 8px;
}

.order-detail-modal {
  width: min(520px, calc(100vw - 32px));
  max-height: min(80vh, 720px);
}

.order-detail-body {
  margin: 0 0 16px;
}

.order-detail-section {
  margin-bottom: 16px;
}

.order-detail-section:last-child {
  margin-bottom: 0;
}

.order-detail-section h4 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
}

.order-detail-section p {
  margin: 0 0 6px;
  line-height: 1.5;
}

.order-detail-voucher {
  padding: 10px 12px;
  margin-bottom: 8px;
  border: 1px solid var(--el-border-color-lighter);
  border-radius: 4px;
  background: var(--el-fill-color-blank);
}

.order-detail-voucher:last-child {
  margin-bottom: 0;
}

.order-detail-voucher h4 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
}

.order-detail-voucher p {
  margin: 0 0 4px;
  font-size: 13px;
}

.order-delivery-text {
  margin: 0;
  padding: 10px 12px;
  border-radius: 4px;
  background: var(--el-fill-color-light);
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 13px;
  line-height: 1.5;
}

.status-tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border: 1px solid var(--el-color-primary-light-8);
  border-radius: 4px;
  color: var(--el-color-primary);
  background: var(--el-color-primary-light-9);
  font-size: 12px;
}

.status-tag.success {
  color: var(--el-color-success);
  border-color: #c2e7b0;
  background: var(--el-color-success-light-9);
}

.status-tag.info {
  color: var(--el-color-info);
  border-color: #d3d4d6;
  background: var(--el-fill-color-light);
}

.status-tag.danger {
  color: var(--el-color-danger);
  border-color: #fbc4c4;
  background: var(--el-color-danger-light-9);
}

.live-console {
  display: grid;
  grid-template-columns: minmax(420px, 0.9fr) minmax(420px, 1.1fr);
  gap: 16px;
  align-items: stretch;
}

.live-ops-card {
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.live-comments-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  margin-bottom: 0;
}

.live-comments-head {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.live-comments-head h2 {
  margin: 0;
  font-size: 18px;
}

.live-console-title {
  margin: 0 0 16px;
  font-size: 20px;
}

.live-console-stream-id {
  margin: -8px 0 16px;
  color: var(--el-text-color-secondary);
  font-size: 13px;
}

.stream-id-display {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  padding: 10px 12px;
  border: 1px dashed var(--el-border-color);
  border-radius: 6px;
  background: var(--el-fill-color-lighter);
}

.stream-id-label {
  flex: 0 0 auto;
  color: var(--el-text-color-secondary);
  font-size: 13px;
}

.stream-id-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.stream-id-text {
  display: inline-block;
  max-width: 100%;
  padding: 2px 8px;
  border-radius: 4px;
  background: #fff;
  color: var(--el-text-color-primary);
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  line-height: 1.5;
  word-break: break-all;
}

.stream-id-copy {
  min-height: 28px;
  padding: 0 10px;
  font-size: 12px;
}

.console-panel {
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--el-border-color-lighter);
  border-radius: 8px;
  background: var(--el-fill-color-lighter);
}

.console-panel h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

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

.console-panel-head h3 {
  margin: 0;
}

.reply-box {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.reply-box input {
  flex: 1;
  min-width: 0;
  margin: 0;
}

.reply-send-btn {
  flex: 0 0 auto;
  min-height: 40px;
  height: 40px;
  padding: 0 16px;
  font-size: 14px;
}

.quick-reply-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-reply-editor {
  width: 100%;
  min-height: 180px;
  margin: 12px 0;
}

.quick-reply-list button {
  min-height: 30px;
  padding: 0 10px;
  color: var(--el-color-primary);
  border-color: var(--el-color-primary-light-8);
  background: var(--el-color-primary-light-9);
}

.quick-reply-modal {
  width: min(560px, calc(100vw - 32px));
  grid-template-columns: 1fr;
  gap: 10px;
}

.quick-reply-modal h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.3;
  writing-mode: horizontal-tb;
  white-space: normal;
}

.quick-reply-modal .confirm-actions {
  grid-column: 1;
}

.batch-comment-form {
  display: grid;
  grid-template-columns: 92px repeat(3, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
}

.batch-comment-form label {
  display: grid;
  gap: 6px;
  color: var(--el-text-color-regular);
  font-size: 13px;
}

.product-push-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.bag-schedule-row {
  display: grid;
  gap: 10px 12px;
  margin-bottom: 12px;
}

.bag-schedule-row-top {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.bag-schedule-row-middle {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.bag-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.bag-field > span {
  color: var(--el-text-color-regular);
  font-size: 13px;
}

.bag-field select,
.bag-field input[type="text"],
.bag-field input[type="number"],
.bag-field textarea {
  width: 100%;
  min-height: 40px;
}

.bag-field textarea {
  min-height: 108px;
  resize: vertical;
  line-height: 1.5;
  font-family: inherit;
}

.bag-field-orders {
  min-width: 0;
}

.bag-schedule-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 132px;
}

.bag-schedule-status {
  margin: 0;
  color: var(--el-text-color-secondary);
  font-size: 12px;
  line-height: 1.5;
}

.bag-manual-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px solid var(--el-border-color-lighter);
}

.bag-control-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.bag-control-toolbar select {
  width: 76px;
  min-height: 40px;
  flex: 0 0 auto;
}

.bag-control-toolbar input[type="number"] {
  width: 72px;
  min-height: 40px;
  flex: 0 0 auto;
  text-align: center;
}

.bag-control-interval-label {
  flex: 0 0 auto;
  color: var(--el-text-color-regular);
  font-size: 14px;
  white-space: nowrap;
}

.console-panel-compact {
  padding-top: 14px;
  padding-bottom: 14px;
}

.console-panel-compact h3 {
  margin: 0 0 12px;
}

.scheduled-comments {
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid var(--el-border-color-lighter);
  border-radius: 8px;
  background: var(--el-fill-color-extra-light);
}

.live-session-actions {
  margin-bottom: 0;
}

.live-session-actions h3 {
  margin-bottom: 10px;
}

.section-head.compact {
  margin-bottom: 10px;
}

.section-head.compact h3,
.live-comment-title {
  margin: 0;
  font-size: 15px;
}

.section-head.compact p {
  margin: 2px 0 0;
  font-size: 12px;
}

.scheduled-comment-form {
  display: grid;
  gap: 8px;
}

.scheduled-template-upload {
  margin-bottom: 10px;
}

.scheduled-template-status {
  margin: 0;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.5;
}

.scheduled-template-status.is-empty {
  color: var(--el-text-color-secondary);
  background: var(--el-fill-color-light);
}

.scheduled-template-status.is-pending {
  color: #b88230;
  background: #fdf6ec;
}

.scheduled-template-status.is-ok {
  color: #3a7a45;
  background: #f0f9eb;
}

.live-comment-loading {
  margin: 0;
  padding: 24px 12px;
  text-align: center;
}

.scheduled-comment-list {
  display: grid;
  gap: 4px;
  max-height: 168px;
  margin-top: 10px;
  overflow-y: auto;
  padding-right: 2px;
}

.scheduled-comment-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 0;
  padding: 5px 8px;
  border-radius: 4px;
  background: #fff;
  border: 1px solid var(--el-border-color-lighter);
  font-size: 12px;
  line-height: 1.35;
}

.scheduled-comment-time {
  color: var(--el-color-primary);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.scheduled-comment-main {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.scheduled-comment-name {
  flex: 0 0 auto;
  max-width: 72px;
  color: var(--el-text-color-secondary);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scheduled-comment-content {
  min-width: 0;
  color: var(--el-text-color-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scheduled-comment-delete {
  min-height: 24px;
  padding: 0 8px;
  font-size: 12px;
}

.live-comment-title {
  margin-bottom: 12px;
}

.comment-list {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  align-content: flex-start;
  gap: 6px;
}

.live-comment-limit-hint {
  position: sticky;
  top: 0;
  z-index: 1;
  flex: 0 0 auto;
  margin: 0 0 4px;
  padding: 6px 8px;
  border-radius: 4px;
  background: var(--el-fill-color-light);
  font-size: 12px;
}

.realtime-comment-list {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  align-content: flex-start;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.comment-row,
.viewer-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--el-border-color-lighter);
  border-radius: 6px;
  background: var(--el-fill-color-lighter);
  transition: border-color var(--el-transition-duration-fast), box-shadow var(--el-transition-duration-fast);
}

.comment-row {
  flex: 0 0 auto;
  align-items: center;
  min-height: 0;
}

.comment-row > div:first-child {
  flex: 1 1 auto;
  min-width: 0;
}

.comment-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.comment-actions button {
  min-height: 26px;
  padding: 0 8px;
  font-size: 12px;
}

.comment-row:hover,
.viewer-row:hover {
  border-color: var(--el-color-primary-light-5);
  box-shadow: 0 0 0 1px var(--el-color-primary-light-9);
}

.comment-row span {
  display: block;
  margin-top: 2px;
  color: var(--el-text-color-secondary);
  font-size: 11px;
  line-height: 1.3;
}

.comment-row p {
  margin: 0;
  color: var(--el-text-color-primary);
  font-size: 14px;
  line-height: 1.35;
  font-weight: 500;
  word-break: break-word;
}

.order-comment-product {
  color: #d48806;
  font-weight: 700;
}

.message-layer {
  position: fixed;
  z-index: 3000;
  top: 20px;
  left: 50%;
  display: grid;
  gap: 10px;
  pointer-events: none;
  transform: translateX(-50%);
}

.el-message {
  min-width: 300px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid var(--el-border-color-lighter);
  border-radius: 4px;
  color: var(--el-text-color-regular);
  background: #fff;
  box-shadow: var(--el-box-shadow-light);
  animation: el-message-in 0.28s ease-out;
}

.el-message.success {
  color: var(--el-color-success);
  border-color: #e1f3d8;
  background: var(--el-color-success-light-9);
}

.el-message.error {
  color: var(--el-color-danger);
  border-color: #fde2e2;
  background: var(--el-color-danger-light-9);
}

.el-message.warning {
  color: var(--el-color-warning);
  border-color: #faecd8;
  background: var(--el-color-warning-light-9);
}

.message-symbol {
  width: 18px;
  height: 18px;
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
}

.confirm-layer {
  position: fixed;
  z-index: 4000;
  inset: 0;
  display: grid;
  place-items: center;
}

.confirm-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  animation: el-fade-in 0.2s ease-out;
}

.confirm-box {
  position: relative;
  width: min(420px, calc(100vw - 32px));
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 12px;
  padding: 22px;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.2);
  animation: el-zoom-in 0.24s ease-out;
}

.confirm-icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--el-color-warning);
  font-size: 13px;
  font-weight: 700;
}

.confirm-content h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
}

.confirm-content p {
  margin: 10px 0 0;
  color: var(--el-text-color-regular);
  font-size: 14px;
  line-height: 1.6;
}

.confirm-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

.confirm-box.order-detail-modal {
  width: min(520px, calc(100vw - 32px));
  max-height: min(80vh, 720px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  text-align: left;
}

.confirm-box.order-detail-modal h2 {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 500;
}

.confirm-box.order-detail-modal .order-detail-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin: 0 0 16px;
}

.confirm-box.order-detail-modal .confirm-actions {
  margin-top: 0;
}

.confirm-box.stream-qr-modal {
  width: min(420px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px;
  text-align: left;
}

.stream-qr-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.stream-qr-modal-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
}

.stream-qr-modal-head p {
  margin: 6px 0 0;
}

.stream-qr-card {
  display: grid;
  gap: 10px;
  justify-items: center;
  padding: 22px 18px 18px;
  border: 1px solid var(--el-border-color-lighter);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.stream-qr-card strong {
  font-size: 18px;
  color: var(--el-text-color-primary);
}

.stream-qr-card h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  color: var(--el-text-color-regular);
  text-align: center;
}

.stream-qr-image {
  width: 220px;
  height: 220px;
  border-radius: 12px;
  background: #fff;
}

.stream-qr-tip {
  margin: 0;
  font-size: 13px;
  color: var(--el-text-color-secondary);
}

.stream-qr-card-preview {
  display: none;
}

.stream-qr-actions {
  flex-wrap: wrap;
}

#quickReplyModal .quick-reply-modal {
  width: min(560px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px;
}

#quickReplyModal .quick-reply-modal h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.35;
  writing-mode: horizontal-tb;
  white-space: normal;
}

#quickReplyModal .quick-reply-modal .confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

@keyframes el-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes el-zoom-in {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes el-message-in {
  from { opacity: 0; transform: translateY(-14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes el-rotate {
  to { transform: rotate(360deg); }
}

@media (max-width: 1000px) {
  .admin-shell {
    grid-template-columns: 180px minmax(0, 1fr);
  }

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

  .dash-hero {
    grid-template-columns: 1fr;
  }

  .dash-hero-main {
    border-right: 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
    padding-right: 0;
    padding-bottom: 16px;
  }

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

  .dash-main-grid {
    grid-template-columns: 1fr;
  }
    grid-template-columns: 1fr;
  }

  .table {
    min-width: 760px;
  }

  #streamList,
  #productTable,
  #orderTable,
  #adminTable,
  #userTable {
    overflow-x: auto;
  }
}

@media (max-width: 720px) {
  .admin-shell {
    display: block;
  }

  .sidebar {
    min-height: 0;
    border-right: 0;
  }

  .sidebar-spacer {
    display: none;
  }

  .brand {
    height: 60px;
  }

  .menu {
    display: flex;
    overflow-x: auto;
    border-bottom: 1px solid var(--el-border-color-lighter);
  }

  .sidebar-footer {
    padding: 0;
    border-top: 0;
    border-bottom: 1px solid var(--el-border-color-lighter);
  }

  .sidebar-logout-btn {
    height: 48px;
    flex: 0 0 auto;
    width: auto;
    padding: 0 16px;
  }

  .menu button {
    height: 48px;
    flex: 0 0 auto;
    padding: 0 15px;
  }

  .menu button::after {
    top: auto;
    right: 10px;
    bottom: 0;
    left: 10px;
    width: auto;
    height: 2px;
    transform: none;
  }

  .menu button.active::after {
    height: 2px;
  }

  .menu-icon {
    display: none;
  }

  .content {
    padding: 12px;
  }

  .card {
    padding: 16px;
  }

  .account-entry-grid {
    grid-template-columns: 1fr;
  }

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

  .stream-form-row {
    flex-direction: column;
    align-items: stretch;
  }

  .stream-form .stream-field-title input,
  .stream-form .stream-field-status select,
  .stream-form .video-source-tools select,
  .stream-form .stream-field-start input,
  .stream-form .stream-field-replay input,
  .stream-form .stream-field-stat input {
    width: 100%;
  }

  .stream-form .video-source-tools {
    flex-direction: column;
    align-items: stretch;
  }

  .room-settings-upload-row {
    gap: 20px;
  }

  .room-settings-grid .room-brand-row {
    width: 100%;
  }

  .room-settings-grid {
    grid-template-columns: 1fr;
  }

  .room-settings-grid .room-settings-actions {
    grid-column: 1;
  }

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

  .with-upload {
    grid-template-columns: 1fr;
  }

  .with-upload > input:first-of-type,
  .with-upload > input[type="file"],
  .with-upload > button {
    grid-column: 1;
  }

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

  .dash-hero-grid {
    grid-template-columns: 1fr;
  }

  .live-console {
    grid-template-columns: 1fr;
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .content:has(#view-live-console:not(.hidden)) {
    height: auto;
    overflow: auto;
  }

  #view-live-console {
    height: auto;
    overflow: visible;
  }

  #view-live-console .live-console {
    height: auto;
    overflow: visible;
  }

  .live-ops-card {
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .live-comments-card {
    min-height: min(72vh, 640px);
    height: min(72vh, 640px);
  }

  .section-head > button {
    align-self: flex-start;
  }

  .live-comments-head {
    align-items: flex-start;
  }

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

  .scheduled-comment-main {
    flex-wrap: wrap;
  }

  .scheduled-comment-name {
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
