:root {
    --bg-main: #FFF0F5;
    --primary: #EC407A;
    --primary-light: #FCE4EC;
    --primary-dark: #C2185B;
    --accent: #BA68C8;
    --text-main: #4A148C;
    --text-soft: #880E4F;
    --white: #ffffff;
    --glass: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --shadow: 0 10px 30px rgba(236, 64, 122, 0.1);
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 8px;
    --sidebar-width: 300px;
}

* {
    box-sizing: border-box;
    transition: all 0.2s ease-out;
}

body {
    margin: 0;
    font-family: 'Noto Sans TC', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
}

/* Dashboard Layout */
.sidebar {
    width: var(--sidebar-width);
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    padding: 30px;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: fixed;
    z-index: 100;
}

.main-content {
    margin-left: var(--sidebar-width);
    flex-grow: 1;
    padding: 30px 40px;
}

.brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 40px;
}

.brand img {
    width: 100%;
    max-width: 260px;
    margin-bottom: 5px;
    filter: drop-shadow(0 5px 15px rgba(236, 64, 122, 0.1));
}

.brand h1 {
    font-size: 18px;
    margin: 0;
    color: var(--primary);
    font-weight: 800;
}

.stats-container {
    display: grid;
    gap: 15px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    padding: 18px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-info .label {
    font-size: 12px;
    color: var(--text-soft);
}

.stat-info .value {
    font-size: 24px;
    font-weight: 900;
    color: var(--primary);
}

/* Region Navigation */
.region-tabs {
    display: flex;
    gap: 10px;
    background: white;
    padding: 10px;
    border-radius: 50px;
    margin-bottom: 25px;
    overflow-x: auto;
    scrollbar-width: none;
    border: 1px solid var(--primary-light);
    box-shadow: var(--shadow);
}

.region-tabs::-webkit-scrollbar {
    display: none;
}

.tab {
    padding: 12px 28px;
    border-radius: 40px;
    border: none;
    background: transparent;
    color: var(--text-soft);
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    font-size: 16px;
}

.tab.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 8px 20px rgba(236, 64, 122, 0.3);
}

/* Sub-region Navigation */
.sub-region-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 30px;
    padding: 5px;
    overflow-x: auto;
    scrollbar-width: none;
}

.sub-tab {
    padding: 8px 20px;
    border-radius: 20px;
    border: 2px solid var(--primary-light);
    background: white;
    font-size: 14px;
    color: var(--text-soft);
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.sub-tab.active {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

/* Controls */
.controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 35px;
}

.search-wrap {
    position: relative;
    width: 450px;
}

.search-wrap i {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
}

.search-wrap input {
    width: 100%;
    padding: 14px 20px 14px 50px;
    border-radius: 50px;
    border: 2px solid var(--primary-light);
    outline: none;
    font-size: 16px;
}

.search-wrap input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

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

.btn-action {
    padding: 12px 24px;
    border-radius: 50px;
    border: none;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-outline {
    background: white;
    border: 2px solid var(--primary-light);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
}

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

.btn-accent:hover {
    background: #9C27B0;
    transform: translateY(-2px);
}

/* Grid & Cards */
.person-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

.person-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    position: relative;
}

.person-card.selected {
    border-color: var(--primary);
    background: var(--primary-light);
}

.card-media {
    height: 400px;
    position: relative;
    background: #eee;
}

.card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-checkbox {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: white;
    border: 2px solid var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.card-checkbox.checked {
    background: var(--primary);
}

.card-checkbox.checked::after {
    content: '✓';
    color: white;
    font-weight: 900;
}

.status-label {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 800;
    color: white;
    z-index: 10;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.status-label.online {
    background: #4CAF50;
}

.status-label.offline {
    background: #FF9800;
}

.card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
}

.person-card:hover .card-overlay {
    opacity: 1;
}

.view-btn {
    background: white;
    color: var(--primary);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 24px;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.card-info {
    padding: 25px;
}

.card-info h3 {
    margin: 0 0 12px 0;
    font-size: 21px;
    color: var(--text-main);
    font-weight: 800;
}

.card-meta {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.badge {
    padding: 5px 12px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
}

.badge-region {
    background: #E3F2FD;
    color: #1976D2;
}

.badge-nat {
    background: #F3E5F5;
    color: #7B1FA2;
}

.card-intro {
    font-size: 14px;
    line-height: 1.6;
    color: #555;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Floating Batch Bar */
.batch-send-bar {
    position: fixed;
    bottom: 35px;
    left: calc(var(--sidebar-width) + 40px);
    right: 40px;
    background: var(--primary);
    color: white;
    padding: 20px 40px;
    border-radius: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 15px 40px rgba(236, 64, 122, 0.4);
    transform: translateY(150px);
    z-index: 1000;
    visibility: hidden;
    opacity: 0;
}

.batch-send-bar.visible {
    transform: translateY(0);
    visibility: visible;
    opacity: 1;
}

.send-info {
    font-size: 18px;
    font-weight: 700;
}

.btn-send-now {
    background: white;
    color: var(--primary);
    padding: 14px 40px;
    border-radius: 40px;
    border: none;
    font-weight: 900;
    cursor: pointer;
    font-size: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-send-now:hover {
    transform: scale(1.05);
    background: var(--bg-main);
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        display: none;
    }

    .main-content {
        margin-left: 0;
    }

    .batch-send-bar {
        left: 40px;
    }
}