:root {
  color-scheme: light;
  --bg: #f4f7ff;
  --surface: #ffffff;
  --surface-soft: #f1f5ff;
  --text: #25314a;
  --text-strong: #0b1f43;
  --muted: #64718a;
  --muted-light: #71809a;
  --line: #dce5f5;
  --line-strong: #c4d2ea;
  --primary: #2256f2;
  --primary-dark: #173eb3;
  --primary-soft: #eaf0ff;
  --success: #317861;
  --success-soft: #edf7f2;
  --danger: #ad4b43;
  --danger-soft: #fbf0ef;
  --warning: #87621d;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --shadow: 0 12px 32px rgba(11, 31, 67, 0.075);
  --font: "Segoe UI", "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body.blog-home,
body.growth-page,
body.industry-page,
body.torrent-page,
body.player-page {
  isolation: isolate;
}

body.private-page {
  background: #edf3ff;
}

::selection {
  color: var(--text-strong);
  background: #dce7ff;
}

img,
video {
  max-width: 100%;
}

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

button,
summary {
  color: inherit;
}

button,
a,
summary {
  touch-action: manipulation;
}

button {
  border: 0;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid rgba(34, 86, 242, 0.42);
  outline-offset: 3px;
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 0;
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(34, 86, 242, 0.12) !important;
}

button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  background: var(--primary-dark);
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.blog-shell,
.content-wrapper {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(calc(100% - 48px), 1120px);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding-right: env(safe-area-inset-right);
  padding-left: env(safe-area-inset-left);
}

.torrent-wrapper,
.player-wrapper {
  width: min(calc(100% - 48px), 1220px);
}

/* Navigation */

.blog-topbar,
.page-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 12px;
  border: 1px solid rgba(220, 229, 245, 0.96);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 4px 18px rgba(11, 31, 67, 0.05);
}

.blog-topbar {
  position: sticky;
  top: 14px;
  z-index: 20;
  margin: 16px 0 40px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.page-heading-row {
  margin: 16px 0 24px;
}

.blog-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
  color: var(--text-strong);
  text-decoration: none;
}

.blog-brand img {
  display: block;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
}

.blog-brand > span {
  display: grid;
  gap: 1px;
}

.blog-brand strong {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
}

.blog-brand small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.blog-nav,
.page-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.blog-nav a,
.page-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  color: #465570;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: color 160ms ease, background-color 160ms ease;
}

.blog-nav .nav-contact {
  color: #fff;
  background: var(--primary);
}

.page-nav a[aria-current="page"] {
  color: var(--primary-dark);
  background: var(--primary-soft);
}

/* Home hero */

.home-main {
  display: grid;
}

.home-hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: 26px;
  align-items: stretch;
}

.home-intro-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: clamp(34px, 5vw, 70px) clamp(12px, 3vw, 38px) clamp(34px, 5vw, 70px) 4px;
}

.page-index,
.section-label,
.dialog-meta,
.result-kicker {
  margin: 0;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
}

.home-intro-panel h1 {
  max-width: 720px;
  margin: 0;
  color: var(--text-strong);
  font-size: clamp(42px, 5.6vw, 68px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.hero-lead {
  max-width: 650px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(16px, 1.7vw, 18px);
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.primary-link,
.ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: border-color 160ms ease, background-color 160ms ease;
}

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

.ghost-link {
  color: #465570;
  background: var(--surface);
}

.home-status-panel {
  display: grid;
  align-content: center;
  justify-items: center;
  min-width: 0;
  padding: clamp(28px, 4vw, 44px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  text-align: center;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.avatar-container {
  display: block;
  padding: 0;
  border: 0;
  cursor: pointer;
  background: transparent;
  user-select: none;
}

.compact-avatar {
  width: 108px;
  height: 108px;
  margin: 0 0 22px;
}

.avatar {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: #fff;
}

.avatar-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.avatar.spinning {
  animation: avatarSpin 520ms cubic-bezier(0.22, 0.8, 0.3, 1);
}

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

.profile-copy h2 {
  margin: 0 0 8px;
  color: var(--text-strong);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
}

.mini-bio {
  max-width: 100%;
  padding: 0;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  background: transparent;
  transition: color 160ms ease, opacity 160ms ease;
}

.home-bio {
  justify-self: center;
}

.mini-bio.fade-out {
  opacity: 0;
}

.mini-bio.fade-in {
  animation: bioFadeIn 180ms ease;
}

@keyframes bioFadeIn {
  from {
    opacity: 0;
  }
}

.home-clock {
  display: grid;
  width: 100%;
  gap: 8px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.time-line,
.date-line,
.lunar-line {
  display: block;
}

.time-line {
  color: var(--text-strong);
  font-size: 32px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.clock-date {
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-size: 12px;
}

/* Home sections */

.home-tools-section {
  padding-top: clamp(60px, 8vw, 88px);
}

.section-heading-row,
.tool-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
}

.section-heading h2,
.tool-intro h2 {
  margin: 0;
  color: var(--text-strong);
  font-size: clamp(30px, 3.8vw, 44px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.section-heading-row > p,
.tool-intro > p {
  max-width: 420px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.home-tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 30px;
}

.home-tool-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 190px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  background: var(--surface);
  transition: border-color 160ms ease, background-color 160ms ease;
}

.tool-card-player,
.tool-card-torrent,
.tool-card-industry,
.tool-card-growth {
  background: var(--surface);
}

.tool-privacy {
  align-self: flex-start;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  background: var(--surface-soft);
}

.tool-card-player .tool-privacy,
.tool-card-torrent .tool-privacy {
  color: #274eae;
  background: #edf2ff;
}

.tool-card-copy {
  display: grid;
  align-content: center;
  gap: 5px;
  flex: 1;
  padding: 22px 0 8px;
}

.tool-card-copy h3 {
  margin: 0;
  color: var(--text-strong);
  font-size: 23px;
  font-weight: 700;
  line-height: 1.3;
}

.tool-card-copy p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

/* Articles */

.home-articles {
  margin-top: clamp(60px, 8vw, 88px);
  padding: clamp(26px, 4vw, 42px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.articles-card,
.growth-tool,
.player-folder-browser {
  min-width: 0;
}

.article-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.article-search {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  width: min(100%, 280px);
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
}

.article-search > span:not(.visually-hidden) {
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
}

.article-search input {
  width: 100%;
  height: 42px;
  min-width: 0;
  padding: 0 3px;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
}

.article-search input:focus-visible {
  box-shadow: none !important;
}

.article-search:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(34, 86, 242, 0.1);
}

.tag-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 24px 0 14px;
}

.tag-filter button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  background: var(--surface);
}

.tag-filter button.is-active {
  border-color: #cbd8ff;
  color: var(--primary-dark);
  background: var(--primary-soft);
}

.article-list {
  display: grid;
}

.article-item {
  border-top: 1px solid var(--line);
}

.article-item:last-child {
  border-bottom: 1px solid var(--line);
}

.article-item button {
  display: grid;
  grid-template-columns: 74px minmax(180px, 0.8fr) minmax(220px, 1.2fr);
  align-items: center;
  gap: 18px;
  width: 100%;
  min-height: 102px;
  padding: 18px 4px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  background: transparent;
  transition: background-color 160ms ease;
}

.article-item span {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 600;
  background: var(--primary-soft);
}

.article-item strong {
  color: var(--text-strong);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.45;
}

.article-item small,
.empty-articles {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.empty-articles {
  margin: 0;
  padding: 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  text-align: center;
}

.article-dialog {
  width: min(calc(100% - 32px), 700px);
  max-height: min(86vh, 820px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 24px 64px rgba(11, 31, 67, 0.2);
}

.article-dialog::backdrop {
  background: rgba(11, 31, 67, 0.52);
}

.article-dialog article {
  position: relative;
  padding: clamp(28px, 5vw, 54px);
}

.article-dialog h2 {
  max-width: 580px;
  margin: 12px 0 28px;
  color: var(--text-strong);
  font-size: clamp(29px, 4.2vw, 42px);
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.dialog-close {
  position: sticky;
  top: 14px;
  float: right;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--muted);
  font-size: 22px;
  cursor: pointer;
  background: #fff;
}

.dialog-body {
  color: #465570;
  font-size: 16px;
  line-height: 1.9;
}

.dialog-body p {
  margin: 0 0 1.2em;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 60;
  max-width: min(90vw, 420px);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 14px;
  text-align: center;
  background: #344054;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity 160ms ease, transform 160ms ease;
}

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

/* Footer */

.footer {
  margin-top: auto;
}

.blog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
  margin: 34px 0 20px;
  padding: 22px 4px;
  border-top: 1px solid var(--line);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.footer-brand img {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
}

.footer-brand div {
  display: grid;
}

.footer-brand strong {
  color: var(--text-strong);
  font-size: 14px;
}

.footer-brand span {
  color: var(--muted);
  font-size: 12px;
}

.footer-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--muted);
  font-size: 12px;
}

.copyright {
  margin: 0;
}

.beian-link {
  color: var(--muted);
  text-decoration: none;
}

/* Inner pages */

.industry-header,
.torrent-header,
.player-header {
  padding-bottom: 0;
}

.page-intro {
  padding: clamp(34px, 5vw, 54px) clamp(4px, 2vw, 18px);
  border-bottom: 1px solid var(--line);
}

.page-intro-copy {
  max-width: 780px;
}

.page-index {
  margin-bottom: 14px;
}

.page-intro h1 {
  margin: 0;
  color: var(--text-strong);
  font-size: clamp(40px, 5vw, 58px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.page-intro-copy > p:last-child {
  max-width: 680px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 17px;
}

.industry-main,
.torrent-main,
.player-main {
  display: grid;
  gap: 20px;
  padding: 28px 0 0;
}

.industry-tool,
.player-stage,
.player-library {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.industry-tool {
  padding: clamp(24px, 4vw, 40px);
}

.tool-intro {
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
}

.tool-intro h2 {
  font-size: clamp(26px, 3.4vw, 36px);
}

.industry-workbench,
.growth-workbench {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(340px, 1.1fr);
  gap: 18px;
  margin-top: 0;
}

.industry-query-panel,
.growth-form {
  min-width: 0;
  padding: 26px;
  border: 0;
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.industry-form,
.growth-form {
  display: grid;
  gap: 16px;
}

.industry-label,
.growth-field > span {
  color: var(--text-strong);
  font-size: 13px;
  font-weight: 700;
}

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

.industry-input,
.growth-field input,
.torrent-textarea,
.torrent-config-form input {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: #fff;
}

.industry-input::placeholder,
.growth-field input::placeholder,
.torrent-textarea::placeholder {
  color: var(--muted-light);
}

.industry-button,
.growth-clear,
.video-retry-button,
.torrent-task-actions button,
.subtitle-file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.industry-button {
  border-color: var(--primary);
  color: #fff;
  background: var(--primary);
}

.growth-clear,
.torrent-task-actions button {
  color: #465570;
  background: #fff;
}

.example-block {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.example-block > p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
}

.example-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.example-list button {
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  background: #fff;
}

.query-tip {
  margin-top: 20px;
  padding: 14px 0 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.query-tip strong {
  color: var(--primary-dark);
  font-size: 13px;
}

.query-tip p {
  margin: 5px 0 0;
  color: #59697a;
  font-size: 12px;
}

.industry-result,
.growth-result {
  min-width: 0;
  min-height: 280px;
  padding: clamp(26px, 4vw, 38px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: var(--surface-soft);
}

.industry-result h3,
.growth-result h3 {
  margin: 32px 0 22px;
  color: var(--text-strong);
  font-size: clamp(28px, 3.8vw, 42px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.025em;
  overflow-wrap: anywhere;
}

.result-body {
  color: #465570;
}

.result-grid {
  display: grid;
  gap: 0;
  margin: 0;
}

.result-grid > div {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid rgba(34, 86, 242, 0.13);
}

.result-grid dt {
  color: var(--muted);
  font-size: 12px;
}

.result-grid dd {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.result-code {
  color: var(--primary-dark);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.result-path {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.result-path > span {
  color: var(--muted-light);
}

.related-results {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(34, 86, 242, 0.13);
}

.related-results p {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 12px;
}

.related-results ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--text);
  font-size: 13px;
}

/* Growth */

.growth-form {
  align-content: start;
}

.growth-field {
  display: grid;
  gap: 7px;
}

.growth-field > small {
  color: var(--muted);
  font-size: 12px;
}

.growth-actions,
.torrent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 6px;
}

.growth-result h3 {
  margin-top: 14px;
  font-size: clamp(42px, 6vw, 64px);
  font-variant-numeric: tabular-nums;
}

.growth-result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 24px 0 0;
}

.growth-result-grid div {
  padding: 14px;
  border: 1px solid rgba(34, 86, 242, 0.13);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.55);
}

.growth-result-grid dt {
  color: var(--muted);
  font-size: 12px;
}

.growth-result-grid dd {
  margin: 6px 0 0;
  color: var(--text-strong);
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.growth-message {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.growth-result.is-positive {
  border-color: var(--line);
  background: var(--surface-soft);
}

.growth-result.is-positive h3,
.growth-result.is-positive .result-kicker {
  color: var(--success);
}

.growth-result.is-negative,
.growth-result.has-error {
  border-color: var(--line);
  background: var(--surface-soft);
}

.growth-result.is-negative h3,
.growth-result.has-error h3,
.growth-result.is-negative .result-kicker,
.growth-result.has-error .result-kicker {
  color: var(--danger);
}

.growth-result.is-flat {
  background: var(--surface-soft);
}

/* Login and download */

.access-panel {
  width: min(100%, 560px);
  margin: 8px auto 28px;
  padding: 0;
  overflow: hidden;
}

.torrent-login-panel,
.player-login-panel {
  min-width: 0;
}

.access-form-wrap {
  display: grid;
  padding: clamp(30px, 5vw, 48px);
}

.torrent-panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.torrent-panel-heading h2 {
  margin: 0;
  color: var(--text-strong);
  font-size: clamp(25px, 3.4vw, 34px);
  font-weight: 700;
  line-height: 1.25;
}

.access-copy {
  margin: 12px 0 24px;
  color: var(--muted);
  font-size: 13px;
}

.torrent-login-form,
.torrent-form,
.torrent-config-form {
  display: grid;
  gap: 15px;
}

.torrent-login-form .industry-button {
  width: 100%;
  margin-top: 3px;
}

.access-back {
  justify-self: center;
  margin-top: 16px;
  color: var(--muted);
  font-size: 12px;
  text-underline-offset: 3px;
}

.torrent-message {
  min-height: 22px;
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.torrent-message[data-tone="ok"],
.subtitle-tool span[data-tone="ok"] {
  color: var(--success);
}

.torrent-message[data-tone="error"],
.subtitle-tool span[data-tone="error"] {
  color: var(--danger);
}

.torrent-dashboard {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
  padding-bottom: 28px;
}

.dashboard-bar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 16px 14px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.dashboard-bar > strong {
  color: var(--text-strong);
  font-size: 16px;
}

.dashboard-bar .growth-clear {
  min-height: 38px;
}

.torrent-icon-button {
  min-width: max-content;
}

.torrent-list-panel {
  grid-column: span 7;
}

.torrent-submit-panel {
  grid-column: span 5;
}

.torrent-config-panel {
  grid-column: 1 / -1;
}

.panel-description {
  margin: 12px 0 20px;
  color: var(--muted);
  font-size: 12px;
}

.torrent-textarea {
  min-height: 132px;
  padding: 13px 14px;
  resize: vertical;
  line-height: 1.55;
}

.torrent-file-field {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.torrent-file-field > span {
  display: grid;
  gap: 2px;
}

.torrent-file-field strong {
  font-size: 12px;
}

.torrent-file-field small {
  color: var(--muted);
  font-size: 12px;
}

.torrent-file-field input {
  width: 100%;
  color: var(--muted);
  font-size: 12px;
}

.torrent-file-field input::file-selector-button {
  min-height: 34px;
  margin-right: 10px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: #465570;
  font-weight: 600;
  cursor: pointer;
  background: #fff;
}

.torrent-status-grid,
.torrent-task-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 20px;
}

.torrent-status-grid div,
.torrent-task-stats div,
.player-details div {
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.torrent-status-grid span,
.torrent-task-stats dt,
.player-details dt {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.torrent-status-grid strong,
.torrent-task-stats dd,
.player-details dd {
  display: block;
  min-width: 0;
  margin: 4px 0 0;
  color: var(--text-strong);
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.torrent-status-grid strong[data-state="ok"] {
  color: var(--success);
}

.torrent-status-grid strong[data-state="error"] {
  color: var(--danger);
}

.torrent-list {
  display: grid;
  gap: 10px;
}

.torrent-task {
  display: grid;
  gap: 13px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.torrent-task-main {
  display: grid;
  gap: 11px;
}

.torrent-task-main > div:first-child {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.torrent-task-main strong {
  min-width: 0;
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.torrent-task-main > div:first-child span {
  flex: 0 0 auto;
  max-width: 45%;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 600;
  text-align: right;
  background: var(--primary-soft);
  overflow-wrap: anywhere;
}

.torrent-progress {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe7f5;
}

.torrent-progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}

.torrent-task-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 0;
}

.torrent-task-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.torrent-task-actions button {
  min-height: 36px;
  padding: 0 12px;
  font-size: 12px;
}

.torrent-task-actions button[data-action="delete"] {
  border-color: #e5c8c5;
  color: var(--danger);
}

/* Details */

details {
  min-width: 0;
}

details > summary {
  list-style: none;
}

details > summary::-webkit-details-marker {
  display: none;
}

.settings-disclosure,
.player-settings,
.folder-disclosure {
  overflow: hidden;
}

.settings-disclosure > summary,
.player-settings > summary,
.folder-disclosure > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
}

.settings-disclosure > summary > span:first-child,
.player-settings > summary > span:first-child,
.folder-disclosure > summary > span:first-child {
  display: grid;
  gap: 2px;
}

.settings-disclosure > summary strong,
.player-settings > summary strong,
.folder-disclosure > summary strong {
  color: var(--text-strong);
  font-size: 17px;
}

.settings-disclosure > summary small,
.player-settings > summary small,
.folder-disclosure > summary small {
  color: var(--muted);
  font-size: 12px;
}

.summary-action {
  flex: 0 0 auto;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 600;
}

details[open] > summary .summary-action {
  font-size: 0;
}

details[open] > summary .summary-action::after {
  content: "收起";
  font-size: 12px;
}

.torrent-config-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.torrent-wide-field {
  grid-column: 1 / -1;
}

/* Player */

.player-app {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 350px);
  gap: 18px;
  align-items: start;
  padding-bottom: 28px;
}

.player-dashboard-bar {
  grid-column: 1 / -1;
}

.player-stage,
.player-library {
  padding: clamp(18px, 3vw, 28px);
}

.video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius);
  background: #081a3a;
}

.video-player {
  display: block;
  width: 100%;
  height: 100%;
  color: #fff;
  background: #081a3a;
}

.video-state {
  position: absolute;
  inset: 0;
  display: none;
  place-content: center;
  justify-items: center;
  gap: 13px;
  padding: 24px;
  color: #fff;
  text-align: center;
  pointer-events: none;
  background: rgba(6, 19, 48, 0.86);
}

.video-frame[data-state="idle"] .video-state,
.video-frame[data-state="loading"] .video-state,
.video-frame[data-state="buffering"] .video-state,
.video-frame[data-state="error"] .video-state {
  display: grid;
}

.video-frame[data-state="playing"] .video-state,
.video-frame[data-state="ready"] .video-state {
  display: none;
}

.video-state strong {
  max-width: 460px;
  font-size: 13px;
}

.video-state-spinner {
  display: none;
  width: 30px;
  height: 30px;
  border: 3px solid rgba(255, 255, 255, 0.22);
  border-top-color: #fff;
  border-radius: 50%;
  animation: playerSpin 760ms linear infinite;
}

.video-frame[data-state="loading"] .video-state-spinner,
.video-frame[data-state="buffering"] .video-state-spinner {
  display: block;
}

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

.video-retry-button {
  min-height: 40px;
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.08);
}

.video-time-display {
  position: absolute;
  top: 11px;
  right: 11px;
  z-index: 2;
  min-width: 104px;
  padding: 5px 9px;
  border-radius: 8px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  background: rgba(6, 19, 48, 0.76);
}

.video-frame[data-state="idle"] .video-time-display {
  display: none;
}

.player-meta,
.player-library-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.player-meta {
  margin-top: 22px;
}

.player-meta h2,
.player-library-heading h2 {
  margin: 5px 0 0;
  color: var(--text-strong);
  font-size: clamp(23px, 3.2vw, 32px);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.player-library-heading h2 {
  margin-top: 0;
  font-size: 25px;
}

.player-details {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 20px 0 0;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.player-details div {
  padding: 6px 12px;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.player-details div:first-child {
  border-left: 0;
}

.player-settings {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.player-playback-tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.subtitle-tool,
.audio-tool,
.seek-tool {
  display: grid;
  align-content: start;
  gap: 9px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
}

.subtitle-tool strong,
.audio-tool strong,
.seek-tool strong {
  display: block;
  color: var(--text-strong);
  font-size: 13px;
}

.subtitle-tool input[type="file"] {
  width: 100%;
  min-height: 40px;
  padding: 6px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  background: var(--surface-soft);
}

.subtitle-tool input::file-selector-button {
  min-height: 28px;
  margin-right: 7px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
}

.subtitle-file-button {
  display: none;
}

.subtitle-tool .growth-clear,
.seek-tool .growth-clear {
  min-height: 38px;
  padding: 0 10px;
  font-size: 12px;
}

.subtitle-tool select,
.audio-tool select {
  width: 100%;
  min-height: 40px;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--text);
  background: #fff;
}

.subtitle-tool > span,
.audio-tool > span,
.seek-tool > span {
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.seek-tool input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
}

.seek-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.player-search {
  width: 100%;
  margin: 18px 0 13px;
}

.video-list {
  display: grid;
  gap: 7px;
  max-height: min(64vh, 620px);
  overflow: auto;
  padding-right: 2px;
  scrollbar-color: var(--line-strong) transparent;
  scrollbar-width: thin;
}

.video-item button {
  position: relative;
  display: grid;
  width: 100%;
  gap: 5px;
  padding: 13px 38px 13px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  background: var(--surface-soft);
  transition: border-color 160ms ease, background-color 160ms ease;
}

.video-item button::after {
  content: "▶";
  position: absolute;
  top: 50%;
  right: 13px;
  color: var(--primary);
  font-size: 12px;
  transform: translateY(-50%);
}

.video-item button.is-active {
  border-color: #b9cafa;
  background: var(--primary-soft);
}

.video-item strong {
  min-width: 0;
  color: var(--text-strong);
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.video-item span {
  color: var(--muted);
  font-size: 12px;
}

.folder-disclosure {
  margin-top: 16px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.folder-disclosure[open] > summary {
  margin-bottom: 14px;
}

.player-folder-current {
  display: grid;
  gap: 3px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
}

.player-folder-current span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.player-folder-current strong {
  min-width: 0;
  color: var(--text-strong);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.player-folder-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 9px;
}

.player-folder-actions .growth-clear,
.player-folder-actions .industry-button {
  min-height: 38px;
  padding: 0 8px;
  font-size: 12px;
}

.folder-list {
  display: grid;
  gap: 6px;
  max-height: 200px;
  margin-top: 9px;
  overflow: auto;
}

.folder-list button {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 42px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  background: #fff;
}

.folder-list button.is-selected {
  border-color: #b9cafa;
  background: var(--primary-soft);
}

.folder-list span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 26px;
  border-radius: 7px;
  color: var(--primary);
  background: var(--primary-soft);
}

.folder-list strong {
  min-width: 0;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.player-folder-message {
  margin-bottom: 0;
}

/* Inner footer */

.industry-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 34px 4px calc(34px + env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: 12px;
}

.industry-footer > a {
  font-weight: 600;
  text-underline-offset: 3px;
}

/* Hover */

@media (hover: hover) {
  .blog-nav a:not(.nav-contact):hover,
  .page-nav a:not([aria-current="page"]):hover {
    color: var(--primary-dark);
    background: var(--primary-soft);
  }

  .nav-contact:hover,
  .primary-link:hover,
  .industry-button:hover {
    background: var(--primary-dark);
  }

  .ghost-link:hover,
  .growth-clear:hover,
  .torrent-task-actions button:hover {
    border-color: #b9c0ca;
    background: var(--surface-soft);
  }

  .home-tool-card:hover {
    border-color: #bdccec;
    background: var(--surface-soft);
  }

  .mini-bio:hover,
  .beian-link:hover {
    color: var(--primary-dark);
  }

  .article-item button:hover {
    background: var(--surface-soft);
  }

  .tag-filter button:hover,
  .example-list button:hover {
    border-color: #b7c7e7;
  }

  .video-item button:hover,
  .folder-list button:hover {
    border-color: #bdcbea;
  }
}

/* Responsive */

@media (max-width: 1000px) {
  .home-hero-panel {
    grid-template-columns: minmax(0, 1.1fr) minmax(290px, 0.9fr);
  }

  .industry-workbench,
  .growth-workbench {
    grid-template-columns: 1fr;
  }

  .industry-result,
  .growth-result {
    min-height: 300px;
  }

  .torrent-list-panel,
  .torrent-submit-panel {
    grid-column: 1 / -1;
  }

  .player-app {
    grid-template-columns: minmax(0, 1fr) 310px;
  }
}

@media (max-width: 820px) {
  html {
    scroll-padding-top: 20px;
  }

  .blog-shell,
  .content-wrapper,
  .torrent-wrapper,
  .player-wrapper {
    width: min(calc(100% - 32px), 1120px);
  }

  .blog-topbar {
    position: static;
  }

  .blog-topbar,
  .page-heading-row {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .blog-nav,
  .page-nav {
    max-width: none;
    overflow: visible;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .blog-nav a,
  .page-nav a {
    flex: 0 0 auto;
  }

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

  .home-intro-panel {
    padding: 42px 4px 30px;
  }

  .home-status-panel {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 20px 24px;
    justify-items: start;
    text-align: left;
  }

  .compact-avatar {
    margin: 0;
  }

  .home-clock {
    grid-column: 1 / -1;
    text-align: center;
  }

  .article-item button {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .article-item small {
    grid-column: 2;
  }

  .player-app {
    grid-template-columns: 1fr;
  }

  .player-dashboard-bar {
    order: -3;
  }

  .player-library {
    order: -1;
  }

  .player-stage {
    order: -2;
  }

  .video-list {
    max-height: 360px;
  }
}

@media (max-width: 620px) {
  body {
    font-size: 16px;
  }

  .blog-shell,
  .content-wrapper,
  .torrent-wrapper,
  .player-wrapper {
    width: min(calc(100% - 22px), 1120px);
  }

  .blog-topbar,
  .page-heading-row {
    display: grid;
    gap: 10px;
    margin-top: 11px;
    padding: 10px;
    border-radius: 14px;
  }

  .blog-nav,
  .page-nav {
    width: 100%;
    max-width: none;
  }

  .blog-nav a,
  .page-nav a {
    min-height: 38px;
    padding: 0 11px;
    font-size: 12px;
  }

  .home-intro-panel h1 {
    font-size: clamp(38px, 11.8vw, 52px);
  }

  .hero-lead {
    font-size: 15px;
  }

  .hero-actions {
    display: grid;
  }

  .primary-link,
  .ghost-link {
    width: 100%;
  }

  .home-status-panel {
    padding: 24px;
  }

  .compact-avatar {
    width: 88px;
    height: 88px;
  }

  .profile-copy h2 {
    font-size: 21px;
  }

  .home-tools-section {
    padding-top: 72px;
  }

  .section-heading-row,
  .tool-intro,
  .article-toolbar {
    display: grid;
  }

  .section-heading h2,
  .tool-intro h2 {
    font-size: 31px;
  }

  .home-tool-grid {
    grid-template-columns: 1fr;
    gap: 11px;
    margin-top: 24px;
  }

  .home-tool-card {
    min-height: 168px;
    padding: 22px;
  }

  .home-articles {
    margin-top: 72px;
    padding: 24px 18px;
    border-radius: 18px;
  }

  .article-search {
    width: 100%;
  }

  .article-item button {
    grid-template-columns: 1fr;
    gap: 7px;
    min-height: 0;
    padding: 18px 3px;
  }

  .article-item span,
  .article-item strong,
  .article-item small {
    grid-column: 1;
  }

  .blog-footer {
    display: grid;
  }

  .footer-meta {
    flex-wrap: wrap;
  }

  .page-intro {
    padding: 38px 4px 44px;
  }

  .page-intro h1 {
    font-size: clamp(36px, 11vw, 48px);
  }

  .page-intro-copy > p:last-child {
    font-size: 15px;
  }

  .industry-main,
  .torrent-main,
  .player-main {
    padding-top: 24px;
  }

  .industry-tool {
    padding: 22px 17px;
    border-radius: 18px;
  }

  .industry-search {
    grid-template-columns: 1fr;
  }

  .industry-search .industry-button {
    width: 100%;
  }

  .industry-workbench,
  .growth-workbench {
    gap: 11px;
    margin-top: 20px;
  }

  .industry-query-panel,
  .growth-form,
  .industry-result,
  .growth-result {
    padding: 20px 16px;
    border-radius: 14px;
  }

  .result-grid > div {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .growth-actions,
  .torrent-actions {
    display: grid;
  }

  .growth-actions > *,
  .torrent-actions > * {
    width: 100%;
  }

  .growth-result-grid {
    grid-template-columns: 1fr;
  }

  .access-form-wrap {
    padding: 28px 20px;
  }

  .dashboard-bar {
    border-radius: 14px;
  }

  .torrent-dashboard {
    gap: 11px;
  }

  .torrent-panel-heading {
    display: grid;
  }

  .torrent-task-main > div:first-child {
    display: grid;
  }

  .torrent-task-main > div:first-child span {
    max-width: 100%;
    justify-self: start;
    text-align: left;
  }

  .torrent-task-stats,
  .torrent-status-grid,
  .torrent-config-form {
    grid-template-columns: 1fr;
  }

  .torrent-task-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .torrent-task-actions button {
    padding: 0 7px;
  }

  .settings-disclosure > summary,
  .player-settings > summary,
  .folder-disclosure > summary {
    align-items: flex-start;
  }

  .player-stage,
  .player-library {
    padding: 17px;
    border-radius: 18px;
  }

  .player-meta {
    display: grid;
  }

  .player-details,
  .player-playback-tools,
  .player-folder-actions {
    grid-template-columns: 1fr;
  }

  .player-details div {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .player-details div:first-child {
    border-top: 0;
  }

  .video-list {
    max-height: 330px;
  }

  .folder-list {
    max-height: 190px;
  }

  .industry-footer {
    flex-wrap: wrap;
  }

  .article-dialog {
    width: calc(100% - 20px);
    border-radius: 17px;
  }

  .article-dialog article {
    padding: 24px 19px 32px;
  }

  .article-dialog h2 {
    padding-right: 30px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-contrast: more) {
  :root {
    --muted: #4f5b6b;
    --line: #cbd1d8;
    --line-strong: #adb5bf;
  }
}
