body{margin:0;padding:0;background:#ffe;font-size:14px;font-family:'微软雅黑','宋体',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;}
#text{width:400px;height:auto;max-height:480px;overflow-y:auto;left:140px;top:52px;position:absolute;}
#code{display:none;font-size:16px;}
#clock-box {position:absolute;left:60px;top:550px;font-size:28px;display:none;}
#clock-box a {font-size:28px;text-decoration:none;}
#clock{margin-left:48px;}
#clock .digit {font-size:64px;}
#canvas {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}
#error{margin:0 auto;text-align:center;margin-top:60px;display:none;}
.hand{cursor:pointer;}
.say{margin-left:0;}
.space{margin-right:150px;}

/* 响应式设计 */
@media (max-width: 768px) {
    #wrap {
        width: 100%;
        height: 100vh;
        margin-top: 0;
        overflow: hidden;
    }
    
    /* 纵向显示 - 适配所有移动设备 */
    @media (orientation: portrait) {
        #text {
            width: 100%;
            left: 0;
            top: 3%;
            font-size: 13px;
            height: auto;
            max-height: 50%;
            overflow-y: auto;
            padding: 0 10px;
            box-sizing: border-box;
        }
        
        #code {
            font-size: 13px;
            line-height: 1.6;
        }
        
        #clock-box {
            left: 0;
            top: 55%;
            font-size: 16px;
            width: 100%;
            overflow: visible;
            white-space: normal;
            padding: 0 10px;
            box-sizing: border-box;
        }
        
        #clock-box a {
            font-size: 16px;
        }
        
        #clock {
            margin-left: 0;
            width: 100%;
            padding-left: 10px;
        }
        
        #clock .digit {
            font-size: 32px;
        }
        
        .say {
            margin-left: 0;
        }
    }
    
    /* 横向显示 */
    @media (orientation: landscape) {
        #text {
            width: 50%;
            left: 0;
            top: 5%;
            font-size: 11px;
            max-height: 45%;
            padding: 0 10px;
            box-sizing: border-box;
        }
        
        #code {
            font-size: 11px;
            line-height: 1.4;
        }
        
        #clock-box {
            left: 0;
            top: 55%;
            font-size: 14px;
            width: 100%;
            overflow: visible;
            white-space: normal;
            padding: 0 10px;
            box-sizing: border-box;
        }
        
        #clock-box a {
            font-size: 14px;
        }
        
        #clock {
            margin-left: 0;
            width: 100%;
            padding-left: 10px;
        }
        
        #clock .digit {
            font-size: 24px;
        }
        
        .say {
            margin-left: 0;
        }
    }
}

/* 小屏幕设备 */
@media (max-width: 480px) {
    #text {
        width: 100%;
        left: 0;
        padding: 0 10px;
        box-sizing: border-box;
        max-height: 50%;
    }
    
    #clock-box {
        left: 0;
        width: 100%;
        overflow: visible;
        white-space: normal;
        padding: 0 10px;
        box-sizing: border-box;
        top: 55%;
    }
    
    #clock {
        width: 100%;
        margin-left: 0;
        padding-left: 10px;
    }
    
    #clock .digit {
        font-size: 24px;
    }
    
    .say {
        margin-left: 0;
    }
}

/* 移动设备特殊优化 */
@media (max-width: 430px) and (orientation: portrait) {
    /* 大屏手机 */
    #text {
        top: 2%;
        font-size: 12px;
        max-height: 50%;
        width: 100%;
        left: 0;
        padding: 0 10px;
        box-sizing: border-box;
    }
    
    #code {
        font-size: 12px;
        line-height: 1.5;
    }
    
    #clock-box {
        top: 55%;
        font-size: 15px;
        width: 100%;
        overflow: visible;
        white-space: normal;
        left: 0;
        padding: 0 10px;
        box-sizing: border-box;
    }
    
    #clock {
        width: 100%;
        margin-left: 0;
        padding-left: 10px;
    }
    
    #clock .digit {
        font-size: 28px;
    }
}

@media (max-width: 393px) and (orientation: portrait) {
    /* 中屏手机 */
    #text {
        top: 2%;
        font-size: 11.5px;
        max-height: 50%;
        width: 100%;
        left: 0;
        padding: 0 10px;
        box-sizing: border-box;
    }
    
    #clock-box {
        top: 55%;
        font-size: 14px;
        width: 100%;
        overflow: visible;
        white-space: normal;
        left: 0;
        padding: 0 10px;
        box-sizing: border-box;
    }
    
    #clock {
        width: 100%;
        margin-left: 0;
        padding-left: 10px;
    }
    
    #clock .digit {
        font-size: 26px;
    }
}

@media (max-width: 375px) and (orientation: portrait) {
    /* 小屏手机 */
    #text {
        top: 1.5%;
        font-size: 11px;
        max-height: 50%;
        width: 100%;
        left: 0;
        padding: 0 10px;
        box-sizing: border-box;
    }
    
    #code {
        font-size: 11px;
        line-height: 1.4;
    }
    
    #clock-box {
        top: 55%;
        font-size: 13px;
        width: 100%;
        overflow: visible;
        white-space: normal;
        left: 0;
        padding: 0 10px;
        box-sizing: border-box;
    }
    
    #clock {
        width: 100%;
        margin-left: 0;
        padding-left: 10px;
    }
    
    #clock .digit {
        font-size: 24px;
    }
    
    .say {
        margin-left: 0;
    }
}

/* 刘海屏和全面屏适配 */
@supports (padding-top: env(safe-area-inset-top)) {
    @media (max-width: 768px) {
        #wrap {
            padding-top: env(safe-area-inset-top);
            padding-bottom: env(safe-area-inset-bottom);
            padding-left: env(safe-area-inset-left);
            padding-right: env(safe-area-inset-right);
        }
    }
}
