* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1a1a1a;
    --secondary-color: #666666;
    --accent-color: #7a7a7a;
    --background-color: #f9f9f9;
    --quote-bg: #ffffff;
    --border-color: #e8e8e8;
    --ink-color: #111111;
    --transition-time: 0.5s;
    --progress-color: #697565;
    --progress-color-dark: #8A9A80;
}

body {
    font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
    font-display: swap;
    background-color: var(--background-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    color: var(--primary-color);
    transition: opacity 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.container {
    width: 100%;
    max-width: 768px;
    margin: auto;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.quote-box {
    background: var(--quote-bg);
    background-image:
        linear-gradient(90deg, rgba(0, 0, 0, 0.015) 1px, transparent 1px),
        linear-gradient(rgba(0, 0, 0, 0.015) 1px, transparent 1px);
    background-size: 20px 20px;
    padding: 70px 60px 90px;
    position: relative;
    transition: all var(--transition-time) cubic-bezier(0.19, 1, 0.22, 1);
    width: 100%;
    max-width: 650px;
    margin: 0 auto;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.08);
    border-radius: 2px;
    overflow: hidden;
}

.date-display {
    font-size: 15px;
    color: var(--secondary-color);
    margin-bottom: 50px;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    font-weight: 300;
}

.date-line {
    display: inline-block;
    width: 25px;
    height: 1px;
    background-color: var(--accent-color);
    margin: 0 12px;
    opacity: 0.5;
}

.quote-title {
    font-family: "Source Han Serif CN", "Noto Serif CJK SC", "SimSun", "STSong", serif;
    font-display: swap;
    font-weight: 600;
    letter-spacing: 0.1em;
    font-size: 34px;
    line-height: 1.5;
    color: var(--primary-color);
    text-align: left;
    margin-bottom: 15px;
    transition:
        opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.quote-subtitle {
    font-family: "Times New Roman", "Source Han Serif CN", "SimSun", serif;
    font-display: swap;
    font-style: italic;
    font-size: 18px;
    color: var(--secondary-color);
    margin-bottom: 50px;
    letter-spacing: 0.5px;
    opacity: 0.7;
    font-weight: 400;
    transition:
        opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.quote-content {
    font-family: "Source Han Serif CN", "Noto Serif CJK SC", "SimSun", "STSong", serif;
    font-display: swap;
    font-weight: 400;
    letter-spacing: 0.05em;
    font-size: 24px;
    line-height: 1.9;
    color: var(--primary-color);
    text-align: justify;
    text-justify: inter-ideograph;
    hanging-punctuation: allow-end;
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
    padding: 40px 32px;
    margin-left: 20px;
    margin-right: 20px;
    width: calc(100% - 40px);
    position: relative;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    border-image: linear-gradient(90deg,
            rgba(0, 0, 0, 0.02) 0%,
            rgba(0, 0, 0, 0.08) 50%,
            rgba(0, 0, 0, 0.02) 100%);
    border-image-slice: 1;
    margin-top: clamp(20px, 3vh, 35px);
    margin-bottom: clamp(25px, 4vh, 40px);
}

.quote-icon {
    position: absolute;
    width: 24px;
    height: auto;
    opacity: 0.25;
    fill: var(--primary-color);
    transition: all var(--transition-time) cubic-bezier(0.19, 1, 0.22, 1);
}

.quote-icon-left {
    top: 30px;
    left: -20px;
    transform: translateX(0);
}

.quote-icon-right {
    bottom: 30px;
    right: -20px;
    transform: translateX(0);
}

.quote-source-container {
    position: absolute;
    bottom: 45px;
    right: 45px;
    font-size: 13px;
    color: var(--accent-color);
    letter-spacing: 1px;
    font-weight: 300;
    z-index: 2;
}

.chinese-character {
    position: absolute;
    top: 65px;
    right: 65px;
    font-size: 100px;
    color: rgba(120, 120, 120, 0.7);
    line-height: 1;
    user-select: none;
    z-index: 0;
    font-weight: 300;
    mix-blend-mode: soft-light;
    filter: blur(0.3px);
    opacity: 0.6;
    font-family: "STKaiti", "KaiTi", "Source Han Serif CN", serif;
    font-display: swap;
}

#quote-source {
    cursor: pointer;
    user-select: none;
    position: relative;
    z-index: 1;
    opacity: 0.85;
    transition: all 0.2s ease;
    background: rgba(248, 248, 248, 0.08);
    padding: 6px 14px;
    border-radius: 4px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: block;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

#quote-source::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    height: 1px;
    width: var(--reading-progress, 0%);
    background: var(--progress-color);
    transition: width 0.3s ease;
    border-radius: 1px;
}

#quote-source:hover {
    opacity: 1;
    background: rgba(248, 248, 248, 0.12);
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.08);
}

#quote-source:active {
    transform: translateY(0);
    background: rgba(248, 248, 248, 0.1);
}

.quote-source-dropdown {
    position: absolute;
    right: 0;
    bottom: calc(100% + 5px);
    background: var(--quote-bg);
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(5px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 120px;
    display: flex;
    flex-direction: column;
}

.quote-source-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    padding: 12px 16px;
    color: var(--primary-color);
    background: none;
    border: none;
    text-align: left;
    width: 100%;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 2px solid transparent;
}

.dropdown-item:hover {
    background: rgba(0, 0, 0, 0.03);
}

.dropdown-item.active {
    background: rgba(0, 0, 0, 0.05);
    border-left: 2px solid var(--primary-color);
    font-weight: 500;
}

.refresh-btn,
.like-btn,
.share-btn {
    background: transparent;
    color: var(--accent-color);
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity var(--transition-time) cubic-bezier(0.19, 1, 0.22, 1);
    opacity: 0.4;
}

.refresh-btn::after,
.like-btn::after,
.share-btn::after {
    content: '';
    position: absolute;
    width: 150%;
    height: 150%;
    background: radial-gradient(circle, rgba(0, 0, 0, 0.1) 10%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.refresh-btn:hover,
.like-btn:hover,
.share-btn:hover {
    opacity: 0.7;
}

.refresh-btn:active,
.like-btn:active,
.share-btn:active {
    opacity: 0.9;
}

.refresh-btn:active::after,
.like-btn:active::after,
.share-btn:active::after {
    opacity: 1;
}

.refresh-btn svg,
.like-btn svg,
.share-btn svg {
    width: 24px;
    height: 24px;
    transition: transform 0.2s ease;
}

.like-btn.active {
    opacity: 0.8;
}

.like-btn.active svg {
    fill: var(--accent-color);
}

#quote,
.quote-title,
.quote-subtitle {
    transition:
        opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.loading {
    opacity: 0;
    transform: translateY(10px);
}

footer {
    margin-bottom: 5px;
    padding-bottom: 20px;
    width: 100%;
    text-align: center;
}

@media (max-width: 767px) {
    .container {
        padding: 30px 15px;
    }

    .quote-box {
        padding: 60px 40px 100px;
    }

    .quote-title {
        font-size: 30px;
    }

    .date-display {
        margin-bottom: 60px;
        font-size: 14px;
    }

    .quote-subtitle {
        font-size: 17px;
        margin-bottom: 55px;
    }

    .quote-content {
        font-size: 22px;
        line-height: 1.8;
        padding: 35px 28px;
        margin-left: 18px;
        margin-right: 18px;
        width: calc(100% - 36px);
    }

    .chinese-character {
        font-size: 85px;
        opacity: 0.4;
        top: 40px;
        right: 40px;
    }

    .quote-source-container {
        bottom: 20px;
        right: 10px;
    }

    #quote-source {
        font-size: 12px;
        padding: 4px 10px;
    }

    .quote-icon {
        width: 20px;
    }

    .quote-icon-left {
        left: -18px;
    }

    .quote-icon-right {
        right: -18px;
    }

    .footer {
        padding: 12px 0;
        font-size: 12px;
    }

    .footer-content {
        padding: 0 15px;
    }

    .dropdown-item {
        padding: 6px 14px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 20px 15px;
    }

    .quote-box {
        padding: 50px 30px 100px;
    }

    .quote-title {
        font-size: calc(1.75rem + 0.5vw);
        margin-bottom: 12px;
    }

    .quote-subtitle {
        margin-bottom: 50px;
    }

    .quote-content {
        font-size: 20px;
        line-height: 1.7;
        padding: 30px 25px;
        margin-left: 16px;
        margin-right: 16px;
        width: calc(100% - 32px);
    }

    .date-display {
        margin-bottom: 50px;
    }

    .chinese-character {
        font-size: 75px;
        top: 35px;
        right: 35px;
        opacity: 0.35;
    }

    .quote-source-container {
        bottom: 15px;
        right: 10px;
    }

    .refresh-btn,
    .like-btn,
    .share-btn {
        width: 36px;
        height: 36px;
        opacity: 0.5;
    }

    .buttons-container .refresh-btn,
    .buttons-container .like-btn,
    .buttons-container .share-btn {
        width: 36px;
        height: 36px;
        opacity: 0.5;
    }

    .quote-icon {
        width: 18px;
    }

    .quote-icon-left {
        left: -16px;
    }

    .quote-icon-right {
        right: -16px;
    }

    .footer {
        padding: 10px 0;
        font-size: 11px;
    }

    .footer-content {
        padding: 0 12px;
    }

    .buttons-container {
        bottom: 30px;
        gap: 15px;
    }

    .collection-selector-btn {
        width: 36px;
        height: 36px;
    }

    .collection-selector-btn svg {
        width: 24px;
        height: 24px;
    }

    .collections-dropdown {
        width: 300px;
        top: 60%;
    }

    .dropdown-items {
        grid-template-columns: 1fr 1fr;
    }

    .dropdown-item {
        padding: 8px 10px;
        font-size: 13px;
    }
}

@media (max-width: 400px) {
    .quote-box {
        padding-bottom: 100px;
    }

    .quote-source-container {
        bottom: 15px;
        right: 10px;
    }
}

/* 添加 body.dark-mode 样式 */
body.dark-mode {
    --primary-color: #e1e1e1;
    --secondary-color: #a0a0a0;
    --accent-color: #888888;
    --background-color: #1a1a1a;
    --quote-bg: #242424;
    --border-color: #333333;
    --ink-color: #f1f1f1;
    --progress-color: var(--progress-color-dark);

    /* 暗色模式下的特定元素样式 */
    .quote-icon {
        opacity: 0.3;
        fill: var(--primary-color);
        filter: brightness(1.2);
    }

    .chinese-character {
        color: rgba(255, 255, 255, 0.35);
    }

    .footer-link,
    .footer-text {
        color: rgba(255, 255, 255, 0.7);
    }

    .quote-content {
        border-top: 1px solid rgba(255, 255, 255, 0.04);
        border-bottom: 1px solid rgba(255, 255, 255, 0.04);
        border-image: linear-gradient(90deg,
                rgba(255, 255, 255, 0.02) 0%,
                rgba(255, 255, 255, 0.08) 50%,
                rgba(255, 255, 255, 0.02) 100%);
        border-image-slice: 1;
    }

    #quote-source {
        background: rgba(255, 255, 255, 0.03);
        border-color: rgba(255, 255, 255, 0.05);
    }

    #quote-source:hover {
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.08);
    }

    #quote-source:active {
        background: rgba(255, 255, 255, 0.04);
    }

    .quote-source-dropdown {
        background: var(--quote-bg);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }

    .dropdown-item:not(:last-child) {
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .dropdown-item:hover {
        background: rgba(255, 255, 255, 0.03);
    }

    .dropdown-item.active {
        background: rgba(255, 255, 255, 0.05);
    }

    #current-collection {
        color: rgba(255, 255, 255, 0.7);
    }

    #current-collection:hover {
        opacity: 0.9;
    }

    .reading-progress {
        background: rgba(60, 61, 55, 0.3);
        /* #3C3D37 with alpha */
    }

    .reading-progress::before {
        background: var(--progress-color-dark);
    }

    .collections-dropdown {
        background: var(--quote-bg);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }

    .dropdown-header {
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .dropdown-item {
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid rgba(255, 255, 255, 0.05);
    }

    .dropdown-item:hover {
        background: rgba(255, 255, 255, 0.06);
    }

    .dropdown-item.active {
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.12);
    }

    .footer-tips {
        color: #666;
    }

    .celebration-toast {
        background: #303030 !important;
        border-color: #444 !important;
        box-shadow: 0 0 10px 1px rgba(255, 255, 255, 0.07) !important;
    }
}

.footer {
    width: 100%;
    padding: 15px 0;
    background: var(--background-color);
    font-size: 13px;
    color: var(--accent-color);
    letter-spacing: 0.5px;
    font-weight: 300;
    margin-top: 5px;
}

.footer-content {
    max-width: 768px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.footer-text {
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.footer-divider {
    opacity: 0.4;
}

.footer-link {
    color: var(--accent-color);
    text-decoration: none;
    opacity: 0.9;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
}

.footer-link:hover,
.footer-text:hover {
    opacity: 1;
}

.twitter-icon {
    vertical-align: middle;
    margin-top: 1px;
    transform-origin: center !important;
    /* 加长显示时间 */
    transition: opacity 0.5s ease-in-out !important;
}

.like-btn,
.share-btn {
    background: transparent;
    color: var(--accent-color);
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity var(--transition-time) cubic-bezier(0.19, 1, 0.22, 1);
    position: absolute;
    bottom: 40px;
    opacity: 0.4;
    overflow: hidden;
}

.like-btn {
    left: 50%;
    transform: translateX(-30px);
}

.share-btn {
    left: 50%;
    transform: translateX(20px);
}

.like-btn::after,
.share-btn::after {
    content: '';
    position: absolute;
    width: 150%;
    height: 150%;
    background: radial-gradient(circle, rgba(0, 0, 0, 0.1) 10%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
}

.like-btn:hover,
.share-btn:hover {
    opacity: 0.7;
}

.like-btn:active,
.share-btn:active {
    opacity: 0.9;
}

.like-btn:active::after,
.share-btn:active::after {
    opacity: 1;
}

.like-btn svg,
.share-btn svg {
    width: 24px;
    height: 24px;
    transition: transform 0.2s ease;
}

.like-btn.active {
    opacity: 0.8;
}

.like-btn.active svg {
    fill: var(--accent-color);
}

/* 新增按钮容器 */
.buttons-container {
    position: absolute;
    bottom: -30px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    z-index: 5;
}

.buttons-container .refresh-btn,
.buttons-container .like-btn,
.buttons-container .share-btn {
    position: static;
    transform: none;
    margin: 0;
}

/* 新增UI组件样式 */
/* 格言集合名称 */
.quote-collection {
    margin-top: 25px;
    margin-bottom: 5px;
    text-align: right;
    padding-right: 8px;
    position: relative;
}

#current-collection {
    font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
    font-display: swap;
    font-size: 13px;
    color: var(--secondary-color);
    letter-spacing: 0.8px;
    font-weight: 300;
    display: inline-block;
    position: relative;
    transition: all 0.3s ease;
    font-style: italic;
    opacity: 0.7;
}

#current-collection:hover {
    opacity: 0.9;
}

/* 底部操作区域 */
.quote-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    margin-top: 25px;
}

/* 阅读进度指示器 */
.reading-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(236, 223, 204, 0.4);
    /* #ECDFCC with alpha */
    overflow: hidden;
}

.reading-progress::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: var(--reading-progress, 0%);
    background: var(--progress-color);
    opacity: 0.2;
    transition: width 0.5s ease;
}

#progress-indicator {
    font-size: 10px;
    color: var(--secondary-color);
    letter-spacing: 0.5px;
    font-weight: 300;
    position: relative;
    z-index: 1;
}

@media (max-width: 767px) {
    .reading-progress {
        height: 25px;
    }

    #progress-indicator {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .reading-progress {
        height: 22px;
    }

    #progress-indicator {
        font-size: 10px;
    }
}

/* 集合选择按钮 */
.collection-selector-btn {
    background: transparent;
    color: var(--accent-color);
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity var(--transition-time) cubic-bezier(0.19, 1, 0.22, 1);
    opacity: 0.4;
    position: relative;
}

.collection-selector-btn:hover {
    opacity: 0.7;
}

.collection-selector-btn:active {
    opacity: 0.9;
}

.collection-selector-btn svg {
    width: 24px;
    height: 24px;
    transition: transform 0.2s ease;
}

/* 集合选择下拉菜单 */
.collections-dropdown {
    position: fixed;
    left: 50%;
    top: 55%;
    transform: translate(-50%, -50%) scale(0.95);
    background: var(--quote-bg);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 420px;
    display: flex;
    flex-direction: column;
    z-index: 10;
    border: 1px solid rgba(128, 128, 128, 0.15);
    padding-bottom: 15px;
}

.collections-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.dropdown-header {
    padding: 15px 20px;
    color: var(--primary-color);
    font-size: 16px;
    text-align: center;
    border-bottom: 1px solid rgba(128, 128, 128, 0.1);
    font-weight: 500;
    margin-bottom: 10px;
}

.dropdown-items {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-gap: 12px;
    padding: 0 15px;
}

.dropdown-item {
    padding: 12px 16px;
    color: var(--primary-color);
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    text-align: center;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dropdown-item:hover {
    background: rgba(0, 0, 0, 0.04);
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.dropdown-item.active {
    background: rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.1);
    font-weight: 500;
}

@media (max-width: 767px) {
    .quote-collection {
        margin-top: 20px;
        margin-bottom: 10px;
        text-align: right;
        padding-right: 8px;
    }

    #current-collection {
        font-size: 13px;
        padding: 4px 10px;
    }

    .reading-progress {
        margin-bottom: 0px;
    }

    #progress-indicator {
        font-size: 12px;
    }

    .collections-dropdown {
        width: 360px;
    }

    .dropdown-header {
        padding: 12px 15px;
        font-size: 15px;
    }

    .dropdown-item {
        padding: 10px 12px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .quote-collection {
        margin-top: 15px;
        margin-bottom: 8px;
        text-align: right;
        padding-right: 8px;
    }

    #current-collection {
        font-size: 12px;
        padding: 3px 8px;
        position: static;
    }

    .reading-progress {
        margin-bottom: 0px;
    }

    #progress-indicator {
        font-size: 11px;
    }

    .collection-selector-btn {
        width: 36px;
        height: 36px;
    }

    .collection-selector-btn svg {
        width: 24px;
        height: 24px;
    }

    .collections-dropdown {
        width: 300px;
        top: 60%;
    }

    .dropdown-header {
        padding: 10px;
        font-size: 14px;
    }

    .dropdown-items {
        grid-template-columns: 1fr 1fr;
    }

    .dropdown-item {
        padding: 8px 10px;
        font-size: 13px;
    }
}

/* 个人按钮样式 - 与其他按钮保持一致 */
.personal-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.19, 1, 0.22, 1);
    position: relative;
    margin: 0;
    color: var(--accent-color);
}

.personal-btn:hover {
    color: var(--primary-color);
    transform: translateY(-1px);
}

.personal-btn:active {
    transform: translateY(0);
}

.personal-btn svg {
    width: 24px;
    height: 24px;
    stroke-width: 1;
    transition: all 0.2s cubic-bezier(0.19, 1, 0.22, 1);
}

.personal-btn.active {
    color: var(--primary-color);
    transform: scale(1.1);
}

.personal-btn.active svg {
    stroke-width: 1.5;
    fill: rgba(0, 0, 0, 0.1);
}

@media (max-width: 480px) {
    .personal-btn {
        width: 38px;
        height: 38px;
    }

    .personal-btn svg {
        width: 24px;
        height: 24px;
    }
}

/* 隐藏收藏视图中的进度条，但保留文本 */
.reading-progress.favorites-view::before {
    display: none;
    /* 隐藏进度条 */
}

/* 添加quote-text的样式以支持换行符 */
#quote-text {
    white-space: pre-line;
}

/* 页脚提示样式 */
.footer-tips {
    font-size: 0.75em;
    /* 保持相对字体大小 */
    color: #888;
    /* 默认浅灰色 */
    margin-top: 12px;
    /* 增加与上方内容的间距 */
    text-align: center;
    letter-spacing: 0.5px;
    /* 轻微增加字间距 */
    padding: 0 15px;
    /* 左右留白 */
}

/* 为庆祝 toast 添加特殊样式 */
.celebration-toast {
    /* 使用更柔和的背景色，接近卡片背景但略有区分 */
    background: var(--quote-bg) !important;
    /* 使用主文本颜色，但稍微突出一点 */
    color: var(--primary-color) !important;
    padding: 14px 28px !important;
    font-size: 15px !important;
    border-radius: 8px !important;
    /* 稍微圆润一点 */
    /* 使用更细微的阴影 */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    font-weight: 500 !important;
    /* 稍微粗一点，增强可读性 */
    /* 添加一个微妙的边框，颜色比背景稍深/浅 */
    border: 1px solid var(--border-color) !important;
    /* 可以添加微妙的透明度 */
    opacity: 0.97 !important;
    /* 添加微妙的边框发光效果 */
    box-shadow: 0 0 8px 1px rgba(255, 255, 255, 0.1) !important;
    /* 添加轻微的动画效果 */
    animation: celebrationPulse 2.5s ease-in-out !important;
    /* 添加字间距使文字更具仪式感 */
    letter-spacing: 0.6px !important;
    /* 确保文本不会换行 */
    white-space: nowrap !important;
    /* 让文字居中 */
    text-align: center !important;
    /* 添加表情图标前的空间 */
    position: relative !important;
    /* 轻微提高 z-index 确保其显示在最上层 */
    z-index: 20 !important;
    /* 添加一点上下移动的动画 */
    transform-origin: center !important;
    /* 加长显示时间 */
    transition: opacity 0.5s ease-in-out !important;
}

/* 庆祝toast的微妙呼吸动画 - 淡入淡出效果 */
@keyframes celebrationPulse {
    0% {
        transform: translateX(-50%) translateY(10px);
        opacity: 0;
    }

    20% {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }

    80% {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }

    100% {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* 添加主题切换按钮的样式 */
.theme-toggle-btn {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
}

.theme-toggle-btn svg {
    display: block;
    /* 确保 SVG 表现为块级元素 */
}

/* --- 墨水屏模式优化 --- */
body.eink-mode {
    --primary-color: #000000;
    --secondary-color: #333333;
    /* 稍浅的黑色用于次要文本 */
    --accent-color: #000000;
    /* 操作按钮等也用黑色 */
    --background-color: #ffffff;
    --quote-bg: #ffffff;
    --border-color: #000000;
    /* 黑色边框 */
    --ink-color: #000000;
    --progress-color: #000000;
    /* 进度条也用黑色 */
    --progress-color-dark: #000000;
    /* 确保暗色模式下的进度条变量也被覆盖 */

    font-family: sans-serif;
    /* 优先使用无衬线字体 */
    transition: none !important;
    /* 禁用 body 的过渡 */
}

.eink-mode *,
.eink-mode *::before,
.eink-mode *::after {
    /* 强制禁用所有元素的动画和过渡 */
    animation: none !important;
    transition: none !important;
    /* 移除阴影 */
    box-shadow: none !important;
    text-shadow: none !important;
    /* 移除混合模式和模糊 */
    mix-blend-mode: normal !important;
    filter: none !important;
    /* 禁用可能存在的背景图片/渐变 */
    background-image: none !important;
    /* 移除 backdrop-filter */
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* 特定元素调整 */
.eink-mode .quote-box {
    border: 1px solid var(--border-color);
    background: var(--quote-bg);
    padding: 50px 40px 70px;
    /* 调整内边距适应边框 */
}

.eink-mode .date-line {
    background-color: var(--border-color);
    opacity: 1;
}

.eink-mode .quote-content {
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    border-image: none;
    /* 移除渐变边框 */
}

.eink-mode .quote-icon {
    fill: var(--primary-color);
    opacity: 1;
}

.eink-mode .chinese-character {
    color: #dddddd;
    /* 可以用浅灰色，避免纯黑遮挡文字 */
    opacity: 1;
    mix-blend-mode: normal;
    /* 移除混合 */
    filter: none;
    /* 移除模糊 */
}

.eink-mode #quote-source {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--primary-color);
    padding: 5px 12px;
    opacity: 1;
}

.eink-mode #quote-source:hover {
    background: #eee;
    /* 简单的悬停反馈 */
    transform: none;
    border-color: var(--border-color);
}

.eink-mode #quote-source:active {
    background: #ddd;
    transform: none;
}

.eink-mode .refresh-btn,
.eink-mode .like-btn,
.eink-mode .share-btn,
.eink-mode .collection-selector-btn,
.eink-mode .personal-btn {
    color: var(--accent-color);
    opacity: 1;
    border: 1px solid transparent;
    /* 添加透明边框占位 */
}

/* 简化按钮反馈 */
.eink-mode .refresh-btn:hover,
.eink-mode .like-btn:hover,
.eink-mode .share-btn:hover,
.eink-mode .collection-selector-btn:hover,
.eink-mode .personal-btn:hover {
    opacity: 1;
    background-color: #eee;
    border: 1px solid var(--border-color);
}

.eink-mode .refresh-btn:active,
.eink-mode .like-btn:active,
.eink-mode .share-btn:active,
.eink-mode .collection-selector-btn:active,
.eink-mode .personal-btn:active {
    opacity: 1;
    background-color: #ddd;
    border: 1px solid var(--border-color);
}

.eink-mode .like-btn.active svg {
    fill: var(--accent-color);
}

.eink-mode .personal-btn.active svg {
    fill: var(--accent-color);
    stroke-width: 2;
    /* 加粗表示激活 */
}

.eink-mode .footer-link {
    color: var(--accent-color);
    opacity: 1;
    text-decoration: none;
    /* Removed underline */
    transition: none !important;
}

.eink-mode .footer-link:hover {
    color: #333;
}

.eink-mode .footer-tips {
    color: var(--secondary-color);
}

.eink-mode .reading-progress {
    background: #eee;
    border-top: 1px solid var(--border-color);
}

.eink-mode .reading-progress::before {
    background: var(--progress-color);
    opacity: 0.5;
    /* 降低不透明度使其不那么刺眼 */
}

.eink-mode #progress-indicator {
    color: var(--secondary-color);
}

/* 简化下拉菜单 */
.eink-mode .collections-dropdown {
    background: var(--quote-bg);
    border: 1px solid var(--border-color);
    box-shadow: none;
    opacity: 0;
    /* 初始隐藏，由JS控制 */
    visibility: hidden;
    transform: translate(-50%, -50%) scale(1);
    /* 移除缩放动画 */
}

.eink-mode .collections-dropdown.show {
    opacity: 1;
    visibility: visible;
}

.eink-mode .dropdown-header {
    border-bottom: 1px solid var(--border-color);
}

.eink-mode .dropdown-item {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--primary-color);
}

.eink-mode .dropdown-item:hover {
    background: #eee;
    transform: none;
    box-shadow: none;
}

.eink-mode .dropdown-item.active {
    background: #ddd;
    border: 1px solid var(--border-color);
    font-weight: bold;
    /* 使用加粗表示激活 */
}

.eink-mode .toast {
    background: #ffffff !important;
    color: #000000 !important;
    border: 1px solid #000000 !important;
    box-shadow: none !important;
    opacity: 0;
    /* 初始隐藏，JS控制 */
    transition: none !important;
    /* 禁用动画 */
}

/* 墨水屏模式激活时，切换按钮的图标样式 */
.eink-mode #eink-toggle-btn svg {
    fill: currentColor;
    /* 填充图标表示激活 */
}

/* 确保暗色模式下的样式在墨水屏模式下被覆盖 */
body.dark-mode.eink-mode {
    /* 强制使用墨水屏的颜色变量 */
    --primary-color: #000000;
    --secondary-color: #333333;
    --accent-color: #000000;
    --background-color: #ffffff;
    --quote-bg: #ffffff;
    --border-color: #000000;
    --ink-color: #000000;
    --progress-color: #000000;
    --progress-color-dark: #000000;
}

/* --- Footer E-ink Adjustments --- */
.eink-mode .footer {
    color: var(--primary-color);
    /* Ensure footer base color is black */
}

.eink-mode .footer-text {
    color: #000000 !important;
    /* Explicitly black, increase importance */
    opacity: 1 !important;
    /* Fully opaque, increase importance */
    transition: none !important;
}

.eink-mode .footer-divider {
    color: #000000;
    /* Black */
    opacity: 0.6;
    /* Make divider visible but slightly dimmer */
    transition: none !important;
}

.eink-mode .footer-link {
    color: var(--primary-color);
    /* Black */
    opacity: 1;
    /* Fully opaque */
    text-decoration: none;
    /* Removed underline */
    transition: none !important;
}

.eink-mode .footer-link:hover {
    color: var(--primary-color);
    /* No color change on hover */
    background-color: #eee;
    /* Simple background hover */
}

/* Ensure SVGs in footer are black */
.eink-mode .footer-link svg {
    stroke: var(--primary-color) !important;
    /* Force black stroke */
    fill: var(--primary-color) !important;
    /* Force black fill */
}

/* Specific icons might need fill/stroke adjustments */
.eink-mode .twitter-icon {
    fill: var(--primary-color) !important;
    stroke: none !important;
    /* Twitter icon only uses fill */
}

.eink-mode #theme-toggle-btn svg path,
.eink-mode #eink-toggle-btn svg path {
    stroke: var(--primary-color) !important;
    /* Ensure paths are stroked black */
    fill: none !important;
    /* Ensure they are not filled by default */
}

/* Style for active e-ink toggle button icon */
.eink-mode #eink-toggle-btn.active svg path {
    fill: var(--primary-color) !important;
    /* Fill the icon when active */
}

.eink-mode .personal-btn.active svg {
    fill: var(--accent-color);
    stroke-width: 2;
    /* 加粗表示激活 */
}

/* Ensure text within links is also explicitly styled */
.eink-mode .footer-link .footer-text {
    color: #000000 !important;
    /* Explicitly black, increase importance */
    opacity: 1 !important;
    /* Fully opaque, increase importance */
}

.eink-mode .footer-link:hover {
    color: #000000;
    /* No color change on hover */
}

/* Tooltip 样式 */
.shortcuts-tooltip {
    position: absolute;
    bottom: calc(100% + 10px);
    /* 定位在按钮上方，并留出间距 */
    left: 50%;
    /* 初始居中 */
    transform: translateX(-50%);
    /* 水平居中 */
    background-color: var(--primary-color);
    /* 使用主颜色作为背景 */
    color: var(--background-color);
    /* 使用背景色作为文字颜色，形成对比 */
    padding: 8px 15px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    /* 防止换行 */
    z-index: 15;
    /* 确保在其他页脚元素之上 */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Tooltip 显示状态 */
.shortcuts-tooltip.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* 确保 footer 是相对定位的 */
footer.footer {
    position: relative;
    /* 为 Tooltip 提供定位上下文 */
}

/* 调整 footer 内边距以适应 Tooltip 可能的溢出 */
.footer {
    padding-bottom: 30px;
    /* 增加底部内边距 */
}