/* 将数字设置为等宽（表格数字） */
#time-date-container {
    font-variant-numeric: tabular-nums; /* 确保数字等宽，防止时间跳动 */
}

/* 垂直居中时间的冒号 */
.time-colon {
    position: relative;
    top: -0.08em; /* 向上微调以实现视觉居中 */
}

/* 交互元素的玻璃拟态效果 */
.glass-effect {
    background-color: rgba(255, 255, 255, 0.4); /* 半透明背景 */
    backdrop-filter: blur(10px); /* 背景模糊 */
    -webkit-backdrop-filter: blur(10px); /* 兼容 Safari */
    border: 1px solid rgba(255, 255, 255, 0.2); /* 边框 */
    transition: background-color 0.3s ease-in-out, border-color 0.3s ease-in-out; /* 过渡效果 */
}

.dark .glass-effect {
    background-color: rgba(30, 30, 30, 0.4); /* 深色模式下的背景 */
    border: 1px solid rgba(255, 255, 255, 0.1); /* 深色模式下的边框 */
}

/* 在日间模式下覆盖搜索引擎列表的样式以确保对比度 */
#search-engine-list-wrapper.glass-effect {
    background-color: rgba(80, 80, 80, 0.6);
    border-color: rgba(255, 255, 255, 0.1);
}

/* 隐藏搜索输入框默认的清除按钮 */
#search-input::-webkit-search-decoration,
#search-input::-webkit-search-cancel-button,
#search-input::-webkit-search-results-button,
#search-input::-webkit-search-results-decoration {
    -webkit-appearance:none;
}

/* 搜索输入框文本和占位符样式 */
#search-input {
    transition: color 0.3s ease-in-out;
}
#search-input::placeholder {
    color: rgb(75 85 99); /* 占位符颜色 */
    transition: color 0.3s ease-in-out;
}
.dark #search-input::placeholder {
    color: rgb(209 213 219 / 0.7); /* 深色模式下占位符颜色 */
}

/* 移除搜索输入框的默认焦点光圈 */
#search-input:focus,
#search-input.focus-visible {
    box-shadow: none !important;
}

/* 当搜索表单聚焦时，使其边框高亮 */
#search-form.is-focused {
    border-color: rgba(255, 255, 255, 0.8);
}

.dark #search-form.is-focused {
    border-color: rgba(255, 255, 255, 0.6);
}

/* 刷新按钮的旋转动画 */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(-360deg); }
}
.is-spinning {
    animation: spin 1s linear infinite; /* 应用旋转动画 */
}

/* 刷新按钮禁用时的样式 */
#refresh-button.is-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(50%); /* 增加灰度效果以增强视觉提示 */
}

/* 菜单中活动主题项的样式 */
.theme-item-active {
    background-color: rgba(0, 0, 0, 0.08); /* 活动项背景色 */
}
.dark .theme-item-active {
    background-color: rgba(255, 255, 255, 0.15); /* 深色模式下活动项背景色 */
}

/* 主题切换图标容器样式 */
.theme-icon-container {
    position: absolute;
    width: 24px; /* w-6 */
    height: 24px; /* h-6 */
    transition: opacity 0.3s ease-in-out;
}

/* 统一搜索引擎图标大小 */
.search-engine-icon svg {
    width: 100%;
    height: 100%;
    object-fit: contain;
    fill: currentColor; /* 确保SVG颜色被继承 */
}

/* 为搜索栏两侧按钮的内部图标添加过渡效果 */
#search-form button[type="submit"] svg {
    /* 合并颜色和缩放的过渡效果 */
    transition: color 0.3s ease-in-out, transform 0.1s ease-in-out;
}

/* 当点击搜索栏两侧按钮时，只缩放内部图标 */
#search-engine-logo:active .search-engine-icon-container,
#search-form button[type="submit"]:active svg {
    transform: scale(0.9);
}

/* 图标过渡样式 */
.search-engine-icon-container {
    position: absolute;
    width: 28px; /* w-7 */
    height: 28px; /* h-7 */
    /* 合并透明度和缩放的过渡效果 */
    transition: opacity 0.2s ease-in-out, transform 0.1s ease-in-out;
}

/* 一言（Hitokoto）样式 */
#hitokoto-container {
    margin-top: 1rem; /* mt-4 */
    padding: 0 1rem; /* px-4 */
    max-width: 80%;
    font-weight: 500; /* font-medium */
    cursor: pointer; /* 鼠标指针为手形 */
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
    text-align: center;

    /* 使用 Flexbox 实现垂直居中 */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 3.2em; /* 使用最小高度确保布局稳定，约等于2行文字高度 */
}

/* 对内部的 span 应用行数限制 */
#hitokoto-container span {
    line-height: 1.6em; /* 给予略微宽松的行高 */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* 限制为两行 */
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
}

#hitokoto-container.is-fading {
    opacity: 0;
}

/* 自定义提示框样式 */
#custom-tooltip {
    color: rgb(31 41 55); /* text-gray-800 */
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
}

.dark #custom-tooltip {
    color: rgb(229 231 235); /* text-gray-200 */
}
