body{margin:0;padding:0;background:#ffe;font-size:14px;font-family:'微软雅黑',Microsoft Yahei,'宋体',sans-serif;color:#231F20;overflow:auto}
a {color:#000;font-size:14px;}
#main{width:100%;}
#wrap{position:relative;margin:0 auto;width:1100px;height:680px;margin-top:10px;}
#main{position:relative;}
#text{width:400px;height:425px;left:calc(50% - 550px + 60px);top:90px;position:absolute;}
#code{display:none;font-size:16px;}
#clock-box {position:absolute;left:calc(50% - 550px + 60px);top:560px;font-size:28px;display:none;}
#clock-box a {font-size:28px;text-decoration:none;}
#clock{margin-left:48px;}
#clock .digit {font-size:64px;}
#canvas{margin:0 auto;width:1100px;height:100%;}
#error{margin:0 auto;text-align:center;margin-top:60px;display:none;}
.hand{cursor:pointer;}
.say{margin-left:5px;color:#FF0000;}
.space{margin-right:150px;}

/* ========== 手机竖屏适配 ========== */
@media screen and (max-width: 768px) and (orientation: portrait) {
    html, body {
        width: 100%;
        height: 100%;
        overflow: hidden;
        margin: 0;
        padding: 0;
    }

    #main {
        width: 100%;
        height: 100vh;
        height: 100dvh;
        overflow: hidden;
        position: relative;
    }

    /* wrap 由 JS 控制位置和缩放，这里只设基础样式 */
    #wrap {
        position: absolute !important;
        width: 1100px !important;
        height: 680px !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    #canvas {
        width: 1100px !important;
        height: 680px !important;
        display: block !important;
    }

    /* 文字：固定在屏幕上方，不跟随缩放 */
    #text {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        top: 8% !important;
        bottom: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        transform: none !important;
        text-align: center !important;
        padding: 0 20px !important;
        box-sizing: border-box !important;
        z-index: 10 !important;
        pointer-events: none;
    }

    #code {
        font-size: 15px !important;
        line-height: 1.8 !important;
        display: none;
    }

    .say {
        font-size: 15px !important;
        margin-left: 0 !important;
        display: inline !important;
    }

    /* 时钟：固定在屏幕下方，不跟随缩放 */
    #clock-box {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        top: auto !important;
        bottom: 8% !important;
        transform: none !important;
        text-align: center !important;
        font-size: 16px !important;
        width: 100% !important;
        z-index: 10 !important;
        pointer-events: none;
    }

    #clock-box font {
        font-size: 16px !important;
    }

    #clock {
        margin-left: 0 !important;
        margin-top: 8px !important;
    }

    #clock .digit {
        font-size: 32px !important;
    }

    /* 底部来源文字 */
    body > div[style="text-align:center;"] {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        margin: 0 !important;
        padding: 8px 0 !important;
        background: #ffe !important;
        z-index: 100 !important;
        text-align: center !important;
    }

    body > div[style="text-align:center;"] p {
        margin: 0 !important;
        font-size: 11px !important;
    }

    body > div[style="text-align:center;"] a {
        font-size: 11px !important;
    }
}

/* 小屏手机 */
@media screen and (max-width: 480px) and (orientation: portrait) {
    #code {
        font-size: 13px !important;
        line-height: 1.7 !important;
    }

    .say {
        font-size: 13px !important;
    }

    #clock-box {
        font-size: 14px !important;
        bottom: 7% !important;
    }

    #clock-box font {
        font-size: 14px !important;
    }

    #clock .digit {
        font-size: 26px !important;
    }

    #text {
        top: 6% !important;
    }
}

/* 手机横屏适配 */
@media screen and (max-width: 900px) and (orientation: landscape) {
    html, body {
        width: 100%;
        height: 100%;
        overflow: hidden;
    }

    #main {
        width: 100%;
        height: 100vh;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
    }

    #wrap {
        width: 1100px !important;
        height: 680px !important;
        margin: 0 !important;
        position: relative;
        flex-shrink: 0;
    }

    #canvas {
        width: 1100px !important;
        height: 680px !important;
    }

    body > div[style="text-align:center;"] {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        margin: 0;
        padding: 5px 0;
        background: #ffe;
        z-index: 100;
        font-size: 10px;
    }

    body > div[style="text-align:center;"] p,
    body > div[style="text-align:center;"] a {
        margin: 0;
        font-size: 10px;
    }
}
