/* 覆盖全局CSS中的header样式 */
header {
    background: #ececec !important;
    color: #555 !important; /* 更优雅的深灰色 */
    padding: 0 !important;
    text-align: center !important;
    box-shadow: none !important;
    height: 25px !important;
    line-height: 25px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    transition: transform 0.5s ease !important;
    transform: translateY(0) !important;
    position: fixed !important; /* 固定定位使其宽度撑满 */
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important; /* 确保宽度100% */
    z-index: 1000 !important; /* 确保在最上层 */
}

header.hidden {
    transform: translateY(-100%) !important;
}

.header-content {
    text-align: center !important;
    padding: 0 !important;
    margin: 0 !important;
    height: 25px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative;
    overflow: hidden;
}

/* 主题切换按钮样式 */
.theme-switcher {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #555;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s;
}

.theme-switcher:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

/* 渐变光效效果 */
.header-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    transition: 0.5s;
}

.header-content:hover::before {
    left: 100%;
}

.header-content h1 {
    font-size: 16px !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 25px !important;
    line-height: 25px !important;
    position: relative;
    z-index: 1;
}

/* 调整container的margin-top以避免被header遮挡 */
.container {
    margin-top: 25px !important;
}

footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    transition: transform 0.5s ease;
    transform: translateY(0);
    background: #ececec;
    color: #555; /* 和header保持一致的颜色 */
    text-align: center;
    padding: 0;
    height: 25px;
    line-height: 25px;
    font-size: 14px;
}

footer.hidden {
    transform: translateY(100%);
}

.footer-content {
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-content p {
    margin: 0;
    padding: 0;
}

.beian-link {
    color: inherit;
    text-decoration: none;
}

.beian-link:hover {
    text-decoration: underline;
}

.github-link {
    display: inline-block;
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z' fill='%23000'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    vertical-align: middle;
    margin-left: 8px;
    transition: opacity 0.3s ease;
}

.github-link:hover {
    opacity: 0.7;
}

body[data-theme="dark"] .github-link {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z' fill='%23fff'/%3E%3C/svg%3E");
}

/* 主题样式 */
/* 浅色主题 */
body[data-theme="light"] {
    background-color: #f5f5f5;
    color: #333;
}

body[data-theme="light"] header,
body[data-theme="light"] footer {
    background: #ececec !important;
    color: #555 !important;
}

body[data-theme="light"] .tool-card {
    background: white;
    color: #333;
}

/* 深色主题 */
body[data-theme="dark"] {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

body[data-theme="dark"] header,
body[data-theme="dark"] footer {
    background: #2d2d2d !important;
    color: #e0e0e0 !important;
}

body[data-theme="dark"] .tool-card {
    background: #2d2d2d;
    color: #e0e0e0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

body[data-theme="dark"] .tool-card h3 {
    color: #f0f0f0;
}

body[data-theme="dark"] .tool-card p {
    color: #b0b0b0;
}

body[data-theme="dark"] .header-content::before {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}
