* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

svg {
    display: block;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
}

:root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: rgba(255, 255, 255, 0.05);
    --bg-card-hover: rgba(255, 255, 255, 0.09);
    --bg-hover: rgba(255, 255, 255, 0.08);
    --bg-input: rgba(255, 255, 255, 0.06);
    --bg-input-focus: rgba(255, 255, 255, 0.1);
    --border-color: rgba(255, 255, 255, 0.12);
    --border-hover: rgba(255, 255, 255, 0.2);
    --border-active: rgba(99, 102, 241, 0.4);
    --text-primary: #f1f5f9;
    --text-secondary: rgba(241, 245, 249, 0.7);
    --text-tertiary: rgba(241, 245, 249, 0.45);
    --accent-primary: #6366f1;
    --accent-primary-hover: #4f46e5;
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --accent-pink: #ec4899;
    --accent-orange: #f97316;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    --gradient-card: linear-gradient(145deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.03) 100%);
    --gradient-header: linear-gradient(180deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.6) 100%);
    --shadow-glow: 0 0 60px rgba(99, 102, 241, 0.25);
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-card-hover: 0 8px 40px rgba(99, 102, 241, 0.15);
    --shadow-modal: 0 25px 80px rgba(0, 0, 0, 0.5);
    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 12px;
    --radius-sm: 8px;
}

html, body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    line-height: 1.6;
}

body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 15% 10%, rgba(99, 102, 241, 0.15) 0%, transparent 45%),
        radial-gradient(circle at 85% 20%, rgba(139, 92, 246, 0.12) 0%, transparent 45%),
        radial-gradient(circle at 50% 95%, rgba(59, 130, 246, 0.08) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 32px;
    position: relative;
    z-index: 1;
}

/* Header */
.header {
    padding: 28px 0 20px;
    position: relative;
    z-index: 10;
}

.header-inner {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.logo-section {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-glow);
    position: relative;
    overflow: hidden;
}

.logo-icon::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: logoShine 3s ease-in-out infinite;
}

@keyframes logoShine {
    0%, 100% { left: -100%; }
    50% { left: 100%; }
}

.logo-icon svg {
    width: 26px;
    height: 26px;
    z-index: 1;
}

.logo-text h1 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-text p {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 2px;
    font-weight: 500;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-menu {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px 8px 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.user-menu:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    line-height: 1;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.user-role {
    font-size: 11px;
    color: var(--text-secondary);
    padding: 3px 8px;
    background: var(--bg-hover);
    border-radius: 100px;
    white-space: nowrap;
}

.user-dropdown-arrow {
    width: 14px;
    height: 14px;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
}

.user-menu:hover .user-dropdown-arrow {
    color: var(--accent-primary);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 160px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: var(--bg-hover);
    color: var(--accent-primary);
}

.dropdown-item svg {
    width: 16px;
    height: 16px;
}

.header-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 100px;
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.badge-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-green);
    box-shadow: 0 0 8px var(--accent-green);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.upload-btn {
    background: var(--gradient-primary);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.upload-btn svg {
    width: 16px;
    height: 16px;
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.4);
}

.upload-btn:active {
    transform: translateY(0);
}

/* Search Section */
.search-section {
    background: var(--gradient-card);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 28px;
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}

.search-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.4), transparent);
}

.search-main {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.search-input-wrap {
    flex: 1;
    min-width: 320px;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-tertiary);
    z-index: 1;
    flex-shrink: 0;
}

.search-input-wrap input {
    width: 100%;
    padding: 16px 20px 16px 52px;
    background: var(--bg-input);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 15px;
    color: var(--text-primary);
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    font-weight: 500;
}

.search-input-wrap input::placeholder {
    color: var(--text-tertiary);
    font-weight: 400;
}

.search-input-wrap input:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.12);
    background: rgba(139, 92, 246, 0.04);
}

.search-btn {
    padding: 16px 32px;
    background: var(--gradient-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.search-btn svg {
    width: 16px;
    height: 16px;
}

.search-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.search-btn:hover::before {
    left: 100%;
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 32px rgba(139, 92, 246, 0.45);
}

.search-btn:active {
    transform: translateY(0);
}

.search-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

/* Platform filters */
.platform-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.filter-label {
    font-size: 13px;
    color: var(--text-tertiary);
    font-weight: 500;
    margin-right: 4px;
}

.platform-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    background: var(--bg-input);
    border: 1.5px solid var(--border-color);
    border-radius: 100px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.25s ease;
    user-select: none;
    color: var(--text-secondary);
}

.platform-filter:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.platform-filter input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    background: transparent;
}

.checkbox-custom svg {
    width: 12px;
    height: 12px;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s ease;
}

.platform-filter input:checked + .checkbox-custom {
    background: var(--gradient-primary);
    border-color: transparent;
}

.platform-filter input:checked + .checkbox-custom svg {
    opacity: 1;
    transform: scale(1);
}

.platform-filter.jd-filter {
    border-left: 3px solid #e1251b;
}

.platform-filter.taobao-filter {
    border-left: 3px solid #ff5000;
}

.platform-filter.pdd-filter {
    border-left: 3px solid #e02e24;
}

/* Demo keywords */
.demo-keywords {
    margin-top: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.demo-keywords span.label {
    font-size: 12px;
    color: var(--text-tertiary);
    font-weight: 500;
}

.demo-tag {
    font-size: 12px;
    padding: 6px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.25s ease;
    color: var(--text-secondary);
    font-weight: 500;
}

.demo-tag:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: var(--accent-purple);
    color: var(--text-primary);
    transform: translateY(-1px);
}

/* Quick Entry Section */
.quick-entry-section {
    padding: 8px 0 16px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.entry-card {
    background: var(--gradient-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    display: flex;
    align-items: center;
    gap: 18px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.entry-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.entry-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent-primary);
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.2);
}

.entry-card:hover::before {
    opacity: 0.08;
}

.entry-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.entry-icon svg {
    width: 28px;
    height: 28px;
}

.entry-icon.goods {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
}

.entry-icon.service {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-purple);
}

.entry-content {
    flex: 1;
    position: relative;
    z-index: 1;
}

.entry-content h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.entry-content p {
    font-size: 13px;
    color: var(--text-secondary);
}

.entry-arrow {
    width: 20px;
    height: 20px;
    color: var(--text-tertiary);
    flex-shrink: 0;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.entry-card:hover .entry-arrow {
    color: var(--accent-primary);
    transform: translateX(4px);
}

/* Stats Section */
.stats-section {
    padding: 24px 0 8px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.stat-card {
    background: var(--gradient-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: rgba(139, 92, 246, 0.25);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}

.stat-icon-wrap {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon-wrap svg {
    width: 24px;
    height: 24px;
}

.stat-icon-wrap.blue { 
    background: rgba(59, 130, 246, 0.12); 
    color: #60a5fa;
}
.stat-icon-wrap.green { 
    background: rgba(16, 185, 129, 0.12); 
    color: #34d399;
}
.stat-icon-wrap.orange { 
    background: rgba(249, 115, 22, 0.12); 
    color: #fb923c;
}
.stat-icon-wrap.purple { 
    background: rgba(139, 92, 246, 0.12); 
    color: #a78bfa;
}

.stat-content {
    flex: 1;
    min-width: 0;
}

.stat-label {
    font-size: 13px;
    color: var(--text-tertiary);
    font-weight: 500;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.stat-value.blue { color: #60a5fa; }
.stat-value.green { color: #34d399; }
.stat-value.orange { color: #fb923c; }
.stat-value.purple { color: #a78bfa; }

.stat-sub {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 4px;
    font-weight: 500;
}

/* Main content */
.main-content {
    padding-bottom: 56px;
}

.content-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 20px;
    align-items: start;
}

/* Panel */
.panel {
    background: var(--gradient-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

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

.panel-title {
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel-icon {
    width: 18px;
    height: 18px;
    color: var(--accent-purple);
}

.panel-count {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
    background: var(--bg-input);
    padding: 2px 10px;
    border-radius: 100px;
    border: 1px solid var(--border-color);
}

.panel-actions {
    display: flex;
    gap: 8px;
}

.sort-select {
    padding: 8px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    outline: none;
    font-family: inherit;
    transition: all 0.2s ease;
    font-weight: 500;
}

.sort-select:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.sort-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Product list */
.product-list {
    max-height: 680px;
    overflow-y: auto;
    padding: 12px;
}

.product-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 1px solid transparent;
    background: transparent;
    position: relative;
}

.product-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-color);
    transform: translateX(4px);
}

.product-item.recommended {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, transparent 50%);
    border-color: rgba(16, 185, 129, 0.25);
}

.product-item.recommended::before {
    content: '性价比之选';
    position: absolute;
    top: -10px;
    right: 14px;
    padding: 4px 12px;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 100px;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    letter-spacing: 0.5px;
}

.product-image {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-md);
    background: var(--bg-input);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    border: 1px solid var(--border-color);
}

.product-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-tags {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.tag {
    font-size: 10px;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.tag.jd { background: rgba(225, 37, 27, 0.15); color: #ff6b6b; }
.tag.taobao { background: rgba(255, 80, 0, 0.15); color: #ff8c42; }
.tag.pinduoduo { background: rgba(224, 46, 36, 0.15); color: #ff6b6b; }
.tag.custom { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.tag.supplier { background: rgba(139, 92, 246, 0.15); color: #a78bfa; }
.tag.recommend { background: rgba(16, 185, 129, 0.15); color: #34d399; }

.product-title {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text-primary);
}

.product-bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.product-price {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, #fb923c, #f97316);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.product-price .unit {
    font-size: 14px;
    font-weight: 600;
    margin-right: 1px;
    -webkit-text-fill-color: #fb923c;
}

.product-stats {
    font-size: 11px;
    color: var(--text-tertiary);
    display: flex;
    gap: 14px;
    align-items: center;
    font-weight: 500;
}

.product-stats .stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Right column */
.right-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Chart containers */
.chart-box {
    padding: 16px;
    height: 260px;
}

.chart-container {
    width: 100%;
    height: 100%;
}

/* Loading */
.loading {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-secondary);
}

.loading-spinner {
    display: inline-block;
    width: 44px;
    height: 44px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-purple);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 20px;
}

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

.loading p {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-tertiary);
}

.empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    color: var(--text-tertiary);
    opacity: 0.6;
}

.empty-icon svg {
    width: 100%;
    height: 100%;
}

.empty-state p {
    font-size: 14px;
    margin-bottom: 6px;
    font-weight: 500;
}

.empty-state p.small {
    font-size: 12px;
    opacity: 0.8;
    font-weight: 400;
}

/* Scrollbar */
.product-list::-webkit-scrollbar {
    width: 6px;
}

.product-list::-webkit-scrollbar-track {
    background: transparent;
}

.product-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.product-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.18);
}

/* Fade in animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-item {
    animation: fadeInUp 0.4s ease forwards;
    opacity: 0;
}

.product-item:nth-child(1) { animation-delay: 0.02s; }
.product-item:nth-child(2) { animation-delay: 0.04s; }
.product-item:nth-child(3) { animation-delay: 0.06s; }
.product-item:nth-child(4) { animation-delay: 0.08s; }
.product-item:nth-child(5) { animation-delay: 0.10s; }
.product-item:nth-child(6) { animation-delay: 0.12s; }
.product-item:nth-child(7) { animation-delay: 0.14s; }
.product-item:nth-child(8) { animation-delay: 0.16s; }
.product-item:nth-child(n+9) { animation-delay: 0.18s; }

/* ========== Modal ========== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 640px;
    max-height: 88vh;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-modal);
    display: flex;
    flex-direction: column;
    animation: modalIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

.modal-title-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
}

.modal-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
}

.modal-icon svg {
    width: 22px;
    height: 22px;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.modal-header p {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 2px;
    font-weight: 500;
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--accent-red);
}

.modal-close svg {
    width: 16px;
    height: 16px;
}

.modal-body {
    padding: 24px 28px;
    overflow-y: auto;
    flex: 1;
}

/* Upload tabs */
.upload-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: var(--bg-input);
    padding: 4px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.upload-tab {
    flex: 1;
    padding: 10px 16px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: inherit;
}

.upload-tab svg {
    width: 15px;
    height: 15px;
}

.upload-tab:hover {
    color: var(--text-primary);
}

.upload-tab.active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 2px 12px rgba(139, 92, 246, 0.3);
}

.upload-panel {
    display: none;
}

.upload-panel.active {
    display: block;
    animation: fadeInUp 0.3s ease;
}

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

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
}

.form-required {
    color: var(--accent-red);
    margin-left: 2px;
}

.form-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.form-label-row .form-label {
    margin-bottom: 0;
}

.link-btn {
    background: none;
    border: none;
    color: var(--accent-purple);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.link-btn:hover {
    background: rgba(139, 92, 246, 0.1);
}

.link-btn svg {
    width: 14px;
    height: 14px;
}

.input-icon-wrap {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-tertiary);
    z-index: 1;
}

input[type="text"],
input[type="number"] {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
    transition: all 0.25s ease;
    font-family: inherit;
    font-weight: 500;
}

input[type="text"]::placeholder,
input[type="number"]::placeholder {
    color: var(--text-tertiary);
    font-weight: 400;
}

input[type="text"]:focus,
input[type="number"]:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}

.input-icon-wrap input {
    padding-left: 42px;
}

.textarea-wrap {
    position: relative;
}

textarea {
    width: 100%;
    min-height: 180px;
    padding: 14px 16px;
    background: var(--bg-input);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    resize: vertical;
    outline: none;
    transition: all 0.25s ease;
    line-height: 1.6;
}

textarea::placeholder {
    color: var(--text-tertiary);
}

textarea:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}

.form-hint {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 8px;
    line-height: 1.6;
}

/* Manual add */
.manual-form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.flex-1 {
    flex: 1;
}

.add-item-btn {
    width: 100%;
    padding: 12px;
    background: var(--bg-input);
    border: 1.5px dashed var(--border-color);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: inherit;
    margin-bottom: 16px;
}

.add-item-btn:hover {
    border-color: var(--accent-purple);
    background: rgba(139, 92, 246, 0.06);
    color: var(--accent-purple);
}

.add-item-btn svg {
    width: 16px;
    height: 16px;
}

.manual-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
}

.manual-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-tertiary);
}

.manual-empty svg {
    width: 32px;
    height: 32px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.manual-empty p {
    font-size: 12px;
    font-weight: 500;
}

.manual-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s ease;
}

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

.manual-item:hover {
    background: var(--bg-card-hover);
}

.manual-item-info {
    flex: 1;
    min-width: 0;
}

.manual-item-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.manual-item-meta {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.manual-item-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent-green);
    margin: 0 12px;
}

.manual-item-remove {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-tertiary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.manual-item-remove:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--accent-red);
}

.manual-item-remove svg {
    width: 12px;
    height: 12px;
}

/* Modal footer */
.modal-footer {
    padding: 20px 28px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-shrink: 0;
}

.btn {
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1.5px solid transparent;
}

.btn svg {
    width: 15px;
    height: 15px;
}

.btn-secondary {
    background: var(--bg-input);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.btn-ghost {
    background: transparent;
    border-color: var(--border-color);
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(139, 92, 246, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Upload result */
.upload-result {
    padding: 0 28px 24px;
}

.upload-result .success,
.upload-result .error,
.upload-result .loading {
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    text-align: center;
}

.upload-result .success {
    color: #34d399;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.upload-result .error {
    color: #f87171;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.upload-result .loading {
    color: #60a5fa;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.25);
}

/* Import Modal Styles */
.import-tips {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    font-size: 13px;
    color: var(--text-secondary);
}

.import-tips ul {
    margin: 8px 0 0 20px;
    line-height: 1.8;
}

.import-tips .required {
    color: var(--accent-red);
    font-weight: 600;
}

.file-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    background: var(--bg-input);
}

.file-upload-area:hover {
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.05);
}

.file-upload-area svg {
    margin: 0 auto 12px;
    color: var(--text-tertiary);
}

.file-upload-area p {
    color: var(--text-secondary);
    margin-bottom: 4px;
}

#importResult {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
}

.import-stats {
    display: flex;
    gap: 32px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

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

.stat-value {
    font-size: 24px;
    font-weight: 700;
}

.stat-value.success {
    color: var(--accent-green);
}

.stat-value.error {
    color: var(--accent-red);
}

.import-errors {
    max-height: 200px;
    overflow-y: auto;
    font-size: 13px;
    color: var(--text-secondary);
}

.import-errors ul {
    margin-left: 20px;
    line-height: 1.6;
}

.import-errors li {
    color: var(--accent-red);
}

/* Responsive */
@media (max-width: 1024px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .container {
        padding: 0 16px;
    }
    
    .header {
        padding: 20px 0 12px;
    }
    
    .logo-text h1 {
        font-size: 18px;
    }
    
    .search-section {
        padding: 20px;
    }
    
    .search-input-wrap {
        min-width: auto;
    }
    
    .search-btn {
        padding: 14px 24px;
        font-size: 14px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-value {
        font-size: 22px;
    }
    
    .stats-grid {
        gap: 12px;
    }
    
    .modal-content {
        width: 95%;
        max-height: 92vh;
    }
    
    .modal-header {
        padding: 20px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .modal-footer {
        padding: 16px 20px;
    }
    
    .manual-form-row {
        flex-direction: column;
        gap: 12px;
    }
    
    .manual-form-row .form-group {
        width: 100% !important;
    }
}

/* Login Page */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
}

.login-card {
    background: var(--gradient-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: var(--shadow-modal);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    background: var(--gradient-primary);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.3);
}

.login-logo svg {
    width: 28px;
    height: 28px;
}

.login-title h1 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.login-title p {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-top: 6px;
}

/* Role Selector */
.role-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 28px;
}

.role-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 28px 12px;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
    border: 2px solid transparent;
}

.role-card.buyer-card {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.25) 0%, rgba(37, 99, 235, 0.12) 100%);
    border-color: rgba(59, 130, 246, 0.4);
}

.role-card.supplier-card {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.25) 0%, rgba(5, 150, 105, 0.12) 100%);
    border-color: rgba(16, 185, 129, 0.4);
}

.role-card.admin-card {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.25) 0%, rgba(217, 119, 6, 0.12) 100%);
    border-color: rgba(245, 158, 11, 0.4);
}

.role-card:hover {
    transform: translateY(-3px);
}

.role-card.buyer-card:hover {
    border-color: rgba(59, 130, 246, 0.7);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.35);
}

.role-card.supplier-card:hover {
    border-color: rgba(16, 185, 129, 0.7);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
}

.role-card.admin-card:hover {
    border-color: rgba(245, 158, 11, 0.7);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.35);
}

.role-card.active {
    transform: translateY(-3px);
}

.role-card.buyer-card.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.45) 0%, rgba(37, 99, 235, 0.2) 100%);
    border-color: #3b82f6;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.5);
}

.role-card.supplier-card.active {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.45) 0%, rgba(5, 150, 105, 0.2) 100%);
    border-color: #10b981;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.5);
}

.role-card.admin-card.active {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.45) 0%, rgba(217, 119, 6, 0.2) 100%);
    border-color: #f59e0b;
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.5);
}

.role-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.role-icon svg {
    width: 28px;
    height: 28px;
}

.role-icon.buyer-icon {
    background: rgba(59, 130, 246, 0.3);
    color: #60a5fa;
}

.role-icon.supplier-icon {
    background: rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.role-icon.admin-icon {
    background: rgba(245, 158, 11, 0.3);
    color: #fbbf24;
}

.role-card.active .role-icon.buyer-icon {
    background: #3b82f6;
    color: white;
}

.role-card.active .role-icon.supplier-icon {
    background: #10b981;
    color: white;
}

.role-card.active .role-icon.admin-icon {
    background: #f59e0b;
    color: white;
}

.role-name {
    font-size: 20px;
    font-weight: 800;
    font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Hiragino Sans GB", sans-serif;
    letter-spacing: 2px;
}

.role-card.buyer-card .role-name {
    color: #93c5fd;
}

.role-card.supplier-card .role-name {
    color: #6ee7b7;
}

.role-card.admin-card .role-name {
    color: #fcd34d;
}

.role-card.active .role-name {
    color: white;
}

/* Role Buttons */
.btn-buyer {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
}

.btn-buyer:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
}

.btn-supplier {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
}

.btn-supplier:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
}

.btn-admin {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border: none;
}

.btn-admin:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.4);
}

/* Form Switch Link */
.form-switch {
    text-align: center;
    margin-top: 16px;
    font-size: 13px;
    color: var(--text-tertiary);
}

.form-switch a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 600;
}

.form-switch a:hover {
    text-decoration: underline;
}

/* Register Banner */
.register-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
}

.register-banner svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.register-banner.buyer-banner {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--accent-blue);
}

.register-banner.supplier-banner {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--accent-green);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-form .form-group {
    margin-bottom: 0;
}

.login-form .form-row {
    display: flex;
    gap: 12px;
}

.login-form .form-row .form-group {
    flex: 1;
}

.supplier-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.supplier-hint svg {
    width: 16px;
    height: 16px;
    color: var(--accent-primary);
    flex-shrink: 0;
}

.btn-full {
    width: 100%;
    justify-content: center;
}

.form-error {
    color: var(--accent-red);
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    min-height: 18px;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.login-footer p {
    font-size: 12px;
    color: var(--text-tertiary);
}

input[type="password"],
input[type="tel"],
input[type="email"] {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
    transition: all 0.25s ease;
    font-family: inherit;
    font-weight: 500;
}

input[type="password"]::placeholder,
input[type="tel"]::placeholder,
input[type="email"]::placeholder {
    color: var(--text-tertiary);
}

input[type="password"]:focus,
input[type="tel"]:focus,
input[type="email"]:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}

/* Admin Page */
.admin-body {
    display: flex;
    min-height: 100vh;
    background: var(--bg-secondary);
}

.admin-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

.admin-sidebar {
    width: 240px;
    background: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo {
    width: 36px;
    height: 36px;
    background: var(--gradient-primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-logo svg {
    width: 18px;
    height: 18px;
}

.sidebar-header span {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
}

.nav-item {
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: rgba(241, 245, 249, 0.75);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: inherit;
    margin-bottom: 4px;
}

.nav-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.nav-item:hover {
    background: rgba(99, 102, 241, 0.12);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(99, 102, 241, 0.2);
    color: #fff;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-red);
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid var(--border-color);
}

.admin-content {
    flex: 1;
    margin-left: 240px;
    display: flex;
    flex-direction: column;
}

.admin-header {
    padding: 20px 32px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-header h2 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.header-user {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
}

.page-content {
    padding: 24px 32px;
    flex: 1;
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-box input {
    padding: 10px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    width: 200px;
    transition: all 0.2s ease;
}

.search-box input:focus {
    border-color: var(--accent-purple);
}

.search-box input::placeholder {
    color: var(--text-tertiary);
}

.filter-group select {
    padding: 10px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
}

.filter-group select:focus {
    border-color: var(--accent-purple);
}

.data-table-wrap {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

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

.data-table thead {
    background: var(--bg-input);
}

.data-table th {
    padding: 14px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 14px 16px;
    font-size: 13px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

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

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.status-badge.active {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

.status-badge.disabled {
    background: rgba(156, 163, 175, 0.15);
    color: #9ca3af;
}

.status-badge.pending {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}

.status-badge.approved {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

.status-badge.rejected {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.status-badge.warning {
    background: rgba(249, 115, 22, 0.15);
    color: #fb923c;
}

.status-badge.success {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.action-btn {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    font-family: inherit;
    margin-right: 6px;
}

.action-btn.edit {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
}

.action-btn.edit:hover {
    background: rgba(59, 130, 246, 0.25);
}

.action-btn.approve {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.action-btn.approve:hover {
    background: rgba(16, 185, 129, 0.25);
}

.action-btn.delete {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

.action-btn.delete:hover {
    background: rgba(239, 68, 68, 0.25);
}

.action-btn.reject {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

.action-btn.reject:hover {
    background: rgba(239, 68, 68, 0.25);
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-row .form-group {
    flex: 1;
}

select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
    transition: all 0.25s ease;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
}

select:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}

/* Admin modal */
#userModal,
#supplierModal,
#productModal,
#quoteModal {
    display: none;
}

#userModal.active,
#supplierModal.active,
#productModal.active,
#quoteModal.active {
    display: flex;
}

@media (max-width: 768px) {
    .admin-sidebar {
        width: 60px;
    }
    
    .sidebar-header span {
        display: none;
    }
    
    .nav-item span {
        display: none;
    }
    
    .admin-content {
        margin-left: 60px;
    }
    
    .admin-header {
        padding: 16px;
    }
    
    .page-content {
        padding: 16px;
    }
    
    .page-actions {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .search-box input {
        width: 100%;
    }
    
    .data-table {
        font-size: 12px;
    }
    
    .data-table th,
    .data-table td {
        padding: 10px 8px;
    }
}

.category-filters {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-section {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 13px;
    min-width: 150px;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
}

.filter-select:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.filter-search {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 200px;
}

.filter-search input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    transition: all 0.2s ease;
}

.filter-search input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.search-btn-sm {
    padding: 8px 16px;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.search-btn-sm:hover {
    background: var(--accent-primary-hover);
    transform: translateY(-1px);
}

.filter-actions {
    margin-left: auto;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.product-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
}

.product-header {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.product-tag {
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 500;
}

.product-tag.goods {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.product-tag.services {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.product-tag.category {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

.product-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-spec {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.product-price {
    margin-bottom: 12px;
}

.price-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent-primary);
}

.price-unit {
    font-size: 13px;
    color: var(--text-secondary);
    margin-left: 4px;
}

.product-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.meta-item svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.product-actions {
    display: flex;
    gap: 10px;
}

.product-actions .btn {
    flex: 1;
    justify-content: center;
}

.empty-state {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 16px;
    margin-bottom: 8px;
}

.empty-hint {
    font-size: 13px !important;
    opacity: 0.7;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.detail-row.full {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.detail-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    min-width: 100px;
}

.detail-value {
    font-size: 13px;
    color: var(--text-primary);
    flex: 1;
    text-align: right;
}

.detail-value.price {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-primary);
}

.detail-text {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.6;
    width: 100%;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    grid-column: 1 / -1;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 12px;
}

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

.error-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: var(--accent-red);
}

/* 供应商管理后台样式 */
.product-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.product-card-info {
    flex: 1;
    min-width: 0;
}

.product-card-price {
    text-align: right;
    flex-shrink: 0;
}

.product-card-price .price {
    font-size: 22px;
    font-weight: 700;
    color: var(--accent-primary);
    display: block;
}

.product-card-price .unit {
    font-size: 12px;
    color: var(--text-secondary);
}

.product-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.tag {
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

.tag-goods {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.tag-service {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.tag-category {
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
}

.tag-sub-category {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

.tag-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

.tag-primary {
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
}

.tag-success {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.tag-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.status-active {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.status-inactive {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
}

.product-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: var(--text-secondary);
    padding: 10px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 12px;
}

.product-card-actions {
    display: flex;
    gap: 8px;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
    border-radius: var(--radius-md);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.5);
}

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

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

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

.detail-section {
    margin-bottom: 24px;
}

.detail-tags {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
}

.detail-section h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

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

.detail-price {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.detail-price .price {
    font-size: 28px;
    font-weight: 700;
    color: var(--accent-primary);
}

.detail-price .unit {
    font-size: 14px;
    color: var(--text-secondary);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-item label {
    font-size: 12px;
    color: var(--text-secondary);
}

.detail-item span {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

.detail-desc {
    margin-bottom: 24px;
}

.detail-desc h4 {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.detail-desc p {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.6;
}

.detail-time {
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.detail-time p {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.goods-icon {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.service-icon {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.price-icon {
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
}

.total-icon {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

.filter-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

