* {
    padding: 0;
    margin: 0;
}

/*让html撑满视口，body才能以视口高度为基准铺满背景*/
html {
    height: 100%;
}

/*设置背景*/
body {
    width: 100%;
    min-height: 100%;
    background: url("../img/背景.jpg") no-repeat center center;
    background-size: cover;
    font-family: "微软雅黑";
}

/*设置导航栏的样式*/
.nav1 {
    position: sticky;
    top: 0;
    width: 100%;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.5);
    box-shadow: -4px 4px 6px rgba(116, 120, 122, 0.5);
    z-index: 100;
}

.position {
    position: absolute;
    right: 200px;
    top: 9px;
}

.href {
    display: inline-block;
    text-decoration: none;
    color: rgb(116, 120, 122);
    font-size: 1em;
    margin-left: 30px;
    transition: all 0.3s ease;
    cursor: pointer;
}

/*主内容样式*/
.OC-info {
    display: flex;
    gap: 30px;
    justify-content: center;
    flex-wrap: wrap;
    position: relative;
    top: 70px;
}

/*三栏共用*/
.box1 {
    height: 800px;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-top: 1px solid rgba(255, 255, 255, 0.6);
    border-left: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.25), inset 0 0 20px rgba(255, 255, 255, 0.3);

}

.left-nav {
    width: 350px;
}

.info {
    width: 970px;
    position: relative;
    transition: width 0.45s ease;
}

/*右栏：立绘。默认窄，悬停展开*/
.other {
    width: 200px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    overflow: hidden;
    transition: width 0.45s ease;
}

.other img {
    display: block;
    flex: 0 0 auto;
    /* 高度始终撑满卡片，宽度按原图比例；窄栏里靠 overflow 裁切 */
    height: 100%;
    width: auto;
    max-width: none;
}

/* 悬停立绘：右栏变宽到刚好露出整张图，中间栏向左让出同样宽度。
   两个宽度一增一减、总和不变，所以整行不会重新居中跳动 */
.OC-info:has(.other img:hover) .other {
    width: 620px;
}

.OC-info:has(.other img:hover) .info {
    width: 550px;
}

/* 老浏览器不支持 :has() 时的兜底：整栏悬停 */
@supports not (selector(:has(*))) {
    .OC-info:hover .other {
        width: 620px;
    }

    .OC-info:hover .info {
        width: 550px;
    }
}

/*头像样式*/
.Avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    /*保证图片的四个角被裁切*/
    position: relative;
    top: 50px;
    border: 2px solid #51c4d3;
    transition: all 0.3s ease;
    margin: 30px auto;
}

.Avatar:hover {
    transform: scale(1.1);
}

.Avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /*防止头像变形，保持比例*/
}

.oc-name {
    font-size: 2em;
    font-weight: bold;
    font-family: "ZCOOL Kursive", cursive;
    text-align: center;
    color: #000;
    margin: 0px auto;
    margin-top: 70px;
}

.left-nav hr {
    width: 300px;
    margin: 20px auto;
}

.help {
    color: #8e8e8e;
    text-align: center;
    font-size: 1.1em;
    line-height: 1.2em;
    margin: 40px auto;
}

/*测运势*/
.fortune-card {
    width: 320px;
    height: 290px;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    font-family: "Microsoft YaHei", sans-serif;
    transition: all 0.3s ease;
    margin: 30px auto;
}

/*标题*/
.card-title {
    margin: 4px 0 15px 0;
    font-size: 16px;
    color: #5a6b8c;
    letter-spacing: 2px;
    font-weight: normal;
    position: relative;
    padding-bottom: 10px;
}

/*标题下方的小装饰线*/
.card-title::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 24px;
    height: 1px;
    background: rgba(90, 107, 140, 0.35);
}

/*结果展示框*/
.result-box {
    flex: 1;
    width: 100%;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 12px 14px;
    box-sizing: border-box;
    color: #4a5568;
    font-size: 14px;
    line-height: 1.8;
    letter-spacing: 0.5px;
    border: 1px dashed rgba(255, 255, 255, 0.8);
    transition: all 0.3s;
    overflow-y: auto;
}

/*占位文字样式*/
.placeholder-text {
    color: #8fa3bf;
    font-size: 13px;
    line-height: 1.9;
}

/*抽中后的文字容器*/
.lucky-text {
    display: block;
    width: 100%;
    animation: fadeIn 0.4s ease-in-out;
}

/*打字光标*/
.typing-cursor {
    display: inline-block;
    width: 1px;
    height: 1em;
    background: #8fa3bf;
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: blink 0.8s step-end infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/*底部按钮*/
.draw-btn {
    width: 100%;
    height: 40px;
    margin-top: 15px;
    border: none;
    border-radius: 20px;
    background: linear-gradient(135deg, #a1c4fd 0%, #c2e9fb 100%);
    color: white;
    font-size: 14px;
    letter-spacing: 2px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(161, 196, 253, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    outline: none;
}

.draw-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(161, 196, 253, 0.6);
}

.draw-btn:active {
    transform: translateY(1px);
}

.draw-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 4px 15px rgba(161, 196, 253, 0.3);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/*中部内容定位：贴在面板底部排，中间栏变窄时不会往下溢出*/
.position2 {
    position: absolute;
    left: 30px;
    right: 30px;
    bottom: 40px;
}

.qustion {
    margin-top: 10px;
    margin-bottom: 10px;
    margin-left: 5px;
}

.say {
    text-indent: 1.3em;
    font-size: 1.6em;
    font-family: "ZCOOL Kursive", cursive;
}

/*按钮*/
.btn {
    width: 150px;
    height: 40px;
    border: none;
    border-radius: 20px;
    background: linear-gradient(135deg, #a1c4fd 0%, #c2e9fb 100%);
    color: white;
    font-size: 14px;
    letter-spacing: 2px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(161, 196, 253, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    outline: none;
    margin: 10px 10px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(161, 196, 253, 0.6);
}

.btn:active {
    transform: translateY(1px);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 4px 15px rgba(161, 196, 253, 0.3);
}

/*回答框*/
.answer {
    width: 100%;
    height: 150px;
    box-sizing: border-box;
    padding: 18px 30px;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 25px;
    display: flex;
    align-items: center;
    text-align: left;
    overflow-y: auto;
    font-family: "Noto Serif SC", "Songti SC", "SimSun", "Microsoft YaHei", serif;
    font-size: 1.2em;
    line-height: 2;
    letter-spacing: 0.06em;
    color: #33415c;
}

/*回答框里逐字打印出来的文字（覆盖运势卡的块级样式）*/
.answer .lucky-text {
    flex: 1;
    width: auto;
    text-indent: 2em;
    animation: fadeIn 0.25s ease-in-out;
}

/*回答框里的打字光标，稍微矮一点、颜色跟文字走*/
.answer .typing-cursor {
    height: 1.1em;
    background: #33415c;
}