/* 关键CSS变量 */
:root {
    --primary-color: #4e73df;
    --secondary-color: #f8f9fc;
    --accent-color: #e74a3b;
    --dark-color: #252729;
    --light-color: #f8f9fa;
    --success-color: #28a745;
    --card-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    --hover-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

/* 深色模式变量 */
[data-bs-theme=dark] {
    --primary-color: #5e83ef;
    --secondary-color: #1e2124;
    --accent-color: #ff6b6b;
    --dark-color: #e9ecef;
    --light-color: #343a40;
    --success-color: #38c959;
    --card-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    --hover-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
    color-scheme: dark;
}

.hidden-initially {
    display: none;
}

.action-menu-style {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    z-index: 10;
}

/* 避免布局偏移 - 预设空间 */
body {
    background-color: var(--secondary-color);
    padding-top: 20px;
    padding-bottom: 70px;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    font-weight: 400;
    background-image: linear-gradient(120deg, var(--secondary-color) 0%, #2c3136 100%);
    color: var(--dark-color);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    contain: content;
    /* 性能优化 */
    content-visibility: auto;
    contain-intrinsic-size: 1000px;
}

[data-bs-theme=dark] body {
    background: linear-gradient(135deg, #0d1117 0%, #161b22 50%, #0d1117 100%);
    background-attachment: fixed;
    color: #e6edf3;
    font-weight: 350;
}

/* 启用硬件加速 */
.time-display, 
.bookmark-card, 
.theme-toggle, 
.bookmark-icon,
.custom-icon,
.info-section,
.side-controls {
    transform: translateZ(0);
    will-change: transform;
}

/* 性能优化：使用简单边框替代复杂阴影 */
@media (max-width: 768px) {
    .bookmark-card {
        box-shadow: none;
        border: 1px solid rgba(0,0,0,0.1);
    }
    
    [data-bs-theme=dark] .bookmark-card {
        border: 1px solid rgba(255,255,255,0.1);
    }
}

.site-header {
    margin-bottom: 2rem;
    position: relative;
    text-align: center;
    padding-top: 1rem;
}

.site-header h1 {
    background: linear-gradient(135deg, 
        #6e93ff 0%, 
        #7ea3ff 25%, 
        #8eb3ff 50%, 
        #7ea3ff 75%, 
        #6e93ff 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
    font-size: 3.2rem;
    letter-spacing: -0.02em;
    text-shadow: 
        0 1px 1px rgba(0,0,0,0.2),
        0 2px 3px rgba(0,0,0,0.15),
        0 4px 6px rgba(0,0,0,0.1),
        0 8px 12px rgba(0,0,0,0.05),
        0 0 15px rgba(110, 147, 255, 0.3),
        0 0 25px rgba(110, 147, 255, 0.2),
        0 0 35px rgba(110, 147, 255, 0.1);
    margin-bottom: 1rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    transform: perspective(600px) rotateX(3deg);
    transition: all 0.4s ease;
    animation: metalShine 3s ease-in-out infinite;
    position: relative;
}

@keyframes metalShine {
    0%, 100% { 
        background-position: 0% 50%;
        text-shadow: 
            0 1px 1px rgba(0,0,0,0.3),
            0 2px 3px rgba(0,0,0,0.2),
            0 4px 6px rgba(0,0,0,0.15),
            0 8px 12px rgba(0,0,0,0.1),
            0 0 15px rgba(110, 147, 255, 0.3),
            0 0 25px rgba(110, 147, 255, 0.2),
            0 0 35px rgba(110, 147, 255, 0.1);
    }
    50% { 
        background-position: 100% 50%;
        text-shadow: 
            0 1px 1px rgba(0,0,0,0.4),
            0 2px 4px rgba(0,0,0,0.3),
            0 4px 8px rgba(0,0,0,0.2),
            0 8px 16px rgba(0,0,0,0.15),
            0 0 25px rgba(110, 147, 255, 0.5),
            0 0 40px rgba(110, 147, 255, 0.4),
            0 0 55px rgba(110, 147极光, 255, 0.3);
    }
}

@media (max-width: 768px) {
    .site-header h1 {
        font-size: 2.2rem;
        font-weight: 650;
    }
}

.bookmark-card {
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    height: 100%;
    border-radius: 16px;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.08),
        0 1px 3px rgba(0, 0, 0, 0.04);
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    border: none;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

[data-bs-theme=dark] .bookmark-card {
    background: linear-gradient(135deg, #1a1d21 0%, #23272b 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 
        0 6px 25px rgba(0, 0, 0, 0.4),
        0 2px 6px rgba(0, 0, 0, 0.25);
}

.bookmark-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.15),
        0 4px 12px rgba(0, 0, 0, 0.08);
}

.bookmark-card:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary-color);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

.bookmark-card:hover:after {
    transform: scaleX(1);
    transform-origin: left;
}

/* 在移动端不使用悬停效果 */
@media (max-width: 767px) {
    .bookmark-card:hover {
        transform: none;
    }
    
    .bookmark-card:hover:after {
        transform: scaleX(0);
    }
}

.card-body {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    text-align: center;
    height: 100%;
    padding: 1.5rem;
    position: relative;
    z-index: 1;
}

.bookmark-icon {
    font-size: 3.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    transition: transform 0.3s ease;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.bookmark-card:hover .bookmark-icon {
    transform: scale(1.1);
}

.custom-icon {
    max-height: 64px;
    max-width: 64px;
    min-height: 48px;
    min-width: 48px;
    margin-bottom: 20px;
    border-radius: 8px;
    transition: transform 0.3s ease;
    display: block;
    margin-left: auto;
    margin-right: auto;
    object-fit: contain;
}

.bookmark-card:hover .custom-icon {
    transform: scale(1.1);
}

.modal-header {
    background-color: var(--secondary-color);
    border-bottom: 3px solid var(--primary-color);
}

[data-bs-theme=dark] .modal-content {
    background: linear-gradient(135deg, #1a1d21 0%, #23272b 100%);
    color: #e6edf3;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-bs-theme=dark] .form-control {
    background-color: #161b22;
    border-color: #30363d;
    color: #e6edf3;
}

[data-bs-theme=dark] .form-control:focus {
    background-color: #1a1d21;
    border-color: #58a6ff;
    box-shadow: 0 0 0 0.2rem rgba(88, 166, 255, 0.25);
}

.bookmark-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.bookmark-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.edit-btn {
    background-color: var(--primary-color);
    margin-right: 5px;
}

.delete-btn {
    background-color: var(--accent-color);
}

/* 在移动端始终显示操作按钮 */
@media (min-width: 768px) {
    .bookmark-card:hover .bookmark-actions {
        opacity: 1;
    }
}

@media (max-width: 767px) {
    .bookmark-actions {
        opacity: 1;
    }
    /* Bookmark grid adjustments for mobile */
    .bookmark-grid {
        grid-template-columns: repeat(4, 1fr); /* Display 4 items per row on mobile */
        gap: 10px; /* Reduce gap on mobile */
    }
}

.flash-messages {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 90%;
}

/* 移动端底部导航 */
.mobile-nav-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--light-color);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    padding: 15px 0;
    z-index: 1000;
}

@media (max-width: 767px) {
    .mobile-nav-bar {
        display: flex;
    }
    .desktop-add-btn {
        display: none;
    }
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    h1 {
        font-size: 1.8rem;
    }
    .flash-messages {
        top: 10px;
        right: 10px;
        left: 10px;
    }
}

/* 长按交互 */
.long-press-indicator {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.1);
    z-index: 1;
    border-radius: 10px;
}

/* 排序模式样式 */
.sort-mode .bookmark-card {
    cursor: move;
    transform: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: transform 0.1s, box-shadow 0.1s;
}

.sort-mode .bookmark-card:hover {
    transform: none;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.sort-mode .bookmark-link {
    pointer-events: none;
}

.sortable-ghost {
    opacity: 0.3;
    background: #f8f9fa;
}

.sortable-chosen {
    box-shadow: 0 10px 20px rgba(0,0,0,0.2) !important;
    background-color: white;
    transform: rotate(2deg) scale(1.02);
}

.sortable-drag {
    opacity: 0.8;
}

.sort-controls {
    display: none;
    margin-bottom: 20px;
    text-align: center;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    font-weight: 550;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
    padding: 10px 20px;
    border-radius: 8px;
}

.btn-primary:hover {
    background-color: #375de0;
    border-color: #375de0;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(78, 115, 223, 0.3);
}

.btn-danger {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    font-weight: 550;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
    padding: 10px 20px;
    border-radius: 8px;
}

.btn-danger:hover {
    background-color: #dc3545;
    border-color: #dc3545;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.card-title {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 1.15rem;
    color: var(--dark-color);
    letter-spacing: -0.01em;
    line-height: 1.3;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

.card-text {
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.4;
    font-weight: 400;
    letter-spacing: 0.01em;
}

[data-bs-theme=dark] .card-title {
    color: #f8f9fa;
    font-weight: 550;
}

[data-bs-theme=dark] .card-text {
    color: #adb5bd;
    font-weight: 350;
}

.bookmark-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    overflow: hidden;
}

.modal-title {
    font-weight: 650;
    color: var(--dark-color);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1.4rem;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

[data-bs-theme=dark] .modal-title {
    color: #f8f9fa;
    font-weight: 600;
}

.form-control {
    border-radius: 8px;
    padding: 12px 16px;
    border: 1px solid #e2e6ea;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    font-size: 0.95rem;
    font-weight: 400;
    line-height: 1.4;
    transition: all 0.2s ease;
}

.form-control:focus {
    box-shadow: 0 0 0 3px rgba(78, 115, 223, 0.15);
    border-color: var(--primary-color);
}

.form-label {
    font-weight: 550;
    color: #495057;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    font-size: 0.95rem;
    letter-spacing: -0.01em;
    margin-bottom: 8px;
}

[data-bs-theme=dark] .form-label {
    color: #ced4da;
    font-weight: 500;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    border-radius: 10px;
    background-color: var(--light-color);
    box-shadow: var(--card-shadow);
    margin-top: 2rem;
}

[data-bs-theme=dark] .empty-state {
    background-color: #2b3035;
}

.empty-state i {
    font-size: 3rem;
    color: #d1d3e2;
    margin-bottom: 1rem;
}

.empty-state p {
    color: #858796;
    font-size: 1.1rem;
}

[data-bs-theme=dark] .empty-state p {
    color: #adb5bd;
}

/* 图标相关样式 */
.loading {
    background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1MTIgNTEyIj48cGF0aCBmaWxsPSIjNmM3NTdkIiBkPSJNMzA0IDQ4Yy0yNi41IDAtNDggMjEuNS00OCA0OHMyMS41IDQ4IDQ4IDQ4IDQ4LTIxLjUgNDgtNDgtMjEuNS00OC00OHptMCAyNTZjLTI2LjUgMC00OCAyMS41LTQ4IDQ4czIxLjUgNDggNDggNDggNDgtMjEuNSA0OC00OC0yMS41LTQ4LTQ4LTQ4em0tMTUtMjRjMC0yNi41LTIxLjUtNDgtNDgtNDhzLTQ4IDIxLjUtNDggNDggMjEuNSA0OCA0OC0yMS41IDQ4LTQ4eiI+PC9wYXRoPjwvc3ZnPg==');
    background-repeat: no-repeat;
    background-position: calc(100% - 10px) center;
    background-size: 20px;
    padding-right: 40px;
}

.icon-preview-box {
    display: inline-block;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    background-color: #f8f9fa;
    min-width: 90px;
    min-height: 90px;
    position: relative;
    text-align: center;
}

[data-bs-theme=dark] .icon-preview-box {
    border-color: #495057;
    background-color: #343a40;
}

.icon-preview-box img {
    max-width: 64px;
    max-height: 64px;
    min-width: 32px;
    min-height: 32px;
    display: block;
    margin: 0 auto;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    object-fit: contain;
}

.form-switch .form-check-input {
    width: 2.5em;
    height: 1.25em;
    margin-top: 0.125em;
    cursor: pointer;
}

.form-switch .form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* 卡片内部结构样式 */
.icon-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 80px;
    margin-bottom: 15px;
    width: 100%;
}

.bookmark-info {
    width: 100%;
}

/* 增强图标显示效果 */
.icon-container img, .icon-container i {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

[data-bs-theme=dark] .icon-container img, [data-bs-theme=dark] .icon-container i {
    filter: drop-shadow(0 2px 4px rgba(255, 255, 255, 0.1));
}

/* 主题切换按钮 */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--light-color);
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    transform: scale(1.1);
}

@media (max-width: 767px) {
    .theme-toggle {
        top: auto;
        bottom: 70px;
        right: 15px;
        width: 45px;
        height: 45px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    }
}

/* 时间日期和每日格言区域 */
.info-section {
    position: fixed;
    right: 20px;
    top: 75px;
    width: 250px;
    text-align: center;
    padding: 15px;
    background-color: var(--light-color);
    border-radius: 10px;
    box-shadow: var(--card-shadow);
    z-index: 100;
}

[data-bs-theme=dark] .info-section {
    background-color: #2b3035;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

@media (max-width: 991px) {
    .info-section {
        display: none;
    }
}

.time-display {
    font-size: 2.4rem;
    font-weight: 750;
    margin-bottom: 5px;
    color: var(--primary-color);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    letter-spacing: -0.03em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.date-display {
    font-size: 1.15rem;
    margin-bottom: 15px;
    color: var(--dark-color);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 450;
    letter-spacing: 0.01em;
}

[data-bs-theme=dark] .date-display {
    color: #ced4da;
    font-weight: 400;
}

.quote-container {
    position: relative;
    padding: 15px;
    margin-top: 15px;
    background-color: rgba(0, 0, 0, 0.03);
    border-left: 4px solid var(--primary-color);
    border-radius: 0 5px 5px 0;
}

[data-bs-theme=dark] .quote-container {
    background-color: rgba(255, 255, 255, 0.03);
}

.quote-container::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 10px;
    background-color: var(--light-color);
    padding: 0 10px;
    font-size: 0.8rem;
    color: var(--primary-color);
    border-radius: 4px;
    display: none;
}

[data-bs-theme=dark] .quote-container::before {
    background-color: #2b3035;
}

.quote-text {
    font-style: italic;
    margin-bottom: 10px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.5;
    color: #6c757d;
}

.quote-author {
    font-weight: 550;
    text-align: right;
    color: var(--primary-color);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.9rem;
    letter-spacing: 0.01em;
}

[data-bs-theme=dark] .quote-text {
    color: #adb5bd;
    font-weight: 350;
}

[data-bs-theme=dark] .quote-author {
    color: #58a6ff;
    font-weight: 500;
}

/* 移动端时间日期和格言区域 */
.mobile-info-section {
    display: none;
    margin-bottom: 2rem;
    text-align: center;
    padding: 15px;
    background-color: var(--light-color);
    border-radius: 10px;
    box-shadow: var(--card-shadow);
}

[data-bs-theme=dark] .mobile-info-section {
    background-color: #2b3035;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

@media (max-width: 991px) {
    .mobile-info-section {
        display: block;
    }
}

/* 侧边控制面板 */
.side-controls {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 100;
}

.side-controls .btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 1.5rem;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
}

.side-controls .btn:hover {
    transform: scale(1.1);
}

@media (max-width: 991px) {
    .side-controls {
        display: none;
    }
}

/* 左侧公告区域样式 */
.announcement-section {
    position: fixed;
    left: 20px; /* 与 side-controls 同侧 */
    top: 75px; /* 与 info-section 顶部对齐或根据需要调整 */
    width: 250px; /* 与 info-section 宽度类似 */
    text-align: left; /* 公告内容左对齐 */
    padding: 15px;
    background-color: var(--light-color);
    border-radius: 10px;
    box-shadow: var(--card-shadow);
    z-index: 100; /* 与 info-section层级类似 */
    max-height: calc(80vh - 150px); /* 限制最大高度为视口的80%，可调整 */
    display: flex;
    flex-direction: column;
    overflow-y: auto; /* 当整个区域超出max-height时，允许滚动 */
}

/* New style for the announcement header container */
.announcement-header {
    display: flex;
    justify-content: space-between; /* Title on left, button on right */
    align-items: center; /* Vertically align items in the middle */
    margin-bottom: 10px; /* Space below the header */
}

.announcement-section h5 {
    color: var(--bs-primary);
    font-weight: bold;
    margin-bottom: 0; /* Adjusted: margin now on .announcement-header */
    padding-bottom: 5px;
    border-bottom: 1px solid var(--bs-border-color);
    font-size: 1.1rem;
}

[data-bs-theme=dark] .announcement-section {
    background-color: #2b3035;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

[data-bs-theme=dark] .announcement-section h5 {
    color: var(--bs-primary-text-emphasis);
    border-bottom-color: var(--bs-border-color);
}

/* New styles for the announcement text container */
.announcement-text-container {
    background-color: var(--bs-tertiary-bg);
    padding: 10px;
    border-radius: var(--bs-border-radius);
    border: 1px solid var(--bs-border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 6em;
    position: relative;
}

.announcement-content-display {
    font-size: 0.9rem;
    line-height: 1.6;
    position: relative;
}

.announcement-text-container.expanded .announcement-content-display {
    animation-play-state: paused;
}

.announcement-text-container.expanded {
    height: auto;
    max-height: 40vh;
    overflow-y: auto;
}

/* Style for a 'Read More' button - to be added in HTML later */
.announcement-read-more {
    font-size: 0.75em; /* Slightly smaller to fit next to title */
    background-color: rgba(var(--bs-primary-rgb), 0.1); /* Lighter background */
    color: var(--bs-primary); /* Use primary color for text */
    padding: 1px 5px; /* Adjust padding */
    border: 1px solid rgba(var(--bs-primary-rgb), 0.3);
    border-radius: 3px;
    cursor: pointer;
    margin-left: 10px; /* Space between title and button */
}

@keyframes colorfulKeyframes {
    0%   { color: red; }
    14%  { color: orange; }
    28%  { color: yellow; }
    42%  { color: limegreen; } /* Lime Green */
    57%  { color: deepskyblue; } /* Deep Sky Blue */
    71%  { color: indigo; }
    85%  { color: violet; }
    100% { color: red; } 
}

@keyframes verticalMarqueeKeyframes {
    0% {
        transform: translateY(0%);
    }
    100% {
        transform: translateY(calc(6em - 100%));
    }
}

/* Dark mode for the new text container */
[data-bs-theme="dark"] .announcement-text-container {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* 响应式：在小屏幕上隐藏公告区域 */
@media (max-width: 1199px) { /* 调整断点以更早隐藏，避免与主要内容重叠 */
    .announcement-section {
        display: none;
    }
}

/* 深色模式下的浅蓝色金属质感效果 */
[data-bs-theme=dark] .site-header h1 {
    background: linear-gradient(135deg, 
        #7ea3ff 0%, 
        #8eb3ff 25%, 
        #9ec3ff 50%, 
        #8eb3ff 75%, 
        #7ea3ff 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 750;
    text-shadow: 
        0 1px 1px rgba(0,0,0,0.2),
        0 2px 3px rgba(0,0,0,0.15),
        0 4px 6px rgba(0,0,0,0.1),
        0 8px 12px rgba(0,0,0,0.05),
        0 0 15px rgba(126, 163, 255, 0.3),
        0 0 25px rgba(126, 163, 255, 0.2),
        0 0 35px rgba(126, 163, 255, 0.1);
    transform: perspective(600px) rotateX(3deg);
    animation: metalShine 3s ease-in-out infinite;
}