/* Mobile-only config entry: left-edge reopen tab after settings collapse. PC unchanged. */
.toolbox-mobile-config-btn {
  display: none;
}
@media screen and (max-width: 991px) {
  .toolbox-mobile-config-btn {
    display: none;
    position: fixed;
    left: 0;
    top: 42%;
    transform: translateY(-50%);
    z-index: 1050;
    width: 36px;
    min-width: 36px;
    min-height: 88px;
    padding: 12px 6px;
    border: 0;
    border-radius: 0 14px 14px 0;
    background: #92400e;
    color: #fff;
    box-shadow: 4px 0 16px rgba(57, 37, 21, 0.22);
    font: 650 12px/1.15 system-ui, sans-serif;
    touch-action: manipulation;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    letter-spacing: 0.08em;
  }
  .toolbox-mobile-config-btn.is-visible {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }
  .toolbox-mobile-config-btn i {
    font-size: 14px;
    writing-mode: horizontal-tb;
    transform: none;
  }
  .toolbox-mobile-config-btn span {
    display: inline-block;
  }
  body.toolbox-mobile-settings-open .toolbox-mobile-config-btn {
    display: none !important;
  }
  /* Single settings entry: hide redundant "调整设置" on bottom bar */
  body.toolbox-mobile-config-ready .toolbox-mobile-actions [data-adjust] {
    display: none !important;
  }
  /* Panel tools: collapsed = preview first */
  body.toolbox-mobile-settings-collapsed .ks-panel,
  body.toolbox-mobile-settings-collapsed .cz-panel,
  body.toolbox-mobile-settings-collapsed .uc-panel {
    display: none !important;
  }
  .toolbox-mobile-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 12px;
    padding: 0 0 10px;
    border-bottom: 1px solid rgba(185, 106, 38, 0.18);
  }
  .toolbox-mobile-panel-head h2 {
    margin: 0;
    font-size: 15px;
    font-weight: 650;
    color: #574330;
  }
  .toolbox-mobile-panel-collapse {
    border: 0;
    min-height: 36px;
    padding: 6px 10px;
    border-radius: 8px;
    background: #fff4e5;
    color: #9a5b20;
    font: 600 13px/1.2 system-ui, sans-serif;
    touch-action: manipulation;
  }
  .toolbox-mobile-panel-collapse .drawer-collapse-label {
    display: inline-block;
    font-size: 12px !important;
  }
  .toolbox-mobile-panel-collapse .drawer-collapse-arrow {
    display: inline-block;
    font-size: 18px !important;
    line-height: 1;
    padding-left: 6px;
    vertical-align: -1px;
  }
  [data-theme="dark"] .toolbox-mobile-config-btn {
    background: #efb16f;
    color: #321c0d;
  }
  [data-theme="dark"] .toolbox-mobile-panel-head {
    border-bottom-color: #806a58;
  }
  [data-theme="dark"] .toolbox-mobile-panel-head h2 {
    color: #f5ece3;
  }
  [data-theme="dark"] .toolbox-mobile-panel-collapse {
    background: #4c3d31;
    color: #f0d2a0;
  }
}
@media print {
  .toolbox-mobile-config-btn,
  .toolbox-mobile-panel-head {
    display: none !important;
  }
}

/* Mobile toolbox config entry: stack the icon above the label instead of using vertical writing mode. */
@media screen and (max-width: 991px) {
  .toolbox-mobile-config-btn {
    width: 52px;
    min-width: 52px;
    padding: 10px 6px;
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    letter-spacing: 0;
  }
  .toolbox-mobile-config-btn.is-visible {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
  }
  .toolbox-mobile-config-btn i,
  .toolbox-mobile-config-btn span {
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    white-space: nowrap;
  }
  .toolbox-mobile-config-btn i {
    font-size: 16px;
    line-height: 1;
  }
  .toolbox-mobile-config-btn span {
    display: block;
    font-size: 12px;
    line-height: 1.2;
  }
}
