/* ===== 全局基础 ===== */
body {
    font-family: -apple-system, "Microsoft YaHei", Arial, sans-serif;
    background: linear-gradient(135deg, #f8fafc 0%, #eef2f7 100%);
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

/* ===== 欢迎界面 ===== */
#welcomeScreen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.welcome-inner {
    text-align: center;
    max-width: 480px;
    width: 100%;
}

#pageTitle {
    font-size: 30px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 8px 0;
    letter-spacing: 3px;
}

.welcome-subtitle {
    font-size: 14px;
    color: #64748b;
    margin: 0 0 16px 0;
}

#readme {
    display: inline-block;
    font-size: 13px;
    color: #94a3b8;
    margin-bottom: 28px;
    text-decoration: none;
    border-bottom: 1px solid #e2e8f0;
    transition: all 0.2s;
}

#readme:hover {
    color: #3b82f6;
    border-color: #3b82f6;
}

/* 拖放区域 */
.drop-zone {
    background: #ffffff;
    border: 2px dashed #cbd5e1;
    border-radius: 16px;
    padding: 40px 32px;
    transition: all 0.3s ease;
    cursor: pointer;
    margin-bottom: 24px;
}

.drop-zone:hover {
    border-color: #3b82f6;
    background: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.1);
}

.drop-icon {
    font-size: 44px;
    margin-bottom: 14px;
}

.drop-text {
    font-size: 15px;
    color: #475569;
    margin: 0 0 10px 0;
}

.drop-or {
    font-size: 13px;
    color: #94a3b8;
    margin: 0 0 14px 0;
}

.upload-btn {
    padding: 10px 32px;
    font-size: 14px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-btn:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.upload-btn:active {
    transform: scale(0.98);
}

/* 欢迎界面里的搜索栏 */
.welcome-search {
    display: flex;
    gap: 8px;
    max-width: 400px;
    margin: 0 auto;
}

.welcome-search input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    background: #ffffff;
    color: #334155;
    outline: none;
    transition: border-color 0.2s;
}

.welcome-search input:focus {
    border-color: #3b82f6;
}

.welcome-search button {
    padding: 10px 16px;
    font-size: 14px;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.welcome-search button:hover {
    background: #e2e8f0;
}

p {
    margin: 10px 0;
}

/* ===== 顶部/底部快捷按钮 ===== */
.top-bottom-buttons {
    position: fixed;
    bottom: 50%;
    right: 12px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transform: translateY(50%);
}

.button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: rgba(128, 128, 128, 0.15);
    color: #666;
    border: none;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: all 0.2s ease;
    opacity: 0.7;
}

.button:hover {
    opacity: 1;
    background: rgba(128, 128, 128, 0.25);
    transform: scale(1.05);
}

.button:active {
    transform: scale(0.95);
}

/* 按钮内箭头用 CSS 绘制 */
.button[data-dir="top"]::before {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    border-left: 2px solid #fff;
    border-top: 2px solid #fff;
    transform: rotate(45deg) translate(2px, 2px);
}

.button[data-dir="bottom"]::before {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg) translate(2px, -2px);
}

/* ===== 使用说明链接 ===== */
#readme {
    display: block;
    text-decoration: none;
    margin: 0 auto 25px;
    width: fit-content;
    font-size: 16px;
    color: #49b300;
    animation: pulse 2s infinite alternate;
}

@keyframes pulse {
    0% { transform: scale(1); }
    to { transform: scale(1.08); }
}

/* ===== 标题 ===== */
h1 {
    margin-top: 30px;
    text-align: center;
    color: #00b3af;
}

/* ===== 文件选择区 ===== */
#fileInput {
    display: none;
}

.label-input {
    margin-top: 15px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 10px;
    justify-content: center;
    gap: 8px;
}

.label-input label {
    margin-right: 10px;
    color: #666;
    font-weight: 700;
}

.label-input input[type="text"],
.label-input select {
    padding: 8px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.label-input input[type="text"] {
    flex: 1;
    min-width: 200px;
}

.label-input button {
    padding: 8px 16px;
    font-size: 14px;
    background-color: #00b3b0;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 0.2s;
}

.label-input button:hover {
    background-color: #009995;
}

/* ===== 搜索框 ===== */
#searchInput {
    width: 100%;
    background-color: #fff;
}

#searchButton {
    margin-right: 10px;
}

/* ===== 内容区域 ===== */
#content,
#searchResults {
    margin-top: 20px;
}

#content {
    margin-bottom: 20px;
}

.page {
    padding: 20px;
    border-radius: 4px;
}

/* ===== 分页按钮 ===== */
#pageButtons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
    margin: 20px 0;
}

#pageButtons .pageButton {
    padding: 4px 10px;
    font-size: 13px;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

#pageButtons .pageButton:hover {
    opacity: 0.8;
}

#pageButtons .pageButton.active {
    font-weight: bold;
}

/* ===== 跳转到指定页 ===== */
.page-jump {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #666;
}

.page-jump input {
    width: 70px;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
}

.page-jump button {
    padding: 5px 12px;
    font-size: 13px;
    background: rgba(128, 128, 128, 0.15);
    color: #666;
    border: 1px solid rgba(128, 128, 128, 0.2);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.page-jump button:hover {
    background: rgba(128, 128, 128, 0.25);
}

.page-jump button:active {
    transform: scale(0.96);
}

.pageButton {
    padding: 8px 16px;
    font-size: 14px;
    background-color: #ddd;
    color: #333;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s;
}

.pageButton:hover {
    background-color: #ccc;
}

.currentPage {
    background-color: #00b3b0;
    color: #fff;
    border-color: #00b3b0;
}

.currentPage:hover {
    background-color: #009995;
}

/* ===== 设置面板 ===== */
#settings {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    background-color: #f0f0f0;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    gap: 8px;
}

#settings select {
    padding: 8px;
    font-size: 14px;
    border: 1px solid #ccc;
    background-color: #fff;
    border-radius: 4px;
}

#settings button {
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

/* ===== 搜索结果 ===== */
.searchResult {
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid #ddd;
    background-color: #f9f9f9;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.searchResult:hover {
    background-color: #eef5f5;
}

.searchResult .search-page {
    display: inline-block;
    background-color: #00b3b0;
    color: #fff;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 12px;
    margin-right: 6px;
}

.highlight {
    background-color: #ff0;
    padding: 0 2px;
}

/* ===== 滚动提示 ===== */
#scrollInfo {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
    font-size: 14px;
}

/* ===== 移动端适配 ===== */
@media (max-width: 600px) {
    body {
        margin: 10px;
    }

    .label-input,
    #settings {
        flex-direction: column;
        align-items: stretch;
    }

    .label-input input[type="text"],
    .label-input select,
    .label-input button,
    #settings select {
        width: 100%;
    }

    .top-bottom-buttons {
        right: 5px;
        bottom: 30%;
    }

    .button {
        width: 32px;
        height: 32px;
        line-height: 32px;
        font-size: 14px;
    }
}
