html { scrollbar-gutter: stable; }

/* reset */
:root {
  color-scheme: light;
  font-family: "Microsoft YaHei Light", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  background: linear-gradient(to right, #f0f1f4, #e3e6eb);
  color: #0d1f30;
}
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  min-height: 100vh;
  background: linear-gradient(to right, #f0f1f4, #e3e6eb);
  display: flex;
  justify-content: center;
  align-items: center;
}

.extractor-page.locked .shell {
  display: none;
}

.unlock-panel[hidden] {
  display: none;
}

.unlock-panel {
  width: 100%;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.unlock-card {
  width: min(420px, calc(100vw - 40px));
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 28px;
  padding: 34px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.94) inset,
    0 24px 58px rgba(13, 31, 48, 0.13),
    0 8px 20px rgba(13, 31, 48, 0.07);
}

.unlock-eyebrow {
  margin: 0 0 12px;
  color: #6a7783;
  font-size: 13px;
  letter-spacing: 0.16em;
}

.unlock-card h1 {
  margin: 0;
  color: #0d1f30;
  font-size: 34px;
  line-height: 1.2;
}

.unlock-copy {
  margin: 14px 0 24px;
  color: #5a6a78;
  font-size: 15px;
  line-height: 1.7;
}

.unlock-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.unlock-form input {
  min-width: 0;
  height: 44px;
  border: 1px solid rgba(13, 31, 48, 0.08);
  border-radius: 999px;
  padding: 0 16px;
  color: #0d1f30;
  background: #ffffff;
  font: 15px/1 "Microsoft YaHei Light", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  outline: none;
}

.unlock-form input:focus {
  border-color: rgba(13, 31, 48, 0.22);
  box-shadow: 0 0 0 4px rgba(13, 31, 48, 0.06);
}

.unlock-form button {
  height: 44px;
  border: none;
  border-radius: 999px;
  padding: 0 22px;
  color: #ffffff;
  background: #0d1f30;
  cursor: pointer;
  font: 700 15px/1 "Microsoft YaHei Light", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

.unlock-form button:disabled {
  cursor: default;
  opacity: 0.72;
}

.unlock-message {
  min-height: 22px;
  margin: 14px 0 0;
  color: #7c4850;
  font-size: 13px;
}

/* shell */
.shell {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 24px 20px;
}

/* title */
.title-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.app-logo {
  display: block;
  flex-shrink: 0;
  margin-bottom: 4px;
  line-height: 0;
}

.app-logo svg {
  display: block;
}

.app-title {
  font-size: 48px;
  font-weight: 900;
  font-family: "Microsoft YaHei", "PingFang SC", "Heiti SC", sans-serif;
  color: #0d1f30;
  letter-spacing: 2px;
  flex-shrink: 0;
  line-height: 1.2;
}

.app-subtitle {
  font-size: 18px;
  font-weight: 400;
  color: #5a6a78;
  margin: 0;
  letter-spacing: 1.5px;
}

.membership-button {
  position: fixed;
  top: 22px;
  right: 24px;
  z-index: 20;
  height: 32px;
  min-width: 86px;
  border: none;
  border-radius: 999px;
  padding: 0 12px;
  color: #0d1f30;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: none;
  cursor: pointer;
  font: 700 12px/1 "Microsoft YaHei Light", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  transition: transform 120ms ease, background 120ms ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.membership-button:hover {
  background: rgba(255, 255, 255, 0.78);
}

.membership-button:active,
.membership-button.is-pressed {
  transform: translateY(1px);
}

.membership-button.is-member {
  color: #ffffff;
  background: #0d1f30;
}

.membership-label {
  font-weight: 500;
  color: rgba(13, 31, 48, 0.68);
}

.membership-count {
  font-weight: 900;
  color: #0d1f30;
}

.membership-button.is-member .membership-label,
.membership-button.is-member .membership-count {
  color: #ffffff;
}

.membership-modal[hidden] {
  display: none;
}

.membership-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
}

.membership-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(13, 31, 48, 0.22);
  backdrop-filter: blur(6px);
}

.membership-dialog {
  position: relative;
  z-index: 1;
  width: min(360px, calc(100vw - 40px));
  border-radius: 24px;
  padding: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 252, 253, 0.94));
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.94) inset,
    0 26px 64px rgba(13, 31, 48, 0.22);
}

.membership-dialog h2 {
  margin: 0 0 18px;
  color: #0d1f30;
  font-size: 22px;
  font-weight: 900;
  text-align: center;
}

.membership-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  color: #6b7a85;
  background: rgba(13, 31, 48, 0.06);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.plan-list {
  display: flex;
  gap: 12px;
}

.plan-card {
  flex: 1;
  min-height: 112px;
  border: none;
  border-radius: 18px;
  padding: 18px 12px;
  color: #0d1f30;
  background: #ffffff;
  cursor: pointer;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 12px 28px rgba(13, 31, 48, 0.09);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.plan-card:active,
.plan-card.is-pressed {
  transform: translateY(1px);
}

.plan-name,
.plan-price {
  display: block;
  font-family: "Microsoft YaHei Light", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  font-weight: 900;
}

.plan-name {
  font-size: 16px;
}

.plan-price {
  margin-top: 12px;
  font-size: 28px;
}

/* workspace */
.workspace {
  width: min(1020px, calc(100vw - 40px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
}

/* input wrapper */
.input-wrapper {
  position: relative;
  width: 100%;
  padding: 0;
  border: none;
  border-radius: 22px;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.input-wrapper::before {
  content: none;
}
/* main textarea */
#mainText {
  width: 100%;
  min-height: 340px;
  max-height: 56vh;
  resize: none;
  border: none;
  border-radius: 22px;
  padding: 22px 40px 22px 40px;
  background: transparent;
  color: #0d1f30;
  font: 15px/1.72 "Microsoft YaHei Light", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  text-align: justify;
  outline: none;
  transition: background 160ms ease;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(13, 31, 48, 0.18) transparent;
}
#mainText:focus {
  outline: none;
}
#mainText::placeholder {
  color: #8e9aa8;
  text-align: left;
  font-family: "Microsoft YaHei Light", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  font-weight: 300;
  letter-spacing: 0.12em;
  line-height: normal;
}
#mainText.has-content {
  overflow-y: scroll;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-right: 46px;
}
#mainText.has-content
#mainText[readonly] {
  background: transparent;
  cursor: default;
  resize: none;
}

/* custom scrollbar - minimal */
#mainText::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}
#mainText::-webkit-scrollbar-button,
#mainText::-webkit-scrollbar-button:start:decrement,
#mainText::-webkit-scrollbar-button:end:increment,
#mainText::-webkit-scrollbar-button:horizontal:decrement,
#mainText::-webkit-scrollbar-button:horizontal:increment,
#mainText::-webkit-scrollbar-button:vertical:decrement,
#mainText::-webkit-scrollbar-button:vertical:increment {
  display: none;
}
#mainText::-webkit-scrollbar-track,
#mainText::-webkit-scrollbar-track-piece,
#mainText::-webkit-scrollbar-corner {
  background: transparent;
}
#mainText::-webkit-scrollbar-thumb {
  background: rgba(13, 31, 48, 0.22);
  border-radius: 99px;
  border: 1px solid transparent;
  background-clip: padding-box;
}
#mainText::-webkit-scrollbar-thumb:hover {
  background: rgba(13, 31, 48, 0.36);
  background-clip: padding-box;
}

/* fade bottom mask */


/* refresh button */
.refresh-btn {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(13, 31, 48, 0.08);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: background 140ms ease;
}
.refresh-btn:hover {
  background: rgba(13, 31, 48, 0.15);
}
.refresh-btn:active {
  background: rgba(13, 31, 48, 0.22);
}
.refresh-icon {
  font-size: 18px;
  color: #0d1f30;
  line-height: 1;
  font-weight: 900;
}

/* button row */
.button-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  flex-shrink: 0;
  height: 120px;
}

/* circle extract button */
.circle-extract {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  padding: 0;
  background: #0d1f30;
  border: none;
  color: #fff;
  font-size: 18px;
  font-family: "Microsoft YaHei Light", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  font-weight: 700;
  cursor: pointer;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.1) inset,
    0 14px 34px rgba(13, 31, 48, 0.18),
    0 4px 12px rgba(13, 31, 48, 0.09);
  transform: translateY(-1px);
  transition: transform 120ms ease, box-shadow 120ms ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  overflow: hidden;
  flex-shrink: 0;
}
.circle-extract:hover {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.12) inset,
    0 16px 38px rgba(13, 31, 48, 0.2),
    0 5px 14px rgba(13, 31, 48, 0.1);
}
.circle-extract:active,
.circle-extract.is-pressed {
  transform: translateY(1px);
}
.circle-extract:disabled {
  opacity: 1;
  cursor: default;
}

.circle-extract .phase-text,
.side-btn {
  font-family: "Microsoft YaHei Light", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  font-weight: 700;
}

/* dots inside circle button */
.dots-row {
  display: none;
  gap: 5px;
  line-height: 1;
}
.dots-row.visible {
  display: flex;
}
.dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255,255,255,0.86);
  opacity: 0.15;
  transition: opacity 100ms ease;
}
.dot.on {
  opacity: 1;
}

/* side buttons */
.side-btn {
   min-width: 114px;
  height: 42px;
  border-radius: 999px;
  padding: 0 22px;
  background: #ffffff;
  border: none;
  color: #6b7a85;
  font-size: 15px;
  font-family: "Microsoft YaHei Light", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  font-weight: 700;
  cursor: pointer;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.92) inset,
    0 14px 34px rgba(13, 31, 48, 0.1),
    0 4px 12px rgba(13, 31, 48, 0.06);
  transform: translateY(-1px);
  transition: background 120ms ease, border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
  flex-shrink: 0;
}
.side-btn:hover {
  background: rgba(13, 31, 48, 0.05);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.96) inset,
    0 16px 38px rgba(13, 31, 48, 0.12),
    0 5px 14px rgba(13, 31, 48, 0.07);
}
.side-btn:active {
  background: rgba(13, 31, 48, 0.10);
  transform: translateY(1px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.8) inset,
    0 7px 16px rgba(13, 31, 48, 0.08),
    0 2px 7px rgba(13, 31, 48, 0.05);
}
.side-btn:disabled {
  opacity: 1;
  cursor: default;
}

/* responsive */
@media (max-width: 600px) {
  .shell {
    padding: 16px 12px;
    gap: 18px;
  }
  .workspace {
    width: calc(100vw - 24px);
    gap: 16px;
  }
  #mainText {
    min-height: 260px;
    font-size: 14px;
    padding: 18px 42px 18px 16px;
  }
  .circle-extract {
    width: 84px;
    height: 84px;
    font-size: 16px;
  }
  .button-row {
    gap: 18px;
    height: 100px;
  }
  .side-btn {
    min-width: 64px;
    height: 38px;
    font-size: 14px;
  }
}


/* ===== custom scrollbar overlay ===== */
.scroll-wrapper {
  position: relative;
  z-index: 0;
  width: 100%;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 24px;
  background: #ffffff;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.92) inset,
    0 14px 34px rgba(13, 31, 48, 0.1),
    0 4px 12px rgba(13, 31, 48, 0.06);
  transform: translateY(-1px);
  transition: box-shadow 180ms ease, transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.scroll-wrapper::before {
  content: none;
}

.scroll-wrapper #mainText {
  position: relative;
  z-index: 0;
  width: 100%;
}

.input-wrapper:focus-within .scroll-wrapper {
  border-color: rgba(255, 255, 255, 0.86);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.96) inset,
    0 16px 38px rgba(13, 31, 48, 0.12),
    0 5px 14px rgba(13, 31, 48, 0.07);
  transform: translateY(-1px);
}

.scroll-wrapper.float-style {
  border: 1px solid rgba(255, 255, 255, 0.74);
  background: #ffffff;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.92) inset,
    0 14px 34px rgba(13, 31, 48, 0.1),
    0 4px 12px rgba(13, 31, 48, 0.06);
  transform: translateY(-1px);
}

/* custom scrollbar - hidden unless textarea overflows */
.custom-scrollbar {
  position: absolute;
  right: 2px;
  top: 22px;
  bottom: 22px;
  width: 4px;
  border-radius: 2px;
  background: rgba(13, 31, 48, 0.05);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
  z-index: 2;
  overflow: hidden;
}

/* only show track when thumb is non-zero (JS adds .visible) */
.custom-scrollbar.visible {
  opacity: 1;
  pointer-events: auto;
}

.custom-scrollbar-thumb {
  position: absolute;
  left: 0;
  width: 100%;
  min-height: 18px;
  border-radius: 2px;
  background: rgba(13, 31, 48, 0.15);
  cursor: pointer;
  transition: background 120ms ease;
}

.custom-scrollbar-thumb:hover,
.custom-scrollbar-thumb.dragging {
  background: rgba(13, 31, 48, 0.32);
}

.btn-active {
  background: #0d1f30 !important;
  border-color: #0d1f30 !important;
  color: #fff !important;
}
