/* 加载指示器样式 */

.loading-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(238, 241, 245, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.3s ease-out;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e0e0e0;
    border-top: 4px solid #4CAF50;
    border-radius: 50%;
    animation: loading-spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes loading-spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.loading-text {
    font-size: 1.1em;
    color: #1a253c;
    font-weight: 500;
    text-align: center;
}


/* 通用隐藏类 */

.hidden {
    display: none !important;
}


/* 渐出动画 */

.loading-indicator.hidden {
    opacity: 0;
    pointer-events: none;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    flex-direction: column;
    /* 为了顶部和底部按钮容器的布局 */
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    background-color: #eef1f5;
    /* 产品文档中的柔和背景色 */
    color: #333;
    text-align: center;
    padding: 15px;
    box-sizing: border-box;
    /* 使用CSS渐变背景替代外部图片，更适合服务器部署 */
    background: linear-gradient(135deg, #a1c4fd 0%, #c2e9fb 100%);
    background-attachment: fixed;
    padding-bottom: 120px;
    /* 为底部按钮区域和备案信息留出空间 */
}

.actions-container {
    /* display: flex; */
    /* Keep for potential re-use or remove if not needed */
    /* justify-content: space-between; */
    /* align-items: center; */
    /* padding: 10px 0; */
    /* Example padding */
    /* width: 100%; */
    /* margin-top: 15px; */
    /* background: rgba(255, 255, 255, 0.1); */
    /* Lighter frosted glass */
    /* backdrop-filter: blur(5px); */
    /* border-radius: 8px; */
    /* box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); */
}

.actions-container.top-actions {
    justify-content: flex-end;
    /* 语言切换按钮默认靠右 */
    margin-bottom: 10px;
}

.language-switcher button {
    background-color: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(221, 221, 221, 0.7);
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85em;
    transition: all 0.2s;
    margin-left: 8px;
    /* 按钮间距 */
    color: #333;
}

.language-switcher button:hover {
    background-color: rgba(224, 224, 224, 0.9);
    transform: translateY(-1px);
}

.language-switcher button.active {
    background-color: #4CAF50;
    color: white;
    border-color: #4CAF50;
    box-shadow: 0 0 5px rgba(76, 175, 80, 0.5);
}

.container {
    background: white;
    /* background: rgba(255, 255, 255, 0.65); */
    /* 降低一点透明度，让文字更清晰 */
    /* backdrop-filter: blur(12px); */
    /* -webkit-backdrop-filter: blur(12px); */
    padding: 25px 30px;
    border-radius: 18px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
    /* border: 1px solid rgba(255, 255, 255, 0.3); */
    border: 1px solid #e0e0e0;
    /* Adjust border for white background */
    max-width: 900px;
    width: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

h1#mainTitle {
    margin-top: 0;
    margin-bottom: 12px;
    color: #1a253c;
    font-size: 1.7em;
    /* 调整标题大小 */
    font-weight: 600;
}

p#currentDateText {
    font-size: 0.95em;
    color: #33475b;
    margin-bottom: 8px;
    /* 减小与日历的间距 */
    margin-top: 16px;
    /* 与进度条保持适当间距 */
    font-weight: 500;
    /* 稍微加粗 */
}

.date-display {
    /* 添加一个新类，使日期显示更加突出 */
    background-color: #f8f9fa;
    padding: 5px 10px;
    border-radius: 4px;
    border: 1px solid #e6e8eb;
    display: inline-block;
}

.progress-bar-container {
    width: 100%;
    max-width: none;
    background-color: rgba(223, 227, 232, 0.75);
    margin: 18px auto 0;
    /* 取消下边距，只保留上边距 */
    padding: 3px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
}

.progress-bar {
    height: 22px;
    background-image: linear-gradient(45deg, #45a247, #81c784);
    width: 0%;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.75em;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.2);
}

p#progressText {
    font-size: 1.0em;
    font-weight: 500;
    color: #1a253c;
    margin-top: 10px;
    margin-bottom: 20px;
}


/* 底部操作按钮容器 */

.actions-container.bottom-actions {
    flex-direction: column;
    /* 按钮垂直排列 */
    gap: 10px;
    /* 按钮之间的间隙 */
    margin-top: 15px;
    margin-bottom: 15px;
    width: 100%;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}


/* 以下是旧的action-button样式，现在注释掉以防止影响底栏按钮 */


/*
.action-button {
    background-color: rgba(0, 123, 255, 0.80);
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    transition: background-color 0.2s, transform 0.1s, box-shadow 0.2s;
    width: 100%;
    max-width: 280px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    text-transform: capitalize;
}

.action-button:hover {
    background-color: rgba(0, 86, 179, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.action-button:active {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
*/

.social-share-buttons {
    display: flex;
    justify-content: center;
    gap: 8px;
    align-items: center;
    margin: 0;
}

.social-button::before,
.social-button[data-platform="wechat"]::before,
.social-button[data-platform="weibo"]::before,
.social-button[data-platform="qq"]::before,
.social-button[data-platform="twitter"]::before {
    content: none;
}

.social-button {
    cursor: pointer;
}

.calendar-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(25px, 1fr));
    gap: 3px;
    justify-content: center;
    padding: 8px;
    margin-top: 8px;
    /* 减小上边距，与日期更靠近 */
    background-color: rgba(247, 248, 250, 0.80);
    border-radius: 8px;
    border: 1px solid rgba(225, 228, 232, 0.6);
    width: 100%;
    max-width: none;
    max-height: 400px;
    overflow-y: auto;
}

.day-square {
    width: 25px;
    height: 25px;
    background-color: rgba(225, 228, 232, 0.75);
    border-radius: 2.5px;
    box-sizing: border-box;
    transition: transform 0.2s, background-color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6em;
    color: #777;
}

.day-square.month-idx-0 {
    background-color: rgba(245, 245, 245, 0.75);
    /* Lighter grey */
}

.day-square.month-idx-1 {
    background-color: rgba(220, 220, 220, 0.75);
    /* Medium grey */
}

.day-square.month-idx-2 {
    background-color: rgba(200, 200, 200, 0.75);
    /* Darker grey (but still light enough) */
}

.day-square:hover {
    transform: scale(1.15);
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.15);
}

.day-square.past {
    background-color: rgba(102, 187, 106, 0.85);
    color: white;
    /* #66bb6a 过去的日期颜色 */
}

.day-square.current {
    background-color: rgba(56, 142, 60, 0.9);
    color: white;
    border: 1.5px solid rgba(46, 125, 50, 1);
    transform: scale(1.15);
    box-shadow: 0 0 10px rgba(56, 142, 60, 0.5);
}


/* 简洁模式下的日历方块样式 */

.day-square:empty {
    /* 当方块没有内容时，稍微调整样式 */
    background-color: rgba(240, 240, 240, 0.6);
}

.day-square.past:empty {
    background-color: rgba(102, 187, 106, 0.75);
}

.day-square.current:empty {
    background-color: rgba(56, 142, 60, 0.8);
    border: 1.5px solid rgba(46, 125, 50, 1);
}


/* 响应式设计 */

@media (max-width: 768px) {
    .container {
        max-width: 600px;
    }
    .day-square {
        width: 22px;
        height: 22px;
        font-size: 0.55em;
        color: #888;
    }
    .calendar-container {
        grid-template-columns: repeat(auto-fill, minmax(22px, 1fr));
        max-height: 480px;
    }
}

@media (max-width: 480px) {
    .container {
        max-width: 100%;
        padding: 20px 10px;
    }
    .calendar-container {
        gap: 2px;
        grid-template-columns: repeat(auto-fill, minmax(15px, 1fr));
        padding: 5px;
        max-height: 420px;
    }
    .day-square {
        width: 15px;
        height: 15px;
        font-size: 0.45em;
        color: #999;
    }
}


/* NEW Global Actions Container Styling */

.global-actions-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #f5f5f5;
    box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.1);
    z-index: 100;
    padding: 8px 10px;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.view-mode-switcher,
.language-switcher,
.core-actions,
.social-share-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.global-actions-container button {
    height: 32px;
    padding: 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #333;
    font-size: 0.85em;
    font-weight: normal;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    text-align: center;
    margin: 0;
    line-height: 1;
    box-sizing: border-box;
    min-width: 90px;
    /* 为所有按钮设置相同的最小宽度 */
}

.global-actions-container button:hover {
    background-color: #f0f0f0;
    border-color: #ccc;
}

.language-switcher button {
    min-width: 40px;
}

.language-switcher button.active {
    font-weight: bold;
    border-color: #999;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}


/* 视图模式切换按钮样式 */

.view-mode-btn {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 8px 12px !important;
    background: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    font-size: 14px !important;
    color: #333 !important;
    transition: all 0.3s ease !important;
    min-width: 80px !important;
    justify-content: center !important;
    height: auto !important;
}

.view-mode-btn:hover {
    background: rgba(255, 255, 255, 1) !important;
    border-color: rgba(0, 0, 0, 0.2) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

.view-mode-btn.active {
    background: #4CAF50 !important;
    color: white !important;
    border-color: #45a049 !important;
}

.view-mode-btn.active:hover {
    background: #45a049 !important;
}

.core-actions button {
    min-width: 90px;
}

.social-share-buttons button,
.social-button {
    min-width: 60px;
}

@media (max-width: 768px) {
    .global-actions-container {
        padding: 6px 8px;
        gap: 8px;
    }
    .view-mode-switcher,
    .language-switcher,
    .core-actions,
    .social-share-buttons {
        gap: 6px;
    }
    .global-actions-container button {
        font-size: 0.8em;
        height: 30px;
        padding: 0 8px;
        min-width: 80px;
        /* 为所有按钮设置相同的最小宽度 */
    }
    .language-switcher button {
        min-width: 36px;
    }
    .core-actions button {
        min-width: 80px;
    }
    .social-share-buttons button,
    .social-button {
        min-width: 55px;
    }
}

@media (max-width: 480px) {
    body {
        padding-bottom: 50px;
    }
    .global-actions-container {
        padding: 5px 6px;
        gap: 5px;
    }
    .view-mode-switcher,
    .language-switcher,
    .core-actions,
    .social-share-buttons {
        gap: 4px;
    }
    .global-actions-container button {
        font-size: 0.75em;
        height: 28px;
        padding: 0 6px;
        min-width: 75px;
        /* 为所有按钮设置相同的最小宽度 */
    }
    .language-switcher button {
        min-width: 34px;
    }
    .core-actions button {
        min-width: 75px;
    }
    .social-share-buttons button,
    .social-button {
        min-width: 50px;
    }
}


/* 统一所有action-button和simple-btn的样式 */

.action-button,
.action-button.simple-btn,
.social-button.action-button.simple-btn {
    height: 32px;
    padding: 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #333;
    font-size: 0.85em;
    font-weight: normal;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    min-width: 90px;
}


/* 覆盖所有底栏按钮的悬停效果，确保一致 */

.global-actions-container button:hover,
.action-button:hover,
.social-button:hover {
    background-color: #f0f0f0;
    border-color: #ccc;
    transform: none;
    /* 移除任何可能的transform效果 */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.language-selector {
    position: relative;
    /* 确保子绝对定位元素是相对于此的 */
    display: inline-block;
}

.lang-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    background-color: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(221, 221, 221, 0.6);
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    min-width: 0;
    max-width: 280px;
    width: auto;
    padding: 8px 0;
    margin-bottom: 10px;
    animation: dropdownSlideUp 0.25s ease-out forwards;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.lang-dropdown.hidden {
    display: none;
    animation: none;
}

.lang-option {
    display: flex;
    align-items: center;
    padding: 9px 15px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
    font-size: 0.9em;
    color: #2c3e50;
    white-space: nowrap;
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}

.lang-option:last-child {
    border-bottom: none;
}

.lang-option:hover {
    background-color: rgba(0, 123, 255, 0.08);
    color: #0069d9;
}

.lang-option.active {
    background-color: #4CAF50;
    /* 主题绿色背景 */
    color: white;
    /* 白色文字以保证对比度 */
    font-weight: 500;
}

.lang-option .lang-name {
    /* margin-left: 8px; */
    /* 之前有图标时的间距，现在语言名称前没有图标，可以移除或设为0 */
    margin-left: 0;
}

@keyframes dropdownSlideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
        /* 从下方10px开始 */
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.language-switcher .lang-selector-btn {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 8px 12px !important;
    background: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    font-size: 14px !important;
    color: #333 !important;
    transition: all 0.3s ease !important;
    min-width: 120px !important;
    justify-content: space-between !important;
    height: auto !important;
    /* 覆盖全局容器的height设置 */
}


/* 响应式设计 - 针对手机优化语言下拉菜单 */

@media (max-width: 480px) {
    .lang-dropdown {
        min-width: 200px;
        /* 在小屏幕上可以更宽一些 */
        max-width: 90vw;
        /* 最大宽度为视口宽度的90%，左右留些空隙 */
        left: 50%;
        /* 先将左边缘移到中间 */
        transform: translateX(-50%);
        /* 再通过transform将其整体居中 */
        font-size: 15px;
        /* 稍微增大字体，方便点击 */
    }
    .lang-option {
        padding: 12px 15px;
        /* 增大选项的内边距，方便点击 */
    }
    .lang-flag {
        font-size: 18px;
        /* 稍微增大国旗图标 */
    }
}


/* 备案信息样式 */

.footer {
    position: fixed;
    bottom: 48px;
    /* 为底部按钮区域留出空间 */
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding: 8px 0;
    text-align: center;
    z-index: 99;
    /* 确保在按钮区域下方 */
}

.footer a {
    color: #666;
    text-decoration: none;
    font-size: 12px;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: #333;
}


/* 响应式设计 - 针对手机优化备案信息 */

@media (max-width: 768px) {
    .footer {
        bottom: 42px;
        /* 移动端按钮区域稍小 */
        padding: 6px 0;
    }
    .footer a {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .footer {
        bottom: 38px;
        /* 小屏幕按钮区域更小 */
        padding: 6px 0;
    }
    .footer a {
        font-size: 11px;
    }
}