/* --- 基础和主页样式 --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f4f4f9;
    color: #333;
    margin: 0;
    padding: 0;
}

body.modal-open {
    overflow: hidden;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 30px;
}

.main-content {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    margin-top: 20px;
}

/* --- 页眉样式 --- */
.header-bar {
    background-color: #333;
    color: white;
    padding: 12px 0;
}

.header-bar .container {
    padding-top: 0;
    padding-bottom: 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logout-button {
    color: white;
    background-color: #d9534f;
    padding: 5px 15px;
    border-radius: 5px;
    text-decoration: none;
    transition: background-color 0.2s ease;
}
.logout-button:hover {
    background-color: #c9302c;
}

/* --- 登录页面专属样式 --- */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    padding: 20px;
    box-sizing: border-box;
}

.login-container {
    background-color: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-container h2 {
    margin-top: 0;
    margin-bottom: 10px;
}

.flash-error, .flash-info {
    padding: 15px;
    border-radius: 5px;
    margin: 20px 0;
    border: 1px solid transparent;
    text-align: left;
}
.flash-error {
    background-color: #f2dede;
    color: #a94442;
    border-color: #ebccd1;
}
.flash-info {
    background-color: #d9edf7;
    color: #31708f;
    border-color: #bce8f1;
}

.login-container .input-group {
    text-align: left;
    margin-bottom: 20px;
}
.login-container label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}
.login-container input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
}

.login-button {
    width: 100%;
    padding: 12px;
    border: none;
    background-color: #007bff;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
}
.login-button:hover {
    background-color: #0056b3;
}


/* --- 主页内容样式 --- */
h1 { text-align: center; color: #444; }
p { text-align: center; color: #666; margin-bottom: 20px; }
.search-box { display: flex; justify-content: center; gap: 10px; margin-bottom: 30px; }
#search-input { width: 70%; padding: 12px; font-size: 16px; border: 1px solid #ddd; border-radius: 25px; outline: none; transition: all 0.3s ease; }
#search-input:focus { border-color: #007bff; box-shadow: 0 0 5px rgba(0, 123, 255, 0.5); }
#search-button { padding: 12px 25px; font-size: 16px; border: none; background-color: #007bff; color: white; border-radius: 25px; cursor: pointer; transition: background-color 0.3s ease; white-space: nowrap; }
#search-button:hover { background-color: #0056b3; }
#loading-indicator { text-align: center; padding: 20px; color: #888; }
.result-card { padding: 20px; border: 1px solid #eee; border-radius: 8px; margin-bottom: 20px; background-color: #fafafa; }
.result-text { flex-grow: 1; }
.result-title { font-size: 18px; font-weight: 600; color: #333; margin-top: 0; margin-bottom: 15px; padding-bottom: 10px; border-bottom: 2px solid #007bff; }
.result-text h3 { margin-top: 0; font-size: 14px; padding-bottom: 5px; border-bottom: 1px solid #ddd; color: #555; }
.text-content { background-color: #fff; padding: 10px; border-radius: 4px; border: 1px solid #eee; word-wrap: break-word; font-size: 15px; line-height: 1.6; max-height: 200px; overflow-y: auto; }
.image-link { display: inline-block; margin-top: 10px; padding: 5px 10px; font-size: 14px; color: #007bff; text-decoration: none; border: 1px solid #007bff; border-radius: 15px; transition: all 0.3s ease; cursor: pointer; }
.image-link:hover { background-color: #007bff; color: white; text-decoration: none; }
.highlight { background-color: #fff34d; color: #333; font-weight: bold; padding: 1px 0; }
.user-message { text-align: center; padding: 20px; font-size: 16px; color: #d9534f; font-weight: 500; }

.controls-container {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 15px;
}
.per-page-selector { display: flex; align-items: center; gap: 8px; }
.per-page-selector label { font-size: 14px; color: #555; }
#per-page { padding: 5px 8px; border-radius: 5px; border: 1px solid #ccc; font-size: 14px; }

.search-summary {
    margin-bottom: 20px;
    padding: 10px 15px;
    background-color: #e9f5ff;
    border-left: 4px solid #007bff;
    color: #31708f;
    font-size: 15px;
    border-radius: 0 5px 5px 0;
}

/* --- 新增: AI修改版本文本样式 --- */
.ai-modified-text {
    color: #31708f; /* 一个沉稳的深蓝色 */
    background-color: #f8f9fa; /* 一个非常浅的灰色背景以示区分 */
}

/* --- 分页控件样式 --- */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 30px;
}
.pagination { display: flex; list-style: none; padding: 0; margin: 0; border-radius: 5px; overflow: hidden; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.page-item { margin: 0; }
.page-link { display: block; padding: 10px 15px; background-color: #fff; color: #007bff; text-decoration: none; border-left: 1px solid #dee2e6; transition: background-color 0.2s ease; }
.page-item:first-child .page-link { border-left: none; }
.page-link:hover { background-color: #f4f4f9; }
.page-item.active .page-link { background-color: #007bff; color: white; font-weight: bold; cursor: default; }
.page-item.disabled .page-link, .page-item.disabled .page-link:hover { color: #6c757d; background-color: #fff; cursor: not-allowed; }
.page-item.disabled span.page-link { color: #6c757d; background-color: #fff; }

.page-jump {
    display: flex;
    align-items: center;
    gap: 8px;
}
.page-jump-input {
    width: 50px;
    padding: 8px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 5px;
}
.page-jump-button {
    padding: 8px 15px;
    border: none;
    background-color: #28a745;
    color: white;
    border-radius: 5px;
    cursor: pointer;
}
.page-jump-button:hover {
    background-color: #218838;
}

/* --- 弹窗样式 --- */
.modal { position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.6); display: none; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.3s ease; }
.modal.show { opacity: 1; }
.modal-box { position: relative; background-color: #fff; padding: 15px; border-radius: 5px; box-shadow: 0 5px 15px rgba(0,0,0,0.3); transform: scale(0.9); transition: transform 0.3s ease; }
.modal.show .modal-box { transform: scale(1); }
.modal-content { display: block; max-width: 90vw; max-height: 85vh; }
.close-modal { position: absolute; top: -15px; right: -15px; color: #fff; background-color: #333; width: 35px; height: 35px; line-height: 35px; text-align: center; border-radius: 50%; font-size: 28px; font-weight: bold; transition: 0.3s; cursor: pointer; z-index: 10; }
.close-modal:hover, .close-modal:focus { background-color: #f44336; color: white; text-decoration: none; }
