/* ==================== CSS Variables ==================== */
:root {
    --primary: #5D9C53;
    --primary-dark: #4a7d42;
    --primary-light: #6fb862;
    --accent: #85CA67;
    --accent-light: #9dd984;
    --cream: #FFF1DF;
    --yellow-green: #E7ECB7;
    --dark: #414143;
    --dark-light: #5a5a5c;
    --gold: #F0CD78;
    --white: #FFFFFF;
    --bg: #F5F7F4;
    --bg-light: #FAFBFA;
    --border: #E5E9E3;
    --border-light: #F0F2EE;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --sidebar-width: 240px;
    --header-height: 64px;
}

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

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--dark);
    background: var(--bg);
    font-size: 14px;
    line-height: 1.5;
    overflow: hidden;
}

/* ==================== Utilities ==================== */
.hidden { display: none !important; }
.btn-block { width: 100%; }
.text-danger { color: #e74c3c !important; }
.text-success { color: var(--primary) !important; }

/* ==================== Buttons ==================== */
.btn-primary {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow); }

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
    padding: 9px 19px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}
.btn-outline:hover { background: var(--primary); color: #fff; }

.btn-text {
    background: none;
    border: none;
    color: var(--dark-light);
    font-size: 14px;
    cursor: pointer;
    padding: 8px 12px;
    transition: var(--transition);
}
.btn-text:hover { color: var(--primary); }

.btn-text-sm {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-warning {
    background: #f59e0b;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-green {
    background: var(--accent);
    color: var(--dark);
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--dark-light);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}
.btn-close:hover { background: var(--bg); color: var(--dark); }

.btn-auth {
    width: 100%;
    justify-content: center;
    padding: 14px;
    font-size: 15px;
}

.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-xs { padding: 3px 8px; font-size: 11px; }

/* ==================== Auth View ==================== */
.auth-view {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 40px 20px;
}

.auth-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 960px;
    width: 100%;
    background: #fff;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.auth-brand {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    padding: 60px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #fff;
}

.logo-large {
    font-size: 36px;
    font-weight: 900;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.logo-large i { font-size: 42px; color: var(--gold); }

.auth-brand p { font-size: 15px; opacity: 0.9; margin-bottom: 40px; }

.auth-illustration { position: relative; width: 180px; height: 180px; }
.orbit {
    width: 100%;
    height: 100%;
    position: relative;
    animation: orbit-spin 20s linear infinite;
}
.orbit-pet {
    position: absolute;
    font-size: 32px;
}
.orbit-pet:nth-child(1) { top: 0; left: 50%; transform: translateX(-50%); }
.orbit-pet:nth-child(2) { bottom: 0; left: 50%; transform: translateX(-50%); }
.orbit-pet:nth-child(3) { left: 0; top: 50%; transform: translateY(-50%); }
.orbit-pet:nth-child(4) { right: 0; top: 50%; transform: translateY(-50%); }

@keyframes orbit-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.auth-form-panel { padding: 48px 40px; }

.auth-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 28px;
    border-bottom: 2px solid var(--border-light);
}

.auth-tab {
    background: none;
    border: none;
    padding: 10px 16px;
    font-size: 15px;
    font-weight: 600;
    color: var(--dark-light);
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}
.auth-tab.active { color: var(--primary); }
.auth-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
}

.auth-form { display: none; }
.auth-form.active { display: block; animation: fadeIn 0.3s ease; }

.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 6px;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
    background: #fff;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(93,156,83,0.1);
}

.input-with-icon {
    position: relative;
}
.input-with-icon i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 14px;
}
.input-with-icon input { padding-left: 40px; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 13px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--dark-light);
}
.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}
.forgot-link { color: var(--primary); text-decoration: none; font-size: 13px; }
.forgot-link:hover { text-decoration: underline; }

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: #999;
    font-size: 13px;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-light);
}

.social-login {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    color: var(--dark);
    cursor: pointer;
    transition: var(--transition);
}
.btn-social:hover { background: var(--border-light); }

.radio-group { display: flex; gap: 16px; }
.radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 14px;
}
.radio-label input { width: auto; accent-color: var(--primary); }

/* ==================== App Layout ==================== */
.app-view {
    display: grid;
    grid-template-areas:
        "sidebar header"
        "sidebar main";
    grid-template-columns: var(--sidebar-width) 1fr;
    grid-template-rows: var(--header-height) 1fr;
    height: 100vh;
    overflow: hidden;
}

/* ==================== Decorative Backgrounds ==================== */
/* Decorative backgrounds removed */

.app-main {
    position: relative;
}

.app-main::before {
    content: '';
    position: absolute;
    top: 30px;
    right: 30px;
    width: 300px;
    height: 300px;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 300 300' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M80 60 C78 48 86 38 96 38 C106 38 114 48 112 60' fill='none' stroke='%23333' stroke-width='3' stroke-linecap='round'/%3E%3Cpath d='M112 60 C110 48 118 38 128 38 C138 38 146 48 144 60' fill='none' stroke='%23333' stroke-width='3' stroke-linecap='round'/%3E%3Cpath d='M86 60 C84 72 86 84 92 88 L100 90 L108 88 C114 84 116 72 114 60' fill='none' stroke='%23333' stroke-width='2.5' stroke-linecap='round'/%3E%3Cpath d='M100 90 C102 98 108 108 116 112 C124 116 126 126 120 130' fill='none' stroke='%23333' stroke-width='2.5' stroke-linecap='round'/%3E%3Cpath d='M40 120 C50 110 60 118 55 130 C50 142 38 138 42 126' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round'/%3E%3Ccircle cx='200' cy='80' r='2.5' fill='%23333'/%3E%3Ccircle cx='220' cy='90' r='2' fill='%23333'/%3E%3Ccircle cx='210' cy='100' r='1.5' fill='%23333'/%3E%3Ccircle cx='230' cy='75' r='1.5' fill='%23333'/%3E%3Cpath d='M200 110 Q210 105 220 110' fill='none' stroke='%23333' stroke-width='1.5' stroke-linecap='round'/%3E%3Cpath d='M60 180 C70 170 80 178 75 190' fill='none' stroke='%23333' stroke-width='1.5' stroke-linecap='round'/%3E%3Cpath d='M180 150 C190 145 200 155 195 165' fill='none' stroke='%23333' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    pointer-events: none;
    z-index: 0;
}

.app-main::after {
    content: '';
    position: absolute;
    bottom: 20px;
    left: 20px;
    width: 200px;
    height: 200px;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M40 50 C38 38 48 28 58 28 C68 28 78 38 76 50' fill='none' stroke='%23333' stroke-width='2.5' stroke-linecap='round'/%3E%3Cpath d='M76 50 C74 38 84 28 94 28 C104 28 114 38 112 50' fill='none' stroke='%23333' stroke-width='2.5' stroke-linecap='round'/%3E%3Cpath d='M52 50 Q50 60 52 68 Q54 76 60 78 L66 78 L72 76 Q78 72 80 64 Q82 56 80 50' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M66 78 Q70 84 76 88 Q80 92 78 96' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M120 60 C130 55 140 65 130 70' fill='none' stroke='%23333' stroke-width='1.5' stroke-linecap='round'/%3E%3Ccircle cx='150' cy='50' r='2' fill='%23333'/%3E%3Ccircle cx='160' cy='60' r='1.5' fill='%23333'/%3E%3Cpath d='M30 120 Q40 115 50 120' fill='none' stroke='%23333' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    pointer-events: none;
    z-index: 0;
}

.view { position: relative; z-index: 1; }

.app-header {
    grid-area: header;
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 50;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.btn-toggle-sidebar {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--dark-light);
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.btn-toggle-sidebar:hover { background: var(--bg); }

.header-search {
    position: relative;
    max-width: 400px;
    width: 100%;
}
.header-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    font-size: 13px;
}
.header-search input {
    width: 100%;
    padding: 9px 12px 9px 36px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    font-family: inherit;
    background: var(--bg);
    transition: var(--transition);
}
.header-search input:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-btn {
    position: relative;
    background: none;
    border: none;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--dark-light);
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
}
.header-btn:hover { background: var(--bg); color: var(--dark); }

.header-btn .badge {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    background: #e74c3c;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    margin-left: 4px;
}
.header-user:hover { background: var(--bg); }

.user-avatar {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}
.user-name { font-size: 13px; font-weight: 600; }
.user-points { font-size: 11px; color: var(--primary); font-weight: 600; }
.user-points i { font-size: 10px; }

.user-chevron { font-size: 11px; color: #999; transition: var(--transition); }
.header-user.open .user-chevron { transform: rotate(180deg); }

/* User Dropdown */
.header-user { position: relative; }

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 240px;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
    border: 1px solid var(--border-light);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    z-index: 100;
    overflow: hidden;
}

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

.dropdown-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-light);
}

.dropdown-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
}

.dropdown-name {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--dark);
}

.dropdown-email {
    display: block;
    font-size: 12px;
    color: #888;
    margin-top: 1px;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-light);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--dark-light);
    text-decoration: none;
    font-size: 13px;
    transition: var(--transition);
}

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

.dropdown-item i {
    width: 18px;
    text-align: center;
    font-size: 14px;
}

.dropdown-item-danger {
    color: #e74c3c;
}
.dropdown-item-danger:hover {
    background: rgba(231,76,60,0.05);
    color: #c0392b;
}

.form-group textarea { resize: vertical; min-height: 60px; }

.form-hint {
    display: block;
    font-size: 11px;
    margin-top: 4px;
    min-height: 16px;
}
.form-hint.error { color: #e74c3c; }
.form-hint.success { color: var(--primary); }

/* ==================== Notification Panel ==================== */
.header-btn-wrap { position: relative; }
.notif-panel {
    position: absolute; top: calc(100% + 8px); right: 0;
    width: 360px; background: #fff; border-radius: var(--radius);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
    border: 1px solid var(--border-light);
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: all 0.2s ease; z-index: 100; overflow: hidden;
}
.notif-panel.open { opacity: 1; visibility: visible; transform: translateY(0); }
.notif-panel-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px; border-bottom: 1px solid var(--border-light);
}
.notif-panel-header h4 { font-size: 14px; font-weight: 700; }
.notif-panel-header button {
    background: none; border: none; font-size: 12px;
    color: var(--primary); cursor: pointer; font-weight: 600;
}
.notif-panel-header button:hover { text-decoration: underline; }
.notif-list { max-height: 360px; overflow-y: auto; }
.notif-item {
    display: flex; gap: 12px; padding: 14px 16px;
    cursor: pointer; transition: var(--transition);
    border-bottom: 1px solid var(--border-light);
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg); }
.notif-item.unread { background: rgba(93,156,83,0.04); }
.notif-item.unread:hover { background: rgba(93,156,83,0.08); }
.notif-icon {
    width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; flex-shrink: 0;
}
.notif-icon.green { background: rgba(93,156,83,0.12); color: var(--primary); }
.notif-icon.gold { background: rgba(240,205,120,0.2); color: #b8951a; }
.notif-icon.blue { background: rgba(52,152,219,0.12); color: #3498db; }
.notif-body { flex: 1; min-width: 0; }
.notif-body p { font-size: 13px; color: var(--dark); line-height: 1.5; margin-bottom: 2px; }
.notif-body small { font-size: 11px; color: #aaa; }
.notif-dot {
    width: 8px; height: 8px; background: var(--primary);
    border-radius: 50%; flex-shrink: 0; margin-top: 4px;
}
.notif-empty { padding: 40px 20px; text-align: center; color: #aaa; font-size: 13px; }

/* ==================== Sidebar ==================== */
.app-sidebar {
    grid-area: sidebar;
    background: #fff;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 60;
}

.sidebar-brand {
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 900;
    color: var(--primary);
    border-bottom: 1px solid var(--border-light);
}
.sidebar-brand i { font-size: 26px; color: var(--accent); }

.sidebar-nav { padding: 12px 0; }

.nav-section { margin-bottom: 8px; }
.nav-section-title {
    display: block;
    padding: 8px 20px;
    font-size: 11px;
    font-weight: 700;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    margin: 2px 12px;
    border-radius: var(--radius-sm);
    color: var(--dark-light);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}
.nav-item i { font-size: 18px; width: 22px; text-align: center; }
.nav-item:hover { background: var(--bg); color: var(--dark); }
.nav-item.active {
    background: rgba(93,156,83,0.1);
    color: var(--primary);
    font-weight: 600;
}
.nav-badge {
    margin-left: auto;
    padding: 2px 8px;
    background: var(--gold);
    color: var(--dark);
    font-size: 10px;
    font-weight: 700;
    border-radius: 50px;
}

/* ==================== Main Content ==================== */
.app-main {
    grid-area: main;
    overflow-y: auto;
    padding: 24px;
    background: var(--bg);
}

.view { display: none; animation: fadeIn 0.25s ease; }
.view.active { display: block; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.view-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}
.view-header h1 { font-size: 24px; font-weight: 900; color: var(--dark); }
.view-header p { font-size: 14px; color: #888; margin-top: 2px; }

/* ==================== Dashboard ==================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto;
    gap: 20px;
}

.dashboard-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.dashboard-card h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 16px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.card-header h3 { margin: 0; }

.quick-actions { grid-column: span 2; }
.action-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 12px;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}
.action-btn:hover {
    border-color: var(--primary);
    background: rgba(93,156,83,0.05);
    transform: translateY(-2px);
}
.action-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
}
.action-btn span { font-size: 13px; font-weight: 600; color: var(--dark); }

.stats-card {
    grid-column: span 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.stat-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
}
.stat-icon-box {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    flex-shrink: 0;
}
.stat-icon-box.green { background: linear-gradient(135deg, var(--primary), var(--accent)); }
.stat-icon-box.gold { background: linear-gradient(135deg, var(--gold), #e5b84d); }
.stat-icon-box.blue { background: linear-gradient(135deg, #3498db, #5dade2); }
.stat-icon-box.purple { background: linear-gradient(135deg, #9b59b6, #bb8fce); }

.stat-data { display: flex; flex-direction: column; }
.stat-value { font-size: 20px; font-weight: 900; color: var(--dark); line-height: 1; }
.stat-label { font-size: 12px; color: #888; margin-top: 2px; }

.my-pets { grid-column: span 2; }
.pet-list {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
}
.pet-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-light);
    border-radius: var(--radius);
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    min-width: 180px;
}
.pet-list-item:hover,
.pet-list-item.active {
    border-color: var(--primary);
    background: rgba(93,156,83,0.05);
}
.pet-list-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    flex-shrink: 0;
}
.pet-list-info { display: flex; flex-direction: column; }
.pet-list-name { font-size: 14px; font-weight: 700; }
.pet-list-meta { font-size: 12px; color: #888; }

.idle-alerts { grid-column: span 1; }
.alert-count {
    font-size: 12px;
    color: var(--gold);
    font-weight: 600;
    background: rgba(240,205,120,0.15);
    padding: 4px 10px;
    border-radius: 50px;
}
.idle-list { display: flex; flex-direction: column; gap: 10px; }
.idle-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--gold);
}
.idle-emoji { font-size: 24px; }
.idle-info { flex: 1; }
.idle-info h4 { font-size: 13px; font-weight: 600; }
.idle-info p { font-size: 11px; color: #888; }
.idle-actions { display: flex; gap: 6px; }

.activity-feed { grid-column: span 2; }
.activity-list { display: flex; flex-direction: column; gap: 12px; }
.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
}
.activity-item:last-child { border-bottom: none; }
.activity-icon {
    width: 36px;
    height: 36px;
    background: rgba(93,156,83,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 14px;
    flex-shrink: 0;
}
.activity-content { flex: 1; }
.activity-content p { font-size: 13px; color: var(--dark); }
.activity-content small { font-size: 11px; color: #aaa; }
.activity-points {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
}

.points-progress { grid-column: span 1; }
.progress-circle-wrapper {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 16px;
}
.progress-svg {
    width: 100px;
    height: 100px;
    transform: rotate(-90deg);
}
.progress-bg {
    fill: none;
    stroke: var(--border-light);
    stroke-width: 8;
}
.progress-bar {
    fill: none;
    stroke: var(--primary);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 314;
    stroke-dashoffset: 78;
    transition: stroke-dashoffset 1s ease;
}
.progress-text { text-align: center; }
.progress-percent { display: block; font-size: 24px; font-weight: 900; color: var(--primary); }
.progress-label { font-size: 12px; color: #888; }

.progress-tasks { display: flex; flex-direction: column; gap: 10px; }
.ptask {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    font-size: 13px;
}
.ptask.completed { color: var(--primary); }
.ptask.completed i { color: var(--primary); }
.ptask i { color: #ccc; font-size: 16px; }
.ptask span { flex: 1; }
.ptask small { font-size: 11px; color: #888; font-weight: 600; }

/* ==================== Profile Grid ==================== */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.profile-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    cursor: pointer;
}
.profile-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-4px);
    border-color: var(--primary);
}
.profile-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}
.profile-card-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    flex-shrink: 0;
}
.profile-card-info h3 { font-size: 16px; font-weight: 700; }
.profile-card-info p { font-size: 12px; color: #888; }
.profile-card-body {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding-top: 14px;
    border-top: 1px solid var(--border-light);
}
.pcb-item { text-align: center; }
.pcb-value { display: block; font-size: 16px; font-weight: 700; color: var(--primary); }
.pcb-label { font-size: 11px; color: #888; }

.profile-card-footer {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border-light);
}
.profile-card-footer button { flex: 1; justify-content: center; font-size: 13px; padding: 8px; }

/* ==================== Step Indicator ==================== */
.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 28px;
}
.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.step-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--border-light);
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    transition: var(--transition);
}
.step-item.active .step-dot { background: var(--primary); color: #fff; }
.step-item.completed .step-dot { background: var(--accent); color: var(--dark); }
.step-item span { font-size: 11px; color: #999; font-weight: 500; }
.step-item.active span { color: var(--primary); font-weight: 600; }

.step-line {
    width: 40px;
    height: 2px;
    background: var(--border-light);
    margin: 0 8px;
    margin-bottom: 20px;
}

.step-content { display: none; }
.step-content.active { display: block; animation: fadeIn 0.3s ease; }

/* ==================== Upload Zone ==================== */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 16px;
}
.upload-zone:hover { border-color: var(--primary); background: rgba(93,156,83,0.02); }
.upload-inner i { font-size: 36px; color: var(--primary); margin-bottom: 10px; display: block; }
.upload-inner p { font-size: 14px; color: var(--dark); margin-bottom: 4px; }
.upload-inner p span { color: var(--primary); font-weight: 600; }
.upload-inner small { font-size: 12px; color: #aaa; }

.upload-preview-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
.upload-preview-item {
    aspect-ratio: 1;
    background: var(--bg);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    position: relative;
}
.upload-preview-item .remove-photo {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==================== AI Analyze Panel ==================== */
.ai-analyze-panel {
    text-align: center;
    padding: 30px;
}
.ai-pet-preview {
    width: 140px;
    height: 140px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: visible;
}
.scan-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    animation: scanMove 2s linear infinite;
}
@keyframes scanMove {
    0% { top: 0; }
    100% { top: 100%; }
}
.analyze-status { max-width: 300px; margin: 0 auto 20px; }
.analyze-status p { font-size: 14px; color: var(--dark); margin-bottom: 10px; }
.analyze-progress {
    height: 6px;
    background: var(--border-light);
    border-radius: 3px;
    overflow: hidden;
}
.analyze-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 3px;
    transition: width 0.3s ease;
}
.analyze-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 300px;
    margin: 0 auto;
}
.adetail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    font-size: 13px;
}
.adetail i { color: var(--primary); }

/* ==================== Profile Result ==================== */
.profile-result-panel {
    text-align: center;
    padding: 20px;
}
.result-pet-avatar {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    border-radius: 50%;
    overflow: visible;
}
.result-measurements {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 20px 0;
}
.rmeasure {
    background: var(--bg-light);
    padding: 14px;
    border-radius: var(--radius-sm);
}
.rlabel { display: block; font-size: 12px; color: #888; margin-bottom: 4px; }
.rvalue { display: block; font-size: 18px; font-weight: 700; color: var(--primary); }
.result-size-recommend {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: rgba(93,156,83,0.1);
    padding: 12px 24px;
    border-radius: var(--radius);
    margin: 10px 0;
}
.rsize-label { font-size: 13px; color: var(--dark); }
.rsize-value { font-size: 28px; font-weight: 900; color: var(--primary); }
.result-hint { font-size: 13px; color: #888; margin-top: 16px; }

/* ==================== Modal ==================== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px;
    backdrop-filter: blur(4px);
}
.modal-overlay.active { display: flex; animation: fadeIn 0.2s ease; }
.clothesDetailModal, .profileModal, .productModal {
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform: translateY(20px);
    opacity: 0;
}
.clothesDetailModal.open, .profileModal.open, .productModal.open {
    transform: translateY(0);
    opacity: 1;
}

.modal {
    background: #fff;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.25s ease;
}
.modal-lg { max-width: 640px; }

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

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
}
.modal-header h2 { font-size: 18px; font-weight: 700; }

.modal-body { padding: 24px; }

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
}

/* ==================== Wardrobe ==================== */
.wardrobe-layout { display: flex; flex-direction: column; gap: 16px; }

.wardrobe-pets-bar {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
}
.wp-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #fff;
    border: 2px solid var(--border);
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}
.wp-tab:hover { border-color: var(--primary); }
.wp-tab.active {
    border-color: var(--primary);
    background: rgba(93,156,83,0.1);
    color: var(--primary);
    font-weight: 600;
}
.wp-tab-emoji { font-size: 20px; display: inline-flex; align-items: center; justify-content: center; }
.pet-avatar-svg { display: block; }
.pet-avatar-bg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}
.pet-avatar-bg::after {
    content: '';
    position: absolute;
    width: 78%;
    height: 78%;
    border-radius: 50%;
    background: #fff;
    z-index: 0;
    display: none;
}
.pet-avatar-bg svg {
    width: 62%;
    height: 62%;
    display: block;
    position: relative;
    z-index: 1;
}
.pet-avatar-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: relative;
    z-index: 1;
}
.pet-list-avatar svg, .profile-card-avatar svg, .wp-tab-emoji svg, .charity-pet-emoji svg, .result-pet-avatar svg, .ai-pet-preview svg { width: 100%; height: 100%; }
.pet-list-avatar img, .profile-card-avatar img, .wp-tab-emoji img, .charity-pet-emoji img, .result-pet-avatar img, .ai-pet-preview img { width: 100%; height: 100%; }

.wardrobe-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.filter-tabs { display: flex; gap: 8px; }
.filter-tab {
    padding: 8px 16px;
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: 50px;
    font-size: 13px;
    font-weight: 500;
    color: var(--dark-light);
    cursor: pointer;
    transition: var(--transition);
}
.filter-tab:hover { border-color: var(--primary); color: var(--primary); }
.filter-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.filter-tab.warning { border-color: var(--gold); color: #b8951a; }
.filter-tab.warning.active { background: var(--gold); color: var(--dark); }

.view-toggle { display: flex; gap: 4px; }
.vt-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--dark-light);
    cursor: pointer;
    transition: var(--transition);
}
.vt-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.wardrobe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}
.wardrobe-grid.list-view { grid-template-columns: 1fr; }
.wardrobe-grid.list-view .clothes-card { display: flex; flex-direction: row; }
.wardrobe-grid.list-view .clothes-img { width: 100px; height: auto; min-height: 80px; flex-shrink: 0; }
.wardrobe-grid.list-view .clothes-info { flex: 1; display: flex; align-items: center; gap: 12px; }
.wardrobe-grid.list-view .clothes-info h4 { margin: 0; }

.clothes-card {
    background: #fff;
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
}
.clothes-card:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-2px); }
.clothes-card.idle { border-color: var(--gold); }
.clothes-card.idle:hover { border-color: #d4a843; }

.clothes-img {
    height: 130px;
    overflow: hidden;
    position: relative;
    background: var(--bg-light);
}
.clothes-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.clothes-status {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 3px 8px;
    border-radius: 50px;
    font-size: 10px;
    font-weight: 700;
}
.clothes-status.active { background: rgba(93,156,83,0.9); color: #fff; }
.clothes-status.idle { background: var(--gold); color: var(--dark); }

.clothes-info { padding: 12px; }
.clothes-info h4 { font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.clothes-info p { font-size: 11px; color: #888; margin-bottom: 8px; }
.clothes-meta { display: flex; justify-content: space-between; align-items: center; }
.clothes-wear-count { font-size: 11px; color: #999; }

.color-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.color-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
}
.color-btn:hover { transform: scale(1.15); }
.color-btn.active { border-color: var(--dark); box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--primary); }

/* ==================== Market ==================== */
.market-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 20px;
}

.market-filters-panel {
    background: #fff;
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--border-light);
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.2) transparent;
}
.market-filters-panel::-webkit-scrollbar { width: 6px; }
.market-filters-panel::-webkit-scrollbar-track { background: transparent; }
.market-filters-panel::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 3px; }
.market-filters-panel::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.3); }

.filter-section { margin-bottom: 20px; }
.filter-section h4 { font-size: 13px; font-weight: 700; margin-bottom: 10px; color: var(--dark); }

.check-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    font-size: 13px;
    color: var(--dark-light);
    cursor: pointer;
}
.check-label input { accent-color: var(--primary); }
.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    font-size: 13px;
    color: var(--dark-light);
    cursor: pointer;
}
.radio-label input { accent-color: var(--primary); }

.price-range {
    display: flex;
    align-items: center;
    gap: 8px;
}
.price-range input {
    width: 80px;
    padding: 8px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
}
.price-range span { color: #999; }

.market-result-count {
    font-size: 13px;
    color: #999;
    margin-left: auto;
    white-space: nowrap;
}
.market-empty-tip {
    text-align: center;
    padding: 60px 20px;
    color: #aaa;
}
.market-empty-tip i {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
    color: #ddd;
}
.market-empty-tip p {
    font-size: 15px;
    margin: 4px 0;
}

.market-content { display: flex; flex-direction: column; gap: 16px; }

.market-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #fff;
    padding: 12px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
}

.search-box-wide {
    position: relative;
    flex: 1;
    max-width: 400px;
}
.search-box-wide i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    font-size: 13px;
}
.search-box-wide input {
    width: 100%;
    padding: 9px 12px 9px 36px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: inherit;
}
.search-box-wide input:focus { outline: none; border-color: var(--primary); }

.sort-select {
    padding: 9px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: inherit;
    background: #fff;
    cursor: pointer;
}

.market-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.product-card {
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}
.product-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }

.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 3px 10px;
    background: var(--accent);
    color: var(--dark);
    font-size: 11px;
    font-weight: 700;
    border-radius: 50px;
    z-index: 2;
}
.product-badge.eco { background: var(--gold); }

.product-img {
    height: 160px;
    overflow: hidden;
    border-radius: var(--radius) var(--radius) 0 0;
    background: #f5f5f5;
}
.product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info { padding: 14px; }
.product-info h4 { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.product-brand { font-size: 12px; color: #888; margin-bottom: 8px; }
.product-cond { display: flex; gap: 6px; margin-bottom: 10px; }
.cond-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}
.cond-badge.excellent { background: rgba(93,156,83,0.15); color: var(--primary); }
.cond-badge.good { background: rgba(240,205,120,0.2); color: #b8951a; }

.product-price { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.price-now { font-size: 20px; font-weight: 900; color: var(--primary); }
.price-was { font-size: 13px; color: #bbb; text-decoration: line-through; }
.price-off {
    font-size: 11px;
    background: rgba(240,205,120,0.2);
    color: #b8951a;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #999;
    padding-top: 10px;
    border-top: 1px solid var(--border-light);
}

.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.pd-images {
    aspect-ratio: 1;
    background: var(--bg-light);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 80px;
}
.pd-info h3 { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.pd-meta { font-size: 13px; color: #888; margin-bottom: 16px; }
.pd-price-row { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.pd-price { font-size: 28px; font-weight: 900; color: var(--primary); }
.pd-seller { font-size: 13px; color: #888; margin-bottom: 16px; }
.pd-desc { font-size: 13px; color: var(--dark-light); line-height: 1.7; margin-bottom: 16px; }
.pd-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.pd-tag {
    padding: 4px 10px;
    background: var(--bg);
    border-radius: 50px;
    font-size: 12px;
    color: var(--dark-light);
}

/* ==================== Green Points ==================== */
.gp-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
}

.gp-main { display: flex; flex-direction: column; gap: 20px; }

.gp-user-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.gp-avatar-section { display: flex; align-items: center; gap: 14px; }
.gp-avatar {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
}
.gp-user-info h3 { font-size: 18px; font-weight: 700; }
.gp-level {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(93,156,83,0.1);
    color: var(--primary);
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 4px;
}

.gp-points-display { text-align: center; }
.gp-big-number { font-size: 42px; font-weight: 900; color: var(--primary); line-height: 1; }
.gp-label { font-size: 13px; color: #888; }

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

.gp-tasks-card,
.gp-history-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--border-light);
}

.task-list { display: flex; flex-direction: column; gap: 10px; }
.task-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.task-item:hover { background: var(--bg); }
.task-item.completed { opacity: 0.6; }
.task-icon {
    width: 36px;
    height: 36px;
    background: rgba(93,156,83,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 14px;
    flex-shrink: 0;
}
.task-info { flex: 1; }
.task-info h4 { font-size: 13px; font-weight: 600; }
.task-info p { font-size: 12px; color: #888; }
.task-reward {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
}
.task-btn {
    padding: 6px 14px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.task-btn:disabled { background: #ccc; cursor: not-allowed; }

.history-list { display: flex; flex-direction: column; gap: 8px; }
.history-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
}
.history-item:last-child { border-bottom: none; }
.history-dot {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    flex-shrink: 0;
}
.history-content { flex: 1; }
.history-content p { font-size: 13px; }
.history-content small { font-size: 11px; color: #aaa; }
.history-points { font-size: 13px; font-weight: 700; color: var(--primary); }

.gp-sidebar { display: flex; flex-direction: column; gap: 20px; }

.gp-impact-card,
.gp-badges-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--border-light);
}

.impact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.impact-cell {
    text-align: center;
    padding: 14px;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
}
.impact-cell i { font-size: 20px; color: var(--primary); margin-bottom: 6px; display: block; }
.ic-value { display: block; font-size: 16px; font-weight: 700; color: var(--dark); }
.ic-label { font-size: 11px; color: #888; }

.badges-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.badge-cell {
    text-align: center;
    padding: 12px 8px;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    opacity: 0.4;
    transition: var(--transition);
}
.badge-cell.earned { opacity: 1; background: rgba(93,156,83,0.1); }
.badge-cell:hover { transform: scale(1.05); }
.badge-icon { font-size: 24px; display: block; margin-bottom: 4px; }
.badge-name { font-size: 11px; font-weight: 600; color: var(--dark); }

/* ==================== ESG Brand Gallery ==================== */
.esg-intro { background: linear-gradient(135deg, #e8f5e9, #f1f8e9); border-radius: 12px; padding: 20px; margin-bottom: 20px; }
.esg-intro h3 { margin: 0 0 8px; color: #2e7d32; }
.esg-intro p { margin: 0; font-size: 13px; color: #555; line-height: 1.6; }
.esg-filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.esg-filter-btn { padding: 6px 14px; border-radius: 20px; border: 1px solid var(--border-light); background: #fff; font-size: 13px; cursor: pointer; transition: all 0.2s; }
.esg-filter-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.esg-filter-btn:hover { border-color: var(--primary); }
.esg-brand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.esg-brand-card { display: flex; gap: 12px; padding: 16px; border: 1px solid var(--border-light); border-radius: 12px; transition: all 0.2s; background: #fff; }
.esg-brand-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); transform: translateY(-2px); }
.esg-brand-logo { width: 56px; height: 56px; border-radius: 50%; overflow: hidden; flex-shrink: 0; background: var(--bg-light); }
.esg-brand-logo img { width: 100%; height: 100%; object-fit: cover; }
.esg-brand-info { flex: 1; min-width: 0; }
@media (max-width: 480px) { .esg-brand-grid { grid-template-columns: 1fr; } }

/* ==================== ESG (Legacy cards - kept for compatibility) ==================== */
.esg-layout { display: flex; flex-direction: column; gap: 20px; }
.esg-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #fff;
    padding: 12px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
}
.esg-filters { display: flex; gap: 10px; }

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

.esg-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    cursor: pointer;
}
.esg-card:hover { box-shadow: var(--shadow); border-color: var(--primary); }

.esg-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}
.esg-logo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: var(--dark);
}
.esg-card-info h3 { font-size: 16px; font-weight: 700; }
.esg-card-info p { font-size: 12px; color: #888; }

.esg-score-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.esg-score-num { font-size: 32px; font-weight: 900; color: var(--primary); min-width: 50px; }
.esg-score-track {
    flex: 1;
    height: 8px;
    background: var(--border-light);
    border-radius: 4px;
    overflow: hidden;
}
.esg-score-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 4px; }

.esg-breakdown {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}
.esg-break-item { text-align: center; padding: 10px; background: var(--bg-light); border-radius: var(--radius-sm); }
.esg-break-label { font-size: 11px; color: #888; }
.esg-break-value { font-size: 16px; font-weight: 700; color: var(--dark); }

.esg-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.esg-tag {
    padding: 3px 10px;
    background: rgba(93,156,83,0.1);
    color: var(--primary);
    border-radius: 50px;
    font-size: 11px;
    font-weight: 600;
}

/* ===== Charity Page ===== */
.charity-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Shelter cards grid layout */
.shelter-cards-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    padding: 4px 0;
    overflow-x: visible;
}

.shelter-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 2px solid var(--border-light);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.25s ease;
    overflow: hidden;
}
.shelter-card:hover { border-color: var(--primary); box-shadow: 0 6px 20px rgba(93,156,83,0.12); transform: translateY(-3px); }
.shelter-card.active { border-color: var(--primary); box-shadow: 0 4px 16px rgba(93,156,83,0.2); }
.shelter-card-cover {
    width: 100%;
    height: 110px;
    overflow: hidden;
    background: var(--bg-light);
}
.shelter-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.shelter-card-info {
    padding: 12px 14px 14px;
}
.shelter-card-info h4 {
    font-size: 13px;
    font-weight: 700;
    margin: 0 0 4px;
    line-height: 1.3;
    color: var(--dark);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.shelter-card-info > p {
    font-size: 12px;
    color: #999;
    margin: 0 0 8px;
}
.shelter-card-info > p i { margin-right: 3px; font-size: 10px; }
.shelter-card-stats {
    display: flex;
    gap: 12px;
}
.shelter-card-stats span {
    font-size: 11px;
    color: var(--dark-light);
    display: flex;
    align-items: center;
    gap: 4px;
}
.shelter-card-stats span i { font-size: 10px; color: var(--primary); }

/* Shelter detail */
.shelter-detail {
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.shelter-info-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 24px;
    border-bottom: 1px solid var(--border-light);
    background: linear-gradient(135deg, rgba(93,156,83,0.03) 0%, rgba(93,156,83,0.01) 100%);
}

.shelter-header-left {
    display: flex;
    gap: 20px;
    flex: 1;
    min-width: 0;
}

.shelter-cover-thumb {
    width: 140px;
    height: 100px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-light);
}
.shelter-cover-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.shelter-meta { flex: 1; min-width: 0; }
.shelter-meta h3 {
    font-size: 18px;
    font-weight: 800;
    margin: 0 0 6px;
    color: var(--dark);
}
.shelter-location {
    font-size: 13px;
    color: #999;
    margin: 0 0 8px;
}
.shelter-location i { margin-right: 4px; color: var(--primary); }
.shelter-desc {
    font-size: 13px;
    color: #666;
    margin: 0 0 14px;
    line-height: 1.6;
}

.shelter-stat-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}
.shelter-stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
}
.shelter-stat-item i { font-size: 16px; }
.shelter-stat-item div { display: flex; flex-direction: column; }
.shelter-stat-item strong { font-size: 16px; font-weight: 800; color: var(--dark); line-height: 1.2; }
.shelter-stat-item span { font-size: 11px; color: #999; }

.shelter-header-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
}
.btn-shelter-donate {
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--primary), #4a8c3f);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    transition: all 0.2s ease;
}
.btn-shelter-donate:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(93,156,83,0.3); }
.btn-shelter-browse {
    padding: 10px 20px;
    background: #fff;
    color: var(--primary);
    border: 2px solid var(--primary);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    transition: all 0.2s ease;
}
.btn-shelter-browse:hover { background: rgba(93,156,83,0.05); }

/* Shelter pets section */
.shelter-pets-section {
    padding: 24px;
}
.shelter-pets-section .section-title {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 16px;
    color: var(--dark);
}

.shelter-pets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}

.shelter-pet-card {
    display: flex;
    gap: 14px;
    padding: 14px;
    background: var(--bg-light);
    border: 2px solid transparent;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.shelter-pet-card:hover { border-color: var(--primary); background: #fff; box-shadow: 0 4px 16px rgba(93,156,83,0.1); transform: translateY(-2px); }

.spc-photo {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(135deg, #c8e6c0, #a8d5a2);
}
.spc-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.spc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.spc-top { display: flex; align-items: center; gap: 8px; }
.spc-top h4 { font-size: 14px; font-weight: 700; margin: 0; color: var(--dark); }
.spc-type {
    font-size: 11px;
    padding: 2px 8px;
    background: rgba(93,156,83,0.1);
    color: var(--primary);
    border-radius: 10px;
    font-weight: 600;
}
.spc-breed { font-size: 12px; color: #999; margin: 0; }
.spc-story { font-size: 12px; color: #666; margin: 0; line-height: 1.5; }

/* Dress progress bar */
.spc-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}
.spc-progress-bar {
    flex: 1;
    height: 6px;
    background: #e8e8e8;
    border-radius: 3px;
    overflow: hidden;
}
.spc-progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}
.spc-progress-text { font-size: 11px; color: #999; white-space: nowrap; }

/* Shop panel (shown when pet or shelter is selected for donation) */
.charity-shop-panel {
    background: #fff;
    border-radius: var(--radius);
    padding: 20px 24px;
    border: 1px solid var(--border-light);
}

.shop-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-light);
}
.shop-target-info {
    display: flex;
    align-items: center;
    gap: 12px;
}
.shop-target-photo {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
}
.shop-target-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.shop-target-meta h4 { font-size: 14px; font-weight: 700; margin: 0 0 2px; color: var(--dark); }
.shop-target-meta p { font-size: 12px; color: #999; margin: 0; }
.btn-back-shelter {
    padding: 8px 16px;
    background: var(--bg-light);
    color: var(--dark-light);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}
.btn-back-shelter:hover { border-color: var(--primary); color: var(--primary); }

/* Category tabs */
.dressup-cats { display: flex; gap: 8px; flex-shrink: 0; margin-bottom: 14px; }
.dc-btn {
    flex: 1;
    padding: 9px 12px;
    background: var(--bg-light);
    border: 2px solid transparent;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--dark-light);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.dc-btn.active,
.dc-btn:hover { border-color: var(--primary); color: var(--primary); background: rgba(93,156,83,0.05); }

.dressup-items {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.dressup-item {
    padding: 14px 8px 10px;
    background: var(--bg-light);
    border: 2px solid transparent;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}
.dressup-item:hover,
.dressup-item.selected {
    border-color: var(--primary);
    background: rgba(93,156,83,0.04);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(93,156,83,0.12);
}
.dui-emoji { font-size: 28px; display: block; margin-bottom: 6px; }
.dui-name { font-size: 12px; font-weight: 600; color: var(--dark); display: block; margin-bottom: 2px; }
.dui-price { font-size: 13px; color: var(--primary); font-weight: 700; display: block; }

/* Donation summary bar */
.donation-summary-bar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
    flex-wrap: wrap;
}
.dsi-impact { font-size: 13px; color: #666; flex: 1; min-width: 0; }
.dsi-impact p { margin: 0 0 4px; }
.dsi-impact ul { list-style: none; margin: 0; padding: 0; }
.dsi-impact li {
    font-size: 12px;
    padding: 2px 0;
    padding-left: 16px;
    position: relative;
    color: var(--dark);
}
.dsi-impact li::before {
    content: '\2713';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: 700;
    font-size: 11px;
}
.dsi-action {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.dsi-amount-label { font-size: 13px; color: #999; white-space: nowrap; }
.dsi-amount { font-size: 24px; font-weight: 900; color: var(--primary); white-space: nowrap; }
.btn-donate {
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary), #4a8c3f);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.btn-donate:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(93,156,83,0.35); }
.btn-donate:disabled { opacity: 0.4; cursor: not-allowed; }
.donation-note { font-size: 11px; color: #bbb; width: 100%; margin-top: 4px; }

/* Bottom bar: platform stats */
.charity-bottom-bar {
    background: #fff;
    border-radius: var(--radius);
    padding: 20px 24px;
    border: 1px solid var(--border-light);
}
.dsi-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}
.dsi-stat {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 120px;
}
.dsi-stat i { font-size: 20px; width: 24px; text-align: center; flex-shrink: 0; }
.dsi-stat div { display: flex; flex-direction: column; }
.dsi-stat strong { font-size: 16px; font-weight: 800; color: var(--dark); line-height: 1.2; }
.dsi-stat span { font-size: 11px; color: #999; }

/* Mobile responsive */
@media (max-width: 768px) {
    .shelter-card { min-width: 180px; max-width: 180px; }
    .shelter-card-cover { height: 90px; }
    .shelter-info-header { flex-direction: column; padding: 16px; }
    .shelter-header-left { flex-direction: column; }
    .shelter-cover-thumb { width: 100%; height: 120px; }
    .shelter-header-actions { flex-direction: row; width: 100%; }
    .btn-shelter-donate, .btn-shelter-browse { flex: 1; justify-content: center; }
    .shelter-pets-grid { grid-template-columns: 1fr; }
    .shelter-pet-card { padding: 12px; }
    .spc-photo { width: 64px; height: 64px; }
    .dressup-items { grid-template-columns: repeat(3, 1fr); }
    .donation-summary-bar { flex-direction: column; gap: 12px; }
    .dsi-stats { gap: 12px; }
    .dsi-stat { min-width: 80px; }
    .charity-shop-panel { padding: 16px; }
}

/* ==================== Settings ==================== */
.settings-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 20px;
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.settings-nav {
    background: var(--bg-light);
    padding: 16px;
    border-right: 1px solid var(--border-light);
}
.settings-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--dark-light);
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
}
.settings-nav-item:hover { background: var(--bg); color: var(--dark); }
.settings-nav-item.active { background: var(--primary); color: #fff; }

.settings-content { padding: 24px; }
.settings-panel { display: none; }
.settings-panel.active { display: block; animation: fadeIn 0.3s ease; }
.settings-panel h3 { font-size: 18px; font-weight: 700; margin-bottom: 20px; }

.toggle-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    font-size: 14px;
}
.toggle-input { display: none; }
.toggle-switch {
    width: 44px;
    height: 24px;
    background: #ddd;
    border-radius: 12px;
    position: relative;
    transition: var(--transition);
    flex-shrink: 0;
}
.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: var(--transition);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-input:checked + .toggle-switch { background: var(--primary); }
.toggle-input:checked + .toggle-switch::after { left: 22px; }

/* ==================== Toast ==================== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.toast {
    background: #fff;
    border-radius: var(--radius);
    padding: 14px 20px;
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 280px;
    animation: toastIn 0.3s ease;
}
.toast.success { border-left-color: var(--primary); }
.toast.error { border-left-color: #e74c3c; }
.toast.warning { border-left-color: var(--gold); }
.toast.toast-out {
    animation: toastOut 0.3s ease forwards;
}
@keyframes toastIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
@keyframes toastOut {
    from { transform: translateY(0); opacity: 1; }
    to { transform: translateY(-20px); opacity: 0; }
}

/* ==================== Scrollbar ==================== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ddd; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #bbb; }

/* ==================== Responsive ==================== */
@media (max-width: 1024px) {
    .app-view { grid-template-columns: 1fr; }
    .app-sidebar { display: none; position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar-width); box-shadow: var(--shadow-lg); }
    .app-sidebar.open { display: flex; }
    .dashboard-grid,
    .gp-layout,
    .charity-layout,
    .market-layout,
    .settings-layout { grid-template-columns: 1fr; }
    .action-buttons { grid-template-columns: repeat(2, 1fr); }
    .stats-card { grid-template-columns: 1fr 1fr; }
    .quick-actions { grid-column: span 1; }
    .my-pets { grid-column: span 1; }
    .activity-feed { grid-column: span 1; }
    .product-detail { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .form-row { grid-template-columns: 1fr; }
    .view-header { flex-direction: column; align-items: flex-start; }
    .auth-container { grid-template-columns: 1fr; }
    .auth-brand { display: none; }
    .header-search { position: absolute; top: 100%; left: 0; right: 0; background: #fff; padding: 12px 16px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); display: none; z-index: 50; }
    .header-search.mobile-show { display: block; }
    .header-search-btn { display: flex !important; }
    .header-user .user-info { display: none; }
    .detail-product-layout { grid-template-columns: 1fr; }
    .detail-product-img { width: 100%; height: 200px; }
    .market-filters-panel { display: none; }
    .market-filters-panel.mobile-show { display: block; position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 200; background: #fff; overflow-y: auto; padding: 20px; }
    .market-filter-toggle { display: flex !important; }
}

@media (max-width: 480px) {
    .auth-container { flex-direction: column; padding: 16px; }
    .auth-brand { display: block; text-align: center; margin-bottom: 24px; }
    .auth-form-panel { width: 100%; }
    .view-header h1 { font-size: 22px; }
    .profile-card { padding: 16px; }
    .market-card-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 8px; }
    .market-card { padding: 8px; }
    .market-card img { height: 120px; }
    .wardrobe-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 8px; }
    .order-body { flex-direction: column; align-items: flex-start; gap: 12px; }
    .order-price { text-align: left; display: flex; gap: 12px; align-items: center; }
    .cart-sidebar { width: 100%; right: -100%; }
}

/* ==================== Market Card (New) ==================== */
.market-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}
.market-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}
.product-img { width: 100%; aspect-ratio: 1; border-radius: var(--radius-sm) var(--radius-sm) 0 0; overflow: hidden; background: var(--bg-light); }
.product-img img { width: 100%; height: 100%; object-fit: cover; }
.product-img svg { width: 70%; height: 70%; }
.market-card .mc-info { padding: 12px; }
.mc-name { font-size: 13px; font-weight: 600; margin-bottom: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.4; }
.mc-price-row { display: flex; align-items: baseline; gap: 6px; margin-bottom: 4px; }
.mc-price { font-size: 16px; font-weight: 700; color: #e74c3c; }
.mc-price-old { font-size: 12px; color: #aaa; text-decoration: line-through; }
.mc-meta { display: flex; align-items: center; gap: 8px; font-size: 11px; color: #999; }
.mc-stars { color: #f0cd78; font-size: 11px; }
.mc-shop { font-size: 11px; color: #999; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ==================== Detail Modal (New) ==================== */
.detail-product-layout { display: grid; grid-template-columns: 240px 1fr; gap: 24px; margin-bottom: 20px; }
.detail-product-img { width: 240px; height: 240px; border-radius: var(--radius); overflow: hidden; background: var(--bg-light); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.detail-product-img svg { width: 65%; height: 65%; }
.detail-product-info h2 { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.detail-tag { display: inline-block; padding: 3px 10px; background: rgba(93,156,83,0.1); color: var(--primary); border-radius: 20px; font-size: 12px; font-weight: 500; }
.detail-desc { font-size: 13px; color: var(--dark-light); line-height: 1.8; margin: 12px 0; }
.detail-shop-card { background: var(--bg-light); padding: 14px; border-radius: var(--radius-sm); margin: 12px 0; }
.detail-shop-name { font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.detail-shop-meta { display: flex; gap: 16px; font-size: 12px; color: #888; }
.detail-sales { display: flex; gap: 20px; margin: 12px 0; font-size: 13px; }
.detail-sales-item { text-align: center; }
.detail-sales-value { font-size: 18px; font-weight: 700; color: var(--dark); display: block; }
.detail-sales-label { font-size: 11px; color: #999; }
.size-selector { display: flex; flex-wrap: wrap; gap: 8px; }
.size-btn { padding: 6px 16px; border: 1px solid var(--border-light); border-radius: 6px; background: #fff; font-size: 13px; cursor: pointer; transition: var(--transition); }
.size-btn:hover { border-color: var(--primary); color: var(--primary); }
.size-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.detail-reviews { margin-top: 16px; }
.detail-reviews h4 { font-size: 14px; font-weight: 700; margin-bottom: 12px; }
.review-item { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--border-light); }
.review-avatar { width: 32px; height: 32px; border-radius: 50%; overflow: hidden; flex-shrink: 0; }
.review-avatar svg { width: 100%; height: 100%; }
.review-content { flex: 1; }
.review-header { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.review-user { font-size: 13px; font-weight: 600; }
.review-stars { color: #f0cd78; font-size: 11px; }
.review-time { font-size: 11px; color: #bbb; margin-left: auto; }
.review-text { font-size: 13px; line-height: 1.6; color: var(--dark-light); }
.review-footer { display: flex; align-items: center; gap: 4px; margin-top: 6px; font-size: 11px; color: #bbb; }

/* ==================== Chat System ==================== */
.chat-container { display: flex; flex-direction: column; height: 520px; }
.chat-header { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border-light); flex-shrink: 0; }
.chat-header-info { flex: 1; }
.chat-header-info h3 { font-size: 15px; font-weight: 700; }
.chat-header-info small { font-size: 12px; color: var(--primary); }
.chat-header-avatar { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--bg-light); }
.chat-header-avatar svg { width: 100%; height: 100%; }
.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; background: #f8f9f7; border-radius: 0 0 var(--radius) var(--radius); }
.chat-msg { display: flex; gap: 8px; max-width: 75%; }
.chat-msg.from-me { align-self: flex-end; flex-direction: row-reverse; }
.chat-msg-avatar { width: 28px; height: 28px; border-radius: 50%; overflow: hidden; flex-shrink: 0; }
.chat-msg-avatar svg { width: 100%; height: 100%; }
.chat-msg-body { display: flex; flex-direction: column; gap: 4px; }
.chat-msg-name { font-size: 11px; color: #999; }
.chat-msg.from-me .chat-msg-name { text-align: right; }
.chat-bubble { padding: 10px 14px; border-radius: 12px; font-size: 13px; line-height: 1.6; word-break: break-word; }
.chat-msg.from-other .chat-bubble { background: #fff; color: var(--dark); border-bottom-left-radius: 4px; }
.chat-msg.from-me .chat-bubble { background: #95d475; color: #1a3a0f; border-bottom-right-radius: 4px; }
.chat-msg-time { font-size: 10px; color: #bbb; }
.chat-msg.from-me .chat-msg-time { text-align: right; }
.chat-product-card { display: flex; gap: 10px; padding: 8px; background: #fff; border: 1px solid var(--border-light); border-radius: 8px; margin-top: 6px; cursor: pointer; transition: var(--transition); }
.chat-product-card:hover { box-shadow: var(--shadow-sm); }
.chat-product-card img, .chat-product-card svg { width: 48px; height: 48px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.chat-product-info { flex: 1; min-width: 0; }
.chat-product-name { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-product-price { font-size: 13px; font-weight: 700; color: #e74c3c; margin-top: 2px; }
.chat-input-area { padding: 12px 16px; border-top: 1px solid var(--border-light); background: #fff; flex-shrink: 0; }
.chat-input-wrap { display: flex; gap: 10px; align-items: flex-end; }
.chat-input-wrap textarea { flex: 1; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: 20px; font-size: 13px; font-family: inherit; resize: none; outline: none; max-height: 80px; line-height: 1.5; transition: var(--transition); }
.chat-input-wrap textarea:focus { border-color: var(--primary); }
.chat-input-wrap .btn-primary { border-radius: 50%; width: 38px; height: 38px; padding: 0; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.chat-system-msg { text-align: center; font-size: 11px; color: #bbb; padding: 4px 0; }

/* ==================== Role Selector ==================== */
.role-selector { display: flex; gap: 12px; }
.role-option {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px;
    padding: 14px 12px; border: 2px solid var(--border); border-radius: var(--radius);
    cursor: pointer; transition: var(--transition); text-align: center; position: relative;
}
.role-option input { position: absolute; opacity: 0; pointer-events: none; }
.role-option i { font-size: 22px; color: var(--dark-light); transition: var(--transition); }
.role-option span { font-size: 13px; font-weight: 600; color: var(--dark-light); transition: var(--transition); }
.role-option.active { border-color: var(--primary); background: rgba(93,156,83,0.06); }
.role-option.active i { color: var(--primary); }
.role-option.active span { color: var(--primary); }
.role-option:hover { border-color: var(--primary); }

/* Merchant Center */
.mstat-card { background: #fff; padding: 18px; border-radius: var(--radius); border: 1px solid var(--border-light); text-align: center; }
.mstat-value { font-size: 22px; font-weight: 800; color: var(--primary); display: block; }
.mstat-label { font-size: 12px; color: #999; margin-top: 4px; }
.merchant-join-card { background: #fff; padding: 32px; border-radius: var(--radius-lg); border: 1px solid var(--border-light); text-align: center; max-width: 600px; margin: 40px auto; }
.merchant-join-card h2 { font-size: 20px; font-weight: 800; margin-bottom: 8px; }
.merchant-join-card p { color: #888; margin-bottom: 24px; font-size: 14px; }
.plan-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.plan-card { padding: 20px; border: 2px solid var(--border); border-radius: var(--radius); text-align: left; transition: var(--transition); cursor: pointer; }
.plan-card.selected { border-color: var(--primary); background: rgba(93,156,83,0.04); }
.plan-card:hover { border-color: var(--primary); }
.plan-name { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.plan-price { font-size: 24px; font-weight: 800; color: var(--primary); }
.plan-price small { font-size: 13px; font-weight: 400; color: #888; }
.plan-features { margin: 12px 0; list-style: none; padding: 0; }
.plan-features li { font-size: 13px; color: var(--dark-light); padding: 3px 0; }
.plan-features li i { color: var(--primary); margin-right: 6px; width: 14px; }
.mproduct-item { display: flex; align-items: center; gap: 12px; padding: 12px; background: #fff; border: 1px solid var(--border-light); border-radius: var(--radius-sm); margin-bottom: 8px; }
.mproduct-img { width: 48px; height: 48px; border-radius: 8px; overflow: hidden; flex-shrink: 0; background: var(--bg-light); display: flex; align-items: center; justify-content: center; }
.mproduct-img svg { width: 65%; height: 65%; }
.mproduct-info { flex: 1; min-width: 0; }
.mproduct-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mproduct-meta { font-size: 11px; color: #999; }
.mproduct-actions { display: flex; gap: 6px; }
.promo-card { background: var(--bg-light); padding: 14px; border-radius: var(--radius-sm); margin-bottom: 10px; }
.promo-card h4 { font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.promo-card p { font-size: 12px; color: #888; line-height: 1.6; }
.promo-card .promo-price { font-size: 11px; color: var(--primary); font-weight: 600; margin-top: 6px; }

/* ========== 商家中心 Tab 系统 ========== */
.merchant-tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border-light); margin-bottom: 20px; overflow-x: auto; }
.merchant-tab { padding: 10px 18px; border: none; background: none; font-size: 14px; font-weight: 500; color: var(--dark-light); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; white-space: nowrap; transition: all .2s; display: flex; align-items: center; gap: 6px; }
.merchant-tab:hover { color: var(--primary); }
.merchant-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 700; }
.merchant-tab-content { display: none; }
.merchant-tab-content.active { display: block; }

/* 商家统计卡片增强 */
.merchant-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.mstat-card { background: #fff; padding: 18px 16px; border-radius: var(--radius); border: 1px solid var(--border-light); text-align: center; position: relative; overflow: hidden; }
.mstat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--primary); opacity: 0.7; }
.mstat-card:nth-child(2)::before { background: #e8a035; }
.mstat-card:nth-child(3)::before { background: #4a9b8e; }
.mstat-card:nth-child(4)::before { background: #9b6dc4; }
.mstat-value { font-size: 24px; font-weight: 800; color: var(--dark); display: block; }
.mstat-label { font-size: 12px; color: #999; margin-top: 4px; }
.mstat-trend { font-size: 11px; margin-top: 4px; }
.mstat-trend.up { color: #e8a035; }
.mstat-trend.down { color: #e74c3c; }

/* 销售趋势图 */
.m-sales-chart { background: #fff; padding: 20px; border-radius: var(--radius); border: 1px solid var(--border-light); margin-bottom: 20px; }
.m-sales-chart h4 { font-size: 14px; font-weight: 700; margin-bottom: 16px; display: flex; align-items: center; gap: 6px; }
.m-chart-bars { display: flex; align-items: flex-end; gap: 6px; height: 120px; padding-top: 10px; }
.m-chart-bar { flex: 1; background: linear-gradient(180deg, var(--primary), rgba(93,156,83,0.3)); border-radius: 4px 4px 0 0; min-height: 4px; transition: height .3s; position: relative; cursor: pointer; }
.m-chart-bar:hover::after { content: attr(data-val); position: absolute; top: -22px; left: 50%; transform: translateX(-50%); background: #333; color: #fff; font-size: 10px; padding: 2px 6px; border-radius: 3px; white-space: nowrap; }
.m-chart-labels { display: flex; gap: 6px; margin-top: 6px; }
.m-chart-labels span { flex: 1; text-align: center; font-size: 10px; color: #999; }

/* 商家双栏布局 */
.m-dual-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* 商品管理表格 */
.m-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.m-product-table { background: #fff; border-radius: var(--radius); border: 1px solid var(--border-light); overflow: hidden; }
.m-product-row { display: grid; grid-template-columns: 48px 2fr 1fr 1fr 1fr 1fr 100px; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border-light); transition: background .15s; }
.m-product-row:hover { background: rgba(93,156,83,0.03); }
.m-product-row:last-child { border-bottom: none; }
.m-product-row.header { background: var(--bg-light); font-size: 12px; font-weight: 600; color: var(--dark-light); text-transform: uppercase; letter-spacing: 0.3px; }
.m-product-row.header:hover { background: var(--bg-light); }
.m-product-thumb { width: 40px; height: 40px; border-radius: 8px; overflow: hidden; background: var(--bg-light); display: flex; align-items: center; justify-content: center; }
.m-product-thumb svg { width: 70%; height: 70%; }
.m-product-cell-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-product-cell { font-size: 13px; color: var(--dark-light); text-align: center; }
.m-product-cell.price { color: var(--primary); font-weight: 600; }
.m-product-cell.status .badge { font-size: 11px; padding: 2px 8px; border-radius: 10px; }
.m-product-cell.status .badge-active { background: #e8f5e9; color: #2e7d32; }
.m-product-cell.status .badge-inactive { background: #fafafa; color: #999; }
.m-product-actions-cell { display: flex; gap: 4px; justify-content: flex-end; }
.m-product-actions-cell button { padding: 4px 8px; font-size: 12px; border: 1px solid var(--border); border-radius: 6px; background: #fff; cursor: pointer; transition: all .15s; }
.m-product-actions-cell button:hover { border-color: var(--primary); color: var(--primary); }
.m-product-actions-cell button.danger:hover { border-color: #e74c3c; color: #e74c3c; }

/* 订单管理 */
.m-order-filters { display: flex; gap: 8px; margin-bottom: 14px; }
.m-order-filter { padding: 6px 14px; font-size: 13px; border: 1px solid var(--border); border-radius: 20px; background: #fff; cursor: pointer; transition: all .15s; }
.m-order-filter:hover { border-color: var(--primary); }
.m-order-filter.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.m-order-list { display: flex; flex-direction: column; gap: 10px; }
.m-order-card { background: #fff; border: 1px solid var(--border-light); border-radius: var(--radius); overflow: hidden; }
.m-order-header { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; background: var(--bg-light); font-size: 12px; border-bottom: 1px solid var(--border-light); }
.m-order-header .order-no { font-weight: 600; color: var(--dark); }
.m-order-header .order-status-badge { padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 600; }
.m-order-body { display: flex; gap: 12px; padding: 12px 16px; align-items: center; }
.m-order-body .m-product-thumb { width: 48px; height: 48px; flex-shrink: 0; }
.m-order-info { flex: 1; min-width: 0; }
.m-order-info .oi-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-order-info .oi-meta { font-size: 12px; color: #999; margin-top: 2px; }
.m-order-amount { text-align: right; flex-shrink: 0; }
.m-order-amount .oa-price { font-size: 16px; font-weight: 700; color: var(--primary); }
.m-order-amount .oa-qty { font-size: 12px; color: #999; }
.m-order-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 8px 16px; border-top: 1px solid var(--border-light); background: #fafafa; }

/* 订单详情弹窗 */
.m-order-detail { max-width: 560px; margin: 0 auto; }
.m-order-detail-section { margin-bottom: 20px; }
.m-order-detail-section h4 { font-size: 14px; font-weight: 700; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border-light); }
.m-detail-row { display: flex; justify-content: space-between; font-size: 13px; padding: 6px 0; }
.m-detail-row .label { color: #999; }
.m-detail-row .value { font-weight: 500; }
.m-timeline { padding-left: 20px; position: relative; }
.m-timeline::before { content: ''; position: absolute; left: 6px; top: 4px; bottom: 4px; width: 2px; background: var(--border-light); }
.m-timeline-item { position: relative; padding-bottom: 16px; font-size: 13px; }
.m-timeline-item::before { content: ''; position: absolute; left: -16px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--border); }
.m-timeline-item.done::before { background: var(--primary); }
.m-timeline-item .tl-title { font-weight: 500; }
.m-timeline-item .tl-time { font-size: 12px; color: #999; }

/* 财务中心 */
.m-finance-overview { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.m-finance-card { background: #fff; padding: 20px; border-radius: var(--radius); border: 1px solid var(--border-light); }
.m-finance-card .mf-label { font-size: 12px; color: #999; margin-bottom: 6px; }
.m-finance-card .mf-value { font-size: 24px; font-weight: 800; }
.m-finance-card .mf-sub { font-size: 12px; margin-top: 4px; }
.m-finance-card.income .mf-value { color: var(--primary); }
.m-finance-card.fee .mf-value { color: #e8a035; }
.m-finance-card.net .mf-value { color: #4a9b8e; }
.m-tx-table { background: #fff; border-radius: var(--radius); border: 1px solid var(--border-light); overflow: hidden; }
.m-tx-row { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 12px; padding: 10px 16px; font-size: 13px; border-bottom: 1px solid var(--border-light); align-items: center; }
.m-tx-row:last-child { border: none; }
.m-tx-row.header { background: var(--bg-light); font-weight: 600; font-size: 12px; color: var(--dark-light); }
.m-tx-type { font-weight: 500; }
.m-tx-amount.income { color: var(--primary); font-weight: 600; }
.m-tx-amount.expense { color: #e8a035; font-weight: 600; }

/* 店铺设置 */
.m-shop-card { background: #fff; padding: 24px; border-radius: var(--radius); border: 1px solid var(--border-light); margin-bottom: 16px; }
.m-shop-card h4 { font-size: 15px; font-weight: 700; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 1px solid var(--border-light); }
.m-shop-info-row { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.m-shop-avatar { width: 64px; height: 64px; border-radius: 12px; background: linear-gradient(135deg, var(--primary), var(--accent)); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 28px; flex-shrink: 0; }
.m-shop-detail { flex: 1; }
.m-shop-detail .ms-name { font-size: 16px; font-weight: 700; }
.m-shop-detail .ms-meta { font-size: 13px; color: #999; margin-top: 2px; }
.m-plan-current { display: flex; justify-content: space-between; align-items: center; padding: 16px; background: var(--bg-light); border-radius: var(--radius-sm); margin-bottom: 12px; }
.m-plan-current .mp-name { font-size: 16px; font-weight: 700; }
.m-plan-current .mp-price { font-size: 14px; color: var(--primary); font-weight: 600; }
.m-deposit-card { display: flex; justify-content: space-between; align-items: center; padding: 16px; background: #fff8e1; border: 1px solid #ffe082; border-radius: var(--radius-sm); }
.mc-deposit-card .md-amount { font-size: 20px; font-weight: 800; color: #e8a035; }

/* 成色标签 */
.mc-condition { font-size: 11px; background: #e8f5e9; color: #2e7d32; padding: 1px 6px; border-radius: 4px; font-weight: 600; white-space: nowrap; }

/* 收藏按钮 */
.btn-fav { background: transparent; color: #999; border: 1.5px solid #ddd; padding: 10px 16px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: var(--transition); }
.btn-fav:hover { color: #e74c3c; border-color: #e74c3c; }
.btn-fav.active { color: #fff; background: #e74c3c; border-color: #e74c3c; }
.btn-fav.active:hover { background: #c0392b; border-color: #c0392b; }

/* ==================== Orders ==================== */
.order-tabs { display: flex; gap: 0; background: var(--bg-light); border-radius: var(--radius); padding: 4px; margin-bottom: 20px; }
.order-tab { flex: 1; padding: 10px 8px; border: none; background: transparent; border-radius: calc(var(--radius) - 2px); font-size: 13px; color: var(--dark-light); cursor: pointer; transition: var(--transition); }
.order-tab.active { background: #fff; color: var(--primary); font-weight: 600; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.order-card { background: #fff; border-radius: var(--radius); border: 1px solid var(--border-light); margin-bottom: 12px; overflow: hidden; }
.order-header { display: flex; align-items: center; padding: 12px 16px; background: var(--bg-light); font-size: 12px; color: #999; gap: 12px; }
.order-id { flex: 1; }
.order-status { color: var(--primary); font-weight: 600; }
.order-status-pending { color: #f39c12; }
.order-status-paid { color: #3498db; }
.order-status-shipped { color: #e67e22; }
.order-status-completed { color: #27ae60; }
.order-status-cancelled { color: #e74c3c; }
.order-body { display: flex; align-items: center; justify-content: space-between; padding: 16px; }
.order-item-info { display: flex; align-items: center; gap: 12px; flex: 1; }
.order-item-detail { }
.order-item-name { font-weight: 600; font-size: 14px; }
.order-item-meta { font-size: 12px; color: #999; margin-top: 2px; }
.order-price { text-align: right; }
.order-price-amount { font-weight: 700; font-size: 16px; color: var(--primary); }
.order-price-qty { font-size: 12px; color: #999; }
.order-footer { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border-light); }
.order-total { flex: 1; font-size: 13px; color: #666; }

/* ==================== Cart ==================== */
.cart-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.3); z-index: 1000; opacity: 0; visibility: hidden; transition: all 0.3s; }
.cart-overlay.open { opacity: 1; visibility: visible; }
.cart-sidebar { position: fixed; top: 0; right: -380px; width: 380px; height: 100%; background: #fff; z-index: 1001; transition: right 0.3s ease; display: flex; flex-direction: column; box-shadow: -4px 0 20px rgba(0,0,0,0.1); }
.cart-sidebar.open { right: 0; }
.cart-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border-light); }
.cart-header h3 { font-size: 16px; display: flex; align-items: center; gap: 8px; }
.cart-header button { background: none; border: none; font-size: 18px; color: #999; cursor: pointer; padding: 4px; }
.cart-body { flex: 1; overflow-y: auto; padding: 12px 20px; }
.cart-footer { padding: 16px 20px; border-top: 1px solid var(--border-light); flex-direction: column; gap: 12px; display: flex; }
.cart-total { font-size: 16px; font-weight: 700; text-align: right; }
.cart-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border-light); }
.cart-item:last-child { border-bottom: none; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-item-price { font-size: 13px; color: var(--primary); font-weight: 600; margin-top: 2px; }
.cart-item-qty { display: flex; align-items: center; gap: 8px; }
.cart-item-qty button { width: 28px; height: 28px; border: 1px solid var(--border-light); background: var(--bg-light); border-radius: 6px; font-size: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.cart-item-qty span { min-width: 20px; text-align: center; font-weight: 600; font-size: 14px; }
.cart-item-remove { background: none; border: none; color: #ccc; cursor: pointer; padding: 4px; font-size: 14px; }
.cart-item-remove:hover { color: #e74c3c; }

/* ==================== Favorites ==================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #bbb;
}
.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
    color: var(--border);
}
.empty-state p {
    font-size: 14px;
    margin: 4px 0;
}
#favoritesList .empty-state { text-align: center; padding: 60px 20px; color: #999; }
#favoritesList .empty-state i { font-size: 48px; margin-bottom: 12px; color: var(--border); }

/* cart badge */
.cart-badge { position: absolute; top: -4px; right: -4px; }

/* ==================== Search History Dropdown ==================== */
#searchHistoryDropdown div[style*="cursor:pointer"] { transition: background 0.15s; }
#searchHistoryDropdown div[style*="cursor:pointer"]:hover { background: var(--bg-light); }

/* ==================== Order Card Enhancements ==================== */
.order-card { transition: box-shadow 0.2s ease; }
.order-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.order-status-cancelled { color: #e74c3c; }

/* ==================== Review Stars ==================== */
#reviewStars span { transition: transform 0.15s ease; }
#reviewStars span:hover { transform: scale(1.2); }

/* ==================== Market Condition Badge ==================== */
.mc-condition { font-size: 11px; padding: 1px 6px; border-radius: 4px; font-weight: 600; white-space: nowrap; }
.mc-condition-new { background: #e8f5e9; color: #2e7d32; }
.mc-condition-95 { background: #fff3e0; color: #e65100; }
.mc-condition-90 { background: #fce4ec; color: #c62828; }
.mc-condition-other { background: #f5f5f5; color: #666; }

/* ==================== Mobile Search Dropdown ==================== */
@media (max-width: 768px) {
    #searchHistoryDropdown { max-height: 180px; }
    .order-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; }
    .order-tab { flex: 0 0 auto; min-width: 60px; }
    .chat-container { height: 420px; }
    .detail-product-layout { gap: 16px; }
    .detail-product-info h2 { font-size: 17px; }
    .size-selector { gap: 6px; }
    .size-btn { padding: 5px 12px; font-size: 12px; }
}

@media (max-width: 480px) {
    .order-header { flex-wrap: wrap; gap: 4px; }
    .order-time { width: 100%; }
    .order-footer { flex-wrap: wrap; }
    .detail-sales { gap: 12px; }
    .detail-sales-value { font-size: 15px; }
    .chat-container { height: 360px; }
    .chat-msg { max-width: 85%; }
    .modal { margin: 8px; max-width: calc(100vw - 16px) !important; }
}

/* ==================== Smooth Transitions ==================== */
.view { animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ==================== Button Hover Refinements ==================== */
.btn-primary:active { transform: scale(0.97); }
.btn-outline:active { transform: scale(0.97); }
.btn-sm { transition: all 0.15s ease; }

/* ==================== Address Card ==================== */
.address-card { transition: box-shadow 0.2s, border-color 0.2s; }
.address-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.05); }

/* ==================== Product Detail Page ==================== */
.pd-breadcrumb { font-size: 13px; color: #999; margin-bottom: 16px; padding: 8px 0; }
.pd-main { display: flex; gap: 24px; margin-bottom: 24px; }
.pd-image { width: 420px; flex-shrink: 0; border-radius: 12px; overflow: hidden; background: var(--bg-light); display: flex; align-items: center; justify-content: center; min-height: 400px; }
.pd-image img { width: 100%; height: auto; display: block; }
.pd-info { flex: 1; min-width: 0; }
.pd-price-row { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.pd-price { font-size: 28px; font-weight: 900; color: #e74c3c; }
.pd-price-old { font-size: 15px; color: #ccc; text-decoration: line-through; }
.pd-discount { font-size: 12px; background: rgba(240,205,120,0.2); color: #b8951a; padding: 2px 8px; border-radius: 4px; font-weight: 600; }
.pd-meta { display: flex; gap: 16px; font-size: 13px; color: #999; margin-bottom: 12px; }
.pd-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.pd-desc { font-size: 13px; color: #666; line-height: 1.6; margin-bottom: 16px; padding: 12px; background: var(--bg-light); border-radius: 8px; }
.pd-shop-card { border: 1px solid var(--border-light); border-radius: 10px; padding: 12px; margin-bottom: 16px; }
.pd-shop-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.pd-shop-actions { display: flex; gap: 8px; justify-content: flex-end; }
.pd-sales { display: flex; gap: 16px; margin-bottom: 16px; }
.pd-section { margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--border-light); }
.pd-section h3 { font-size: 15px; margin: 0 0 12px; }
.pd-qty-control { display: inline-flex; align-items: center; border: 1px solid var(--border-light); border-radius: 8px; overflow: hidden; }
.pd-qty-btn { width: 40px; height: 40px; border: none; background: var(--bg-light); cursor: pointer; font-size: 18px; }
.pd-qty-btn:hover { background: #e0e0e0; }
.pd-qty-num { width: 48px; text-align: center; font-weight: 600; font-size: 16px; }
.pd-actions { display: flex; gap: 10px; margin-bottom: 24px; align-items: center; }
.pd-action-btn { flex: 1; }
.pd-back { text-align: center; padding: 20px 0; }
@media (max-width: 768px) { .pd-main { flex-direction: column; } .pd-image { width: 100%; min-height: 300px; } .pd-actions { flex-direction: column; } .pd-action-btn { width: 100%; } }

/* ==================== Community (萌宠星球) ==================== */
.community-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}
.community-header-info h1 {
    font-size: 24px;
    font-weight: 900;
    color: var(--dark);
    margin: 0;
}
.community-header-info p {
    font-size: 14px;
    color: #888;
    margin: 2px 0 0;
}
.community-post-btn {
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.community-tabs {
    display: flex;
    gap: 0;
    background: var(--bg-light);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 20px;
}
.community-tab {
    padding: 10px 28px;
    border: none;
    background: none;
    font-size: 14px;
    font-weight: 600;
    color: #888;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
}
.community-tab:hover {
    color: var(--dark);
}
.community-tab.active {
    background: #fff;
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.community-feed {
    max-width: 680px;
    margin: 0 auto;
}

.community-post-card {
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid var(--border-light);
    transition: box-shadow 0.2s;
}
.community-post-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

.post-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}
.post-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    flex-shrink: 0;
}
.post-user-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}
.post-username {
    font-size: 14px;
    font-weight: 700;
    color: var(--dark);
}
.post-time {
    font-size: 12px;
    color: #bbb;
}

.post-content-text {
    font-size: 14px;
    line-height: 1.7;
    color: var(--dark-light);
    margin-bottom: 10px;
    word-break: break-word;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}
.community-post-tag {
    font-size: 12px;
    color: var(--primary);
    background: rgba(93,156,83,0.08);
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 500;
}

.community-post-images.single img {
    width: 100%;
    border-radius: 10px;
    cursor: pointer;
    object-fit: cover;
    max-height: 400px;
}
.community-post-images.grid {
    display: grid;
    gap: 6px;
    border-radius: 10px;
    overflow: hidden;
}
.community-post-images.grid.cols-2 {
    grid-template-columns: repeat(2, 1fr);
}
.community-post-images.grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
}
.community-img-item {
    aspect-ratio: 1;
    overflow: hidden;
    cursor: pointer;
}
.community-img-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s;
}
.community-img-item img:hover {
    transform: scale(1.03);
}

.post-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    padding-top: 14px;
    border-top: 1px solid var(--border-light);
    margin-top: 14px;
}
.post-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: none;
    background: none;
    font-size: 13px;
    color: #888;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.15s;
    font-weight: 500;
}
.post-action-btn:hover {
    background: var(--bg-light);
    color: var(--dark);
}
.post-action-btn.liked {
    color: #e74c3c;
}
.post-action-btn.liked i {
    animation: likeAnim 0.3s ease;
}
.post-action-btn.bookmarked {
    color: #f0cd78;
}

@keyframes likeAnim {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.post-comments-preview {
    margin-top: 10px;
    padding: 10px 12px;
    background: var(--bg-light);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}
.post-comments-preview:hover {
    background: #eaeaea;
}
.comment-preview-item {
    font-size: 13px;
    line-height: 1.5;
    color: var(--dark-light);
}
.comment-preview-user {
    font-weight: 600;
    color: var(--dark);
}
.comment-preview-more {
    font-size: 12px;
    color: #aaa;
    margin-top: 4px;
}

.community-empty {
    text-align: center;
    padding: 60px 20px;
    color: #ccc;
}
.community-empty p {
    margin-top: 16px;
    font-size: 14px;
}

/* ===== Post Modal ===== */
.community-modal {
    max-width: 560px;
}
.community-textarea {
    width: 100%;
    min-height: 120px;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 14px;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    outline: none;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.2s;
}
.community-textarea:focus {
    border-color: var(--primary);
}
.community-char-count {
    text-align: right;
    font-size: 12px;
    color: #bbb;
    margin-top: 4px;
}

.community-image-upload {
    margin-top: 16px;
}
.community-upload-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.community-upload-item {
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}
.community-upload-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.community-upload-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.5);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.community-upload-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1;
    border: 2px dashed var(--border-light);
    border-radius: 8px;
    cursor: pointer;
    color: #bbb;
    gap: 6px;
    transition: all 0.2s;
    margin-top: 8px;
}
.community-upload-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.community-upload-btn i {
    font-size: 24px;
}
.community-upload-btn span {
    font-size: 12px;
}
.community-image-hint {
    font-size: 12px;
    color: #bbb;
    margin-top: 6px;
}

.community-tag-select {
    margin-top: 16px;
}
.community-tag-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 8px;
}
.community-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.community-tag-btn {
    padding: 6px 14px;
    border: 1px solid var(--border-light);
    border-radius: 20px;
    background: #fff;
    font-size: 13px;
    color: #888;
    cursor: pointer;
    transition: all 0.15s;
}
.community-tag-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.community-tag-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ===== Comments Modal ===== */
.community-comments-modal {
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}
.community-comments-modal .modal-header {
    flex-shrink: 0;
}
.comments-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px 0;
    min-height: 200px;
    max-height: 50vh;
}
.comments-empty {
    text-align: center;
    padding: 40px 0;
    color: #ccc;
    font-size: 14px;
}
.comment-item {
    display: flex;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}
.comment-item:last-child {
    border-bottom: none;
}
.comment-body {
    flex: 1;
}
.comment-header-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.comment-user {
    font-size: 13px;
    font-weight: 600;
    color: var(--dark);
}
.comment-time {
    font-size: 11px;
    color: #ccc;
}
.comment-text {
    font-size: 13px;
    line-height: 1.6;
    color: var(--dark-light);
}
.comment-like-row {
    margin-top: 6px;
}
.comment-like-btn {
    border: none;
    background: none;
    font-size: 12px;
    color: #bbb;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.15s;
}
.comment-like-btn:hover {
    color: #e74c3c;
}

.comment-input-bar {
    display: flex;
    gap: 10px;
    padding-top: 14px;
    border-top: 1px solid var(--border-light);
    flex-shrink: 0;
}
.comment-input {
    flex: 1;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s;
}
.comment-input:focus {
    border-color: var(--primary);
}

/* ===== Image Preview ===== */
.image-preview-container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.image-preview-container img {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: 8px;
    object-fit: contain;
}
.image-preview-close {
    position: absolute;
    top: -36px;
    right: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.9);
    color: #333;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .community-header { flex-direction: column; align-items: flex-start; }
    .community-feed { max-width: 100%; }
    .community-post-card { padding: 14px; }
    .post-action-btn { padding: 8px 10px; font-size: 12px; }
    .community-tab { padding: 8px 18px; font-size: 13px; }
}
