* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

/* 头部样式 */
.header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.header p {
    font-size: 1.1em;
    opacity: 0.9;
}

/* 管理后台头部 */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 20px 30px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.admin-header h1 {
    color: #333;
    font-size: 1.8em;
}

.logout-btn {
    background: #e74c3c;
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    transition: background 0.3s;
}

.logout-btn:hover {
    background: #c0392b;
}

/* 登录框 */
.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    max-width: 400px;
    margin: 100px auto;
}

.login-box h2 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
}

/* 查询框和管理框 */
.query-box, .admin-box {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.admin-box h2 {
    color: #333;
    margin-bottom: 10px;
}

.tip {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 20px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
}

/* 标签页 */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.tab-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1em;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.tab-btn:hover {
    color: #667eea;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    font-weight: bold;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-group textarea {
    resize: vertical;
    min-height: 150px;
}

/* 按钮样式 */
button, .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-weight: 500;
}

button:hover, .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

button:active, .btn-primary:active {
    transform: translateY(0);
}

/* 结果框 */
.result-box {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 5px;
    min-height: 50px;
}

.loading {
    text-align: center;
    color: #667eea;
    font-size: 1.1em;
}

.success-message {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #c3e6cb;
    margin-bottom: 15px;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #f5c6cb;
}

.error-list {
    margin-top: 15px;
    padding: 15px;
    background: #fff3cd;
    border-radius: 5px;
    border: 1px solid #ffeaa7;
}

.error-list ul {
    margin-top: 10px;
    margin-left: 20px;
}

.error-list li {
    color: #856404;
    margin: 5px 0;
}

/* 结果表格 */
.result-table {
    overflow-x: auto;
}

.result-table table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 5px;
    overflow: hidden;
}

.result-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.result-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

.result-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
}

.result-table tbody tr:hover {
    background: #f8f9fa;
}

.result-table tbody tr:last-child td {
    border-bottom: none;
}

.error-text {
    color: #e74c3c;
    font-weight: 500;
}

/* 状态标签 */
.status-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 500;
}

.status-badge.unused {
    background: #e2e3e5;
    color: #6c757d;
}

.status-badge.used {
    background: #d4edda;
    color: #155724;
}

.status-badge.expired {
    background: #f8d7da;
    color: #721c24;
}

/* 分页样式 */
.pagination {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.pagination span {
    margin-right: 15px;
    color: #666;
}

.btn-page {
    padding: 8px 15px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    color: #333;
    transition: all 0.3s;
}

.btn-page:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.btn-page.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
    font-weight: bold;
}

/* 删除按钮 */
.btn-delete {
    padding: 6px 12px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.3s;
}

.btn-delete:hover {
    background: #c0392b;
}

.info-box {
    background: #e7f3ff;
    border-left: 4px solid #2196F3;
    padding: 15px;
    border-radius: 5px;
    text-align: center;
    color: #666;
}

/* 公告栏样式 */
.announcement-box {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 12px 20px;
    margin-bottom: 20px;
    border-radius: 5px;
    text-align: center;
}

.announcement-content {
    color: #856404;
    font-size: 0.95em;
    line-height: 1.6;
}

/* 等待提示样式 */
.waiting-box {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.waiting-icon {
    font-size: 3em;
    margin-bottom: 20px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.waiting-text {
    font-size: 1.5em;
    color: #667eea;
    font-weight: bold;
    margin-bottom: 10px;
}

.waiting-text #countdown {
    color: #e74c3c;
    font-size: 1.2em;
}

.waiting-tip {
    color: #666;
    font-size: 0.9em;
    margin-top: 10px;
}

/* 禁用按钮样式 */
button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 导出按钮样式 */
.btn-export {
    padding: 10px 20px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.95em;
    transition: all 0.3s;
    font-weight: 500;
}

.btn-export:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.btn-export:active {
    transform: translateY(0);
}

.btn-export:disabled {
    background: #6c757d;
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 复选框样式 */
.item-checkbox, #selectAllCheckbox, #selectAll {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.result-table th:first-child,
.result-table td:first-child {
    text-align: center;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2em;
    }
    
    .admin-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .query-box, .admin-box {
        padding: 20px;
    }
    
    .result-table {
        font-size: 0.9em;
    }
    
    .result-table th,
    .result-table td {
        padding: 8px;
    }
}
