.my-ai-page {
  min-height: 70vh;
  padding: 0 6px 28px;
}

.my-ai-page > .section-title-row {
  margin-right: 5px;
  margin-left: 5px;
}

.my-ai-title {
  margin: 7px 6px 12px;
  color: #d8d8d8;
  font-size: 15px;
  font-weight: 500;
}

.tool-tabs {
  display: flex;
  gap: 10px;
  padding: 0 4px 8px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: #737373 #1d1d1d;
}

.tool-tabs.is-loading {
  min-height: 48px;
  visibility: hidden;
}

.my-content-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
  padding: 5px;
  background: #101010;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
}

.my-content-tabs button {
  min-height: 38px;
  color: #989898;
  font-size: 13px;
  font-weight: 600;
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

.my-content-tabs button.active {
  color: #17100a;
  background: linear-gradient(180deg, #ffb22b, #ff8500);
}

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

.novel-record-card {
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
}

.novel-record-card h3 {
  margin: 0;
  color: #ededed;
  font-size: 15px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.novel-record-card .novel-record-meta {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 10px;
  color: #747474;
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.novel-record-card .novel-record-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 18px;
}

.novel-record-card .novel-record-actions button {
  min-height: 36px;
  color: #ffad42;
  font-size: 12px;
  background: rgba(247, 144, 4, 0.06);
  border: 1px solid rgba(247, 144, 4, 0.28);
  border-radius: 6px;
  cursor: pointer;
}

.novel-reader {
  position: fixed;
  z-index: 10000;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.94);
}

.novel-reader.open {
  display: flex;
}

.novel-reader-panel {
  position: relative;
  width: min(100%, 820px);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  padding: 24px;
  background: #121212;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
}

.novel-reader-panel > span {
  color: #f79004;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.4px;
}

.novel-reader-panel h2 {
  margin: 7px 35px 14px 0;
  color: #fff;
  font-size: 21px;
  line-height: 1.45;
}

.novel-reader-panel pre {
  flex: 1;
  max-height: 62vh;
  margin: 0;
  padding: 15px;
  overflow: auto;
  color: #e5e5e5;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.9;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #090909;
  border: 1px solid #292929;
  border-radius: 7px;
}

.novel-reader-close {
  position: absolute;
  top: 9px;
  right: 13px;
  color: #aaa;
  font-size: 26px;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.novel-reader-download {
  width: 100%;
  min-height: 40px;
  margin-top: 12px;
  color: #17100a;
  font-weight: 700;
  background: #f79004;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

.my-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

.my-pagination button {
  min-height: 36px;
  padding: 0 14px;
  color: #ddd;
  background: #151515;
  border: 1px solid #333;
  border-radius: 6px;
  cursor: pointer;
}

.my-pagination button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.my-pagination span {
  color: #888;
  font-size: 11px;
  text-align: center;
}

.tool-tabs::-webkit-scrollbar {
  height: 8px;
}

.tool-tabs::-webkit-scrollbar-track {
  background: #1d1d1d;
  border-radius: 4px;
}

.tool-tabs::-webkit-scrollbar-thumb {
  background: #737373;
  border-radius: 4px;
}

.tool-tabs a,
.tool-tabs span {
  min-width: 94px;
  flex: 0 0 auto;
  padding: 10px 14px;
  color: #d3d3d3;
  font-size: 14px;
  text-align: center;
  white-space: nowrap;
  background: #111;
  border: 1px solid #313131;
  border-radius: 7px;
}

.tool-tabs a.active {
  color: var(--orange);
  border-color: var(--orange);
}

.status-tabs {
  display: flex;
  align-items: stretch;
  margin-top: 8px;
  overflow: hidden;
  background: #111;
  border-radius: 5px;
}

.status-tabs button {
  min-height: 43px;
  flex: 0 0 auto;
  padding: 0 15px;
  color: #777;
  font-size: 14px;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.status-tabs button.active {
  color: #17100a;
  font-weight: 700;
  background: linear-gradient(180deg, #ffb22b, #ff8500);
}

.status-tabs b {
  display: inline-grid;
  min-width: 18px;
  height: 18px;
  margin-left: 4px;
  place-items: center;
  font-size: 10px;
  background: rgba(0, 0, 0, 0.16);
  border-radius: 999px;
}

.works-panel {
  min-height: 430px;
  margin-top: 12px;
}

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

.works-grid:empty {
  display: none;
}

.work-card {
  min-width: 0;
  display: block;
  overflow: hidden;
  color: #ddd;
  background: #111;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 8px;
}

.work-card img {
  width: 100%;
  display: block;
  background: #080808;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  cursor: zoom-in;
}

.work-card video {
  width: 100%;
  display: block;
  background: #080808;
  aspect-ratio: 4 / 5;
  object-fit: contain;
}

.work-media-pending {
  width: 100%;
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 5;
  color: #777;
  font-size: 12px;
  background:
    linear-gradient(110deg, #0b0b0b 20%, #171717 40%, #0b0b0b 60%);
  background-size: 220% 100%;
  animation: work-preview-loading 1.3s linear infinite;
}

@keyframes work-preview-loading {
  to {
    background-position: -220% 0;
  }
}

.work-info {
  padding: 9px 10px 10px;
}

.work-info .work-type {
  width: fit-content;
  display: inline-flex;
  margin: 0 0 6px;
  padding: 2px 6px;
  color: #ff9f2f;
  font-size: 9px;
  font-weight: 700;
  background: rgba(255, 139, 19, 0.1);
  border: 1px solid rgba(255, 139, 19, 0.22);
  border-radius: 999px;
}

.work-info .work-type.video {
  color: #72b5ff;
  background: rgba(67, 145, 255, 0.1);
  border-color: rgba(67, 145, 255, 0.24);
}

.work-info strong {
  display: block;
  overflow: hidden;
  color: #d7d7d7;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.work-info span {
  display: block;
  margin-top: 3px;
  color: #717171;
  font-size: 10px;
}

.work-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}

.work-info .work-download,
.work-info .work-view {
  display: inline-flex;
  padding: 5px 8px;
  color: #ff9f2f;
  font-size: 10px;
  text-decoration: none;
  background: transparent;
  border: 1px solid rgba(255, 139, 19, 0.24);
  border-radius: 5px;
  cursor: pointer;
}

.work-info .work-view {
  color: #d7d7d7;
  border-color: rgba(255, 255, 255, 0.14);
}

.image-preview {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.94);
}

.image-preview.open {
  display: flex;
}

.image-preview img {
  max-width: 94vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
}

.image-preview-close {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  right: 18px;
  width: 42px;
  height: 42px;
  padding: 0;
  color: #fff;
  font-size: 30px;
  line-height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  cursor: pointer;
}

.empty-works {
  min-height: 430px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #8b8b8b;
}

.empty-works[hidden] {
  display: none;
}

.empty-illustration {
  position: relative;
  width: 230px;
  height: 230px;
  margin-bottom: 18px;
}

.empty-shadow {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 18px;
  height: 38px;
  background: #151515;
  border-radius: 50%;
}

.empty-box-body {
  position: absolute;
  left: 64px;
  bottom: 40px;
  width: 108px;
  height: 88px;
  background: linear-gradient(135deg, #383838, #202020);
  clip-path: polygon(0 22%, 50% 0, 100% 24%, 100% 100%, 0 100%);
}

.empty-box-lid {
  position: absolute;
  left: 44px;
  bottom: 120px;
  width: 142px;
  height: 68px;
  background: linear-gradient(160deg, #414141, #272727);
  clip-path: polygon(0 26%, 43% 0, 100% 28%, 58% 62%);
}

.spark {
  position: absolute;
  color: #555;
  font-size: 26px;
  font-weight: 300;
}

.spark-1 {
  top: 37px;
  left: 57px;
}

.spark-2 {
  top: 36px;
  left: 121px;
}

.spark-3 {
  top: 52px;
  right: 45px;
  font-size: 22px;
}

.empty-works p {
  margin: 0;
  color: #747474;
  font-size: 15px;
}

@media (min-width: 768px) {
  .my-ai-page {
    padding: 0 14px 36px;
  }

  .my-ai-title {
    margin: 12px 8px 15px;
    font-size: 18px;
  }

  .tool-tabs {
    gap: 12px;
  }

  .tool-tabs a,
  .tool-tabs span {
    min-width: 112px;
    font-size: 15px;
  }

  .works-grid {
    gap: 20px 14px;
  }

  .work-info strong {
    font-size: 15px;
  }
}

@media (max-width: 520px) {
  .novel-records-grid {
    grid-template-columns: 1fr;
  }

  .novel-reader {
    padding: 12px;
  }

  .novel-reader-panel {
    max-height: 92vh;
    padding: 20px 15px 16px;
  }

  .my-pagination {
    flex-wrap: wrap;
  }

  .my-pagination span {
    width: 100%;
    order: -1;
  }

  .my-pagination button {
    min-height: 40px;
    flex: 1;
  }
}
