/**
 * 快查系统 - 样式文件
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'OPPO Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f0f2f5;
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

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

/* 头部 */
.header {
    text-align: center;
    padding: 40px 0 30px;
}

.logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 16px;
    object-fit: cover;
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.subtitle {
    color: #666;
    font-size: 15px;
}

/* 管理栏 */
.admin-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #e6f7ff;
    border: 1px solid #91d5ff;
    border-radius: 6px;
    padding: 10px 16px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #1890ff;
}

.logout-link {
    color: #1890ff;
    text-decoration: none;
}

.logout-link:hover {
    text-decoration: underline;
}

/* 登录页面 */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-box {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    padding: 40px;
    width: 100%;
    max-width: 360px;
}

.login-box h2 {
    font-size: 20px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 24px;
    color: #333;
}

.login-logo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: block;
    margin: 0 auto 16px;
}

.login-error {
    background: #fff2f0;
    border: 1px solid #ffccc7;
    color: #ff4d4f;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 14px;
    text-align: center;
}

.login-box .form-group {
    margin-bottom: 16px;
}

.login-box input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
    font-family: inherit;
}

.login-box input:focus {
    outline: none;
    border-color: #1890ff;
}

.login-btn {
    width: 100%;
    padding: 12px;
    background: #1890ff;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
}

.login-btn:hover {
    background: #40a9ff;
}

.back-link {
    display: block;
    text-align: center;
    margin-top: 16px;
    color: #888;
    font-size: 14px;
    text-decoration: none;
}

.back-link:hover {
    color: #1890ff;
}

/* 标签页 */
.tabs {
    display: flex;
    background: #fff;
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.tab {
    flex: 1;
    padding: 12px;
    border: none;
    background: transparent;
    font-size: 15px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    font-family: inherit;
    color: #666;
}

.tab.active {
    background: #1890ff;
    color: #fff;
}

.tab:hover:not(.active) {
    background: #f5f5f5;
}

/* 面板 */
.panel {
    display: none;
}

.panel.active {
    display: block;
}

/* 项目卡片 */
.project-list h3,
.upload-section h3,
.project-manage h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #333;
}

.projects {
    display: grid;
    gap: 12px;
}

.project-card {
    background: #fff;
    border-radius: 8px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 2px solid transparent;
}

.project-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: #1890ff;
}

.project-name {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.project-desc {
    font-size: 13px;
    color: #888;
    margin-bottom: 8px;
}

.project-meta {
    font-size: 12px;
    color: #1890ff;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.date-range {
    color: #888;
}

/* 空状态 */
.empty {
    text-align: center;
    padding: 40px;
    color: #999;
    background: #fff;
    border-radius: 8px;
}

.empty .hint {
    font-size: 13px;
    margin-top: 8px;
    color: #bbb;
}

/* 查询表单 */
.search-form {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.back-btn {
    background: none;
    border: none;
    color: #1890ff;
    cursor: pointer;
    font-size: 14px;
    padding: 0;
    margin-bottom: 16px;
    font-family: inherit;
}

.back-btn:hover {
    text-decoration: underline;
}

.search-form h3 {
    font-size: 18px;
    margin-bottom: 20px;
}

.search-fields {
    margin-bottom: 20px;
}

.search-field {
    margin-bottom: 16px;
}

.search-field label {
    display: block;
    font-size: 14px;
    color: #666;
    margin-bottom: 6px;
}

.search-field input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
    font-family: inherit;
}

.search-field input:focus {
    outline: none;
    border-color: #1890ff;
}

.search-btn {
    width: 100%;
    padding: 12px;
    background: #1890ff;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
}

.search-btn:hover {
    background: #40a9ff;
}

/* 查询结果 */
.search-result {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    margin-top: 20px;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.result-header h3 {
    font-size: 16px;
}

#result-count {
    font-size: 13px;
    color: #888;
}

.result-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.result-table th,
.result-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.result-table th {
    background: #fafafa;
    font-weight: 600;
    color: #666;
    font-size: 13px;
}

.result-table tr:last-child td {
    border-bottom: none;
}

.no-result {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* 管理面板 */
.upload-section,
.project-manage {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

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

.form-group label {
    display: block;
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.form-group input[type="text"],
.form-group input[type="date"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: #1890ff;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-row .form-group.half {
    flex: 1;
}

/* 文件上传 */
.file-upload {
    border: 2px dashed #e0e0e0;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.file-upload:hover {
    border-color: #1890ff;
    background: #fafafa;
}

.file-upload input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-placeholder span {
    display: block;
}

.file-placeholder .hint {
    font-size: 12px;
    color: #bbb;
    margin-top: 8px;
}

.file-selected {
    color: #1890ff;
}

/* 字段配置 */
.field-config {
    background: #fafafa;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.field-config h4 {
    font-size: 14px;
    margin-bottom: 4px;
}

.field-config .hint {
    font-size: 12px;
    color: #888;
    margin-bottom: 12px;
}

#field-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.field-item {
    display: flex;
    align-items: center;
    background: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    border: 1px solid #e0e0e0;
    cursor: pointer;
    transition: all 0.2s;
}

.field-item:hover {
    border-color: #1890ff;
}

.field-item input {
    margin-right: 6px;
}

.field-item.active {
    background: #e6f7ff;
    border-color: #1890ff;
    color: #1890ff;
}

.upload-btn {
    width: 100%;
    padding: 12px;
    background: #1890ff;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
}

.upload-btn:hover {
    background: #40a9ff;
}

.upload-btn:disabled {
    background: #bbb;
    cursor: not-allowed;
}

/* 项目管理列表 */
.manage-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.manage-item:last-child {
    border-bottom: none;
}

.manage-item.expired {
    background: #fff2f0;
}

.manage-item.future {
    background: #fffbe6;
}

.item-info strong {
    display: block;
    font-size: 14px;
}

.item-meta {
    font-size: 12px;
    color: #888;
}

.status-expired {
    color: #ff4d4f;
    margin-left: 8px;
}

.status-future {
    color: #faad14;
    margin-left: 8px;
}

.delete-btn {
    padding: 6px 12px;
    background: #fff;
    color: #ff4d4f;
    border: 1px solid #ffccc7;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.delete-btn:hover {
    background: #ff4d4f;
    color: #fff;
}

/* 消息提示 */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    z-index: 1000;
    animation: slideDown 0.3s ease;
}

.toast.success {
    background: #52c41a;
    color: #fff;
}

.toast.error {
    background: #ff4d4f;
    color: #fff;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* 响应式 */
@media (max-width: 600px) {
    .container {
        padding: 15px;
    }
    
    .header {
        padding: 24px 0;
    }
    
    .logo {
        width: 60px;
        height: 60px;
    }
    
    .header h1 {
        font-size: 20px;
    }
    
    .search-form,
    .upload-section,
    .project-manage {
        padding: 16px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .result-table {
        font-size: 13px;
    }
    
    .result-table th,
    .result-table td {
        padding: 10px 8px;
    }
}
