/* 通用样式 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    text-align: center;
    padding: 30px;
    margin: 0;
    box-sizing: border-box;
    background-color: #f4f4f9;
    color: #333;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: background-color 0.3s, color 0.3s;
}

h1 {
    font-size: 36px;
    color: #2196F3;
    margin-bottom: 20px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
}

/* 按钮样式 */
button {
    padding: 12px 24px;
    margin: 10px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    border-radius: 30px;
    background: linear-gradient(to bottom, #2196F3, #1976D2);
    color: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

button:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    background: linear-gradient(to bottom, #1976D2, #1565C0);
}

/* 开关样式 */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
    margin-top: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    -webkit-transition:.4s;
    transition:.4s;
    border-radius: 34px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    -webkit-transition:.4s;
    transition:.4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked +.slider {
    background-color: #2196F3;
}

input:focus +.slider {
    box-shadow: 0 0 1px #2196F3, inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked +.slider:before {
    -webkit-transform: translateX(26px);
    -ms-transform: translateX(26px);
    transform: translateX(26px);
}

/* Rounded sliders */
.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* 深色模式样式 */
.dark-mode {
    background-color: #111;
    color: white;
}

.dark-mode button {
    background: linear-gradient(to bottom, #673AB7, #512DA8);
}

.dark-mode button:hover {
    background: linear-gradient(to bottom, #512DA8, #4527A0);
}

/* 适配华为手机（竖屏） */
@media (max-width: 480px) {
    body {
        padding: 15px;
    }

    h1 {
        font-size: 24px;
    }

    button {
        padding: 8px 16px;
        font-size: 16px;
    }

   .switch {
        width: 50px;
        height: 28px;
    }

   .slider:before {
        height: 22px;
        width: 22px;
        left: 3px;
        bottom: 3px;
    }

    input:checked +.slider:before {
        -webkit-transform: translateX(22px);
        -ms-transform: translateX(22px);
        transform: translateX(22px);
    }
}

/* 适配华为平板（竖屏） */
@media (min-width: 481px) and (max-width: 1024px) {
    body {
        padding: 20px;
    }

    h1 {
        font-size: 32px;
    }

    button {
        padding: 10px 20px;
        font-size: 18px;
    }
}

/* 适配 iWatch 和普通手表 */
@media (max-width: 200px) {
    body {
        padding: 5px;
    }

    h1 {
        font-size: 12px;
    }

    button {
        padding: 3px 6px;
        font-size: 10px;
        margin: 3px;
    }

   .switch {
        width: 30px;
        height: 17px;
    }

   .slider:before {
        height: 13px;
        width: 13px;
        left: 2px;
        bottom: 2px;
    }

    input:checked +.slider:before {
        -webkit-transform: translateX(13px);
        -ms-transform: translateX(13px);
        transform: translateX(13px);
    }
}

/* 顶部信息条样式 */
#poweredByText {
    text-align: center;
    font-size: 12px;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #222;
    color: white;
    margin: 0;
    white-space: pre-line;
    padding: 5px 0;
    z-index: 1000;
}