/* 首页特定样式 */
#hero-title {
    transition: color 0.5s ease;
    color: #ffffff;
}

[data-theme="light"] #hero-title {
    color: #1a1a1a !important;
}

/* 搜索框 */
#search-input:focus {
    outline: none;
}

/* Font Awesome 图标支持 */
.api-card i[class*="fa-"],
.social-links-wrapper i[class*="fa-"] {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands";
    font-weight: 900;
}

/* 确保底部统计栏不撑大卡片 */
.api-card {
    display: flex;
    flex-direction: column;
}

.api-card > *:last-child {
    margin-top: auto;
}

/* 超小字体支持 */
.text-\[8px\] {
    font-size: 8px;
    line-height: 1.2;
}

/* ========== 图表样式 ========== */
.chart-area {
    position: relative;
    height: 40px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    overflow: hidden;
}

[data-theme="light"] .chart-area {
    background: rgba(0, 0, 0, 0.03);
}

/* Y轴标签 */
.chart-axis-y {
    color: rgba(255, 255, 255, 0.5) !important;
    font-weight: 500 !important;
    text-shadow: none !important;
}

[data-theme="light"] .chart-axis-y {
    color: rgba(0, 0, 0, 0.45) !important;
    text-shadow: none !important;
}

/* X轴日期标签 */
.chart-axis-x {
    color: rgba(255, 255, 255, 0.45) !important;
    font-weight: 500 !important;
    text-shadow: none !important;
}

[data-theme="light"] .chart-axis-x {
    color: rgba(0, 0, 0, 0.4) !important;
    text-shadow: none !important;
}

/* 图表线条 */
.chart-area svg path[stroke-width="1.5"] {
    filter: none !important;
    stroke-opacity: 0.6;
}

/* ========== Tooltip 样式 ========== */
.chart-tooltip {
    position: fixed;
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 10px;
    color: #fff;
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, -100%);
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 9999;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    min-width: 100px;
    text-align: center;
}

.chart-tooltip.visible {
    opacity: 1;
    transform: translate(-50%, -110%);
}

.chart-tooltip::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 10px;
    height: 10px;
    background: rgba(20, 20, 20, 0.95);
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

[data-theme="light"] .chart-tooltip {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(0, 0, 0, 0.15);
    color: #1a1a1a;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

[data-theme="light"] .chart-tooltip::after {
    background: rgba(255, 255, 255, 0.98);
    border-right-color: rgba(0, 0, 0, 0.15);
    border-bottom-color: rgba(0, 0, 0, 0.15);
}

.tooltip-date {
    font-weight: 600;
    margin-bottom: 2px;
    color: inherit;
    font-size: 10px;
}

.tooltip-value {
    font-size: 9px;
    opacity: 0.8;
    color: inherit;
}

.tooltip-value span {
    font-weight: 700;
    opacity: 1;
    font-size: 11px;
}

/* 统计卡片动画 */
.stat-value {
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

/* 玻璃拟态增强 */
.glass {
    position: relative;
    overflow: hidden;
}

.glass::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.glass:hover::before {
    opacity: 1;
}

/* 响应式优化 */
@media (max-width: 640px) {
    .chart-area {
        height: 36px;
    }
}

/* ========== 公告栏样式 - 黄色主题 ========== */
.announcement-yellow-bg {
    background: rgba(251, 191, 36, 0.12) !important;
    backdrop-filter: blur(12px);
    border-color: rgba(251, 191, 36, 0.4) !important;
}

/* 白天模式 */
[data-theme="light"] .announcement-yellow-bg {
    background: rgba(251, 191, 36, 0.2) !important;
    border-color: rgba(217, 119, 6, 0.5) !important;
}

/* 公告文字颜色 - 白天深棕色，晚上浅黄色 */
.announcement-text {
    color: #78350f !important; /* amber-900 */
    line-height: 1.6;
    transition: all 0.3s ease;
}

/* 确保 <br> 标签生效 */
.announcement-text br {
    display: block;
    content: "";
    margin-bottom: 0.25em;
}

[data-theme="dark"] .announcement-text,
body:not([data-theme="light"]) .announcement-text {
    color: #fef3c7 !important; /* amber-100 */
}

/* 折叠状态 - 单行 */
.announcement-text-collapsed {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-height: 1.6em;
}

/* 展开状态 */
.announcement-text-expanded {
    display: block;
    max-height: 300px;
    overflow-y: auto;
    -webkit-line-clamp: unset;
}

/* 自定义滚动条 */
.announcement-text-expanded::-webkit-scrollbar {
    width: 4px;
}

.announcement-text-expanded::-webkit-scrollbar-track {
    background: transparent;
}

.announcement-text-expanded::-webkit-scrollbar-thumb {
    background: rgba(251, 191, 36, 0.3);
    border-radius: 2px;
}

/* 提示文字 */
#announcement-hint {
    color: #92400e !important;
}

[data-theme="dark"] #announcement-hint,
body:not([data-theme="light"]) #announcement-hint {
    color: rgba(251, 191, 36, 0.8) !important;
}

/* 公告标签 */
#announcement-box .bg-amber-400\/25 {
    background: rgba(251, 191, 36, 0.25) !important;
}

/* 关闭按钮 */
#announcement-box button {
    color: #92400e;
}

#announcement-box button:hover {
    background: rgba(251, 191, 36, 0.2);
}

[data-theme="dark"] #announcement-box button,
body:not([data-theme="light"]) #announcement-box button {
    color: rgba(251, 191, 36, 0.8);
}

/* 公告关闭动画 */
#announcement-box {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* spacer 保持高度 */
#announcement-spacer {
    transition: all 0.3s ease;
}

/* ========== 倒计时样式 - 缩小时间 ========== */
.countdown-wrapper {
    font-family: 'Courier New', 'Monaco', 'Consolas', monospace;
}

/* 缩小数字 text-xl (20px) 代替 text-2xl (24px) */
.countdown-wrapper .text-xl {
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    line-height: 1;
    text-shadow: 0 0 20px rgba(251, 191, 36, 0.3);
    min-width: 1.2em;
    text-align: center;
}

[data-theme="light"] .countdown-wrapper .text-xl {
    text-shadow: none;
    color: #d97706; /* amber-600 */
}

/* 确保倒计时容器对齐 */
.countdown-wrapper > div {
    min-width: 2rem;
}

/* 冒号位置微调 */
.countdown-wrapper .pb-3 {
    padding-bottom: 0.75rem;
}

/* ========== 底部社交媒体样式 ========== */
.social-links-wrapper a {
    transition: all 0.2s ease;
}

.social-links-wrapper a:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

[data-theme="light"] .social-links-wrapper a:hover {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.2);
}

/* 社交媒体悬停效果 */
.social-links-wrapper a[title="Bilibili"]:hover {
    box-shadow: 0 4px 12px rgba(0, 161, 214, 0.2);
}
.social-links-wrapper a[title="抖音"]:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.social-links-wrapper a[title="快手"]:hover {
    box-shadow: 0 4px 12px rgba(255, 80, 0, 0.2);
}
.social-links-wrapper a[title="微博"]:hover {
    box-shadow: 0 4px 12px rgba(230, 22, 45, 0.2);
}
.social-links-wrapper a[title="Gitee"]:hover {
    box-shadow: 0 4px 12px rgba(199, 29, 35, 0.2);
}
.social-links-wrapper a[title="GitHub"]:hover {
    box-shadow: 0 4px 12px rgba(51, 51, 51, 0.2);
}
.social-links-wrapper a[title="QQ"]:hover {
    box-shadow: 0 4px 12px rgba(18, 183, 245, 0.2);
}

/* ========== 公告按钮在导航栏的样式 ========== */
nav button[onclick="showAnnouncement()"] {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

nav button[onclick="showAnnouncement()"]:hover {
    background: rgba(251, 191, 36, 0.1);
    color: #fbbf24;
}

/* 实时状态指示点动画 */
@keyframes pulse-green {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

.animate-pulse {
    animation: pulse-green 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
