/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background-color: #0078d7;
    color: white;
    padding: 15px;
    text-align: center;
    border-radius: 5px 5px 0 0;
    margin-bottom: 20px;
}

h1 {
    font-size: 24px;
    font-weight: bold;
}

h2 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #0078d7;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

/* 主内容区 - 上下布局 */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.query-panel, .result-panel {
    background-color: white;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

/* 表单网格布局 */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

/* 表单样式 */
.form-container {
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 5px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

input[type="text"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.tip {
    font-size: 12px;
    color: #888;
    margin-top: 5px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#queryBtn {
    background-color: #0078d7;
    color: white;
}

#exportBtn {
    background-color: #5cb85c;
    color: white;
}

#setCookieBtn {
    background-color: #f0ad4e;
    color: white;
}

#updateDataBtn {
    background-color: #6f42c1;
    color: white;
}

#nicoExportBtn {
    background-color: #ff6b9d;
    color: white;
    border-radius: 20px;
    font-weight: bold;
    box-shadow: 0 2px 10px rgba(255, 107, 157, 0.3);
    transition: all 0.3s ease;
}

#nicoExportBtn:hover {
    background-color: #ff4081;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.4);
}

#startNicoExportBtn {
    background-color: #ff6b9d;
    color: white;
    border-radius: 8px;
    font-weight: bold;
}

#startNicoExportBtn:hover {
    background-color: #ff4081;
}

#cancelNicoExportBtn {
    background-color: #d9534f;
    color: white;
}

#nicoExportModal .modal-content {
    width: 500px;
}

#saveCookieBtn,
#startUpdateBtn {
    background-color: #0078d7;
    color: white;
}

#cancelCookieBtn,
#cancelUpdateBtn {
    background-color: #d9534f;
    color: white;
}

button:hover {
    opacity: 0.9;
}

button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

/* 表格样式 */
.table-container {
    overflow-x: auto;
    margin-top: 20px;
    margin-bottom: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th, td {
    padding: 12px 15px;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #f2f2f2;
    font-weight: bold;
}

tr:hover {
    background-color: #f9f9f9;
}

/* 分页样式 */
.pagination-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-top: 1px solid #eee;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.current-page {
    display: flex;
    align-items: center;
    gap: 5px;
}

#currentPageInput {
    width: 50px;
    text-align: center;
}

#pageSizeSelector {
    width: auto;
}

/* Cookie弹窗样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    width: 500px;
    max-width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 统计模版模态窗口样式 */
#templateModal .modal-content {
    width: 650px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #0078d7;
}

.close {
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
}

.close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .pagination-footer {
        flex-direction: column;
        gap: 10px;
    }
    
    .pagination-controls {
        width: 100%;
        justify-content: center;
    }
}

/* 更新数据相关样式 */
.checkbox-group {
    margin: 15px 0;
}

.checkbox-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: normal;
}

.checkbox-group input[type="checkbox"] {
    margin-right: 8px;
}

.update-status {
    margin-top: 15px;
    padding: 10px;
    border-radius: 4px;
    max-height: 200px;
    overflow-y: auto;
}

.update-status .success {
    color: #5cb85c;
}

.update-status .error {
    color: #d9534f;
}

.update-status .info {
    color: #0078d7;
}

/* Select2 自定义样式 */
.select2-container .select2-selection--multiple {
    min-height: 36px;
    line-height: 1.5;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: #0078d7;
    color: white;
    border: none;
    border-radius: 3px;
    padding: 3px 8px;
    margin-top: 4px;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: white;
    margin-right: 5px;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: #f0f0f0;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #0078d7;
}

.select2-container--default .select2-search--inline .select2-search__field {
    margin-top: 7px;
}

.select2-dropdown {
    border: 1px solid #ddd;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* 添加导出加载指示器的样式 */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 2s linear infinite;
}

.loading-text {
    color: white;
    font-size: 18px;
    margin-top: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 统计模版相关样式 */
.template-tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 15px;
}

.tab-btn {
    padding: 8px 15px;
    border: none;
    background: none;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    border-bottom: 2px solid transparent;
}

.tab-btn.active {
    color: #1890ff;
    border-bottom: 2px solid #1890ff;
}

.tab-content {
    display: block;
}

.tab-content.hidden {
    display: none;
}

.template-list-container {
    max-height: 350px;
    overflow-y: auto;
    padding: 10px 5px;
}

.template-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.template-item {
    display: flex;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    align-items: flex-start;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 10px;
}

.template-item:hover {
    background-color: #f5f5f5;
}

.template-item.selected {
    background-color: #e6f7ff;
    border-color: #91d5ff;
}

.template-item-radio {
    margin-right: 12px;
    margin-top: 3px;
}

.template-item-content {
    flex: 1;
    overflow: hidden;
}

.template-item-name {
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 15px;
}

.template-item-info {
    font-size: 12px;
    color: #666;
    line-height: 1.5;
    white-space: normal;
    word-break: break-all;
}

.no-template-tip {
    text-align: center;
    color: #999;
    padding: 20px 0;
}

.template-tip {
    font-size: 12px;
    color: #999;
    margin-top: 10px;
}

.template-divider {
    margin: 15px 0;
    border: none;
    border-top: 1px solid #eee;
}

.template-section-title {
    font-size: 16px;
    font-weight: 600;
    margin-top: 5px;
    margin-bottom: 15px;
}

#createTemplateTab .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-gap: 15px;
}

#createTemplateTab .form-group {
    margin-bottom: 15px;
}

#createTemplateFooter, #useTemplateFooter {
    display: flex;
    gap: 10px;
}

#createTemplateFooter.hidden, #useTemplateFooter.hidden {
    display: none;
} 