/* ========== 全局手绘重置 ========== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.social-hover-grid .telegram {
    fill: #29b6f6;
}

.social-hover-grid .card:nth-child(8):hover .telegram>path:nth-of-type(1) {
    fill: white;
}

.social-hover-grid .card:nth-child(8):hover .telegram>path:nth-of-type(2) {
    fill: #29b6f6;
}

.social-hover-grid .card:nth-child(8):hover .telegram>path:nth-of-type(3) {
    fill: #29b6f6;
}

body {
    background-color: #fefaf0;
    background-image: radial-gradient(circle at 30% 40%, rgba(0, 0, 0, 0.02) 1px, transparent 1px),
        radial-gradient(circle at 70% 80%, rgba(0, 0, 0, 0.02) 1px, transparent 1px);
    background-size: 40px 40px;
    font-family: 'Quicksand', sans-serif;
    color: #2e2e2e;
    line-height: 1.7;
    padding: 2rem 1.5rem;
}

.paper-container {
    max-width: 1300px;
    margin: 0 auto;
    background-color: rgba(255, 255, 245, 0.8);
    backdrop-filter: blur(2px);
    border-radius: 100px 100px 60px 60px / 60px 60px 80px 80px;
    box-shadow: 10px 10px 0 rgba(0, 0, 0, 0.1), 0 0 0 2px #2e2e2e inset, 0 0 0 5px #f0e6d2 inset;
    padding: 2rem 2.5rem;
    border: 2px dashed #a5a5a5;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1rem 1.2rem 1rem;
    border-bottom: 3px dotted #b0a28a;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo a {
    font-family: 'Caveat', cursive;
    font-size: 3.2rem;
    font-weight: 700;
    text-decoration: none;
    color: #3a2e1f;
    text-shadow: 3px 3px 0 #e0d6c8;
    background: #fff3e0;
    padding: 0.2rem 1rem;
    border-radius: 60% 40% 50% 50% / 40% 50% 60% 50%;
    border: 3px solid #3a2e1f;
    transform: rotate(-1deg);
    display: inline-block;
}

.logo span {
    color: #b35e3a;
    font-size: 3.5rem;
}

.nav-links a {
    font-family: 'Caveat', cursive;
    font-size: 1.8rem;
    text-decoration: none;
    color: #4f3e2c;
    margin-left: 2rem;
    border-bottom: 3px wavy #b35e3a;
    padding-bottom: 0.2rem;
    transition: 0.2s;
}

.nav-links a.active {
    border-bottom-style: solid;
    background: #ffedc0;
    padding: 0.2rem 1rem;
    border-radius: 30px 10px 30px 10px;
}

.about-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 2.5rem;
    margin: 2rem 0 3rem;
}

/* 左侧随笔 */
.essay-card {
    background: #fffcf5;
    padding: 2.2rem 2rem 2.5rem 2rem;
    border-radius: 70px 20px 70px 20px;
    border: 4px solid #3e3a35;
    box-shadow: 12px 12px 0 #ab8e6a, 0 0 0 2px #f0dbc0 inset;
    transform: rotate(0.3deg);
    transition: 0.2s;
}

.essay-title {
    font-family: 'Caveat', cursive;
    font-size: 3.2rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 0.5rem;
    border-left: 10px solid #d9b48f;
    padding-left: 1.2rem;
    color: #2c3a2b;
}

.essay-date {
    font-size: 1.1rem;
    color: #7f6e5a;
    margin-bottom: 1.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-style: italic;
}

.essay-date i {
    font-size: 1.3rem;
    color: #b35e3a;
}

.essay-content {
    font-family: 'Quicksand', sans-serif;
    font-size: 1.1rem;
    color: #2f2a24;
}

.essay-content p {
    margin-bottom: 1.5rem;
    position: relative;
    padding-left: 1rem;
    border-left: 3px dotted #d9b48f;
}

.essay-content p:first-of-type:first-letter {
    font-family: 'Caveat', cursive;
    font-size: 4rem;
    float: left;
    line-height: 0.8;
    margin-right: 0.4rem;
    color: #b35e3a;
    text-shadow: 2px 2px 0 #e5c5a0;
}

.hand-drawn-line {
    height: 30px;
    background: repeating-linear-gradient(45deg, transparent, transparent 8px, #cbb59b 8px, #cbb59b 12px);
    margin: 2rem 0 1rem;
    width: 100%;
}

.signature {
    font-family: 'Caveat', cursive;
    font-size: 2rem;
    text-align: right;
    margin-top: 2rem;
    color: #6d4f33;
    border-top: 4px dotted #ceb092;
    padding-top: 1rem;
}

/* 右侧区域 */
.right-side {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* 音乐播放器 (带专辑封面) */
.music-player {
    background: #fcf6ea;
    padding: 1.2rem 1rem 1.5rem 1rem;
    border-radius: 90px 30px 90px 30px;
    border: 4px solid #4a3f35;
    box-shadow: 8px 8px 0 #a18464, inset 0 0 0 2px #ecdbbd;
    transform: rotate(-0.2deg);
}

.music-player .currentplaying {
    display: flex;
    margin: 1em 0.5em 0.5em 0.5em;
    align-items: center;
}

.music-player .spotify {
    width: 50px;
    height: 50px;
    margin-right: 0.8em;
    filter: drop-shadow(2px 2px 0px #ab8e6a);
}

.music-player .heading {
    color: #2f2a24;
    font-size: 1.5rem;
    font-family: 'Caveat', cursive;
    font-weight: bold;
    align-self: center;
    border-bottom: 3px dotted #b35e3a;
}

.music-player .loader {
    display: flex;
    flex-direction: row;
    height: 4em;
    padding-left: 1em;
    padding-right: 1em;
    transform: rotate(180deg);
    justify-content: right;
    border-radius: 30px 10px 30px 10px;
    transition: 0.3s ease-in-out;
    margin: 0.6em 0;
    border: 2px solid transparent;
    cursor: pointer;
    align-items: center;
}

.music-player .loader:hover {
    background-color: #ece1d1;
    border: 2px solid #8f6f4c;
    transform: rotate(180deg) scale(1.01);
}

.music-player .albumcover {
    position: relative;
    margin-right: 1em;
    height: 45px;
    width: 45px;
    background-color: #e0cfb9;
    align-self: center;
    border-radius: 20% 50% 20% 50%;
    border: 3px solid #6b4f32;
    box-shadow: 3px 3px 0 #ab8e6a;
    transform: rotate(180deg);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.music-player .song {
    position: relative;
    transform: rotate(180deg);
    margin-right: 1em;
    color: #2f2a24;
    align-self: center;
}

.music-player .name {
    font-family: 'Caveat', cursive;
    font-size: 1.3rem;
    font-weight: 600;
    line-height: 1.2;
}

.music-player .artist {
    font-size: 0.9rem;
    color: #5e4d39;
}

.music-player .play-pause {
    width: 2.2em;
    height: 2.2em;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f0dbc0;
    border-radius: 50%;
    border: 3px solid #4a3f35;
    box-shadow: 3px 3px 0 #ab8e6a;
    transform: rotate(180deg);
    color: #2e2e2e;
    font-size: 1.2rem;
    transition: 0.2s;
    margin-left: 0.2em;
}

.music-player .play-pause i {
    transform: rotate(180deg);
}

.music-player .loader:hover .play-pause {
    background-color: #e6c8a8;
    box-shadow: 2px 2px 0 #8f6f4c;
}

/* 社交网格卡片 (微信和QQ悬停背景白色，图标保持原色) */
.social-card {
    background: #fcf6ea;
    padding: 1rem 0.5rem 1.2rem 0.5rem;
    border-radius: 40px 20px 40px 20px;
    border: 4px solid #4a3f35;
    box-shadow: 6px 6px 0 #a18464;
}

.social-title {
    font-family: 'Caveat', cursive;
    font-size: 2rem;
    margin-left: 1rem;
    margin-bottom: 0.2rem;
    color: #3f321f;
}

.social-hover-grid {
    display: flex;
    flex-wrap: wrap;
    width: 14em;
    align-items: center;
    justify-content: center;
    position: relative;
    margin: 0.5rem auto;
}

.social-hover-grid .main_back {
    position: absolute;
    transform: rotate(90deg);
    border-radius: 18px;
    width: 11em;
    height: 11em;
    background: radial-gradient(circle, #f5e1a0);
    z-index: 0;
    border: 4px solid #3a2e1f;
    box-shadow: 8px -8px 0 #5e4b35;
    transition: 0.4s ease-in-out;
}

.social-hover-grid .card {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-top-left-radius: 10px;
    background: rgba(255, 255, 240, 0.8);
    backdrop-filter: blur(4px);
    border: 2px solid transparent;
    transition: 0.4s ease-in-out;
    z-index: 2;
}

.social-hover-grid .card i,
.social-hover-grid .card svg {
    opacity: 0;
    transition: 0.2s ease-in-out;
    width: 30px;
    height: 30px;
    font-size: 30px;
    /* 用于Font Awesome图标 */
}

.social-hover-grid .card:nth-child(2) {
    border-radius: 0px;
}

.social-hover-grid .card:nth-child(3) {
    border-top-right-radius: 10px;
    border-top-left-radius: 0px;
}

.social-hover-grid .card:nth-child(4) {
    border-radius: 0px;
}

.social-hover-grid .card:nth-child(5) {
    border-radius: 0px;
}

.social-hover-grid .card:nth-child(6) {
    border-radius: 0px;
}

.social-hover-grid .card:nth-child(7) {
    border-bottom-left-radius: 10px;
    border-top-left-radius: 0px;
}

.social-hover-grid .card:nth-child(8) {
    border-radius: 0px;
}

.social-hover-grid .card:nth-child(9) {
    border-bottom-right-radius: 10px;
    border-top-left-radius: 0px;
}

/* 默认图标颜色 (内联style已设置，此处作为后备) */
.social-hover-grid .card i {
    color: inherit;
}

/* 悬停展开效果 */
.social-hover-grid:hover {
    width: 14em;
    cursor: pointer;
}

.social-hover-grid:hover .main_back {
    opacity: 0;
    transform: scale(0.1) rotate(180deg);
}

.social-hover-grid:hover .card {
    margin: 0.3em;
    border-radius: 10px;
    box-shadow: 5px 5px 0px #3a2e1f;
    border: 3px solid #2e2e2e;
    background: rgba(255, 255, 240, 0.3);
}

.social-hover-grid:hover .card i,
.social-hover-grid:hover .card svg {
    opacity: 1;
}

.social-hover-grid:hover .text {
    opacity: 0;
    z-index: -3;
}

.social-hover-grid .card:hover {
    transform: scale(1.1) rotate(-5deg);
}

/* 各卡片悬停背景色及图标颜色 (微信和QQ背景白，图标保持原色) */
.social-hover-grid .card:nth-child(1):hover {
    background-color: #e91e63;
}

.social-hover-grid .card:nth-child(1):hover i,
.social-hover-grid .card:nth-child(1):hover svg {
    color: white;
    fill: white;
}

.social-hover-grid .card:nth-child(2):hover {
    background-color: #FCF6EA;
}

/* X */
.social-hover-grid .card:nth-child(2):hover i {
    color: white;
}

/* 微信 - 悬停背景白，图标保持绿色 */
.social-hover-grid .card:nth-child(3):hover {
    background-color: #FCF6EA;
}

.social-hover-grid .card:nth-child(3):hover i {
    color: #07C160;
}

.social-hover-grid .card:nth-child(4):hover {
    background-color: #000000;
}

/* Codepen */
.social-hover-grid .card:nth-child(4):hover svg {
    fill: white;
}

.social-hover-grid .card:nth-child(5):hover {
    background-color: #FCF6EA;
}

/* Email */
.social-hover-grid .card:nth-child(5):hover i {
    color: #000;
}

.social-hover-grid .card:nth-child(6):hover {
    background-color: #7289da;
}

/* Discord */
.social-hover-grid .card:nth-child(6):hover svg {
    fill: white;
}

.social-hover-grid .card:nth-child(7):hover {
    background-color: #333;
}

/* GitHub */
.social-hover-grid .card:nth-child(7):hover svg {
    fill: white;
}

.social-hover-grid .card:nth-child(8):hover {
    background-color: #29b6f6;
}

/* Telegram */
.social-hover-grid .card:nth-child(8):hover svg {
    fill: white;
}

/* QQ - 悬停背景白，图标保持蓝色 */
.social-hover-grid .card:nth-child(9):hover {
    background-color: #FCF6EA;
}

.social-hover-grid .card:nth-child(9):hover i {
    color: #000;
}

.social-hover-grid .text {
    position: absolute;
    font-family: 'Caveat', cursive;
    font-size: 2em;
    font-weight: 500;
    transition: 0.4s;
    color: #2b2b2b;
    text-align: center;
    letter-spacing: 2px;
    z-index: 3;
    text-shadow: 2px 3px 0 #ffffff;
    line-height: 0.7;
    pointer-events: none;
}

.footer {
    margin-top: 4rem;
    padding: 2rem 0.5rem 1rem;
    border-top: 5px dotted #c6ad8a;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    font-family: 'Caveat', cursive;
    font-size: 1.4rem;
    color: #5c4b36;
}

@media (max-width: 800px) {
    .about-grid {
        grid-template-columns: 1fr;
    }

    .paper-container {
        padding: 1.5rem;
    }
}