/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f8f9fa;
    color: #343a40;
    line-height: 1.6;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }

    to {
        transform: translateY(0);
    }
}

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

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

/* 全局提示条 */
.alert-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 12px 20px;
    text-align: center;
    font-weight: 500;
    z-index: 1000;
    transform: translateY(-100%);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.alert-bar.show {
    transform: translateY(0);
    animation: slideDown 0.4s forwards;
}

.alert-bar.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-bottom: 1px solid #bee5eb;
}

.alert-bar.warning {
    background-color: #fff3cd;
    color: #856404;
    border-bottom: 1px solid #ffeeba;
}

.alert-bar.error {
    background-color: #f8d7da;
    color: #721c24;
    border-bottom: 1px solid #f5c6cb;
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    padding: 0.8rem 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 100;
    transition: all 0.3s ease;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.header-left {
    display: flex;
    flex-direction: column;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
    transition: all 0.3s ease;
}

.header-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    opacity: 0.9;
    align-items: center;
}

.version {
    background-color: rgba(255, 255, 255, 0.2);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.current-time {
    display: inline-flex;
    align-items: center;
}

.parse-status {
    background-color: rgba(255, 255, 255, 0.2);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.parse-status.parsed {
    background-color: rgba(40, 167, 69, 0.2);
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* 公告栏样式 */
.notice-tab {
    background-color: #e7f5ff;
    border: 1px solid #d0ebff;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
    position: relative;
    transition: all 0.3s ease;
    display: none;
}

.notice-tab.active {
    display: block;
    animation: fadeIn 0.5s ease-out;
}

.notice-content h3 {
    color: #1971c2;
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
}

.notice-content ol {
    padding-left: 1.2rem;
    margin-bottom: 0;
}

.notice-content li {
    margin-bottom: 0.4rem;
}

.close-notice {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: none;
    border: none;
    color: #868e96;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
}

.close-notice:hover {
    color: #495057;
    transform: scale(1.1);
}

/* 切换按钮样式 */
.toggle-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toggle-label {
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: #28a745;
}

input:checked+.slider:before {
    transform: translateX(26px);
}

/* 刷新按钮样式 */
.delete-button,
.refresh-button {
    background-color: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.delete-button:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
    color: #ff6b6b;
}

.refresh-button:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.refresh-button.refreshing {
    animation: spin 0.7s linear infinite, pulse 1.5s infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg) scale(1);
    }

    100% {
        transform: rotate(360deg) scale(1);
    }
}

/* 内容区域样式 */
.content {
    max-width: 1200px;
    margin: 1.5rem auto;
    padding: 0 2rem;
    animation: fadeIn 0.6s ease-out;
}

.search-container {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
}

.search-tabs {
    display: flex;
    border-bottom: 1px solid #e9ecef;
}

.tab-button {
    padding: 0.7rem 1.3rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    color: #6c757d;
    position: relative;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.tab-button:hover {
    color: #495057;
    background-color: #f8f9fa;
    transform: translateY(-2px);
}

.tab-button.active {
    color: #2575fc;
    font-weight: 500;
}

.tab-button.active:after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #2575fc;
    animation: widthGrow 0.3s ease-out;
}

@keyframes widthGrow {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

.tab-content {
    display: none;
    padding: 1.3rem;
    animation: fadeIn 0.4s ease-out;
}

.tab-content.active {
    display: block;
}

.search-form {
    display: flex;
    margin-bottom: 0;
    gap: 0.5rem;
    flex-direction: column;
    animation: fadeIn 0.5s ease-out;
}

.search-form input {
    padding: 0.6rem 0.8rem;
    flex-grow: 1;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-form input:focus {
    outline: none;
    border-color: #2575fc;
    box-shadow: 0 0 0 0.2rem rgba(37, 117, 252, 0.25);
    transform: translateY(-1px);
}

/* 修改搜索表单按钮样式 */
.search-form button[type="submit"] {
    padding: 0.6rem 1.2rem;
    background-color: #2575fc;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    width: 100%;
}

.search-form button[type="submit"]:hover {
    background-color: #1a68e8;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.query-buttons {
    display: flex;
    gap: 0.5rem;
}

.query-buttons button {
    flex: 1;
    padding: 0.6rem 1.2rem;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* 添加查询记录样式 */
.query-history {
    margin-top: 2rem;
    background-color: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.query-history h3 {
    color: #2575fc;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
}

#historyList {
    list-style: none;
}

#historyList li {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.2s;
}

#historyList li:hover {
    background-color: #f8f9fa;
    color: #2575fc;
}

#historyList li:last-child {
    border-bottom: none;
}

/* 添加暂无查询提示样式 */
/* .result-content.empty::before {
    content: "暂无查询结果";
    display: block;
    text-align: center;
    color: #868e96;
    font-style: italic;
    padding: 2rem 0;
} */

.local-query {
    background-color: #6c757d;
}

.local-query:hover {
    background-color: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.online-query {
    background-color: #2575fc;
}

.online-query:hover {
    background-color: #1a68e8;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* 结果内容样式 */
.result-content {
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 1.5rem;
    background-color: white;
    margin-top: 1rem;
    animation: fadeIn 0.5s ease-out;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
}

.result-title {
    margin-bottom: 1.2rem;
    color: #2575fc;
    font-size: 1.2rem;
    font-weight: 500;
    position: relative;
    padding-left: 0.8rem;
}

.result-title:before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: #2575fc;
    border-radius: 2px;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.result-item {
    display: flex;
    align-items: flex-start;
    animation: fadeIn 0.6s ease-out;
}

.result-item.full-width {
    grid-column: span 2;
}

.result-item label {
    font-weight: 500;
    color: #495057;
    min-width: 80px;
    margin-right: 1rem;
    transition: all 0.3s ease;
}

.result-item span,
.result-value {
    color: #212529;
    word-break: break-word;
    transition: all 0.3s ease;
}

.result-value {
    background-color: white;
    padding: 0.8rem;
    border-radius: 4px;
    border: 1px solid #e9ecef;
    white-space: pre-line;
    line-height: 1.5;
}

/* 强调效果 */
.highlight {
    font-weight: 600;
    color: #1a68e8;
    transition: all 0.3s ease;
}

.answer {
    color: #28a745;
    font-weight: 700;
    animation: pulse 1s ease-in-out;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: stretch;
        gap: 0.8rem;
        padding: 0.8rem;
    }

    .header-left {
        margin-bottom: 0.3rem;
    }

    .header h1 {
        font-size: 1.3rem;
    }

    .header-meta {
        flex-wrap: wrap;
    }

    .header-controls {
        justify-content: space-between;
    }

    .search-tabs {
        overflow-x: auto;
    }

    .tab-button {
        padding: 0.6rem 0.9rem;
        font-size: 0.9rem;
        white-space: nowrap;
    }

    .query-buttons {
        flex-direction: column;
    }

    .result-grid {
        grid-template-columns: 1fr;
    }

    .result-item.full-width {
        grid-column: span 1;
    }

    .result-item {
        flex-direction: column;
        gap: 0.3rem;
    }

    .result-item label {
        margin-right: 0;
    }

    .content {
        padding: 0 1rem;
        margin: 1rem auto;
    }
}


/* 查询记录头部样式 */
.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
}


/* 多结果列表样式 */
.multi-results {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.multi-results h4 {
    margin-bottom: 0.8rem;
    color: #495057;
}

.result-list {
    list-style: none;
    max-height: 300px;
    overflow-y: auto;
}

.result-list li {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid #e9ecef;
    cursor: pointer;
    transition: all 0.2s;
}

.result-list li:hover {
    background-color: #e9f5ff;
    color: #2575fc;
}

.result-list li:last-child {
    border-bottom: none;
}

.result-list li .question-preview {
    color: #6c757d;
    font-size: 0.9rem;
    margin-top: 0.3rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}



/* 系统配置页面样式 */
.settings-container {
    padding: 1.5rem;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.setting-item {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.setting-item h4 {
    margin-bottom: 0.8rem;
    color: #495057;
}

.radio-group {
    display: flex;
    gap: 1.5rem;
}

.radio-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.radio-group input[type="radio"] {
    margin-right: 0.5rem;
}

.save-settings {
    padding: 0.6rem 1.2rem;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
}

.save-settings:hover {
    background-color: #218838;
    transform: translateY(-2px);
}

/* 导入按钮样式 (与刷新按钮一致) */
.import-button {
    background-color: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.import-button:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}




/* 设置按钮容器 */
.setting-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* 获取授权按钮样式 */
.get-auth {
    padding: 0.6rem 1.2rem;
    background-color: #FFD700; /* 淡金黄色 */
    color: #333;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.get-auth:hover {
    background-color: #FFC800;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* 禁用状态样式 */
.get-auth:disabled {
    background-color: #e0e0e0;
    color: #999;
    cursor: not-allowed;
}