@font-face {
  font-family: "code";
  src: url("../media/fonts/PixelifySans-Regular.woff2") format("woff2"),
       url("../media/fonts/PixelifySans-Regular.woff") format("woff");
}
   
body {
    margin: 0;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    background: #0f0f0f;
    color: #99caff; 
    font-family: "code", monospace;
    overflow: hidden;
    color-scheme: dark;
} 
#imageHolder {
    position: absolute;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
}
#buttonContainer {
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: center;
    height: 60px; 
}
    
#buttonContainer button {
    background: none;
    border: none;
    color: #99edff;
    font-family: "code", monospace;
    font-size: 35px;
    cursor: pointer;
    text-shadow:
    0 0 10px rgba(153, 237, 255, 0.8),
    0 0 20px rgba(153, 237, 255, 0.5),
    0 0 40px rgba(0, 183, 235, 0.3);
}
    
#buttonContainer button:hover {
    opacity: 0.7;
}

#forkLink {
    position: absolute;
    bottom: 20px;
    right: 20px;
    color: #99caff;
    text-decoration: none;
    font-size: 16px;
    opacity: 0.7;
}

#forkLink:hover {
    opacity: 1;
    text-decoration: underline;
}

#factoryResetBtn {
    position: absolute;
    bottom: 45px;
    right: 20px;
    background: none;
    border: none;
    color: #ff6b6b;
    font-family: "code", monospace;
    font-size: 16px;
    cursor: pointer;
    opacity: 0.7;
    padding: 0;
}
#factoryResetBtn:hover:not([disabled]) {
    opacity: 1;
    text-decoration: underline;
}
#factoryResetBtn[disabled] {
    opacity: 0.3;
    cursor: not-allowed;
}

#guideLink {
    position: absolute;
    bottom: 20px;
    left: 20px;
    color: #99caff;
    text-decoration: none;
    font-size: 16px;
    opacity: 0.7;
}
#guideLink:hover {
    opacity: 1;
    text-decoration: underline;
}

.modal {
    display: none;
    position: fixed;
    z-index: 20;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: transparent;
}
.modal-content {
    background-color: #0f0f0f;
    border: 1px solid #99edff;
    margin: 10% auto;
    padding: 20px;
    width: 80%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    color: #99edff;
    box-shadow: 0 0 20px rgba(153, 237, 255, 0.5);
    font-family: "code", monospace;
}
#closeCustoms, #closeSettings {
    color: #99caff;
    align-self: flex-end;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}
#closeCustoms:hover, #closeSettings:hover {
    color: #fff;
}
.custom-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #333;
}
.custom-item span {
    flex-grow: 1;
}

.modal-body {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 15px;
    margin-bottom: 15px;
}
.modal-body::-webkit-scrollbar {
    width: 8px;
}
.modal-body::-webkit-scrollbar-track {
    background: transparent;
    border-left: 1px dashed #333;
}
.modal-body::-webkit-scrollbar-thumb {
    background: #99edff;
    border-radius: 0;
}
.modal-body::-webkit-scrollbar-thumb:hover {
    background: #fff;
}

.modal-content input[type="number"], .modal-content input[type="text"], .modal-content select {
    padding: 5px;
    font-family: "code", monospace;
    background: #000;
    color: #99edff;
    border: 1px solid #99edff;
}
.modal-content input[type="number"] {
    width: 60px;
}

#timerDisplay {
    font-size: 35px;
    font-family: 'code', monospace;
    color: #99edff;
    margin: 0 20px;
    text-shadow: 0 0 10px rgba(153, 237, 255, 0.8);
}

@media (max-width: 600px) {
    #buttonContainer button {
        font-size: 24px;
    }
    #buttonContainer {
        gap: 10px;
    }
    #timerDisplay {
        font-size: 24px;
        margin: 0 10px;
    }
    #forkLink, #guideLink, #factoryResetBtn {
        font-size: 10px;
    }
    #guideLink {
        bottom: 10px;
        left: 10px;
    }
    #forkLink {
        bottom: 10px;
        right: 10px;
    }
    #factoryResetBtn {
        bottom: 30px;
        right: 10px;
    }
}

.custom-item button {
    background: none;
    border: 1px solid #99edff;
    color: #99edff;
    cursor: pointer;
    font-family: "code", monospace;
    padding: 5px 10px;
    margin-left: 10px;
}
.custom-item button:hover {
    background: #99edff;
    color: #000;
}
#newCustomInput {
    width: 60%;
    padding: 5px;
    font-family: "code", monospace;
    background: #000;
    color: #99edff;
    border: 1px solid #99edff;
}
#addCustomBtn, #saveSettingsBtn, #sendCustomBtn, #exportPrescriptsBtn, #importPrescriptsBtn, #colorizeBtn, #previewNewBtn {
    background: none;
    border: 1px solid #99edff;
    color: #99edff;
    padding: 5px 10px;
    cursor: pointer;
    font-family: "code", monospace;
}
#addCustomBtn:hover, #saveSettingsBtn:hover, #sendCustomBtn:hover, #exportPrescriptsBtn:hover, #importPrescriptsBtn:hover, #colorizeBtn:hover, #previewNewBtn:hover {
    background: #99edff;
    color: #000;
}

.tab-btn {
    background: none;
    border: none;
    color: #555;
    font-family: "code", monospace;
    font-size: 1em;
    cursor: pointer;
    padding: 5px 0;
    transition: all 0.2s;
}
.tab-btn:hover {
    color: #99edff;
}
.tab-btn.active {
    color: #99edff;
    border-bottom: 2px solid #99edff;
    text-shadow: 0 0 10px #99edff;
}

#visualEditorContainer {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    overflow: hidden;
}

#customsList {
    flex-grow: 1;
    overflow-y: auto;
    min-height: 100px;
    margin-top: 15px;
    padding-right: 5px;
}

#customsList::-webkit-scrollbar {
    width: 6px;
}
#customsList::-webkit-scrollbar-track {
    background: transparent;
}
#customsList::-webkit-scrollbar-thumb {
    background: #99edff;
    border-radius: 0;
}

#newCustomDuration, #autoSleepInput {
    width: 60px;
    padding: 5px;
    font-family: "code", monospace;
    background: #000;
    color: #99edff;
    border: 1px solid #99edff;
}

#settingsBtn {
    position: absolute;
    top: 20px;
    left: 20px;
    background: none;
    border: none;
    color: #99caff;
    font-family: "code", monospace;
    font-size: 16px;
    cursor: pointer;
    opacity: 0.7;
    padding: 0;
    z-index: 100;
}
#settingsBtn:hover:not([disabled]) {
    opacity: 1;
    text-decoration: underline;
}
#settingsBtn[disabled] {
    opacity: 0.3;
    cursor: not-allowed;
}

.sync-modal-desc {
    font-size: 14px;
    margin-bottom: 30px;
}

.sync-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sync-btn {
    background: none;
    padding: 15px;
    font-family: "code", monospace;
    font-size: 18px;
    cursor: pointer;
}

.sync-btn--override {
    border: 1px solid #ff6b6b;
    color: #ff6b6b;
    text-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
}

.sync-btn--merge {
    border: 1px solid #99edff;
    color: #99edff;
    text-shadow: 0 0 10px rgba(153, 237, 255, 0.5);
}

.sync-btn span {
    font-size: 12px;
    opacity: 0.8;
}

#closeSync {
    align-self: flex-end;
    cursor: pointer;
    color: #99caff;
    font-size: 28px;
    font-weight: bold;
}
#closeSync:hover {
    color: #fff;
}

.custom-item-text {
    flex-grow: 1;
    margin-right: 10px;
    padding: 5px;
    background: transparent;
    color: #99caff;
    border: 1px solid transparent;
    font-family: "code", monospace;
}
.custom-item-text:focus {
    border: 1px solid #99edff;
    outline: none;
}

.custom-item-duration {
    width: 40px;
    padding: 5px;
    background: transparent;
    color: #99caff;
    border: 1px solid transparent;
    font-family: "code", monospace;
}
.custom-item-duration:focus {
    border: 1px solid #99edff;
    outline: none;
}

input[type="checkbox"] {
    accent-color: #99edff;
}

/* 中文字体回退链：保留 "code" 像素字体渲染英文，中文回退至系统字体 */
*, *::before, *::after {
    font-family: "code", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif !important;
}

/* ===== 蓝牙环境提示条 ===== */
#browserTip {
    display: none;
    flex: 0 0 auto;
    flex-direction: column;
    gap: 6px;
    padding: 9px 14px 10px;
    background: #180d0d;
    border-bottom: 1px solid #ff6b6b;
    box-shadow: 0 0 18px rgba(255, 107, 107, 0.25), inset 0 0 24px rgba(255, 107, 107, 0.08);
    color: #ffd9d9;
    font-family: "code", monospace;
    font-size: 14px;
    line-height: 1.45;
    z-index: 60;
}
#browserTip.visible { display: flex; }
#browserTip .bt-tip-head {
    display: flex;
    align-items: center;
    gap: 10px;
}
#browserTip .bt-tip-title {
    color: #ff6b6b;
    font-weight: bold;
    white-space: nowrap;
    text-shadow: 0 0 8px rgba(255, 107, 107, 0.6);
}
#browserTip .bt-tip-text { display: block; }
#browserTip .bt-tip-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    white-space: nowrap;
}
#browserTip .bt-tip-actions a,
#browserTip .bt-tip-actions button {
    background: none;
    border: 1px solid #ff6b6b;
    color: #ff6b6b;
    font-family: "code", monospace;
    font-size: 13px;
    padding: 3px 9px;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.3;
}
#browserTip .bt-tip-actions a:hover,
#browserTip .bt-tip-actions button:hover {
    background: rgba(255, 107, 107, 0.15);
}
#browserTip #browserTipClose {
    border: none;
    font-size: 20px;
    padding: 0 4px;
    opacity: 0.75;
}
#browserTip #browserTipClose:hover { opacity: 1; background: none; }

@media (max-width: 680px) {
    #browserTip { font-size: 12.5px; padding: 8px 12px 9px; }
    #browserTip .bt-tip-title { font-size: 13px; }
    #browserTip .bt-tip-actions a,
    #browserTip .bt-tip-actions button { font-size: 12px; padding: 3px 7px; }
}

/* 横幅显示时把左上角设置按钮往下推，避免遮住 */
body.has-tip #settingsBtn {
    top: calc(20px + var(--tip-height, 0px));
    transition: top 0.15s ease;
}
#browserTip .bt-tip-head { flex-wrap: wrap; }
#browserTip .bt-tip-actions { flex-wrap: wrap; }

@media (max-width: 680px) {
    #browserTip { min-width: 0; }
    #browserTip .bt-tip-head { display: block; }
    #browserTip .bt-tip-title { display: block; margin-bottom: 6px; }
    #browserTip .bt-tip-actions { margin-left: 0; }
}
