/* css/main.css - 主管理页面样式 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #4b6cb7 0%, #182848 100%);
    color: white;
    padding: 25px 30px;
    text-align: center;
}

h1 {
    font-size: 2.4rem;
    margin-bottom: 8px;
    font-weight: 600;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

.content {
    padding: 30px;
}

.section {
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid #eee;
}

.section-title {
    font-size: 1.4rem;
    margin-bottom: 18px;
    color: #2c3e50;
    display: flex;
    align-items: center;
}

.section-title i {
    margin-right: 10px;
    font-size: 1.6rem;
}

.controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 25px;
}

@media (max-width: 768px) {
    .controls {
        grid-template-columns: 1fr;
    }
}

.control-group {
    background-color: #f9fafc;
    border-radius: 10px;
    padding: 20px;
    border: 1px solid #eaeef2;
}

.control-group h3 {
    margin-bottom: 15px;
    color: #4b6cb7;
    font-size: 1.2rem;
}

.buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

button {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.primary-btn {
    background-color: #4b6cb7;
    color: white;
}

.primary-btn:hover:not(:disabled) {
    background-color: #3a5899;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(75, 108, 183, 0.3);
}

.secondary-btn {
    background-color: #2ecc71;
    color: white;
}

.secondary-btn:hover:not(:disabled) {
    background-color: #27ae60;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.3);
}

.export-btn {
    background-color: #e74c3c;
    color: white;
}

.export-btn:hover:not(:disabled) {
    background-color: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.3);
}

.clear-btn {
    background-color: #95a5a6;
    color: white;
}

.clear-btn:hover:not(:disabled) {
    background-color: #7f8c8d;
    transform: translateY(-2px);
}

.count-input {
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    width: 150px;
    font-size: 1rem;
}

.count-input:focus {
    outline: none;
    border-color: #4b6cb7;
}

/* 防伪验证部分样式 */
.verification-section {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 25px;
    margin-top: 25px;
    border: 1px solid #eaeaea;
}

.verification-title {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: #2c3e50;
    display: flex;
    align-items: center;
}

.verification-box {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.verification-input {
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1.2rem;
    font-family: monospace;
    letter-spacing: 1px;
    flex: 1;
    min-width: 300px;
    text-transform: uppercase;
    max-width: 500px;
}

.verification-input:focus {
    outline: none;
    border-color: #4b6cb7;
    box-shadow: 0 0 0 3px rgba(75, 108, 183, 0.2);
}

.verification-input.correct {
    border-color: #2ecc71;
    background-color: rgba(46, 204, 113, 0.05);
}

.verification-input.error {
    border-color: #e74c3c;
    background-color: rgba(231, 76, 60, 0.05);
}

.verification-hint {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-top: 8px;
    text-align: center;
}

.code-display {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-top: 15px;
    border: 1px solid #eaeaea;
}

.single-code {
    font-size: 1.8rem;
    font-weight: bold;
    letter-spacing: 2px;
    color: #2c3e50;
    text-align: center;
    padding: 15px;
    background-color: white;
    border-radius: 8px;
    border: 2px dashed #4b6cb7;
    margin-bottom: 20px;
    word-break: break-all;
}

.codes-list {
    max-height: 400px;
    overflow-y: auto;
    margin-top: 10px;
    border-radius: 8px;
    border: 1px solid #eaeaea;
}

.code-item {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    font-family: monospace;
    font-size: 1.1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.code-item:nth-child(even) {
    background-color: #f9f9f9;
}

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

.stats {
    margin-top: 20px;
    font-size: 1rem;
    color: #7f8c8d;
    text-align: center;
}

.info-box {
    background-color: #f0f7ff;
    padding: 20px;
    border-radius: 8px;
    margin-top: 25px;
    border-left: 4px solid #4b6cb7;
}

.info-box h3 {
    margin-bottom: 10px;
    color: #2c3e50;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.info-card {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.info-card h4 {
    margin-bottom: 10px;
    color: #4b6cb7;
    font-size: 1.1rem;
}

.info-value {
    font-size: 1.4rem;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
}

.info-desc {
    font-size: 0.9rem;
    color: #7f8c8d;
}

.icon {
    margin-right: 8px;
    font-size: 1.2rem;
}

footer {
    text-align: center;
    padding: 20px;
    color: #7f8c8d;
    font-size: 0.9rem;
    border-top: 1px solid #eee;
}

.instructions {
    background-color: #f0f7ff;
    padding: 20px;
    border-radius: 8px;
    margin-top: 25px;
    border-left: 4px solid #4b6cb7;
}

.instructions h3 {
    margin-bottom: 10px;
    color: #2c3e50;
}

.instructions ul {
    padding-left: 20px;
}

.instructions li {
    margin-bottom: 8px;
}

.copy-btn {
    background-color: #3498db;
    color: white;
    padding: 6px 12px;
    font-size: 0.9rem;
    border-radius: 4px;
}

.copy-btn:hover {
    background-color: #2980b9;
}

.success-message {
    background-color: #2ecc71;
    color: white;
    padding: 10px 15px;
    border-radius: 6px;
    margin-top: 15px;
    display: none;
    text-align: center;
}

.error-message {
    background-color: #e74c3c;
    color: white;
    padding: 10px 15px;
    border-radius: 6px;
    margin-top: 15px;
    display: none;
    text-align: center;
}

.warning-message {
    background-color: #f39c12;
    color: white;
    padding: 10px 15px;
    border-radius: 6px;
    margin-top: 15px;
    display: none;
    text-align: center;
}

.loading {
    display: none;
    text-align: center;
    padding: 20px;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border-left-color: #4b6cb7;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

.filter-section {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    border: 1px solid #eaeaea;
}

.filter-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.date-input {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    width: 100%;
}

.date-picker-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.date-label {
    font-weight: 600;
    color: #2c3e50;
    min-width: 80px;
}

.batch-info {
    background-color: #e8f4fd;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    border-left: 4px solid #3498db;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 20px;
}

.page-btn {
    padding: 8px 12px;
    border: 1px solid #ddd;
    background-color: white;
    cursor: pointer;
    border-radius: 4px;
}

.page-btn.active {
    background-color: #4b6cb7;
    color: white;
    border-color: #4b6cb7;
}

.page-btn:hover:not(.active) {
    background-color: #f5f5f5;
}

/* 数据库统计样式 */
.database-stats {
    background-color: #f0f7ff;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: #2c3e50;
}

.stat-label {
    font-size: 0.9rem;
    color: #7f8c8d;
}

/* 验证结果样式 */
.verification-result {
    margin-top: 25px;
    padding: 25px;
    border-radius: 8px;
    display: none;
}

.verification-valid {
    background-color: rgba(46, 204, 113, 0.1);
    border: 2px solid #2ecc71;
}

.verification-invalid {
    background-color: rgba(231, 76, 60, 0.1);
    border: 2px solid #e74c3c;
}

.verification-warning {
    background-color: rgba(241, 196, 15, 0.1);
    border: 2px solid #f1c40f;
}

.result-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.result-icon {
    font-size: 2.5rem;
    margin-right: 15px;
}

.result-title {
    font-size: 1.5rem;
    font-weight: bold;
}

.result-details {
    margin-top: 15px;
}

.detail-row {
    display: flex;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.detail-label {
    font-weight: bold;
    min-width: 120px;
    color: #2c3e50;
}

.detail-value {
    flex: 1;
    font-family: monospace;
}

.check-digit-section {
    background-color: #f0f7ff;
    padding: 15px;
    border-radius: 6px;
    margin-top: 15px;
    border-left: 4px solid #3498db;
}

.check-digit-title {
    font-weight: bold;
    margin-bottom: 8px;
    color: #2c3e50;
}

.check-digit-info {
    font-size: 0.95rem;
    color: #555;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-content {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    min-width: 200px;
}

.capacity-meter {
    height: 10px;
    background-color: #ecf0f1;
    border-radius: 5px;
    margin-top: 10px;
    overflow: hidden;
}

.capacity-fill {
    height: 100%;
    background: linear-gradient(90deg, #2ecc71, #f1c40f, #e74c3c);
    border-radius: 5px;
    width: 0%;
    transition: width 0.5s ease;
}

.capacity-label {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    font-size: 0.9rem;
}

.duplicate-count {
    color: #e74c3c;
    font-weight: bold;
}