/* ============================================
   星禾铺子 STARHELY - 后台管理样式
   ============================================ */

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

html {
    -webkit-font-smoothing: antialiased;
}

body.admin-body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: #f0f2f5;
    color: #333;
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

ul { list-style: none; }

/* ============================================
   Sidebar
   ============================================ */
.admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 250px;
    height: 100vh;
    background: #1a2744;
    z-index: 1000;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 24px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo {
    display: block;
    color: #c8a45a;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 2px;
}

.sidebar-logo-sub {
    display: block;
    color: rgba(255,255,255,0.4);
    font-size: 10px;
    letter-spacing: 3px;
    margin-top: 4px;
}

.sidebar-logo-img {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 0;
    font-size: 0;
    letter-spacing: 0;
    line-height: 1;
}

.sidebar-logo-img img {
    height: 38px;
    width: auto;
    display: block;
}



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

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    color: rgba(255,255,255,0.6);
    font-size: 14px;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    color: #c8a45a;
    background: rgba(255,255,255,0.03);
}

.sidebar-link.active {
    color: #c8a45a;
    background: rgba(200,164,90,0.08);
    border-left-color: #c8a45a;
}

.sidebar-link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar-divider {
    height: 1px;
    background: rgba(255,255,255,0.08);
    margin: 12px 24px;
}

/* ============================================
   Main Content
   ============================================ */
.admin-main {
    margin-left: 250px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.admin-topbar {
    height: 60px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 900;
}

.topbar-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: #1a2744;
}

.topbar-toggle svg {
    width: 24px;
    height: 24px;
}

.topbar-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a2744;
    letter-spacing: 1px;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-username {
    color: #1a2744;
    font-weight: 600;
    font-size: 14px;
}

.topbar-role {
    color: #c8a45a;
    font-size: 12px;
    padding: 2px 10px;
    background: rgba(200,164,90,0.1);
    border-radius: 12px;
}

.topbar-logout {
    color: #999;
    font-size: 14px;
    transition: color 0.2s;
}

.topbar-logout:hover {
    color: #e74c3c;
}

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

/* ============================================
   Cards
   ============================================ */
.admin-card {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.card-title {
    font-size: 16px;
    color: #1a2744;
    font-weight: 600;
    margin-bottom: 20px;
}

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

.card-header .card-title {
    margin-bottom: 0;
}

/* ============================================
   Statistics Cards
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.stat-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

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

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #1a2744;
    line-height: 1;
}

.stat-label {
    font-size: 13px;
    color: #999;
    margin-top: 4px;
}

/* ============================================
   Charts
   ============================================ */
.charts-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.chart-card {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.chart-title {
    font-size: 15px;
    color: #1a2744;
    font-weight: 600;
    margin-bottom: 16px;
}

.chart-container {
    height: 280px;
    position: relative;
}

/* ============================================
   Tables
   ============================================ */
.table-responsive {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.admin-table thead {
    background: #f7f8fa;
}

.admin-table th {
    padding: 12px 16px;
    text-align: left;
    color: #1a2744;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
}

.admin-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

.admin-table tbody tr:nth-child(even) {
    background: #fafbfc;
}

.admin-table tbody tr:hover {
    background: #f7f9fc;
}

.admin-table td {
    padding: 12px 16px;
    color: #555;
}

.admin-table .text-center {
    text-align: center;
    color: #999;
    padding: 24px;
}

.admin-table .actions {
    display: flex;
    gap: 8px;
    white-space: nowrap;
}

/* Badges */
.type-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    background: #f0f2f5;
    color: #666;
}

.type-HJ { background: #fff3e0; color: #e65100; }
.type-TD { background: #f3e5f5; color: #6a1b9a; }
.type-HT { background: #e8f5e9; color: #2e7d32; }
.type-PG { background: #ffebee; color: #c62828; }
.type-BL { background: #fff8e1; color: #f57f17; }

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

.status-1 { background: #e8f5e9; color: #2e7d32; }
.status-0 { background: #ffebee; color: #c62828; }

.role-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
}

.role-admin { background: rgba(200,164,90,0.15); color: #c8a45a; }
.role-staff { background: #e3f2fd; color: #1565c0; }

/* Small buttons */
.btn-sm {
    display: inline-block;
    padding: 5px 12px;
    font-size: 13px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-edit { background: #e3f2fd; color: #1565c0; }
.btn-edit:hover { background: #bbdefb; }

.btn-delete { background: #ffebee; color: #c62828; }
.btn-delete:hover { background: #ffcdd2; }

.btn-view { background: #f3e5f5; color: #6a1b9a; }
.btn-view:hover { background: #e1bee7; }

.btn-toggle { background: #fff8e1; color: #f57f17; }
.btn-toggle:hover { background: #ffecb3; }

.btn-qr { background: #e8f5e9; color: #2e7d32; }
.btn-qr:hover { background: #c8e6c9; }

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-block;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.btn-primary {
    background: #c8a45a;
    color: #fff;
}

.btn-primary:hover {
    background: #b89248;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(200,164,90,0.3);
}

.btn-cancel {
    background: #f0f0f0;
    color: #666;
}

.btn-cancel:hover {
    background: #e0e0e0;
}

/* ============================================
   Forms
   ============================================ */
.admin-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

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

.form-group label {
    display: block;
    color: #1a2744;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
}

.required {
    color: #e74c3c;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
    background: #fff;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #c8a45a;
    box-shadow: 0 0 0 2px rgba(200,164,90,0.1);
}

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

.content-editor {
    min-height: 300px !important;
    font-family: monospace;
    line-height: 1.8;
}

.form-hint {
    display: block;
    color: #999;
    font-size: 12px;
    margin-top: 4px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.current-image {
    margin-bottom: 10px;
}

.current-file {
    font-size: 13px;
    margin-bottom: 6px;
    color: #666;
}

.current-file a {
    color: #c8a45a;
    text-decoration: underline;
}

/* ============================================
   Alert
   ============================================ */
.alert {
    padding: 12px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success {
    background: #e8f5e9;
    border: 1px solid #c8e6c9;
    color: #2e7d32;
}

/* ============================================
   Pagination
   ============================================ */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 24px;
}

.page-btn {
    padding: 8px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    color: #666;
    font-size: 14px;
    transition: all 0.2s;
}

.page-btn:hover {
    border-color: #c8a45a;
    color: #c8a45a;
}

.page-btn.active {
    background: #c8a45a;
    border-color: #c8a45a;
    color: #fff;
}

/* ============================================
   Quick Actions
   ============================================ */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 24px 16px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    color: #1a2744;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}

.quick-action-btn:hover {
    border-color: #c8a45a;
    color: #c8a45a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.quick-action-btn svg {
    width: 28px;
    height: 28px;
}

/* ============================================
   Settings Tabs
   ============================================ */
.settings-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    border-bottom: 2px solid #e0e0e0;
}

.settings-tab {
    padding: 12px 24px;
    color: #666;
    font-size: 14px;
    font-weight: 600;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.settings-tab:hover {
    color: #c8a45a;
}

.settings-tab.active {
    color: #c8a45a;
    border-bottom-color: #c8a45a;
}

/* ============================================
   Carousel List
   ============================================ */
.carousel-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.carousel-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #f7f8fa;
    border-radius: 8px;
}

.carousel-thumb {
    width: 100px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.carousel-info {
    flex: 1;
}

.carousel-title-text {
    font-weight: 600;
    color: #1a2744;
    margin-bottom: 4px;
}

.carousel-link {
    color: #999;
    font-size: 13px;
}

.carousel-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* ============================================
   Batch Display
   ============================================ */
.batch-display {
    padding: 12px 20px;
    background: #f7f8fa;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #1a2744;
}

.batch-display code {
    color: #c8a45a;
    font-size: 16px;
    font-weight: 700;
}

/* ============================================
   Image Preview
   ============================================ */
.image-preview-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.image-preview-list img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
}

.image-preview-item {
    position: relative;
    display: inline-block;
}

.image-remove-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #e74c3c;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

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

.login-container {
    width: 100%;
    max-width: 400px;
}

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

.login-logo {
    color: #c8a45a;
    font-size: 36px;
    font-weight: 700;
    letter-spacing: 4px;
}

.login-logo-sub {
    color: rgba(255,255,255,0.4);
    font-size: 12px;
    letter-spacing: 4px;
    margin-top: 4px;
}

.login-tagline {
    color: rgba(255,255,255,0.3);
    font-size: 13px;
    margin-top: 16px;
    letter-spacing: 2px;
}

.login-card {
    background: #fff;
    border-radius: 12px;
    padding: 40px 32px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.2);
}

.login-title {
    color: #1a2744;
    font-size: 22px;
    text-align: center;
    margin-bottom: 28px;
    font-weight: 700;
    letter-spacing: 2px;
}

.login-error {
    background: #ffebee;
    border: 1px solid #ffcdd2;
    color: #c62828;
    padding: 10px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    text-align: center;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    color: #1a2744;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
}

.login-form input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

.login-form input:focus {
    border-color: #c8a45a;
    box-shadow: 0 0 0 2px rgba(200,164,90,0.1);
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: #c8a45a;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 4px;
}

.btn-login:hover {
    background: #b89248;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(200,164,90,0.35);
}

.login-footer {
    text-align: center;
    margin-top: 24px;
}

.login-footer a {
    color: rgba(255,255,255,0.4);
    font-size: 14px;
    transition: color 0.2s;
}

.login-footer a:hover {
    color: #c8a45a;
}

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

    .charts-row {
        grid-template-columns: 1fr;
    }

    .quick-actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }

    .admin-sidebar.open {
        transform: translateX(0);
    }

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

    .topbar-toggle {
        display: block;
    }

    .admin-content {
        padding: 16px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .admin-form .form-row {
        grid-template-columns: 1fr;
    }

    .quick-actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .admin-card {
        padding: 16px;
    }

    .topbar-role {
        display: none;
    }

    .carousel-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .carousel-thumb {
        width: 100%;
        height: 120px;
    }
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 999;
}

.sidebar-overlay.show {
    display: block;
}


/* 登录页 LOGO 图片 */
.login-logo-img {
    display: block;
    width: 220px;
    max-width: 60%;
    height: auto;
    margin: 0 auto;
}
