/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 主色调 - 深邃蓝 */
    --primary-color: #1a365d;
    --primary-hover: #2c5282;
    --primary-light: #3182ce;
    /* 强调色 - 金色 */
    --accent-color: #d69e2e;
    --accent-hover: #ecc94b;
    /* 功能色 */
    --success-color: #38a169;
    --warning-color: #d69e2e;
    --error-color: #e53e3e;
    /* 文字色 */
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    /* 背景色 */
    --bg-primary: #ffffff;
    --bg-secondary: #f7fafc;
    --bg-gradient-start: #1a365d;
    --bg-gradient-end: #2d3748;
    /* 边框和阴影 */
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-hover: 0 10px 25px rgba(0, 0, 0, 0.15);
    --shadow-gold: 0 4px 14px rgba(214, 158, 46, 0.4);
    --radius: 8px;
    --radius-lg: 12px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 头部导航 */
.header {
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    box-shadow: var(--shadow-hover);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.logo-icon {
    font-size: 32px;
    color: var(--accent-color);
    filter: drop-shadow(0 2px 4px rgba(214, 158, 46, 0.3));
}

.nav-menu {
    display: flex;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius);
    text-decoration: none;
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.3s;
    font-weight: 500;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.nav-item.active {
    background: var(--accent-color);
    color: #ffffff;
    box-shadow: var(--shadow-gold);
}

.nav-icon {
    font-size: 18px;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.menu-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.3s;
}

/* 主内容区 */
.main-content {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 24px 20px;
}

/* 底部 */
.footer {
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #73d13d;
}

.btn-danger {
    background: var(--error-color);
    color: white;
}

.btn-danger:hover {
    background: #ff4d4f;
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

.btn-large {
    padding: 14px 32px;
    font-size: 16px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-icon {
    font-size: 16px;
}

/* 表单样式 */
.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    transition: all 0.3s;
    background: var(--bg-primary);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.1);
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* 首页样式 */
.home-container {
    max-width: 800px;
    margin: 0 auto;
}

.hero-section {
    text-align: center;
    padding: 70px 30px;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--primary-light) 50%, var(--accent-color) 100%);
    border-radius: var(--radius-lg);
    color: white;
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    pointer-events: none;
}

.hero-icon {
    font-size: 72px;
    margin-bottom: 24px;
    color: var(--accent-color);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.hero-title {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 16px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    letter-spacing: 1px;
}

.hero-subtitle {
    font-size: 16px;
    opacity: 0.9;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.feature-card {
    background: var(--bg-primary);
    padding: 28px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s;
    position: relative;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.feature-icon {
    font-size: 48px;
    margin-bottom: 20px;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, #ffffff 100%);
    margin-left: auto;
    margin-right: auto;
    transition: all 0.3s;
}

.feature-card:hover .feature-icon {
    transform: scale(1.1);
    box-shadow: var(--shadow-hover);
}

.camera-icon {
    color: #3182ce;
}

.input-icon {
    color: #38a169;
}

.data-icon {
    color: #d69e2e;
}

.feature-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.feature-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.feature-arrow {
    position: absolute;
    right: 20px;
    bottom: 20px;
    font-size: 20px;
    color: var(--primary-color);
}

.stats-section {
    background: var(--bg-primary);
    padding: 28px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.stats-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.stat-item {
    text-align: center;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
}

.stat-number {
    display: block;
    font-size: 36px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
}

/* 拍照页面样式 */
.camera-container {
    max-width: 600px;
    margin: 0 auto;
}

.camera-section {
    background: var(--bg-primary);
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.camera-preview {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 20px;
}

.camera-preview video,
.camera-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.placeholder-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.camera-controls {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.result-section {
    margin-top: 24px;
}

.result-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.result-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

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

.result-content {
    padding: 24px 20px;
}

.plate-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.plate-number {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
}

.plate-status {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.status-success {
    background: #f6ffed;
    color: var(--success-color);
    border: 1px solid #b7eb8f;
}

.status-error {
    background: #fff2f0;
    color: var(--error-color);
    border: 1px solid #ffccc7;
}

.status-warning {
    background: #fffbe6;
    color: var(--warning-color);
    border: 1px solid #ffe58f;
}

.card-success {
    border-left: 4px solid var(--success-color);
}

.card-error {
    border-left: 4px solid var(--error-color);
}

.card-warning {
    border-left: 4px solid var(--warning-color);
}

.vehicle-info {
    background: var(--bg-secondary);
    padding: 16px;
    border-radius: var(--radius);
}

.info-item {
    display: flex;
    margin-bottom: 12px;
}

.info-item:last-child {
    margin-bottom: 0;
}

.info-label {
    color: var(--text-secondary);
    min-width: 60px;
}

.info-value {
    font-weight: 500;
    color: var(--text-primary);
}

.manual-fallback {
    text-align: center;
    padding: 24px;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.manual-fallback p {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* 手动输入页面样式 */
.manual-container {
    max-width: 600px;
    margin: 0 auto;
}

.input-section {
    background: var(--bg-primary);
    padding: 28px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 24px;
}

.input-wrapper {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
}

.input-wrapper .form-input {
    flex: 1;
}

.input-hint {
    font-size: 12px;
    color: var(--text-muted);
}

.quick-input-section {
    background: var(--bg-primary);
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.subsection-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
}

.quick-input-group {
    margin-bottom: 20px;
}

.quick-input-group h4 {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

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

.quick-btn {
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.quick-btn-action {
    min-width: 60px;
    background: var(--bg-secondary);
}

.quick-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* 数据管理页面样式 */
.manage-container {
    background: var(--bg-primary);
    padding: 28px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

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

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

.search-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.search-bar .form-input {
    flex: 1;
    max-width: 300px;
}

.table-container {
    overflow-x: auto;
    margin-bottom: 24px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 14px;
}

.data-table tr:hover {
    background: var(--bg-secondary);
}

.plate-cell {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    letter-spacing: 1px;
}

.action-cell {
    display: flex;
    gap: 8px;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: #f6ffed;
    color: var(--success-color);
}

.badge-secondary {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.empty-message {
    text-align: center;
    color: var(--text-muted);
    padding: 40px;
}

/* 批量操作栏 */
.batch-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #fff7e6;
    border: 1px solid #ffd591;
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.batch-info {
    font-size: 14px;
    color: var(--text-primary);
}

.batch-info strong {
    color: var(--warning-color);
    font-weight: 600;
}

/* 表格中的复选框 */
.data-table th:first-child,
.data-table td:first-child {
    width: 50px;
    text-align: center;
}

.data-table .checkbox-label {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin: 0;
}

.data-table .checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.page-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.page-btn:hover:not(.disabled):not(.active) {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.page-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.page-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-ellipsis {
    color: var(--text-muted);
    padding: 0 8px;
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease;
}

.modal-small {
    max-width: 400px;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

/* 上传区域 */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary-color);
    background: rgba(24, 144, 255, 0.02);
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.upload-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
}

.template-download {
    text-align: center;
    margin-top: 20px;
}

.template-download a {
    color: var(--primary-color);
    text-decoration: none;
}

.template-download a:hover {
    text-decoration: underline;
}

/* 加载动画 */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.loading-overlay.show {
    display: flex;
}

.loading-spinner {
    text-align: center;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 消息提示 */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--radius);
    color: white;
    font-size: 14px;
    box-shadow: var(--shadow-hover);
    animation: toastSlideIn 0.3s ease;
    max-width: 300px;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast-success {
    background: var(--success-color);
}

.toast-error {
    background: var(--error-color);
}

.toast-warning {
    background: var(--warning-color);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header-content {
        height: 56px;
    }
    
    .logo-text {
        display: none;
    }
    
    .nav-menu {
        display: none;
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        background: var(--bg-primary);
        flex-direction: column;
        padding: 12px;
        box-shadow: var(--shadow);
    }
    
    .nav-menu.show {
        display: flex;
    }
    
    .nav-item {
        padding: 12px 16px;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .main-content {
        padding: 16px;
    }
    
    .hero-section {
        padding: 40px 20px;
    }
    
    .hero-title {
        font-size: 24px;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
    }
    
    .input-wrapper {
        flex-direction: column;
    }
    
    .input-wrapper .btn {
        width: 100%;
    }
    
    .manage-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .manage-actions {
        width: 100%;
    }
    
    .manage-actions .btn {
        flex: 1;
    }
    
    .search-bar {
        flex-direction: column;
    }
    
    .search-bar .form-input {
        max-width: none;
    }
    
    .data-table {
        font-size: 14px;
    }
    
    .data-table th,
    .data-table td {
        padding: 10px 12px;
    }
    
    .action-cell {
        flex-direction: column;
        gap: 4px;
    }
    
    .action-cell .btn {
        width: 100%;
    }
    
    .modal-content {
        margin: 20px;
        max-height: calc(100vh - 40px);
    }
    
    .quick-buttons {
        gap: 6px;
    }
    
    .quick-btn {
        min-width: 36px;
        height: 36px;
        padding: 0 8px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .hero-icon {
        font-size: 48px;
    }
    
    .hero-title {
        font-size: 20px;
    }
    
    .plate-number {
        font-size: 22px;
    }
    
    .camera-controls {
        flex-direction: column;
    }
    
    .camera-controls .btn {
        width: 100%;
    }
}
