:root {
  --bg: #f6f8fc;
  --panel: #ffffff;
  --text: #172033;
  --muted: #6d7788;
  --line: #e7ebf2;
  --accent: #1677ff;
  --accent-strong: #0b63de;
  --accent-soft: #e8f2ff;
  --vip: #ff8a00;
  --danger: #d43f3a;
  --shadow: 0 18px 50px rgba(26, 37, 61, 0.12);
  --radius: 8px;
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, #eef5ff 0, rgba(246, 248, 252, 0) 260px),
    var(--bg);
  color: var(--text);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.page-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 8px 20px rgba(22, 119, 255, 0.18);
}

.brand-title {
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}

.icon-button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(26, 37, 61, 0.06);
}

.icon-button span {
  font-size: 28px;
  line-height: 1;
  transform: translateY(-1px);
}

.app-main {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  flex: 1;
}

.share-card,
.content-panel,
.viewer-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.share-card {
  padding: 28px;
  margin: 8px 0 18px;
}

.share-kicker {
  color: var(--muted);
  margin: 0 0 12px;
  font-size: 14px;
}

.share-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.share-title {
  margin: 0;
  font-size: clamp(24px, 4vw, 36px);
  line-height: 1.18;
}

.badge-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.badge {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 600;
  background: #f2f5fb;
  color: #465266;
}

.badge.vip {
  background: #fff1df;
  color: #a95b00;
}

.badge.blue {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.badge.red {
  background: var(--accent-soft);
  color: red;
}
.content-panel {
  overflow: hidden;
}

.panel-head {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.panel-title {
  margin: 0;
  font-size: 18px;
}

.panel-meta {
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

.item-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.disk-item {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  color: inherit;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 12px 20px;
  text-align: left;
}

.disk-item:last-child {
  border-bottom: 0;
}

.disk-item:hover,
.disk-item:focus-visible {
  background: #f8fbff;
  outline: none;
}

.file-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  flex: 0 0 auto;
}

.file-icon svg {
  width: 22px;
  height: 22px;
  display: block;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.file-icon.folder {
  background: #fff6df;
  color: #cf7a00;
}

.file-icon.image {
  background: #ebf8f0;
  color: #1f8a4c;
}

.file-icon.video {
  background: #f0efff;
  color: #6550d9;
}

.item-name {
  display: block;
  font-size: 16px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.item-sub {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  margin-top: 5px;
}

.item-action {
  color: var(--muted);
  font-size: 24px;
  padding-left: 8px;
}

.viewer-panel {
  padding: 18px;
}

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

.viewer-title {
  margin: 0;
  font-size: 20px;
  overflow-wrap: anywhere;
}

.media-frame {
  width: 100%;
  min-height: 260px;
  border-radius: var(--radius);
  background: #111827;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.preview-image {
  display: block;
  max-width: 100%;
  max-height: min(72vh, 760px);
  object-fit: contain;
}

.video-player {
  display: block;
  width: 100%;
  max-height: 76vh;
  background: #000000;
}

.empty-state,
.error-state,
.loading-state {
  min-height: 320px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
}

.empty-state h2,
.error-state h2 {
  color: var(--text);
  margin: 0 0 8px;
}

.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid #dce8f8;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.primary-button,
.secondary-button {
  min-height: 40px;
  border-radius: 8px;
  padding: 0 14px;
  font-weight: 700;
}

.primary-button {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.primary-button:hover,
.primary-button:focus-visible {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.secondary-button {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
}

.site-footer {
  width: min(1120px, calc(100% - 32px));
  margin: 26px auto 18px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 18, 31, 0.56);
}

.modal-panel {
  position: relative;
  width: min(540px, 94vw);
  max-height: min(760px, 92vh);
  overflow: auto;
  background: var(--panel);
  border-radius: 8px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.26);
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.48);
  color: #ffffff;
  font-size: 24px;
  line-height: 1;
}

.modal-video-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #111827;
}

.modal-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.video-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: #111827;
}

.modal-app {
  padding: 18px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.modal-app-logo {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  object-fit: cover;
}

.modal-app-copy h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}

.modal-app-copy p {
  margin: 5px 0 0;
  color: var(--muted);
}

.modal-app .primary-button {
  grid-column: 1 / -1;
  width: 100%;
  margin-top: 4px;
}

.hidden {
  display: none !important;
}

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

@media (max-width: 640px) {
  .topbar,
  .app-main,
  .site-footer {
    width: min(100% - 24px, 1120px);
  }

  .topbar {
    padding-top: 16px;
  }

  .brand-logo {
    width: 36px;
    height: 36px;
  }

  .brand-title {
    font-size: 19px;
  }

  .share-card {
    padding: 20px 16px;
  }

  .share-title-row {
    display: block;
  }

  .share-title {
    font-size: 25px;
  }

  .panel-head {
    padding: 15px 14px;
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .panel-meta {
    white-space: normal;
  }

  .disk-item {
    grid-template-columns: 40px minmax(0, 1fr) 18px;
    min-height: 68px;
    padding: 12px 14px;
  }

  .item-name {
    font-size: 15px;
  }

  .viewer-panel {
    padding: 12px;
  }

  .viewer-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .media-frame {
    min-height: 220px;
  }
}
