* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}
a { text-decoration: none; color: inherit; }

/* ========== 前端查询页 ========== */
.container {
    max-width: 800px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 20px;
}
.header {
    text-align: center;
    padding: 40px 0 30px;
}
.header h1 {
    font-size: 28px;
    color: #2c3e50;
    margin-bottom: 8px;
    font-weight: 600;
}
.subtitle {
    color: #7f8c8d;
    font-size: 14px;
}
.main { flex: 1; }

.search-box {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    margin-bottom: 24px;
}
.search-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.tab-btn {
    flex: 1;
    padding: 10px;
    border: 1px solid #e0e0e0;
    background: #fafafa;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}
.tab-btn.active {
    background: #3498db;
    color: #fff;
    border-color: #3498db;
}
.search-input-wrap {
    display: flex;
    gap: 10px;
}
.search-input-wrap input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}
.search-input-wrap input:focus { border-color: #3498db; }
.search-btn {
    padding: 0 24px;
    background: #3498db;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
}
.search-btn:hover { background: #2980b9; }

.result-area {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.info-card h3 {
    font-size: 20px;
    color: #2c3e50;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}
.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
.info-item {
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
}
.info-label {
    font-size: 12px;
    color: #999;
    margin-bottom: 4px;
}
.info-value {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}
.status-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.status-tag {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}
.status-success { background: #d4edda; color: #155724; }
.status-warning { background: #fff3cd; color: #856404; }
.status-danger { background: #f8d7da; color: #721c24; }
.status-gray { background: #e9ecef; color: #6c757d; }

.update-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}
.btn-outline {
    display: inline-block;
    padding: 10px 20px;
    border: 1px solid #3498db;
    color: #3498db;
    border-radius: 8px;
    cursor: pointer;
    background: #fff;
    font-size: 14px;
}
.btn-outline:hover { background: #f0f7ff; }

.footer {
    text-align: center;
    padding: 30px 0 20px;
    color: #999;
    font-size: 12px;
}
.footer a { color: #999; }
.footer a:hover { color: #3498db; }
.footer p { margin-bottom: 6px; }

/* ========== 弹窗 ========== */
.modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}
.modal-content {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
}
.modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h3 { font-size: 18px; color: #2c3e50; }
.close-modal {
    font-size: 24px;
    cursor: pointer;
    color: #999;
    line-height: 1;
}
.modal-body { padding: 20px; }
.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid #eee;
    text-align: right;
}

.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #555;
    font-weight: 500;
}
.form-group input[type="text"],
.form-group input[type="password"],
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
}
.form-group input:focus,
.form-group select:focus { border-color: #3498db; }

.radio-group {
    display: flex;
    gap: 20px;
}
.radio-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 0;
    font-weight: normal;
    cursor: pointer;
}

.btn-primary {
    padding: 10px 24px;
    background: #3498db;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}
.btn-primary:hover { background: #2980b9; }
.btn-block { width: 100%; padding: 12px; font-size: 15px; }
.btn-lg { padding: 14px 32px; font-size: 16px; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-success { background: #27ae60; color: #fff; border: none; border-radius: 6px; cursor: pointer; }
.btn-success:hover { background: #219a52; }
.btn-warning { background: #f39c12; color: #fff; border: none; border-radius: 6px; cursor: pointer; }
.btn-warning:hover { background: #e67e22; }
.btn-default {
    padding: 10px 20px;
    background: #fff;
    color: #666;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: inline-block;
}
.btn-default:hover { background: #f5f5f5; }

/* ========== 后台登录 ========== */
.admin-login {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.login-box {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
}
.login-box h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
}
.error-msg {
    background: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 13px;
    text-align: center;
}

/* ========== 后台布局 ========== */
.admin-layout {
    display: flex;
    min-height: 100vh;
}
.admin-sidebar {
    width: 220px;
    background: #2c3e50;
    color: #fff;
    flex-shrink: 0;
}
.logo {
    padding: 20px;
    font-size: 18px;
    font-weight: 600;
    border-bottom: 1px solid #34495e;
    text-align: center;
}
.admin-nav { padding: 10px 0; }
.nav-item {
    display: block;
    padding: 12px 20px;
    color: #bdc3c7;
    transition: all 0.2s;
    font-size: 14px;
}
.nav-item:hover, .nav-item.active {
    background: #34495e;
    color: #fff;
}
.nav-item.logout { color: #e74c3c; margin-top: 20px; }
.nav-item.logout:hover { background: rgba(231,76,60,0.1); }

.admin-main {
    flex: 1;
    padding: 24px;
    overflow-x: hidden;
}
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.admin-header h1 { font-size: 22px; color: #2c3e50; }

.panel {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.panel h3 {
    font-size: 16px;
    color: #2c3e50;
    margin-bottom: 16px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.stat-card.warning { border-top: 3px solid #f39c12; }
.stat-num {
    font-size: 32px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}
.stat-label {
    font-size: 13px;
    color: #7f8c8d;
}

.quick-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.search-form {
    display: flex;
    gap: 10px;
}
.search-form input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    outline: none;
}

.table-wrap { overflow-x: auto; }
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.data-table th, .data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}
.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
    white-space: nowrap;
}
.data-table tr:hover { background: #f8f9fa; }
.text-sm { font-size: 12px; }

.tag {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}
.tag-success { background: #d4edda; color: #155724; }
.tag-warning { background: #fff3cd; color: #856404; }
.tag-danger { background: #f8d7da; color: #721c24; }
.tag-gray { background: #e9ecef; color: #6c757d; }

.actions .link-btn {
    margin-right: 8px;
    color: #3498db;
    font-size: 13px;
    cursor: pointer;
}
.actions .link-btn.warn { color: #f39c12; }
.actions .link-btn.danger { color: #e74c3c; }

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 20px 0 0;
}
.pagination a {
    color: #3498db;
    font-size: 14px;
}
.pagination span { color: #999; font-size: 14px; }

.empty {
    text-align: center;
    color: #999;
    padding: 30px !important;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.form-grid .full-width { grid-column: 1 / -1; }

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .header h1 { font-size: 22px; }
    .info-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    
    .admin-layout { flex-direction: column; }
    .admin-sidebar { width: 100%; }
    .admin-nav { display: flex; flex-wrap: wrap; padding: 5px; }
    .nav-item { padding: 10px 12px; font-size: 13px; }
    .nav-item.logout { margin-top: 0; margin-left: auto; }
    
    .form-grid { grid-template-columns: 1fr; }
    .admin-main { padding: 16px; }
}
