:root {
  color-scheme: dark;
  --el-font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  --el-font-size-extra-large: 20px;
  --el-font-size-large: 18px;
  --el-font-size-medium: 16px;
  --el-font-size-base: 14px;
  --el-font-size-small: 13px;
  --el-font-size-extra-small: 12px;
  --el-border-radius-base: 4px;
  --el-border-radius-small: 2px;
  --el-box-shadow: 0 12px 32px 4px rgba(0, 0, 0, 0.04), 0 8px 20px rgba(0, 0, 0, 0.08);
  --el-box-shadow-light: 0 0 12px rgba(0, 0, 0, 0.12);
  --vip-transition: all 0.3s;
  --bg: #101010;
  --top: #303030;
  --panel: #333;
  --panel-2: #383838;
  --panel-3: #202020;
  --line: #4b4b4b;
  --text: #edf2f7;
  --muted: #a8b0bc;
  --blue: #2f8fe8;
  --green: #5ac836;
  --orange: #f0a032;
  --red: #ff666c;
}

* {
  box-sizing: border-box;
}

* {
  scrollbar-width: thin;
  scrollbar-color: #6d6d6d #252525;
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-track {
  background: #252525;
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
  background: #6d6d6d;
  border: 2px solid #252525;
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb:hover {
  background: #858585;
}

*::-webkit-scrollbar-corner {
  background: transparent;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--el-font-family);
  font-size: var(--el-font-size-base);
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html.theme-light {
  color-scheme: light;
  --bg: #eef0f4;
  background: var(--bg);
  scrollbar-color: #aeb5c0 #e3e6eb;
}

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

b,
strong,
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 400;
}

button {
  cursor: pointer;
  outline: none;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
  transform: none !important;
  box-shadow: none !important;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  width: 100%;
  min-height: 100vh;
  height: 100vh;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

.login-card {
  width: min(380px, 100%);
  border: 1px solid #4f4f4f;
  border-radius: var(--el-border-radius-base);
  padding: 24px;
  display: grid;
  gap: 16px;
  background: var(--panel);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
  transform: translateY(-6vh);
}

.login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: var(--el-font-size-large);
}

.login-brand img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.login-field {
  display: grid;
  gap: 7px;
  color: #d8dee9;
}

.login-field input {
  width: 100%;
  height: 34px;
  border: 1px solid #4b4b4b;
  border-radius: var(--el-border-radius-base);
  padding: 0 10px;
  color: var(--text);
  background: #262626;
  outline: none;
}

.login-field input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(47, 143, 232, 0.16);
}

.login-submit {
  width: 100%;
}

.login-message {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  text-align: center;
  font-size: var(--el-font-size-small);
}

.login-message.is-error {
  color: #ff8585;
}

.top-nav {
  height: 50px;
  background: var(--top);
  border-bottom: 1px solid #444;
  display: flex;
  align-items: center;
  padding: 0 16px 0 10px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  width: 208px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--el-font-size-large);
  white-space: nowrap;
}

.brand-logo {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  display: block;
  object-fit: contain;
}

.nav-tabs {
  display: flex;
  align-self: stretch;
}

.nav-item {
  min-width: 124px;
  height: 50px;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #e7edf6;
  background: transparent;
  font-size: var(--el-font-size-base);
  font-weight: 400;
  transition: var(--vip-transition);
}

.nav-item:hover,
.nav-item.is-active {
  color: #5bb0ff;
  background: #272727;
  border-bottom-color: var(--blue);
}

.nav-icon {
  font-size: 18px;
}

.nav-icon-home,
.nav-icon-disk,
.nav-icon-proxy {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-icon-proxy {
  width: 18px;
  height: 18px;
}

.nav-icon-home svg,
.nav-icon-disk svg,
.nav-icon-proxy svg {
  width: 16px;
  height: 16px;
}

.nav-icon-proxy svg {
  width: 18px;
  height: 18px;
}

.nav-icon-home svg {
  fill: currentColor;
}

.nav-icon-disk svg,
.nav-icon-proxy svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.35;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-icon-proxy svg {
  stroke-width: 1.8;
}

.theme-toggle {
  width: 52px;
  height: 28px;
  margin-left: auto;
  border: 0;
  border-radius: 999px;
  padding: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  background: #ff8500;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  transition: var(--vip-transition);
}

.top-settings-button {
  width: 30px;
  height: 30px;
  margin-left: 10px;
  border: 1px solid #4d4d4d;
  border-radius: var(--el-border-radius-base);
  padding: 0;
  display: inline-grid;
  place-items: center;
  color: #d9e2f0;
  background: #303030;
  transition: var(--vip-transition);
}

.top-settings-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.top-settings-button:hover {
  color: #5bb0ff;
  border-color: #4f9fe8;
  background: #262f38;
}

.theme-knob {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
  transition: transform 0.18s ease;
}

.theme-icon {
  width: 22px;
  text-align: center;
  font-size: var(--el-font-size-base);
  line-height: 1;
  transition: var(--vip-transition);
}

.theme-toggle:hover {
  transform: scale(1.08);
}

.theme-toggle:active {
  transform: scale(0.95);
}

body.theme-light .theme-toggle {
  color: #fff;
  background: #4b83ff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

body.theme-light .theme-knob {
  transform: translateX(24px);
  background: #fff;
}

body.theme-light .theme-icon {
  transform: translateX(-24px);
}

.main {
  min-height: calc(100dvh - 50px);
  overflow-x: hidden;
}

.toast-host {
  position: fixed;
  top: 70px;
  left: 50%;
  z-index: 80;
  width: min(520px, calc(100vw - 32px));
  display: grid;
  justify-items: center;
  gap: 8px;
  pointer-events: none;
  transform: translateX(-50%);
}

.toast-message {
  min-height: 36px;
  max-height: 44px;
  max-width: 100%;
  border: 1px solid #5d9d4d;
  border-radius: var(--el-border-radius-base);
  padding: 8px 20px;
  display: inline-flex;
  align-items: center;
  color: #7fe55f;
  background: rgba(24, 54, 22, 0.9);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  font-size: var(--el-font-size-base);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  transform-origin: top center;
  will-change: transform, opacity, max-height;
  transition: opacity 0.3s, transform 0.4s, max-height 0.4s, padding 0.4s, border-width 0.4s;
  animation: toast-in 0.3s cubic-bezier(0.23, 1, 0.32, 1) both;
}

.toast-message > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toast-message.is-error {
  color: #ff9a9a;
  background: rgba(76, 20, 24, 0.9);
  border-color: rgba(205, 69, 76, 0.78);
}

.toast-message.is-warn {
  color: #ffd37a;
  background: rgba(67, 48, 19, 0.9);
  border-color: rgba(164, 120, 37, 0.78);
}

.toast-message.is-leaving {
  animation: toast-out 0.4s cubic-bezier(0.23, 1, 0.32, 1) both;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toast-out {
  from {
    opacity: 1;
    max-height: 44px;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-top-width: 0;
    border-bottom-width: 0;
    transform: translateY(-100%);
  }
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.home-page {
  width: min(906px, calc(100% - 32px));
  margin: 38px auto 0;
  padding-bottom: 24px;
}

.parser-card,
.recent-card,
.disk-card,
.config-modal {
  border: 1px solid #4f4f4f;
  background: var(--panel);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

.parser-card {
  border-radius: 4px;
  padding: 20px;
  position: relative;
}

.notice-box {
  min-height: 128px;
  border-radius: 3px;
  padding: 10px 16px 12px;
  background: var(--panel-3);
  color: var(--muted);
  font-size: var(--el-font-size-base);
  line-height: 1.75;
  position: relative;
}

.hero-icon-box {
  min-height: 128px;
  display: grid;
  place-items: center;
}

.hero-icon {
  width: 82px;
  height: 82px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  color: #67b8ff;
  background:
    linear-gradient(135deg, rgba(47, 143, 232, 0.22), rgba(90, 200, 54, 0.1)),
    #242424;
  border: 1px solid rgba(103, 184, 255, 0.32);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 10px 26px rgba(0, 0, 0, 0.32);
}

.hero-icon img {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.pan-strip {
  margin-top: 18px;
  border: 1px solid #494949;
  border-radius: 4px;
  padding: 7px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px 14px;
  background: #353535;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.pan-strip a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--el-font-size-base);
  line-height: 1.25;
}

.pan-strip a {
  color: #45a4ff;
  text-decoration: none;
  transition: var(--vip-transition);
}

.pan-strip a:hover {
  color: #78bdff;
  transform: translateY(-1px);
}

.pan-strip img {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  object-fit: contain;
}

.pan-strip.is-error {
  color: var(--danger);
}

.stats-line {
  margin: 10px 0 18px;
  color: var(--muted);
  font-size: var(--el-font-size-base);
}

.stats-line span {
  color: #42a8ff;
}

.divider {
  height: 1px;
  background: #292929;
  margin-bottom: 22px;
}

.input-grid {
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr);
  gap: 1px;
  margin-bottom: 14px;
}

.input-prefix {
  height: 31px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: #303030;
  border: 1px solid #484848;
  border-right: 0;
  font-size: var(--el-font-size-base);
  font-weight: 400;
}

.input-grid input,
.dark-field input,
.dark-field textarea,
.form-row input,
.form-row textarea,
.login-disk-select,
.file-picker-filter,
#downloadUrl,
#directDownloadUrl {
  width: 100%;
  min-width: 0;
  border: 1px solid #4b4b4b;
  border-radius: 3px;
  background: #333;
  color: var(--text);
  outline: none;
}

.input-grid input,
.login-disk-select,
.file-picker-filter,
.form-row input {
  height: 32px;
  padding: 0 10px;
}

.input-grid input {
  color: #fff;
  font-size: var(--el-font-size-base);
  font-weight: 400;
}

.input-grid input::placeholder {
  color: #fff;
  font-size: var(--el-font-size-base);
  font-weight: 400;
  opacity: 1;
}

.share-url-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px;
  align-items: center;
  gap: 8px;
}

.login-disk-select {
  cursor: pointer;
  color: #dce3ee;
  background: #2f2f2f;
}

.form-row input:disabled {
  color: #c4cad3;
  background: #303030;
}

.dark-field {
  display: grid;
  gap: 6px;
  color: #d8dee9;
  font-weight: 400;
}

.dark-field textarea,
.form-row textarea,
#downloadUrl,
#directDownloadUrl {
  min-height: 92px;
  resize: vertical;
  padding: 9px 10px;
  line-height: 1.45;
}

.provider-cookie {
  margin: 0 0 16px;
}

.input-grid input:focus,
.login-disk-select:focus,
.file-picker-filter:focus,
.dark-field textarea:focus,
.form-row input:focus,
.form-row textarea:focus {
  border-color: #5aaeff;
  box-shadow: 0 0 0 1px rgba(64, 158, 255, 0.18);
}

.home-actions,
.result-actions,
.disk-actions,
.modal-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.home-actions {
  justify-content: center;
}

.btn,
.mini-btn,
.icon-btn {
  border: 1px solid #4d4d4d;
  border-radius: var(--el-border-radius-base);
  color: #dce3ee;
  background: #2f2f2f;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--vip-transition);
}

.btn {
  min-width: 60px;
  height: 32px;
  padding: 0 16px;
}

.btn:hover,
.mini-btn:hover {
  color: #409eff;
  border-color: #409eff;
  background: #343f4d;
}

.btn:active,
.mini-btn:active {
  color: #337ecc;
  border-color: #337ecc;
  transform: scale(0.98);
}

.btn.primary,
.mini-btn.primary {
  border-color: var(--blue);
  color: #fff;
  background: var(--blue);
}

.btn.primary:hover,
.mini-btn.primary:hover {
  color: #fff;
  border-color: #66b1ff;
  background: #66b1ff;
  box-shadow: var(--el-box-shadow-light);
}

.btn.green,
.mini-btn.green {
  border-color: #4a9f2d;
  color: #fff;
  background: #67c23a;
}

.btn.green:hover,
.mini-btn.green:hover {
  color: #fff;
  border-color: #3f8f26;
  background: #5daf34;
  box-shadow: var(--el-box-shadow-light);
}

.mini-btn.danger {
  border-color: var(--red);
  color: #fff;
  background: var(--red);
}

.mini-btn.danger:hover {
  border-color: #ff8589;
  background: #ff7378;
  color: #fff;
}

.mini-btn {
  height: 24px;
  min-width: 48px;
  padding: 0 11px;
  font-size: var(--el-font-size-small);
}

.proxy-test-button {
  gap: 6px;
}

.proxy-test-button.is-loading::before {
  content: "";
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  opacity: 0.65;
  animation: button-spin 0.72s linear infinite;
}

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

.icon-btn {
  width: 28px;
  height: 28px;
  border: 0;
  color: #aeb7c3;
  background: transparent;
  font-size: 22px;
}

.icon-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  transform: rotate(90deg);
}

.status-pill,
.mini-status,
.small-tag {
  min-height: 22px;
  border: 1px solid #4f4f4f;
  border-radius: 4px;
  padding: 1px 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #cdd5df;
  background: #2b2b2b;
  font-size: var(--el-font-size-extra-small);
}

.parser-card > .status-pill {
  position: absolute;
  right: 20px;
  bottom: 20px;
}

.mini-status.is-done,
.status-pill.is-done {
  color: #62e33e;
  background: #17370f;
  border-color: #3a7b2b;
}

.mini-status.is-warn {
  color: #ffcc66;
  background: #3a2b13;
  border-color: #72551f;
}

.status-pill.is-busy {
  color: #bfe0ff;
  background: #18324d;
  border-color: #2c6fa8;
}

.status-pill.is-error,
.mini-status.is-error {
  color: #ff8585;
  background: #3e1618;
  border-color: #793439;
}

.recent-card {
  margin-top: 32px;
  border-radius: var(--el-border-radius-base) var(--el-border-radius-base) 0 0;
  overflow: hidden;
}

.section-head,
.modal-head {
  min-height: 54px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #343434;
}

.recent-empty {
  height: 48px;
  padding: 14px 20px;
  color: var(--muted);
  background: #2a2a2a;
}

.result {
  padding: 16px 20px 20px;
  display: grid;
  gap: 14px;
}

.result .dark-field {
  font-size: var(--el-font-size-base);
  font-weight: 400;
}

#downloadUrl,
#directDownloadUrl {
  font-size: var(--el-font-size-base);
  font-weight: 400;
}

dl {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

dt {
  color: var(--muted);
  font-size: var(--el-font-size-extra-small);
}

dd {
  margin: 4px 0 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.result-count {
  display: none;
}

.config-page {
  width: min(916px, calc(100% - 32px));
  margin: 26px auto 0;
  padding-bottom: 24px;
}

.proxy-page {
  width: min(1206px, calc(100% - 32px));
}

.proxy-section {
  margin-bottom: 18px;
  border-radius: 0;
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.proxy-section-head {
  min-height: 32px;
  padding: 0;
  gap: 12px;
  background: transparent;
}

.proxy-section-head > span {
  margin-right: auto;
}

.proxy-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.proxy-list {
  min-height: 0;
  padding: 18px 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 378px));
  align-items: start;
  gap: 16px;
  background: transparent;
}

.proxy-card {
  min-height: 272px;
  border: 1px solid #4f4f4f;
  border-radius: var(--el-border-radius-base);
  padding: 16px 20px;
  display: grid;
  gap: 10px;
  background: #333;
  transition: var(--vip-transition);
}

.proxy-card:hover {
  border-color: #686868;
  background: #3a3a3a;
  transform: translateY(-2px);
  box-shadow: var(--el-box-shadow);
}

.proxy-card-head,
.proxy-title-wrap,
.proxy-card-info,
.proxy-card-actions,
.proxy-enable-button,
.proxy-port-control,
.switch-field {
  display: flex;
  align-items: center;
}

.proxy-card-head {
  padding-bottom: 8px;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #4b4b4b;
}

.proxy-title-wrap {
  min-width: 0;
  gap: 10px;
}

.proxy-title-wrap strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #edf2f7;
  font-size: 16px;
  font-weight: 600;
}

.proxy-card-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  object-fit: contain;
}

.proxy-card-icon-fallback {
  justify-content: center;
  color: #67b8ff;
  font-size: 18px;
  line-height: 1;
}

.proxy-address {
  height: 31px;
  padding: 5px 10px;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #cdd5df;
  background: #262626;
  border-radius: 2px;
  font-family: Consolas, "Courier New", monospace;
}

.proxy-card-info {
  min-width: 0;
  gap: 8px;
  color: #c4cad3;
  font-size: var(--el-font-size-small);
}

.proxy-card-info span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.proxy-info-icon {
  width: 18px;
  color: #f0a032;
  text-align: center;
}

.proxy-card-actions {
  margin-top: 8px;
  padding-top: 12px;
  justify-content: space-between;
  gap: 7px;
  border-top: 1px solid #4b4b4b;
}

.proxy-card-actions .mini-btn {
  width: 78px;
  min-width: 78px;
  height: 24px;
  padding: 0 8px;
}

.proxy-enable-button {
  width: 78px;
  height: 24px;
  border: 1px solid #4a9f2d;
  border-radius: var(--el-border-radius-base);
  justify-content: center;
  gap: 6px;
  color: #fff;
  background: #5ac836;
  font-size: var(--el-font-size-extra-small);
  cursor: pointer;
}

.proxy-enable-button::before {
  content: "↻";
  font-size: 12px;
  line-height: 1;
}

.proxy-enable-button.is-disabled {
  border-color: #4a9f2d;
  background: #5ac836;
}

.proxy-enable-button.is-enabled {
  border-color: #d98a22;
  background: #e6a23c;
}

.proxy-empty {
  grid-column: 1 / -1;
  min-height: 72px;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.proxy-modal {
  width: min(560px, calc(100% - 34px));
}

.proxy-editor-body {
  padding: 18px 16px 0;
  display: grid;
  gap: 12px;
}

.proxy-editor-body .form-row {
  grid-template-columns: 102px minmax(0, 1fr);
}

.proxy-editor-body .form-row > span b {
  color: #ff666c;
  font-weight: 400;
}

.proxy-editor-body select {
  width: 100%;
  height: 32px;
  border: 1px solid #4b4b4b;
  border-radius: 3px;
  padding: 0 10px;
  color: var(--text);
  background: #333;
  outline: none;
}

.proxy-editor-body textarea {
  min-height: 72px;
}

.proxy-port-control {
  width: 100%;
}

.proxy-port-control .mini-btn {
  width: 34px;
  min-width: 34px;
  height: 32px;
  border-radius: 3px 0 0 3px;
}

.proxy-port-control .mini-btn:last-child {
  border-radius: 0 3px 3px 0;
}

.proxy-port-control input {
  border-radius: 0;
  text-align: center;
}

.proxy-toggle-row {
  align-items: center;
}

.switch-field {
  width: 40px;
  height: 22px;
  position: relative;
}

.switch-field input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}

.switch-field i {
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: #59616c;
  position: relative;
  transition: var(--vip-transition);
}

.switch-field i::after {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 50%;
  position: absolute;
  left: 2px;
  top: 2px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: var(--vip-transition);
}

.switch-field input:checked + i {
  background: #409eff;
}

.switch-field input:checked + i::after {
  transform: translateX(18px);
}
.disk-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.disk-card {
  min-height: 180px;
  border-radius: var(--el-border-radius-base);
  padding: 16px;
  display: flex;
  gap: 13px;
  transition: var(--vip-transition);
}

.disk-card:hover {
  border-color: #686868;
  background: #3d3d3d;
  transform: translateY(-2px);
  box-shadow: var(--el-box-shadow);
}

.disk-icon {
  width: 36px;
  height: 36px;
  border-radius: 7px;
  object-fit: contain;
  background: #fff;
  flex: 0 0 auto;
}

.disk-icon.is-transparent {
  background: transparent;
}

.disk-icon-text {
  display: grid;
  place-items: center;
  color: #257be6;
  font-weight: 400;
}

.disk-main {
  min-width: 0;
  display: grid;
  gap: 6px;
  font-size: var(--el-font-size-small);
}

.disk-main h3 {
  margin: 0;
  font-size: var(--el-font-size-medium);
}

.disk-main p {
  margin: -4px 0 3px;
  color: var(--muted);
  font-size: var(--el-font-size-small);
}

.disk-actions {
  margin-top: 8px;
}

#securityEditor {
  width: min(780px, calc(100vw - 28px));
  max-height: min(760px, calc(100vh - 28px));
}

.system-settings-head {
  min-height: 66px;
  padding: 0 22px;
  border-bottom: 1px solid #474747;
}

.system-settings-title {
  display: grid;
  gap: 2px;
}

.system-settings-title > span {
  color: var(--text);
  font-size: 17px;
  font-weight: 600;
}

.system-settings-title small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.system-settings-layout {
  min-height: 390px;
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  background: #303030;
}

.system-settings-nav {
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-right: 1px solid #454545;
  background: #292929;
}

.system-settings-tab {
  width: 100%;
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0 15px;
  display: flex;
  align-items: center;
  color: #b6bec9;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  transition: border-color .18s ease, background .18s ease, color .18s ease, transform .18s ease;
}

.system-settings-tab:hover {
  color: var(--text);
  background: #343434;
}

.system-settings-tab:active {
  transform: translateY(1px);
}

.system-settings-tab.is-active {
  border-color: rgba(90, 174, 255, .58);
  color: #eaf4ff;
  background: linear-gradient(135deg, rgba(64, 158, 255, .2), rgba(64, 158, 255, .08));
  box-shadow: inset 3px 0 0 #409eff;
}


.system-settings-content {
  min-width: 0;
  padding: 24px 26px 22px;
  overflow-y: auto;
}

.system-settings-panel {
  display: grid;
  gap: 20px;
}

.system-settings-panel-head {
  min-height: 58px;
  padding-bottom: 16px;
  border-bottom: 1px solid #484848;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.system-settings-panel-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 600;
}

.system-settings-panel-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.system-settings-fields {
  display: grid;
  gap: 16px;
}

.system-settings-field {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

.system-settings-field > span {
  color: #d8dee9;
  font-size: 13px;
  text-align: right;
}

.system-settings-field input,
#analyticsExcludedLinks {
  width: 100%;
  min-width: 0;
  border: 1px solid #505050;
  border-radius: 5px;
  background: #282828;
  color: var(--text);
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.system-settings-field input {
  height: 38px;
  padding: 0 12px;
}

.system-settings-field input:focus,
#analyticsExcludedLinks:focus {
  border-color: #409eff;
  box-shadow: 0 0 0 3px rgba(64, 158, 255, .12);
}


#analyticsExcludedLinks {
  min-height: 184px;
  resize: vertical;
  padding: 12px 13px;
  line-height: 1.65;
}

.system-settings-footer {
  min-height: 64px;
  padding: 13px 20px;
  border-top: 1px solid #474747;
  background: #303030;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.68);
}

.config-modal {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 41;
  transform: translate(-50%, -50%);
  border-radius: var(--el-border-radius-base);
  overflow: hidden;
}

.edit-modal {
  width: min(520px, calc(100vw - 32px));
}

.qr-modal {
  width: min(420px, calc(100vw - 32px));
}

.editor-body {
  padding: 18px 16px 8px;
}

.editor-section {
  display: grid;
  gap: 16px;
}

.form-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  color: #d8dee9;
  font-size: var(--el-font-size-base);
}

.form-row > span {
  text-align: right;
  font-weight: 400;
}

.area-row {
  align-items: start;
}

.toggle-row input {
  width: 18px;
  height: 18px;
}

.modal-footer {
  justify-content: flex-end;
  padding: 14px 16px 16px;
}

.qr-body {
  padding: 24px 28px 10px;
  display: grid;
  justify-items: center;
  gap: 14px;
}

.qr-box {
  width: 260px;
  height: 260px;
  border-radius: 3px;
  display: grid;
  place-items: center;
  color: #a8b0bc;
  background: #fff;
  text-align: center;
}

.qr-box span {
  color: #555;
}

.qr-box img {
  width: 240px;
  height: 240px;
  object-fit: contain;
}

.qr-status {
  position: static;
  min-width: 80px;
}

#qrProvider {
  margin: 0;
  color: #d6dbe3;
}

.file-picker-modal {
  width: min(780px, calc(100vw - 32px));
}

.file-picker-body {
  padding: 16px;
  display: grid;
  gap: 12px;
}

.file-picker-toolbar {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.file-picker-path {
  min-height: 26px;
  min-width: 0;
  border: 1px solid #4b4b4b;
  border-radius: 3px;
  padding: 3px 8px;
  overflow: hidden;
  color: #cdd5df;
  background: #292929;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-picker-list {
  min-height: 240px;
  max-height: min(52vh, 420px);
  border: 1px solid #494949;
  border-radius: 3px;
  overflow: auto;
  background: #2a2a2a;
}

.file-picker-row {
  width: 100%;
  min-height: 44px;
  border-bottom: 1px solid #3d3d3d;
  padding: 0 12px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 64px 92px;
  align-items: center;
  gap: 10px;
  color: #e4ebf5;
  cursor: pointer;
  outline: none;
}

.file-picker-row:last-child {
  border-bottom: 0;
}

.file-picker-row:hover {
  background: #343f4d;
}

.file-picker-row:focus-visible {
  background: #343f4d;
  box-shadow: inset 0 0 0 1px #5aaeff;
}

.file-picker-icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex: 0 0 28px;
}

.file-picker-icon-shape {
  width: 24px;
  height: 20px;
  display: block;
  position: relative;
}

.file-picker-icon.is-folder .file-picker-icon-shape {
  margin-top: 4px;
  border-radius: 2px;
  background: linear-gradient(180deg, #ffc938 0%, #ffb716 100%);
  box-shadow: inset 0 -1px 0 rgba(184, 122, 0, 0.18);
}

.file-picker-icon.is-folder .file-picker-icon-shape::before {
  content: "";
  position: absolute;
  left: 2px;
  top: -4px;
  width: 9px;
  height: 5px;
  border-radius: 2px 2px 0 0;
  background: #ff9f12;
}

.file-picker-icon:not(.is-folder) .file-picker-icon-shape {
  width: 26px;
  height: 26px;
  border-radius: 5px;
  background: #f8fafb;
  box-shadow: inset 0 0 0 1px #eef2f4, 0 1px 2px rgba(0, 0, 0, 0.08);
}

.file-picker-icon:not(.is-folder) .file-picker-icon-shape::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 7px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #169bff;
  box-shadow: 0 5px 0 #169bff, 0 10px 0 #169bff;
}

.file-picker-icon:not(.is-folder) .file-picker-icon-shape::after {
  content: "";
  position: absolute;
  display: none;
}

.file-picker-icon.is-text .file-picker-icon-shape::before,
.file-picker-icon.is-app .file-picker-icon-shape::before,
.file-picker-icon.is-unknown .file-picker-icon-shape::before {
  display: none;
}

.file-picker-icon.is-text .file-picker-icon-shape::after {
  content: "TXT";
  display: block;
  left: 6px;
  top: 9px;
  color: #169bff;
  font-size: 7px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0;
  background: transparent;
}

.file-picker-icon.is-app .file-picker-icon-shape::after {
  content: "";
  display: block;
  left: 11px;
  top: 11px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #169bff;
  box-shadow: 0 -5px 0 #169bff, 0 5px 0 #169bff, -5px 0 0 #169bff, 5px 0 0 #169bff;
}

.file-picker-icon.is-unknown .file-picker-icon-shape::after {
  content: "?";
  display: block;
  left: 10px;
  top: 7px;
  color: #169bff;
  font-size: 13px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0;
  background: transparent;
}

.file-picker-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-picker-kind,
.file-picker-meta {
  color: var(--muted);
  font-size: var(--el-font-size-small);
  white-space: nowrap;
}

.file-picker-empty {
  padding: 24px 12px;
  color: var(--muted);
  text-align: center;
}

.file-picker-more {
  justify-self: center;
}

@media (max-width: 980px) {
  .disk-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .top-nav {
    height: auto;
    min-height: 50px;
    flex-wrap: wrap;
  }

  .brand {
    width: auto;
  }

  .nav-item {
    min-width: 96px;
  }

  .home-page,
  .config-page {
    width: min(100% - 20px, 906px);
    margin-top: 18px;
  }

  dl {
    grid-template-columns: 1fr;
  }

  .disk-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .proxy-list {
    grid-template-columns: 1fr;
  }

  .proxy-card-actions {
    flex-wrap: wrap;
  }

  .disk-card {
    min-height: 156px;
    padding: 12px;
    gap: 9px;
  }

  .disk-icon {
    width: 30px;
    height: 30px;
  }

  .disk-main {
    gap: 5px;
    font-size: 12px;
  }

  .disk-main h3 {
    font-size: 14px;
    line-height: 1.25;
  }

  .disk-main p,
  .mini-status {
    font-size: 12px;
  }

  .disk-actions {
    margin-top: 5px;
  }

  .input-grid,
  .form-row {
    grid-template-columns: 1fr;
  }

  .input-prefix,
  .form-row > span {
    justify-content: flex-start;
    text-align: left;
    border-right: 1px solid #484848;
    padding-left: 12px;
  }

  .file-picker-toolbar {
    grid-template-columns: repeat(2, auto);
  }

  .file-picker-path {
    grid-column: 1 / -1;
  }

  .file-picker-row {
    grid-template-columns: 28px minmax(0, 1fr) 58px 88px;
    gap: 8px;
    padding: 8px 10px;
  }

  .file-picker-meta {
    grid-column: 2;
  }

}

body.theme-light {
  --bg: #eef0f4;
  --top: #ffffff;
  --panel: #ffffff;
  --panel-2: #f7f8fa;
  --panel-3: #f5f6f8;
  --line: #d9dde4;
  --text: #20242a;
  --muted: #687181;
  background: var(--bg);
  color: var(--text);
}

body.theme-light::-webkit-scrollbar-track,
body.theme-light *::-webkit-scrollbar-track {
  background: #e3e6eb;
}

body.theme-light::-webkit-scrollbar-thumb,
body.theme-light *::-webkit-scrollbar-thumb {
  background: #aeb5c0;
  border-color: #e3e6eb;
}

body.theme-light .top-nav {
  background: #ffffff;
  border-bottom-color: #dfe3ea;
}

body.theme-light .login-card {
  background: #ffffff;
  border-color: #d9dde4;
  box-shadow: 0 10px 24px rgba(30, 41, 59, 0.12);
}

body.theme-light .login-field {
  color: #20242a;
}

body.theme-light .login-field input {
  color: #20242a;
  background: #ffffff;
  border-color: #c9d1dc;
}

body.theme-light .nav-item {
  color: #2f3742;
}

body.theme-light .nav-item:hover,
body.theme-light .nav-item.is-active {
  color: #1677d2;
  background: #eef5ff;
  border-bottom-color: #2f8fe8;
}

body.theme-light .parser-card,
body.theme-light .recent-card,
body.theme-light .disk-card,
body.theme-light .proxy-card,
body.theme-light .config-modal {
  border-color: #cfd6e0;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(30, 41, 59, 0.12);
}

body.theme-light .notice-box,
body.theme-light .recent-empty {
  background: #f0f2f5;
  color: #4b5563;
}

body.theme-light .hero-icon {
  color: #237bd5;
  background: linear-gradient(135deg, rgba(47, 143, 232, 0.16), rgba(90, 200, 54, 0.08)), #ffffff;
  border-color: #c8dbef;
}

body.theme-light .pan-strip {
  border-color: #cfd6e0;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(30, 41, 59, 0.1);
}

body.theme-light .divider {
  background: #d6dde7;
}

body.theme-light .stats-line {
  color: #687181;
}

body.theme-light .input-prefix {
  color: #20242a;
  background: #e9edf3;
  border-color: #c9d1dc;
}

body.theme-light .input-grid input,
body.theme-light .dark-field input,
body.theme-light .dark-field textarea,
body.theme-light .form-row input,
body.theme-light .form-row textarea,
body.theme-light .login-disk-select,
body.theme-light .file-picker-filter,
body.theme-light #downloadUrl,
body.theme-light #directDownloadUrl {
  color: #20242a;
  background: #ffffff;
  border-color: #c9d1dc;
}

body.theme-light .input-grid input::placeholder {
  color: #20242a;
}

body.theme-light .toast-message {
  color: #67c23a;
  background: rgba(240, 249, 235, 0.96);
  border-color: #e1f3d8;
  box-shadow: 0 10px 24px rgba(30, 41, 59, 0.14);
}

body.theme-light .toast-message.is-error {
  color: #f56c6c;
  background: rgba(254, 240, 240, 0.96);
  border-color: #fde2e2;
}

body.theme-light .toast-message.is-warn {
  color: #e6a23c;
  background: rgba(253, 246, 236, 0.96);
  border-color: #faecd8;
}

body.theme-light .btn,
body.theme-light .mini-btn,
body.theme-light .icon-btn {
  color: #20242a;
  background: #f2f4f7;
  border-color: #c9d1dc;
}

body.theme-light .btn:disabled,
body.theme-light .mini-btn:disabled {
  color: #7b8794;
  background: #eef1f5;
  border-color: #cbd3df;
  opacity: 1;
}

body.theme-light .btn:hover,
body.theme-light .mini-btn:hover {
  color: #409eff;
  background: #ecf5ff;
  border-color: #409eff;
}

body.theme-light .btn:active,
body.theme-light .mini-btn:active {
  color: #337ecc;
  border-color: #337ecc;
  transform: scale(0.98);
}

body.theme-light .btn.primary,
body.theme-light .mini-btn.primary {
  color: #fff;
  border-color: #409eff;
  background: #409eff;
}

body.theme-light .btn.primary:disabled,
body.theme-light .mini-btn.primary:disabled {
  color: #fff;
  border-color: #a0cfff;
  background: #a0cfff;
  opacity: 1;
}

body.theme-light .btn.green,
body.theme-light .mini-btn.green {
  color: #fff;
}

body.theme-light .btn.green,
body.theme-light .mini-btn.green {
  border-color: #4a9f2d;
  background: #67c23a;
}

body.theme-light .btn.primary:hover,
body.theme-light .mini-btn.primary:hover {
  color: #fff;
  border-color: #337ecc;
  background: #337ecc;
}

body.theme-light .btn.green:hover,
body.theme-light .mini-btn.green:hover {
  color: #fff;
  border-color: #3d8b25;
  background: #58aa36;
}

body.theme-light .system-settings-head,
body.theme-light .system-settings-footer {
  border-color: #d8dee7;
  background: #f8fafc;
}

body.theme-light .system-settings-layout,
body.theme-light .system-settings-content {
  background: #fff;
}

body.theme-light .system-settings-nav {
  border-color: #d8dee7;
  background: #f4f6f9;
}

body.theme-light .system-settings-tab {
  color: #4b5563;
}

body.theme-light .system-settings-tab:hover {
  color: #20242a;
  background: #e9eef5;
}

body.theme-light .system-settings-tab.is-active {
  border-color: #8fc7ff;
  color: #1769aa;
  background: linear-gradient(135deg, #eaf4ff, #f4f9ff);
}


body.theme-light .system-settings-panel-head {
  border-color: #dfe4eb;
}

body.theme-light .system-settings-field > span {
  color: #303844;
}

body.theme-light .system-settings-field input,
body.theme-light #analyticsExcludedLinks {
  border-color: #c9d1dc;
  color: #20242a;
  background: #fff;
}


@media (max-width: 680px) {
  #securityEditor {
    width: min(100% - 18px, 620px);
    max-height: calc(100vh - 18px);
  }

  .system-settings-head {
    min-height: 60px;
    padding: 0 16px;
  }

  .system-settings-layout {
    min-height: 0;
    max-height: calc(100vh - 142px);
    grid-template-columns: 1fr;
    overflow-y: auto;
  }

  .system-settings-nav {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 10px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-right: 0;
    border-bottom: 1px solid #454545;
  }

  .system-settings-tab {
    min-height: 44px;
    justify-content: center;
    padding: 0 10px;
    text-align: center;
  }

  .system-settings-content {
    padding: 20px 16px;
  }

  .system-settings-field {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .system-settings-field > span {
    text-align: left;
  }

  body.theme-light .system-settings-nav {
    border-bottom-color: #d8dee7;
  }
}
/* Mobile top navigation: keep all destinations on one horizontal row while
   leaving the theme and settings controls fixed at the right. */
@media (max-width: 760px) {
  .top-nav {
    height: 50px;
    min-height: 50px;
    flex-wrap: nowrap;
    gap: 6px;
    padding: 0 8px;
    overflow: hidden;
  }

  .brand {
    display: none;
  }

  .nav-tabs {
    min-width: 0;
    flex: 1 1 auto;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .nav-tabs::-webkit-scrollbar {
    display: none;
  }

  .nav-item {
    flex: 0 0 44px;
    min-width: 44px;
    height: 50px;
    padding: 0 4px;
    gap: 0;
    font-size: 13px;
    white-space: nowrap;
  }

  .nav-item .nav-icon,
  .nav-item .nav-label {
    display: none;
  }

  .nav-item::after {
    display: block;
    content: attr(data-mobile-label);
    line-height: 1;
  }

  .theme-toggle,
  .top-settings-button {
    flex: 0 0 auto;
  }

  .theme-toggle {
    margin-left: 2px;
  }

  .top-settings-button {
    margin-left: 0;
  }
}