:root {
    --color-primary: #004d40;
    --color-secondary: #ffc107;
    --color-neutral: #f8f9fa;
    --color-neutral-dark: #212121;
    --color-primary-hover: #003d33; /* 新增悬停颜色 */
}
body {
    font-family: 'Noto Sans SC', sans-serif;
    background-color: var(--color-neutral);
    color: #4a5568;
    font-size: 16px; /* 设定一个基础字号 */
}
header {
    background-color: var(--color-primary);
}

/* --- 页眉样式 --- */
.site-header .nav-link {
    @apply hover:text-secondary transition-colors duration-200 py-2;
}
.site-header .nav-link-active {
    @apply text-secondary font-semibold;
}
.site-header .nav-icon {
    @apply text-white hover:text-secondary transition-colors duration-200 text-xl p-2 rounded-full hover:bg-white/10;
}
.nav-dropdown {
    @apply relative;
}
.nav-dropdown-content {
    @apply absolute top-full left-1/2 -translate-x-1/2 mt-2 w-48 bg-white text-neutral-dark rounded-md shadow-lg py-2 opacity-0 invisible transition-all duration-300;
    transform: translateY(10px);
}
.nav-dropdown:hover .nav-dropdown-content {
    @apply opacity-100 visible;
    transform: translateY(0);
}
.nav-dropdown-content a {
    @apply block px-4 py-2 hover:bg-neutral;
}

details summary .faq-arrow {
    transition: transform 0.3s ease-in-out;
}
details[open] summary .faq-arrow {
    transform: rotate(180deg);
}
.filter-btn.active {
    background-color: var(--color-primary);
    color: white;
    font-weight: 700;
    box-shadow: 0 0 0 3px rgba(0, 77, 64, 0.3);
}
/* --- 优化后的骨架屏动画 --- */
.skeleton {
    position: relative;
    overflow: hidden;
    background-color: #e5e7eb;
}
.skeleton::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    transform: translateX(-100%); /* 初始位置在左侧外部 */
    background: linear-gradient(to right, transparent 0%, #f3f4f6 50%, transparent 100%);
    animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
    100% { transform: translateX(100%); }
}

.honeypot-field {
    display: none;
}
.form-error-message {
    color: #d32f2f;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    min-height: 1.25rem;
}

/* --- 实时表单验证样式 --- */
.form-input-error {
    border-color: #ef4444 !important; /* red-500 */
    box-shadow: 0 0 0 1px #ef4444;
}
.form-input-success {
    border-color: #22c55e !important; /* green-500 */
    box-shadow: 0 0 0 1px #22c55e;
}
.validation-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}
.form-icon-success {
    color: #22c55e; /* green-500 */
}
.form-icon-error {
    color: #ef4444; /* red-500 */
}
/* ---------------------------------- */

@keyframes animate-fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.animate-fade-in-up {
    animation: animate-fade-in-up 0.5s ease-out forwards;
}
.like-btn, #post-like-btn, #newsletter-form button, #sidebar-newsletter-form button {
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.2s;
}
.like-btn:active, #post-like-btn:active {
    transform: scale(0.9);
}
#newsletter-form button:active, #sidebar-newsletter-form button:active {
     transform: scale(0.95);
}
.like-btn.liked i {
    animation: like-pop 0.5s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}
@keyframes like-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1); }
}

/* --- [新增] 个人中心侧边栏导航样式 --- */
.sidebar-nav-item {
    @apply w-full text-left flex items-center px-4 py-3 text-base font-medium text-gray-700 rounded-lg transition-colors duration-200;
}
.sidebar-nav-item:hover {
    @apply bg-gray-100 text-primary;
}
.sidebar-nav-item.active {
    @apply bg-primary text-white font-semibold;
}

:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 2px;
    border-radius: 4px;
}

/* --- 统一美化的视图标签页样式 --- */
.view-tabs-container {
    @apply inline-flex items-center bg-gray-100 p-1 rounded-full;
}
.view-tab {
    @apply px-4 py-2 text-sm font-semibold text-gray-600 rounded-full transition-colors duration-300;
}
.view-tab:hover {
    @apply text-primary;
}
.view-tab.active {
    @apply bg-primary text-white shadow-md;
}
/* ---------------------------------- */

#thread-content-container .prose {
    color: var(--color-primary);
}

main.bg-gray-50 .text-gray-600 {
    color: var(--color-primary) !important;
}

/* --- 页脚样式 --- */
.footer-heading {
    font-size: 0.875rem; /* text-sm */
    font-weight: 600; /* font-semibold */
    margin-bottom: 1rem; /* mb-4 */
    color: white;
    text-transform: uppercase;
    letter-spacing: .05em;
    opacity: 0.8;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem; /* space-y-3 */
}

.footer-links a, .footer-link {
    color: #9ca3af; /* text-gray-400 */
    transition: color 0.2s ease-in-out;
}

.footer-links a:hover, .footer-link:hover {
    color: var(--color-secondary);
}

.social-icon-sm {
    display: inline-block;
    color: #9ca3af; /* text-gray-400 */
    transition: color 0.2s ease-in-out, transform 0.2s ease-in-out;
    font-size: 1.5rem; /* text-2xl */
}

.social-icon-sm:hover {
    color: var(--color-secondary);
    transform: translateY(-2px);
}
/* --- 通知中心样式 --- */
.notification-bell-wrapper {
    position: relative;
}
.notification-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 10px;
    height: 10px;
    background-color: #d32f2f; /* accent color */
    border-radius: 50%;
    border: 2px solid var(--color-primary);
    display: none; /* Hidden by default */
}
.notification-dot.visible {
    display: block;
}

#notification-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 360px;
    max-height: 400px;
    overflow-y: auto;
    background-color: white;
    color: var(--color-neutral-dark);
    border-radius: 0.75rem; /* rounded-xl */
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    z-index: 100;
}
#notification-panel.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.notification-item {
    display: block;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb; /* gray-200 */
    transition: background-color 0.2s;
}
.notification-item:hover {
    background-color: var(--color-neutral);
}
.notification-item.unread {
    background-color: #fefce8; /* yellow-50 */
}
.notification-item:last-child {
    border-bottom: none;
}
/* --- 统一侧边栏样式 --- */
.sidebar-module {
    background-color: white;
    padding: 1.5rem; /* p-6 */
    border-radius: 0.75rem; /* rounded-xl */
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
}
.sidebar-title {
    font-size: 1.25rem; /* text-xl */
    font-weight: 700; /* font-bold */
    color: var(--color-primary);
    border-bottom: 1px solid #e5e7eb; /* border-b */
    padding-bottom: 0.75rem; /* pb-3 */
    margin-bottom: 1rem; /* mb-4 */
}
.sidebar-btn {
    display: block;
    width: 100%;
    text-align: center;
    background-color: var(--color-primary);
    color: white;
    font-weight: 700; /* font-bold */
    padding-top: 0.75rem; /* py-3 */
    padding-bottom: 0.75rem; /* py-3 */
    padding-left: 1.5rem; /* px-6 */
    padding-right: 1.5rem; /* px-6 */
    border-radius: 9999px; /* rounded-full */
    transition: background-color 0.2s;
}
.sidebar-btn:hover {
    background-color: #003d33; /* Darker primary */
}
.sidebar-btn-secondary {
    display: block;
    width: 100%;
    text-align: center;
    background-color: white;
    color: var(--color-primary);
    font-weight: 700; /* font-bold */
    padding-top: 0.75rem; /* py-3 */
    padding-bottom: 0.75rem; /* py-3 */
    padding-left: 1.5rem; /* px-6 */
    padding-right: 1.5rem; /* px-6 */
    border-radius: 9999px; /* rounded-full */
    border: 2px solid var(--color-primary);
    transition: background-color 0.2s, color 0.2s;
}
.sidebar-btn-secondary:hover {
    background-color: var(--color-primary);
    color: white;
}

/* --- 字体大小优化 --- */
.main-content p, 
.main-content li, 
.sidebar-module p,
.sidebar-module li {
    font-size: 1rem; 
    line-height: 1.75;
}

/* --- 活动页面视图切换器优化 --- */
.view-toggle-switch {
    display: inline-flex;
    background-color: #e5e7eb; /* gray-200 */
    border-radius: 9999px; /* rounded-full */
    padding: 0.25rem; /* p-1 */
    position: relative;
}
.view-toggle-switch .toggle-btn {
    padding: 0.5rem 1rem; /* py-2 px-4 */
    font-size: 0.875rem; /* text-sm */
    font-weight: 600; /* font-semibold */
    border-radius: 9999px; /* rounded-full */
    color: #4b5563; /* gray-600 */
    border: none;
    background-color: transparent;
    cursor: pointer;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem; /* gap-2 */
    z-index: 10;
}
.view-toggle-switch .toggle-btn.active {
    color: white;
}

.view-toggle-switch .toggle-glider {
    position: absolute;
    top: 0.25rem;
    left: 0.25rem;
    height: calc(100% - 0.5rem);
    background-color: var(--color-primary);
    border-radius: 9999px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 5;
}

/* --- 新增：社区风格的下划线TAB --- */
.community-tabs-nav {
    @apply relative flex space-x-6;
}
.community-tab {
    @apply py-2 px-1 text-lg font-semibold text-gray-500 hover:text-primary relative transition-colors duration-300;
    border-bottom: 3px solid transparent;
}
.community-tab.active {
    @apply text-primary;
}
.community-tab.active::after {
    content: '';
    @apply absolute bottom-[-2px] left-0 w-full h-1 bg-primary;
    animation: slide-in 0.3s ease-out forwards;
}
@keyframes slide-in {
    from { width: 0; }
    to { width: 100%; }
}
/* ---------------------------------- */


/* 修复：全局尊重 prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* 【修复】强制设置页脚订阅按钮的文字颜色 */
#footer-newsletter-form button {
    color: var(--color-primary);
}

/* 【修复】强制设置页眉“支持我们”按钮的文字颜色 */
.site-header a.bg-white {
    color: var(--color-primary);
}

/* 【修复】强制设置详情页报名按钮背景色为主题色 */
#event-registration-btn.bg-primary {
    background-color: var(--color-primary) !important;
}

/* 【新增】Cookie 同意管理模态框中的开关样式 */
.consent-toggle-label {
    transition: background-color .2s ease-in-out;
}
.consent-toggle-checkbox:checked + .consent-toggle-label {
    background-color: var(--color-primary);
}
.consent-toggle-checkbox:checked {
    right: 0;
    border-color: var(--color-primary);
    transform: translateX(1rem);
}
.consent-toggle-checkbox:disabled + .consent-toggle-label {
    background-color: #d1d5db;
    cursor: not-allowed;
}
.consent-toggle-checkbox:disabled {
    cursor: not-allowed;
}

/* --- 新增：隐私和法律页面的特定样式 --- */
@layer components {
    .prose-custom h2 { @apply text-2xl font-bold text-primary border-b border-gray-200 pb-3 mb-6 flex items-center; }
    .prose-custom h3 { @apply text-xl font-semibold text-neutral-dark mt-6 mb-3; }
    .prose-custom p { @apply mb-4 text-lg leading-relaxed; }
    .prose-custom ul { @apply list-none pl-0 space-y-3; }
    .prose-custom ul li { @apply flex items-start text-lg; }
    .prose-custom ul li::before {
        content: '\f00c'; /* FontAwesome check icon */
        font-family: 'FontAwesome';
        @apply text-primary mr-3 mt-1;
    }
    .prose-custom .summary-box {
        @apply bg-primary/5 border-l-4 border-primary p-6 rounded-r-lg mb-12;
    }
    .prose-custom .summary-box h2 {
        @apply border-none text-2xl mb-4;
    }
    .prose-custom .summary-box ul li::before {
        content: '\f0a9'; /* FontAwesome right arrow icon */
        font-family: 'FontAwesome';
        @apply text-primary/80;
    }
    .prose-custom h2 .fa {
        @apply text-primary/70;
    }
    #toc-nav a { 
        @apply transition-colors duration-200 ease-in-out border-l-2 border-transparent py-2 px-4 block;
    }
    #toc-nav a:hover { 
        @apply text-primary border-l-secondary;
    }
    #toc-nav a.toc-link-active { 
        @apply text-primary font-semibold border-l-primary;
    }
}

/* --- 新增：社区中心页面优化样式 --- */
.community-stat-item {
    @apply flex flex-col items-center justify-center p-4 rounded-lg bg-white/10 backdrop-blur-sm;
    min-width: 120px;
}
.community-stat-item .stat-value {
    @apply text-3xl font-bold;
}
.community-stat-item .stat-label {
    @apply text-sm text-white/80 font-semibold;
}