:root {
    --sidebar-width: 240px;
    --sidebar-bg: #1e293b;
    --sidebar-active: #3b82f6;
    --topbar-height: 56px;
}

* { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f1f5f9;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--sidebar-bg);
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-nav {
    padding: 12px 0;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-nav .nav-link:hover {
    color: #e2e8f0;
    background: rgba(255,255,255,0.05);
}

.sidebar-nav .nav-link.active {
    color: #fff;
    background: rgba(59,130,246,0.15);
    border-left-color: var(--sidebar-active);
}

.sidebar-nav .nav-section-title {
    padding: 16px 20px 6px;
    font-size: 11px;
    text-transform: uppercase;
    color: #64748b;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* Page Content */
.page-content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
}

.topbar {
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.main-content {
    padding: 24px;
}

/* Cards */
.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    transition: box-shadow 0.2s;
}

.stat-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
}

.stat-card .stat-label {
    font-size: 13px;
    color: #64748b;
}

/* Content Cards */
.content-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.content-card .card-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    background: #fff;
    font-weight: 600;
}

.content-card .card-body {
    padding: 20px;
}

/* Status badges */
.badge-bound { background: #10b981; }
.badge-unbound { background: #94a3b8; }
.badge-done { background: #3b82f6; }
.badge-draft { background: #f59e0b; }
.badge-published { background: #10b981; }
.badge-scheduled { background: #8b5cf6; }
.badge-scraped { background: #6366f1; }
.badge-remaking { background: #f59e0b; }
.badge-pending { background: #94a3b8; }
.badge-sent { background: #3b82f6; }
.badge-replied { background: #10b981; }
.badge-generating { background: #f59e0b; }
.badge-created { background: #6366f1; }
.badge-ready { background: #10b981; }
.badge-processing { background: #f59e0b; }

/* Material grid */
.material-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.material-item {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow 0.2s;
    background: #fff;
}

.material-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.material-item .material-thumb {
    width: 100%;
    height: 140px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: #94a3b8;
}

.material-item .material-info {
    padding: 10px 12px;
}

.material-item .material-info h6 {
    font-size: 13px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.material-item .material-info small {
    color: #94a3b8;
    font-size: 11px;
}

/* Platform icon colors */
.platform-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

.platform-douyin { background: #111; }
.platform-kuaishou { background: #ff5000; }
.platform-xiaohongshu { background: #fe2c55; }
.platform-weixin { background: #07c160; }
.platform-bilibili { background: #00a1d6; }

/* Table improvements */
.table th {
    font-weight: 600;
    font-size: 13px;
    color: #64748b;
    border-bottom-width: 1px;
}

.table td {
    vertical-align: middle;
    font-size: 14px;
}

/* QR Code modal */
.qrcode-placeholder {
    width: 200px;
    height: 200px;
    background: #f1f5f9;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    flex-direction: column;
    color: #94a3b8;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .page-content {
        margin-left: 0;
        width: 100%;
    }
}
