:root {
  --bg: #121212;
  --panel: #1e1e1e;
  --panel-strong: #2a2a2a;
  --line: #333333;
  --text: #e0e0e0;
  --muted: #9e9e9e;
  --accent: #bb86fc;
  --accent-strong: #9965f4;
  --accent-soft: #382a4d;
  --green: #4caf50;
  --blue: #2196f3;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  background: var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

.page-shell {
  width: min(1600px, calc(100% - 24px));
  margin: 16px auto 32px;
}

.hero,
.toolbar,
.video-card,
.empty-state {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  gap: 14px;
  padding: 18px 20px;
  border-radius: 12px;
}

.hero-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.guangya-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  background: var(--panel-strong);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--line);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}

.guangya-status.logged-in .status-dot {
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}

.status-text {
  color: var(--muted);
}

.guangya-status.logged-in .status-text {
  color: var(--text);
}

.status-btn {
  background: transparent;
  border: none;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
  font-weight: bold;
  font-size: 12px;
}

.status-btn:hover {
  text-decoration: underline;
}

.hero h1,
.empty-state h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(24px, 4vw, 36px);
  line-height: 1;
}

.hero-text,
.empty-state p {
  margin: 8px 0 0;
  max-width: 880px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

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

.search-label {
  color: var(--muted);
  font-size: 13px;
}

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

.search-row-wide {
  align-items: center;
}

.search-select, .search-row input {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #121212;
  color: var(--text);
  font-size: 13px;
}

.search-select {
  min-width: 100px;
}

.search-row input {
  flex: 1 1 260px;
  min-width: 0;
}

.search-row button,
.toolbar-btn,
.action-btn,
.copy-small-btn {
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.18s ease;
  background: var(--panel-strong);
  color: var(--text);
}

.search-row button,
.toolbar-btn {
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 700;
}

.toolbar-btn.active, .search-row button:hover, .toolbar-btn:hover, .action-btn:hover, .copy-small-btn:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.stat-card {
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
}

.stat-num {
  display: block;
  font-size: 22px;
  font-weight: 800;
}

.stat-label {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.toolbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 16px;
  margin: 12px 0;
  border-radius: 12px;
}

.toolbar-top, .toolbar-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.toolbar-label {
  font-size: 13px;
  color: var(--muted);
  align-self: center;
}

.actor-line {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.actor-link {
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

.actor-link:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

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

.pikpak-push-btn {
  background: var(--accent-soft) !important;
  color: var(--accent) !important;
  border-color: var(--accent) !important;
}

.pikpak-push-btn:hover {
  background: var(--accent) !important;
  color: #fff !important;
}

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

.overview-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.overview-card {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 12px;
  padding: 14px;
}

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

.overview-head h2 {
  margin: 0;
  font-size: 16px;
}

.overview-meta {
  color: var(--muted);
  font-size: 12px;
}

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

.overview-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  font-size: 12px;
}

.overview-item:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}

.overview-name {
  max-width: 120px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.overview-count {
  color: var(--muted);
}

.video-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
}

.poster-box {
  aspect-ratio: 720 / 478;
  border-radius: 8px;
  overflow: hidden;
  background: #121212;
  border: 1px solid var(--line);
}

.poster,
.poster-empty {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.poster-empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
}

.card-main h2 {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-weight: normal;
}

.info-row,
.action-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.code-pill,
.date-pill,
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: normal;
  background: var(--panel-strong);
}

.code-pill {
  color: var(--accent);
}

.date-pill,
.badge.size {
  color: var(--muted);
}

.badge.sub {
  color: var(--green);
}

.badge.hd {
  color: var(--blue);
}

.info-row {
  gap: 6px;
  row-gap: 4px;
}

.action-row {
  margin-top: 8px;
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  align-items: center;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 6px;
  font-size: 11px;
  white-space: nowrap;
  flex: 1;
}

.file-list {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.file-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 6px 8px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.file-item:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.file-size {
  color: var(--muted);
  font-size: 10px;
}

.more-box {
  margin-top: 10px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.more-box summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 11px;
}

.more-box summary:hover {
  color: var(--accent);
}

.magnet-list {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.magnet-line-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.magnet-link-name {
  color: var(--text);
  font-size: 11px;
  word-break: break-all;
}

.magnet-link-name:hover {
  color: var(--accent);
  text-decoration: underline;
}

.magnet-tags {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.copy-small-btn {
  padding: 2px 6px;
  font-size: 10px;
  margin-left: auto;
}

.empty-state {
  padding: 22px;
  border-radius: 12px;
}

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  margin: 12px 0;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.pagination-meta,
.page-current,
.page-link {
  font-size: 12px;
}

.pagination-meta,
.page-current {
  color: var(--muted);
}

.pagination-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.page-link {
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  color: var(--text);
}
.page-link:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}

.float-actions {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 100;
}

.float-actions button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.float-actions button:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 12px);
  padding: 12px 20px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: #121212;
  font-weight: bold;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 200;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 300;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.modal-content {
  background-color: var(--panel);
  margin: 15% auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  width: min(400px, 90%);
  box-shadow: var(--shadow);
}

.modal-header {
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  margin: 0;
  font-size: 16px;
}

.close-modal {
  color: var(--muted);
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
}

.close-modal:hover {
  color: var(--text);
}

.modal-body {
  padding: 20px;
}

.modal-body input {
  width: 100%;
  padding: 10px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #121212;
  color: var(--text);
}

.modal-body button {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: bold;
  cursor: pointer;
  margin-bottom: 8px;
}

.modal-body button:hover {
  background: var(--accent);
  color: #fff;
}

.modal-body button.secondary {
  background: var(--panel-strong);
  color: var(--muted);
}

.modal-body button.secondary:hover {
  background: var(--line);
  color: var(--text);
}

@media (max-width: 1200px) {
  .cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .pagination {
    flex-direction: column;
    align-items: stretch;
  }
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .cards {
    grid-template-columns: 1fr;
  }
}
