:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --success: #10b981;
    --success-dark: #059669;
    --danger: #ef4444;
    --danger-dark: #dc2626;
    --warning: #f59e0b;
    --warning-dark: #d97706;
    --dark: #1e293b;
    --gray: #64748b;
    --light: #f1f5f9;
    --white: #ffffff;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 12px;
    --radius-sm: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 30px;
    color: var(--dark);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
    color: var(--white);
    padding: 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.header h1 {
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    position: relative;
}

.header .subtitle {
    font-size: 0.875rem;
    opacity: 0.9;
    margin-top: 8px;
    font-weight: 400;
}

.controls {
    padding: 20px 24px;
    background: linear-gradient(to bottom, #fafbfc, #f1f5f9);
    border-bottom: 1px solid #e2e8f0;
}

.file-controls, .search-box {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.file-controls {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px dashed #e2e8f0;
}

.file-name {
    color: var(--gray);
    font-size: 0.9rem;
    flex: 1;
    min-width: 150px;
}

input[type="text"], input[type="date"] {
    padding: 10px 14px;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    transition: all 0.2s ease;
    outline: none;
    background: var(--white);
}

input[type="text"]:focus, input[type="date"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.search-box input {
    flex: 1;
    min-width: 180px;
}

.btn {
    padding: 10px 18px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-success:hover {
    background: var(--success-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background: var(--danger-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}

.btn-warning {
    background: var(--warning);
    color: var(--white);
}

.btn-warning:hover {
    background: var(--warning-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.file-input-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.stats {
    padding: 16px 24px;
    background: var(--dark);
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.stats span {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
}

.stats strong {
    color: var(--white);
    font-weight: 600;
    margin-left: 6px;
}

.stats .status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    animation: pulse 2s infinite;
}

.stats .status-dot.active {
    background: var(--success);
}

.stats .status-dot.inactive {
    background: var(--warning);
    animation: none;
}

.stats .status-dot.error {
    background: var(--danger);
    animation: none;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.table-container {
    overflow-x: auto;
    padding: 0;
    max-height: 500px;
    overflow-y: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

th {
    background: linear-gradient(to right, #f8fafc, #f1f5f9);
    color: var(--dark);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 16px;
    text-align: left;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 2px solid #e2e8f0;
}

td {
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.9rem;
    color: #475569;
}

tr {
    transition: background 0.15s ease;
}

tbody tr:hover {
    background: linear-gradient(to right, rgba(99, 102, 241, 0.04), rgba(139, 92, 246, 0.04));
}

tbody tr:nth-child(even) {
    background: #fafbfc;
}

tbody tr:nth-child(even):hover {
    background: linear-gradient(to right, rgba(99, 102, 241, 0.06), rgba(139, 92, 246, 0.06));
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.action-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.action-btn.btn-primary {
    background: var(--primary);
    color: white;
}

.action-btn.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.action-btn.btn-danger {
    background: #fee2e2;
    color: var(--danger);
}

.action-btn.btn-danger:hover {
    background: #fecaca;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
}

.form-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--white);
    padding: 28px;
    border-radius: var(--radius);
    width: 90%;
    max-width: 420px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content h3 {
    color: var(--dark);
    font-size: 1.25rem;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f1f5f9;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #475569;
    font-size: 0.875rem;
}

.form-group input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
    outline: none;
}

.modal-buttons {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.modal-buttons .btn {
    flex: 1;
    justify-content: center;
    padding: 12px;
}

/* ========== 店铺选择遮罩层 ========== */
.shop-overlay {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.97) 0%, rgba(118, 75, 162, 0.97) 100%);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    animation: overlayFadeIn 0.4s ease;
}

@keyframes overlayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.shop-selector {
    text-align: center;
    padding: 40px;
    max-width: 640px;
    width: 90%;
}

.shop-selector h2 {
    color: #fff;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 8px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.shop-selector-subtitle {
    color: rgba(255,255,255,0.8);
    font-size: 1rem;
    margin-bottom: 40px;
}

.shop-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.shop-card {
    background: hsla(var(--card-hue, 240), 60%, 90%, 0.15);
    backdrop-filter: blur(8px);
    border: 1px solid hsla(var(--card-hue, 240), 60%, 85%, 0.25);
    border-radius: 16px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.shop-card:hover {
    background: hsla(var(--card-hue, 240), 60%, 70%, 0.25);
    transform: translateY(-6px);
    box-shadow: 0 16px 40px hsla(var(--card-hue, 240), 60%, 40%, 0.25);
    border-color: hsla(var(--card-hue, 240), 60%, 80%, 0.4);
}

.shop-card:active {
    transform: translateY(-2px);
}

.shop-card .shop-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    display: block;
    color: hsl(var(--card-hue, 240), 70%, 60%);
}

.shop-card .shop-icon svg {
    display: block;
    margin: 0 auto;
}

.brand-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.shop-card .shop-name {
    color: #fff;
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* ========== 顶部店铺信息 ========== */
.header-shop-info {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.current-shop {
    color: rgba(255,255,255,0.95);
    font-size: 0.95rem;
    font-weight: 500;
    padding: 4px 14px;
    background: rgba(255,255,255,0.15);
    border-radius: 20px;
}

.btn-light {
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 6px 16px;
    font-size: 0.8rem;
}

.btn-light:hover {
    background: rgba(255,255,255,0.35);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
    border-radius: 6px;
}

@media (max-width: 768px) {
    .shop-selector {
        padding: 24px 16px;
    }

    .shop-selector h2 {
        font-size: 1.5rem;
    }

    .shop-grid {
        gap: 14px;
    }

    .shop-card {
        padding: 24px 16px;
    }

    .shop-card .shop-icon {
        font-size: 2.2rem;
    }

    .shop-card .shop-name {
        font-size: 1rem;
    }

    .header-shop-info {
        gap: 10px;
    }
}

.notification {
    position: fixed;
    top: 24px;
    right: 24px;
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    background: var(--success);
    color: var(--white);
    font-weight: 500;
    font-size: 0.875rem;
    z-index: 1001;
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
}

.notification.show {
    transform: translateX(0);
}

.notification.error {
    background: var(--danger);
}

.notification::before {
    content: '✓';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    font-size: 12px;
}

.notification.error::before {
    content: '✕';
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray);
    display: none;
}

.empty-state .icon {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.1rem;
    color: #64748b;
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 0.875rem;
    color: #94a3b8;
}

.search-hint {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray);
    font-size: 0.9rem;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23f1f5f9' fill-opacity='0.4'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

@media (max-width: 768px) {
    body {
        padding: 12px;
    }

    .header {
        padding: 24px 16px;
    }

    .header h1 {
        font-size: 1.4rem;
    }

    .controls {
        padding: 16px;
    }

    .file-controls, .search-box {
        flex-direction: column;
        align-items: stretch;
    }

    .file-controls {
        gap: 12px;
    }

    .file-name {
        text-align: center;
        padding: 8px;
        background: #f1f5f9;
        border-radius: var(--radius-sm);
    }

    .search-box input {
        min-width: 100%;
    }

    .btn {
        justify-content: center;
    }

    .stats {
        gap: 20px;
    }

    .stats span {
        font-size: 0.8rem;
    }

    th, td {
        padding: 12px;
        font-size: 0.85rem;
    }

    .modal-content {
        margin: 16px;
        padding: 20px;
    }
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* 备案号 */
.icp-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    text-align: center;
    padding: 8px 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 999;
}
.icp-footer a {
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-size: 12px;
}
.icp-footer a:hover {
    color: rgba(255,255,255,0.9);
}
