:root {
  --office-blue: #185abd;
  --office-accent: #0078d4;
  --text-main: #1f1f1f;
  --text-soft: #616161;
  --line: #e5e7eb;
  --surface: #ffffff;
  --canvas: #f5f7fb;
  --success: #107c41;
  --danger: #c50f1f;
  --shadow: 0 16px 40px rgba(17, 24, 39, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text-main);
  font-family: "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  background: var(--canvas);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 72px;
  padding: 0 40px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand-mark {
  display: grid;
  grid-template-columns: repeat(2, 16px);
  gap: 3px;
  width: 35px;
  height: 35px;
}

.brand-mark span {
  display: block;
}

.brand-mark span:nth-child(1) {
  background: #f25022;
}

.brand-mark span:nth-child(2) {
  background: #7fba00;
}

.brand-mark span:nth-child(3) {
  background: #00a4ef;
}

.brand-mark span:nth-child(4) {
  background: #ffb900;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 650;
  letter-spacing: 0;
}

.layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 32px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 28px 72px;
}

.invalid-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 42px 18px;
}

.invalid-card h2 {
  margin: 0 0 10px;
}

.invalid-card p {
  margin: 0;
  color: var(--text-soft);
}

.sidebar {
  position: relative;
}

.bookmark {
  position: sticky;
  top: 104px;
  display: grid;
  gap: 8px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.bookmark-link {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px 0 18px;
  color: var(--text-soft);
  border-radius: 6px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
}

.bookmark-link::before {
  content: "";
  position: absolute;
  left: 7px;
  width: 3px;
  height: 20px;
  border-radius: 999px;
  background: transparent;
}

.bookmark-link:hover,
.bookmark-link.active {
  color: var(--office-blue);
  background: #edf5ff;
}

.bookmark-link.active::before {
  background: var(--office-blue);
}

.content {
  min-width: 0;
}

.section {
  scroll-margin-top: 104px;
  margin-bottom: 28px;
  padding: 34px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 650;
  letter-spacing: 0;
}

.video-section .section-heading {
  display: block;
}

.video-panel {
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
  width: 100%;
}

.video-frame {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 330px;
  background: #111827;
}

.video-frame video {
  position: relative;
  z-index: 1;
  display: none;
  width: 100%;
  height: 100%;
  min-height: 330px;
  object-fit: cover;
}

.video-frame.has-video video {
  display: block;
}

.video-placeholder {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 20px;
  padding: 30px;
  color: #ffffff;
  text-align: center;
  background: linear-gradient(135deg, rgba(0, 120, 212, 0.92), rgba(24, 90, 189, 0.88));
}

.video-frame.has-video .video-placeholder {
  display: none;
}

.play-button {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.2);
}

.play-button::after {
  content: "";
  display: block;
  width: 0;
  height: 0;
  margin: 22px 0 0 29px;
  border-top: 14px solid transparent;
  border-bottom: 14px solid transparent;
  border-left: 20px solid var(--office-blue);
}

.video-chapters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 14px;
}

.chapter-button {
  min-height: 42px;
  padding: 0 16px;
  color: var(--office-blue);
  background: #f3f8ff;
  border: 1px solid #cfe3ff;
  border-radius: 6px;
  font: inherit;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0;
  cursor: pointer;
}

.chapter-button:hover,
.chapter-button.active {
  color: #ffffff;
  background: var(--office-blue);
  border-color: var(--office-blue);
}

.step-number {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  color: #ffffff;
  background: var(--office-blue);
  font-weight: 700;
}

.instruction {
  color: var(--text-soft);
  font-size: 17px;
  line-height: 1.9;
}

.instruction p {
  margin: 0 0 16px;
}

.instruction ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
}

.instruction li::marker {
  color: var(--office-accent);
}

.inline-link,
.copy-key,
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  color: var(--office-blue);
  background: #edf5ff;
  border: 1px solid #cfe5ff;
  border-radius: 6px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.inline-link,
.copy-key {
  margin-left: 8px;
}

.inline-link:hover,
.copy-key:hover,
.primary-button:hover {
  color: #ffffff;
  background: var(--office-blue);
  border-color: var(--office-blue);
}

.primary-button:disabled {
  color: #9ca3af;
  background: #f3f4f6;
  border-color: #e5e7eb;
  cursor: not-allowed;
}

.tool-panel {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.tool-head h3 {
  margin: 0 0 6px;
  font-size: 22px;
}

.tool-head p {
  margin: 0 0 18px;
  color: var(--text-soft);
}

.usage-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.usage-grid div {
  padding: 16px;
  border: 1px solid var(--line);
  background: #fafafa;
}

.usage-grid span {
  display: block;
  color: var(--text-soft);
  font-size: 14px;
}

.usage-grid strong {
  display: block;
  margin-top: 4px;
  color: var(--office-blue);
  font-size: 28px;
}

.upload-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.upload-row input[type="file"] {
  max-width: 100%;
  padding: 9px;
  border: 1px solid var(--line);
  background: #ffffff;
}

.manual-iid-panel {
  margin-bottom: 14px;
}

.manual-iid-grid {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 8px;
}

.manual-iid-input {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 8px;
  color: var(--text-main);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 4px;
  font: inherit;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0;
}

.manual-iid-input:focus {
  outline: 2px solid #cfe5ff;
  border-color: var(--office-accent);
}

.result-box {
  min-height: 44px;
  margin-top: 10px;
  padding: 10px 12px;
  color: var(--text-main);
  background: #f8fafc;
  border: 1px solid var(--line);
  line-height: 1.6;
  word-break: break-all;
}

.result-box.muted {
  color: var(--text-soft);
}

.result-box.strong {
  color: var(--office-blue);
  font-weight: 700;
}

.result-box.error {
  color: var(--danger);
  background: #fff5f5;
  border-color: #fecaca;
}

.result-box.success {
  color: var(--success);
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.cached-value,
.cached-result {
  color: var(--danger);
  font-weight: 800;
}

.cached-value {
  display: block;
  margin-top: 10px;
  line-height: 1.7;
  word-break: break-all;
}

.cached-value[hidden] {
  display: none;
}

.result-box.cached-result {
  color: var(--danger);
  background: #fff5f5;
  border-color: #fecaca;
}

.back-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  display: none;
  width: 44px;
  height: 44px;
  color: #ffffff;
  background: var(--office-blue);
  border: 0;
  border-radius: 50%;
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(24, 90, 189, 0.28);
}

.back-top.show {
  display: block;
}

@media (max-width: 820px) {
  .topbar {
    padding: 0 18px;
  }

  .layout {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 18px 14px 56px;
  }

  .bookmark {
    top: 82px;
    grid-template-columns: repeat(4, 1fr);
    overflow-x: auto;
  }

  .bookmark-link {
    justify-content: center;
    min-width: 76px;
    padding: 0 12px;
    white-space: nowrap;
  }

  .bookmark-link::before {
    display: none;
  }

  .section {
    padding: 24px 18px;
    scroll-margin-top: 150px;
  }
}

@media (max-width: 520px) {
  .brand-mark {
    grid-template-columns: repeat(2, 12px);
    width: 27px;
    height: 27px;
  }

  .topbar h1 {
    font-size: 20px;
  }

  .section-heading {
    align-items: flex-start;
  }

  .step-number {
    width: 44px;
    height: 44px;
  }

  .video-frame,
  .video-frame video {
    min-height: 240px;
  }

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

  .manual-iid-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
