* {
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    box-sizing: border-box;
}

body {
    background-image: linear-gradient(to left, rgba(255, 0, 149, 0.2), rgba(0, 247, 255, 0.2)), url(https://sobing.oss-cn-guangzhou.aliyuncs.com/bg.jpg?Expires=1748478466&OSSAccessKeyId=TMP.3KrAbhvjhdfTcqXiUhNxqg7JoSjqvBS4tHqMDiJyQEdADKMDKst4DURqxzCxVLsXHJtrcjFnNQUvjnNQEZkNZsAAFkaDxx&Signature=vvCYk9ZIXAKU9pGlyxZH1HIXv%2F0%3D);
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-size: cover;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

/* 移动端优化 */
@supports (-webkit-touch-callout: none) {
    /* iOS设备 */
    body {
        background-attachment: scroll;
        width: 100vw;
        min-height: 100vh;
        min-height: -webkit-fill-available;
        overflow-x: hidden;
        position: relative;
        padding-bottom: env(safe-area-inset-bottom);
    }

    html {
        height: -webkit-fill-available;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    #box {
        width: 100%;
        padding: 20px 15px;
        margin: 0;
        overflow-x: hidden;
        padding-bottom: calc(120px + env(safe-area-inset-bottom));
    }

    .meBox {
        width: 90%;
        max-width: 320px;
        margin: 60px auto 30px;
        padding-bottom: 20px;
        border-radius: 15px;
    }

    .headPhoto {
        width: 90px;
        height: 90px;
        top: -45px;
        margin-left: -45px;
        border: 3px solid #fff;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }

    .meBox-title {
        margin-top: -15px;
    }

    .meBox-title p {
        margin: 0 auto;
        text-align: center;
        width: auto;
        animation: none;
        border-right: none;
    }

    .cmd {
        width: 100%;
        max-width: 100%;
        margin: 15px auto;
        left: 0;
        transform: none;
    }

    .cmd2 {
        position: static;
        margin: 15px auto;
    }

    .cmdText {
        -webkit-overflow-scrolling: touch;
        overflow-x: hidden;
        word-wrap: break-word;
        white-space: pre-wrap;
    }

    /* 修复二维码显示位置 */
    .qr-code {
        left: 20px;
        top: 50%;
        transform: translateY(-50%);
        background: white;
        padding: 5px;
        border-radius: 5px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        z-index: 9999;
        opacity: 0;
        transition: all 0.2s ease;
        width: 100px;
        height: 100px;
        display: none;
    }

    .qr-code img {
        width: 90px;
        height: 90px;
        display: block;
        margin: 0 auto;
        border-radius: 3px;
    }

    .qr-code.show {
        display: block;
        opacity: 1;
    }

    /* 优化页脚在iOS上的显示 */
    #footer {
        position: fixed;
        bottom: 0;
        padding-bottom: calc(18px + env(safe-area-inset-bottom));
    }
}

/* 修复iOS Safari中的滚动问题 */
@supports (-webkit-overflow-scrolling: touch) {
    body {
        -webkit-overflow-scrolling: touch;
    }
    
    .cmd, .cmdText {
        -webkit-overflow-scrolling: touch;
        overflow-y: auto;
    }
}

/* 优化iOS设备上的动画效果 */
@media not all and (min-resolution:.001dpcm) { 
    @supports (-webkit-appearance:none) and (not (stroke-color: transparent)) {
        .meBox, .headPhoto, .cmd {
            transition: none;
            animation: none;
        }
        
        .meBox-title p {
            animation: none;
            border-right: none;
        }
    }
}

/* 修复iOS设备上的渐变和背景 */
@supports (-webkit-touch-callout: none) {
    body {
        background-image: 
            linear-gradient(
                to left,
                rgba(255, 0, 149, 0.2),
                rgba(0, 247, 255, 0.2)
            ),
            url(../img/bg.jpg);
        background-position: center center;
        background-repeat: no-repeat;
        background-size: cover;
    }
    
    #footer {
        background: rgba(0, 0, 0, 0.8);
        -webkit-backdrop-filter: saturate(180%) blur(20px);
    }
}

/* 适配刘海屏 */
@supports (padding-top: constant(safe-area-inset-top)) or (padding-top: env(safe-area-inset-top)) {
    #box {
        padding-top: constant(safe-area-inset-top);
        padding-top: env(safe-area-inset-top);
    }
    
    #footer {
        padding-bottom: constant(safe-area-inset-bottom);
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* 动画和过渡效果兼容性处理 */
.meBox,
.headPhoto,
.qr-code,
.cmd {
    -webkit-transition: all 0.3s;
    -moz-transition: all 0.3s;
    -o-transition: all 0.3s;
    transition: all 0.3s;
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* 毛玻璃效果兼容性处理 */
@supports (-webkit-backdrop-filter: blur(10px)) or (backdrop-filter: blur(10px)) {
    #footer {
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
    }
}

/* 修复Safari中的特定问题 */
@media not all and (min-resolution:.001dpcm) { 
    @supports (-webkit-appearance:none) {
        .meBox {
            transform: translateZ(0);
        }
        
        #footer {
            transform: translateZ(0);
        }
    }
}

/* 修复某些Android浏览器的渲染问题 */
@media screen and (-webkit-min-device-pixel-ratio:0) {
    .meBox,
    .cmd {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
}

#box {
    /* background-color: red; */
    width: 100%;
    height: 100px;
    margin: 0 auto;
    padding-top: 5%;
}

.meBox {
    float: left;
    width: 20rem;
    height: 25rem;
    background-color: white;
    margin-top: 100px;
    margin-left: 10%;
    border-radius: 2%;
    text-align: center;
}

.meBox:hover {
    width: 21rem;
    height: 26rem;
    margin: 95px 0 0 9.5%;
}

.headPhoto {
    width: 8rem;
    height: 8rem;
    background: url(https://q1.qlogo.cn/g?b=qq&nk=873636316&s=640) no-repeat;
    background-size: cover;
    border-radius: 50%;
    position: relative;
    top: -15%;
    left: 50%;
    margin-left: -4rem;
    border: 3px solid #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1), transform 0.5s cubic-bezier(0.4, 0, 0.2, 1) !important;
    transform: rotate(0deg) !important;
}

.meBox:hover .headPhoto {
    width: 9rem;
    height: 9rem;
    margin: -0.5rem 0 0 -4.5rem;
    transform: rotate(360deg) !important;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
}

.headPhoto:hover {
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.meBox-title {
    width: auto;
    margin: 0 auto;
}

@keyframes typing {
    from {
        width: 0;
    }
}

@keyframes blink-caret {
    50% {
        border-color: transparent;
    }
}

.meBox-title p {
    font-size: 1.2rem;
    border-right: .1em solid;
    width: 12ch;
    white-space: nowrap;
    overflow: hidden;
    animation: typing 2s steps(20, end), blink-caret .3s step-end infinite alternate;
    margin: -30px 0 0 90px;
    transition: all 0.3s;
}

.meBox:hover .meBox-title p {
    font-size: 1.3rem;
}

.meBox-title .fg {
    width: 80%;
    height: 2px;
    background-image: linear-gradient(to left, #3498db, #2980b9);
    margin: 5% 0 0 10%;
}

.meBox-text {
    width: 80%;
    height: 45%;
    overflow: hidden;
    text-align: center;
    color: rgb(70, 70, 70);
    animation-name: meBox-text;
    animation-duration: 2s;
    animation-fill-mode: forwards;
    margin: 5% 0 0 10%;
    transition: all 0.3s;
}

.meBox-text p {
    margin-top: 5px;
}

@keyframes meBox-text {
    0% {
        transform: translateY(50px);
        color: white;
    }

    100% {
        transform: translateY(0);
        color: rgb(70, 70, 70);
    }
}

.meBox:hover .meBox-text {
    font-size: 1.05rem;
}

/* 按钮区域基础样式 - PC端 */
.meBox-Button {
    width: 100%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: nowrap;
    padding: 0 10px;
}

.meBox-Button a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 40px;
    text-decoration: none;
    color: gray;
    transition: all 0.3s;
    flex-shrink: 0;
    white-space: nowrap;
    position: relative;
}

.meBox-Button a:hover {
    color: rgb(0, 132, 255);
    transform: translateY(-2px);
}

/* 微信图标样式 - PC端 */
.about-link i.fab {
    font-size: 1.1em;  /* 减小PC端图标大小 */
    color: #07C160;
}

/* 二维码基础样式 */
.qr-code {
    display: none;
    position: absolute;
    padding: 0;
    background: #fff;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
    z-index: 1000;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
}

.qr-code img {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 3px;
}

.qr-code.show {
    display: block;
}

#qqQR img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    margin-right: 0;
}

/* QQ二维码定位 */
#qqQR {
    right: 0;
}

/* 移动端适配 */
@media screen and (max-width: 768px) {
    .qr-code {
        width: 150px;
        height: 150px;
        padding: 5px;
    }
    .qr-code img {
        width: 140px;
        height: 140px;
    }
}

#cmdBox {
    width: 710px;
    height: 550px;
    float: right;
    margin-right: 5%;
    position: relative;
}

.cmd, .cmd2 {
    background-color: rgba(40, 44, 52, 0.95) !important;
    box-shadow: 
        0 2px 20px rgba(0, 0, 0, 0.2),
        inset 0 0 15px rgba(0, 0, 0, 0.1);
}

.cmd {
    width: 600px;
    height: 400px;
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 6px;
    overflow: hidden;
    font-size: 14px;
    color: #abb2bf;
    z-index: 1;
    transition: opacity 0.3s ease, box-shadow 0.3s ease, transform 0.1s ease;
    cursor: default;
    user-select: none;
    display: flex;
    flex-direction: column;
}

.cmd:hover {
    z-index: 2;
}

.cmd .title {
    width: 100%;
    height: 32px;
    background: rgba(33, 37, 43, 0.98);
    font-size: 13px;
    line-height: 32px;
    cursor: move;
    user-select: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.cmd .title span {
    color: #abb2bf;
    margin-left: auto;
    margin-right: auto;
    font-weight: 500;
}

.cmd .click {
    display: flex;
    align-items: center;
    padding-left: 12px;
    gap: 8px;
}

.cmd .click div {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.cmd .click .red {
    background-color: #ff5f56;
}

.cmd .click .yellow {
    background-color: #ffbd2e;
}

.cmd .click .green {
    background-color: #27c93f;
}

.cmd .click div:hover {
    transform: scale(1.1);
    filter: brightness(1.1);
}

.cmdText {
    padding: 16px;
    line-height: 1.6;
    font-size: 14px;
    height: calc(100% - 32px);
    overflow-y: auto;
    overflow-x: hidden;
    color: #abb2bf;
    font-family: 'Fira Code', 'Consolas', monospace;
    text-shadow: 0 1px 1px rgba(0,0,0,0.3);
    letter-spacing: 0.3px;
}

.cmdText .prompt {
    color: rgb(152, 195, 121);
}

.cmdText .path {
    color: rgb(97, 175, 239);
}

.cmdText .command {
    color: rgb(229, 192, 123);
}

.cmdText .output {
    color: rgb(171, 178, 191);
    margin-left: 24px;
    display: block;
    white-space: pre-wrap;
    word-break: break-word;
}

.cmdText a {
    color: #56b6c2;
    text-decoration: none;
    transition: all 0.3s ease;
}

.cmdText a:hover {
    color: #7bc6d0;
}

.cmdText .highlight {
    color: #c678dd;
}

.cmdText .highlight-string {
    color: #98c379;
}

.cmdText .highlight-comment {
    color: #7f848e;
    font-style: italic;
}

.cmd2 {
    position: absolute;
    top: 120px;
    left: 100px;
    width: 600px;
    height: 400px;
    z-index: 1;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-radius: 6px;
    overflow: hidden;
    font-family: 'Fira Code', 'Consolas', monospace;
    display: flex;
    flex-direction: column;
}

.cmd2:hover {
    z-index: 2;
}

/* 自定义滚动条样式 */
.cmdText::-webkit-scrollbar {
    width: 8px;
}

.cmdText::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.cmdText::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    transition: all 0.2s ease;
}

.cmdText::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Firefox滚动条样式 */
.cmdText {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) rgba(0, 0, 0, 0.1);
}

/* 拖拽相关样式 */
.cmd.dragging {
    opacity: 0.95;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3) !important;
    transition: none;
    z-index: 999 !important;
}

#footer {
    width: 100%;
    position: fixed;
    bottom: 0;
    left: 0;
    padding: 18px 0;
    background: linear-gradient(135deg, rgba(40,40,40,0.9) 0%, rgba(20,20,20,0.95) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
    z-index: 1000;
    border-top: 1px solid rgba(255,255,255,0.08);
    text-align: center;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

#footer p {
    color: #f0f0f0;
    margin: 8px 0;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
    line-height: 1.5;
}

#footer a {
    color: #5eb0ff;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

#footer a:hover {
    color: #80c8ff;
    text-shadow: 0 0 8px rgba(94, 176, 255, 0.4);
}

#footer a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: currentColor;
    transition: width 0.3s ease;
}

#footer a:hover::after {
    width: 100%;
}

/* 移动端布局基础设置 */
@media screen and (max-width: 768px) {
    html, body {
        min-height: 100vh;
        position: relative;
        margin: 0;
        padding: 0;
    }

    body {
        display: flex;
        flex-direction: column;
        padding-bottom: env(safe-area-inset-bottom, 0);
    }

    #box {
        flex: 1 0 auto;
        width: 100%;
        padding: 20px 15px;
        padding-bottom: 100px; /* 为页脚留出空间 */
        margin: 0;
        min-height: calc(100vh - 70px); /* 减去页脚高度 */
    }

    .meBox {
        float: none;
        width: 92%;
        margin: 60px auto 20px;
    }

    #cmdBox {
        width: 92%;
        margin: 20px auto;
        float: none;
    }

    /* 页脚固定定位 */
    #footer {
        flex-shrink: 0;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        padding: 15px 0;
        background: linear-gradient(135deg, rgba(40,40,40,0.9) 0%, rgba(20,20,20,0.95) 100%);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        z-index: 1000;
    }

    /* 适配iPhone底部安全区域 */
    @supports (padding-bottom: env(safe-area-inset-bottom)) {
        #footer {
            padding-bottom: calc(15px + env(safe-area-inset-bottom));
        }
    }

    .cmd, .cmd2 {
        width: calc(100% - 20px);
        max-width: 100%;
        height: auto;
        margin: 10px auto;
        position: relative;
        left: 0;
        top: 0;
        transform: none;
    }

    .cmd2 {
        top: 0;
        margin-top: 20px;
    }

    .cmdText {
        width: 100% !important;
        padding: 0 !important;
        font-size: 14px !important;
        white-space: pre-wrap !important;
        word-break: break-word !important;
        overflow-x: hidden !important;
        max-height: 50vh !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .cmdText p,
    .cmdText span,
    .cmdText li {
        display: block !important;
        margin: 8px 0 !important;
        line-height: 1.5 !important;
    }

    .cmd .click div {
        width: 10px !important;
        height: 10px !important;
        margin: 5px 0 0 8px !important;
    }

    .cmd .title span {
        font-size: 13px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        display: inline-block !important;
        max-width: 80% !important;
    }

    .cmdText ul.ul {
        margin-left: 15px !important;
        padding-left: 0 !important;
    }

    .cmd {
        background: rgba(255, 255, 255, 0.95) !important;
        border-radius: 8px !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
    }
}

/* 超小屏幕适配 */
@media screen and (max-width: 480px) {
    #box {
        padding-bottom: 80px;
    }

    .meBox {
        width: 94%;
        margin: 50px auto 15px;
    }

    #footer {
        padding: 12px 0;
    }

    @supports (padding-bottom: env(safe-area-inset-bottom)) {
        #footer {
            padding-bottom: calc(12px + env(safe-area-inset-bottom));
        }
    }
}

/* 修复iOS特定问题 */
@supports (-webkit-touch-callout: none) {
    body {
        min-height: -webkit-fill-available;
    }

    html {
        height: -webkit-fill-available;
    }

    #box {
        min-height: calc(100vh - 70px - env(safe-area-inset-bottom));
    }
}

/* 自适应 */
@media screen and (max-width: 1250px)
{
    .meBox {
        margin-left: 3%;
    }

    .meBox:hover {
        width: 21rem;
        height: 26rem;
        margin: 95px 0 0 2.5%;
    }

    #cmdBox {
        margin-right: 3%;
    }
}

@media screen and (max-width: 1110px)
{
    .meBox {
        float: none;
        margin: 100px auto 100px;
    }

    .meBox:hover {
        width: 21rem;
        height: 26rem;
        margin: 95px auto 95px;
    }

    #cmdBox {
        float: none;
        margin: 0 auto 100px;
    }
}

/* 强制覆盖终端内联样式 */
.cmdText span { 
    color: inherit;
    transition: all 0.3s ease;
}

/* 优化移动端终端显示 */
@media screen and (max-width: 480px) {
    .cmdText { font-size: 14px; padding: 10px; }
}

/* 合并重复的iOS适配代码 */
@supports (-webkit-touch-callout: none) {
    body, html, #box, .meBox, .cmd {
        /* 合并后的统一样式 */
    }
}

/* 移除所有悬停效果 */
#cmdBox:hover .cmd,
#cmdBox:hover .cmd2,
.cmd2:hover,
.cmd2:hover ~ .cmd {
    /* 移除 all: unset !important */
}

.cmd2 .cmdText a:hover {
    color: #7bc6d0;
    background: rgba(86, 182, 194, 0.2);
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(94, 176, 255, 0.3);
    border-radius: 3px;
    padding: 0 4px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
