html {
    width: 100%;
    min-width: 775px;
    height: 100%;
    overflow: hidden;
    padding: 0;
    margin: 0;
    /*min-width: 1025px;*/
}

body {
    width: 100%;
    min-width: 775px;
    height: 100%;
    padding: 0;
    margin: 0;
    overflow: hidden;
    /*min-width: 1025px;*/
    /*-webkit-touch-callout: none; !* iOS Safari *!*/
    /*-webkit-user-select: none;   !* Chrome/Safari/Opera *!*/
    /*-khtml-user-select: none;    !* Konqueror *!*/
    /*-moz-user-select: none;      !* Firefox *!*/
    /*-ms-user-select: none;       !* Internet Explorer/Edge *!*/
    /*user-select: none;           !* Non-prefixed version, currently*/
    /*not supported by any browser *!*/
}

p {
    margin: 15px 0 15px 0;
}

/* 层级靠字号与颜色而非加粗：正文强调 600，面板小节标题 500 */
b,
strong {
    font-weight: 600;
}
#controls b,
#controlsLeft b,
#basicUI b {
    font-weight: 500;
}

/* 数字读数统一等宽数字格式 */
#controls,
#controlsLeft,
#basicUI,
#controlsBottom {
    font-variant-numeric: tabular-nums;
}

#basicUI {
    position: absolute;
    top: 53px;
    font-size: 14px;
    color: var(--text-primary);
    text-align: right;
    right: 0px;
    width: 400px;
    padding: 20px 20px;
}
#showAdvancedOptions {
    color: var(--text-primary);
    font-weight: 500;
}
#hideAdvancedOptions {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
    text-align: right;
    width: 100%;
    display: inline-block;
}

#controlsBottom {
    width: 100%;
    min-width: 775px;
    max-width: 850px;
    margin: auto;
    position: absolute;
    bottom: 0;
    right: 0;
    left: 0;
    height: 110px;
    font-weight: 500;
}
#controlsBottom > div {
    display: inline-block;
}
#bottomSliderContainer {
    text-align: center;
    position: absolute;
    right: 350px;
    left: 250px;
    margin-top: 20px;
}
#bottomSliderContainer > span {
    font-size: 14px;
}
#creasePercentBottom {
    width: 100%;
    margin-top: 16px;
    margin-bottom: 4px;
}
#creasePercentBottom > .flat-slider {
    width: 100%;
    margin: 0;
    background: var(--fill-soft);
}
.sliderEndPt {
    text-align: center;
    width: 100px;
    position: absolute;
    top: -32px;
    color: var(--text-primary);
    line-height: 18px;
}
#flatIndicator {
    left: -50px;
    top: -15px;
}
.sliderEndPt > img {
    width: 100%;
}
#foldedIndicator {
    right: -50px;
    top: -15px;
}
.sliderEndPt > .fui-triangle-down {
    display: block;
    color: var(--text-primary);
    margin-top: 0px;
}
.sliderEndPtLabel {
    color: var(--text-primary);
    display: block;
    /*margin-top: 30px;*/
}

#viewToggle {
    left: 30px;
}
#controlsToggle {
    right: 140px;
}
.preserveAspect {
    width: auto;
}
.bigToggle {
    height: 90px;
    width: 140px;
    text-align: center;
    position: absolute;
    font-size: 14px;
    /*border: 1px solid var(--text-primary);*/
}
.bigToggle > div {
    border: 1px solid var(--border-strong);
    background: var(--surface);
    height: 70px;
    overflow: hidden;
    border-radius: 10px;
    margin-bottom: 4px;
}
.bigToggle > div div {
    padding: 5px;
    width: 50%;
    height: 100%;
    display: inline-block;
    text-align: center;
    font-size: 12px;
    color: var(--text-primary);
}
.bigToggle div.active {
    background: var(--fill-soft);
}
.bigToggle .separator {
    width: 1px;
    height: 68px;
    position: absolute;
    background: var(--border-strong);
    padding: 0;
    margin: 0;
}
.bigToggle img {
    display: inline-block;
    height: 40px;
}
.bigToggle span {
    display: block;
    width: 100%;
}

#resetBottom {
    position: absolute;
    right: 30px;
    top: 12px;
    color: var(--text-primary);
    font-weight: 500;
}

#controls {
    position: absolute;
    top: 53px;
    bottom: 0;
    right: -430px;
    width: 430px;
    padding: 20px;
    overflow: auto;
    background: var(--panel-overlay);
    border-left: 1px solid var(--border);
}
#controls > a {
    /*float:right;*/
}
#controlsLeft {
    position: absolute;
    bottom: 0;
    left: -420px;
    width: 420px;
    top: 53px;
    padding: 20px;
    max-height: 100%;
    overflow: auto;
    background: var(--panel-overlay);
    border-right: 1px solid var(--border);
}
#controlsLeft .radio {
    width: 240px;
}

.sliderInput {
    float: right;
    display: inline-block;
    margin-bottom: 15px;
}
.sliderContainer {
    display: block;
    margin-bottom: 15px;
}

.indent {
    padding-left: 20px;
}
.doubleIndent {
    padding-left: 40px;
}

#gpuMathCanvas {
    display: none;
}

a,
a:hover,
a:visited,
a:focus {
    color: var(--color-primary);
}

/* 主色按钮上的文字与按钮底色保持一致的深色，:visited 不再回退为白色 */
a.btn-primary:visited,
a.btn-primary:focus,
a.btn-success:visited,
a.btn-success:focus {
    color: var(--color-on-accent);
}
a.btn-default:visited,
a.btn-default:focus {
    color: var(--text-primary);
}

button {
    border: 0;
    outline: none;
}

.editable {
    color: var(--text-primary);
    height: 42px;
    display: inline-block;
    line-height: 42px;
    width: 70px;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}
.editable:hover {
    color: var(--text-primary);
    cursor: text;
}
.editableInput {
    display: none;
    outline: grey;
    padding: 5px 7px;
    height: 42px;
    line-height: 42px;
}
.editableInput:focus {
    outline: grey;
    border: none;
}

input.form-control {
    width: 90px;
    display: inline-block;
}

.radioSlider {
    display: inline-block;
    float: right;
}

.form-control,
.select2-search input[type='text'] {
    height: 35px;
}

.floatRight {
    float: right;
}

#threeContainer {
    width: 100%;
    height: 100%;
    padding: 0;
    position: absolute;
    top: 0px;
    left: 0px;
}

.slider.slider-horizontal {
    width: 200px;
    margin: 0;
    padding: 20px;
    top: 10px;
}

.slider.slider-vertical {
    height: 200px;
    margin: 0;
    padding: 20px;
}

.flat-slider.ui-corner-all,
.flat-slider .ui-corner-all {
    border-radius: 0;
}

.flat-slider.ui-slider {
    border: 0;
    background: var(--fill-soft);
    border-radius: 3px;
}

.flat-slider.ui-slider-horizontal {
    height: 6px;
}

.flat-slider.ui-slider-vertical {
    width: 6px;
}

.flat-slider .ui-slider-handle {
    width: 20px;
    height: 20px;
    background: var(--control-strong);
    border-radius: 50%;
    border: none;
    cursor: pointer;
}

.flat-slider.ui-slider-horizontal .ui-slider-handle {
    top: 50%;
    margin-top: -10px;
    opacity: 0.8;
}

.flat-slider.ui-slider-vertical .ui-slider-handle {
    left: 50%;
    margin-left: -10px;
    opacity: 0.8;
}

.flat-slider .ui-slider-handle:hover {
    opacity: 0.7;
}

.flat-slider .ui-slider-handle:focus {
    outline: none;
}

.flat-slider {
    vertical-align: middle;
    display: inline-block;
    width: 130px;
    position: relative;
    margin: 10px 10px 10px 10px;
    /*padding: 4px 0;*/
}

.modal-content {
    border-radius: 12px;
}
.modal-body {
    padding: 20px 35px;
}

span.modal-close {
    display: none;
}
.titleSpan {
    display: inline-block;
    width: 100%;
    margin-top: 15px;
}
.form-control:focus {
    border-color: var(--control-strong);
}

.checkbox input.custom-checkbox[type='checkbox']:checked + .icons .icon-checked,
.radio input.custom-checkbox[type='checkbox']:checked + .icons .icon-checked,
.checkbox input.custom-radio[type='radio']:checked + .icons .icon-checked,
.radio input.custom-radio[type='radio']:checked + .icons .icon-checked {
    color: var(--control-strong);
}
.checkbox .icon-checked,
.radio .icon-checked,
.checkbox .icon-unchecked,
.radio .icon-unchecked {
    color: var(--icon-muted);
}

.radio .icon-checked {
    transition-duration: 0s;
}

.radio .icon-unchecked {
    transition-duration: 0s;
}

.sliderInput > .flat-slider {
    width: 90px;
}

.label-slider {
    font-size: 15px;
}

.extraSpace {
    display: inline-block;
    width: 100%;
    height: 15px;
}

.flipped {
    direction: rtl;
}
.flipped > div {
    direction: ltr;
}

.paddingBottom {
    margin-bottom: 20px;
}

#svgViewer {
    /* 折痕图 SVG 的生成容器（保存 SVG、判断图案是否存在都依赖它）。
       页面上不再全屏展示，由右下角缩略图 #patternThumb 镜像显示 */
    display: none;
}
svg {
    width: 100%;
    height: 100%;
}

/* 右上角视图立方体：同步主相机朝向，点击面切换视图 */
#viewCube {
    position: fixed;
    top: 96px;
    right: 16px;
    z-index: 4;
    width: 110px;
    height: 110px;
    transition: transform 0.3s ease;
}
#viewCube canvas {
    display: block;
}
#viewCube.panel-open {
    transform: translateX(-430px); /* 面板宽 430 + 右移 16 边距，避免遮住"隐藏高级选项" */
}
/* home 归位按钮：浮在立方体左下角，点击回到默认等轴视图 */
#viewCubeHome {
    position: absolute;
    left: -2px;
    bottom: -2px;
    width: 24px;
    height: 24px;
    padding: 4px;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}
#viewCubeHome svg {
    display: block;
    width: 100%;
    height: 100%;
}
#viewCubeHome:hover {
    background: var(--fill-soft);
    color: var(--text-primary);
}

/* 右下角折痕图胶囊：默认收起，点击展开小图，再点击小图放大 */
#patternThumb {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}
#patternThumbCapsule {
    display: flex;
    align-items: center;
    padding: 5px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}
#patternThumbCapsule:hover {
    background: var(--fill-soft);
}
.pattern-thumb-caret {
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    margin-right: 6px;
    transform: rotate(-90deg); /* 收起时指向右侧 */
    transition: transform 0.18s ease;
}
#patternThumb.expanded .pattern-thumb-caret {
    transform: rotate(0deg);
}
#patternThumbPreview {
    width: 150px;
    height: 150px;
    margin-bottom: 8px;
    background: var(--pattern-bg); /* 纸面固定白色，两主题下折痕线均可读 */
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    cursor: zoom-in;
    overflow: hidden;
    transform-origin: bottom right;
    transition: opacity 0.18s ease, transform 0.18s ease;
}
#patternThumbPreview.collapsed {
    opacity: 0;
    transform: translateY(10px) scale(0.9);
    pointer-events: none;
    visibility: hidden;
}
#patternThumbBody {
    width: 100%;
    height: 100%;
    padding: 6px;
    overflow: hidden;
}

/* 折痕图放大灯箱 */
#patternLightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    padding: 40px;
}
#patternLightbox.open {
    display: flex;
}
#patternLightboxPanel {
    display: flex;
    flex-direction: column;
    width: 90vw;
    max-width: 1000px;
    height: 85vh;
    max-height: 900px;
    background: var(--pattern-bg); /* 纸面固定白色，两主题下折痕线均可读 */
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
#patternLightboxHeader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 14px;
    background: var(--fill-soft);
    border-bottom: 1px solid var(--border-strong);
    color: var(--text-primary);
    font-weight: 500;
    flex: none;
}
#patternLightboxClose {
    border: none;
    background: none;
    font-size: 28px;
    line-height: 1;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0 4px;
}
#patternLightboxClose:hover {
    color: var(--color-danger);
}
#patternLightboxBody {
    flex: 1;
    min-height: 0;
    padding: 12px;
    overflow: hidden;
}

@media only screen and (max-width: 1250px) {
    /* 窄屏时底部中央控件可能与右下角胶囊重叠，将其抬高到控件条上方 */
    #patternThumb {
        bottom: 126px;
    }
}
@media only screen and (max-width: 768px) {
    #patternThumb {
        right: 10px;
    }
    #patternThumbPreview {
        width: 110px;
        height: 110px;
    }
    #viewCube {
        transform: scale(0.72);
        transform-origin: top right;
        top: 88px;
        right: 10px;
    }
    #viewCube.panel-open {
        transform: scale(0.72) translateX(-430px);
    }
}

.hexVal {
    border-width: 4px;
}

#warningMessage {
    padding: 30px 0;
    text-align: center;
    margin: 0 18px;
}

/* 帮助问号图标取弱化文本角色色，不与正文争夺注意力 */
.about {
    margin-right: 10px;
    color: var(--icon-muted) !important;
    font-size: 18px;
    line-height: 18px;
}
.about:hover {
    color: var(--text-secondary) !important;
}
#controls .about,
#basicUI .about {
    position: absolute;
    line-height: 1.7;
    margin-top: 2px;
    right: 5px;
}

#aboutError {
    line-height: 2;
}
#aboutStiffness {
    line-height: 28px;
}

#aboutUserInteraction {
    margin-top: 10px !important;
    line-height: 21px !important;
}

#aboutVR {
    float: none;
    margin-left: 40px;
    position: absolute;
    line-height: 1.7;
    margin-top: 2px;
}

#start,
#stepForwardOptions {
    display: none;
}
#stepForwardOptions {
    width: 100%;
}
#reset {
    margin-left: 20px;
}

#creasePercentNav {
    margin-bottom: 0;
    margin-top: 12px;
    color: white;
    display: none;
}

.bigLabel {
    font-size: 16px;
    margin-top: 20px;
}
.checkbox.bigLabel .icons,
.radio .icons {
    top: 2px;
}

.smallTxt {
    font-size: 14px;
}
input.form-control.bigInput {
    width: 300px;
}

.actionButton {
    min-width: 110px;
    font-size: 16px;
}

#unitsDropdown {
    height: 100px;
    overflow: auto;
}

.modal img {
    width: 200px;
}

a.seeMore {
    float: none !important;
    color: var(--text-primary);
}
a.seeMore > .fui-triangle-down {
    display: inline-block;
    margin-right: 10px;
}
a.seeMore.closed > .fui-triangle-down {
    -ms-transform: rotate(-90deg); /* IE 9 */
    -webkit-transform: rotate(-90deg); /* Chrome, Safari, Opera */
    transform: rotate(-90deg);
}

.hide {
    display: none;
}

.inlineBlock {
    display: inline-block;
}

.alignRight {
    text-align: right;
}

.fullWidth {
    width: 100%;
}

#simulationSettings,
#errorInfo,
#animationsSettings,
#cameraAngle,
#edgeVisibility,
#virtualReality,
#materialSettings {
    margin-top: 15px;
}
.modal-body img {
    margin-left: auto;
    margin-right: auto;
    display: block;
}

.colorSwatch {
    display: inline-block;
    width: 20px;
    height: 10px;
    margin-right: 10px;
    margin-bottom: 2px;
}

#authorMoreInfo {
    display: none;
    position: absolute;
    top: 0px;
    left: 100px;
    z-index: 5;
}
#authorMoreInfo > #authorContent {
    font-size: 14px;
    background: var(--surface-alt);
    padding: 16px 24px;
    margin-left: 20px;
    color: var(--text-primary);
    white-space: normal;
    width: 300px;
    border: 1px solid var(--border-strong);
}

#authorMoreInfo a,
#authorMoreInfo a:hover,
#authorMoreInfo a:visited,
#authorMoreInfo a:focus {
    color: var(--color-primary) !important;
}

#authorMoreInfo:after {
    content: '';
    display: block;
    position: absolute;
    top: 19px;
    left: 11px;
    width: 20px;
    height: 20px;
    background: var(--surface-alt);
    border-left: 1px solid var(--border-strong);
    border-bottom: 1px solid var(--border-strong);
    -ms-transform: rotate(45deg); /* IE 9 */
    -moz-transform: rotate(45deg);
    -webkit-transform: rotate(45deg);
    transform: rotate(45deg);
}

#helper {
    display: none;
    position: absolute;
    padding: 8px 16px;
    font-size: 14px;
    background: var(--surface-alt);
    margin-top: 20px;
    opacity: 0;
    top: 54px;
    -webkit-transition: opacity 1s; /* For Safari 3.1 to 6.0 */
    transition: opacity 1s;
    left: 140px;
    color: var(--text-primary);
    white-space: normal;
    border: 1px solid var(--border-strong);
    /*transition-timing-function: easeInOutCubic;*/
}

#helper:after {
    content: '';
    display: block;
    position: absolute;
    top: -12px;
    left: 105px;
    width: 20px;
    height: 20px;
    background: var(--surface-alt);
    border-left: 1px solid var(--border-strong);
    border-top: 1px solid var(--border-strong);
    -ms-transform: rotate(45deg); /* IE 9 */
    -moz-transform: rotate(45deg);
    -webkit-transform: rotate(45deg);
    transform: rotate(45deg);
}

#screenCaptureModal .modal-content,
#animationSetupModal .modal-content {
    background: var(--modal-overlay);
}

#recordStatus {
    position: absolute;
    bottom: 20px;
    width: 350px;
    left: 0;
    right: 0;
    margin: 0 auto;
    z-index: 2;
    display: none;
}
#stopRecord {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.animationStep {
    margin: 7px 0;
    display: inline-block;
    padding: 5px 15px;
    background: var(--surface);
}
#animationSetupModal p,
#animationSetupModal ul,
#animationSetupModal div.btns {
    text-align: center;
    padding: 0;
}
.warning {
    color: var(--color-warning);
}

.red {
    color: var(--color-danger) !important;
}

#coverImg {
    z-index: 5;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

object {
    width: 100%;
    margin-bottom: 10px;
}

#aboutCorner {
    display: none;
    position: absolute;
    z-index: 6;
    top: 0;
    right: 0;
    background: rgba(40, 40, 40, 0.7);
    width: 30px;
    text-align: center;
    color: white;
}

#noSupportModal {
    text-align: center;
}

#tipImportSVG {
    float: left;
    display: inline-block;
    margin-top: 8px;
    margin-left: 20px;
}

@media only screen and (max-width: 1180px) {
    #PackCADLink {
        display: none;
    }
}
