/**
 * SHOPAGG Admin Panel Styles
 * 统一后台样式管理
 */

/* ==================== CSS 变量 ==================== */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --info-gradient: linear-gradient(135deg, #17a2b8 0%, #20c997 100%);
    --success-gradient: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    --warning-gradient: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
    --danger-gradient: linear-gradient(135deg, #dc3545 0%, #e83e8c 100%);
    --dark-gradient: linear-gradient(135deg, #343a40 0%, #495057 100%);
    --link-gradient: linear-gradient(135deg, #3273dc 0%, #667eea 100%);
    --card-shadow: 0 4px 20px rgba(0,0,0,0.08);
    --card-hover-shadow: 0 12px 40px rgba(0,0,0,0.12);
    --border-radius: 16px;
    --border-radius-sm: 12px;
    --border-radius-xs: 10px;
    --border-radius-pill: 50px;
}

/* ==================== 全局基础样式 ==================== */
body { 
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
    min-height: 100vh; 
    display: flex; 
    flex-direction: column; 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif; 
}

.admin-main { flex: 1; }
.relative { position: relative; }

/* ==================== Tailwind 过渡兼容层 ==================== */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

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

img,
video {
    max-width: 100%;
}

.container {
    width: min(1200px, calc(100% - 2rem));
    margin-inline: auto;
}

.label {
    display: block;
    margin-bottom: 0.5rem;
    color: #334155;
    font-size: 0.875rem;
    font-weight: 600;
}

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

.table th,
.table td {
    text-align: left;
}

.image.is-3by2 {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 2;
}

.image.is-3by2 img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.is-hidden { display: none !important; }
.is-expanded { width: 100%; }
.is-left { left: 0; }

/* ==================== 页面头部样式 ==================== */
.page-header {
    background: var(--primary-gradient);
    border-radius: var(--border-radius);
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    color: white;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
}

.page-header h1 {
    color: white !important;
    margin-bottom: 0.5rem !important;
    font-weight: 700;
    line-height: 1.3;
}

/* ==================== 统一表格样式 ==================== */
.card {
    border-radius: 1rem;
    border: 1px solid #e2e8f0;
    background: white;
    box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
.admin-table {
    border-radius: 1rem;
    border: 1px solid #e2e8f0;
    background: white;
    box-shadow: 0 1px 2px rgba(0,0,0,.05);
    overflow: hidden;
}
.admin-table table { width: 100%; border-collapse: collapse; }
.admin-table thead th {
    position: sticky; top: 0;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.75rem 1.25rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
}
.admin-table tbody td {
    padding: 1rem 1.25rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
}
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table tbody tr:hover { background: #f8fafc; }

/* ==================== 统一Tabs样式 ==================== */
.modern-tabs {
    background: white;
    border-radius: var(--border-radius-sm);
    padding: 0.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    margin-bottom: 1.5rem;
    display: inline-flex;
    gap: 0.25rem;
}

.modern-tabs a {
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    color: #64748b;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s;
    text-decoration: none;
}

.modern-tabs a:hover {
    background: #f1f5f9;
    color: #334155;
}

.modern-tabs a.is-active {
    background: var(--primary-gradient);
    color: white;
}

/* ==================== 分区标题 ==================== */
.section-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-title .icon-box {
    width: 36px;
    height: 36px;
    border-radius: var(--border-radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.section-title .icon-box.primary { background: rgba(102, 126, 234, 0.15); color: #667eea; }
.section-title .icon-box.info { background: rgba(23, 162, 184, 0.15); color: #17a2b8; }
.section-title .icon-box.success { background: rgba(40, 167, 69, 0.15); color: #28a745; }
.section-title .icon-box.warning { background: rgba(255, 193, 7, 0.15); color: #d39e00; }
.section-title .icon-box.danger { background: rgba(220, 53, 69, 0.15); color: #dc3545; }

/* ==================== 空状态 ==================== */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: #94a3b8;
}

.empty-state > :first-child {
    height: 5rem;
    width: 5rem;
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state > button > :first-child {
    font-size: 1.6rem;
    margin-bottom: 0rem;
    opacity: 0.5;
}
.empty-state p {
    font-size: 1rem;
}

/* ==================== 导航样式 ==================== */
.admin-navbar { 
    background: white;
    border-bottom: 1px solid #edf2f7; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.04); 
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 二级导航 */
.admin-subnav { 
    background: #fff; 
    border-bottom: 1px solid #edf2f7; 
    padding: 0; 
    margin-bottom: 1.5rem; 
}

.admin-subnav .container { 
    display: flex; 
    align-items: stretch; 
    overflow-x: auto; 
    white-space: nowrap; 
    -webkit-overflow-scrolling: touch; 
}

/* 隐藏滚动条但保持功能 */
.admin-subnav .container::-webkit-scrollbar { display: none; }
.admin-subnav .container { -ms-overflow-style: none; scrollbar-width: none; }

/* ==================== 媒体库相关样式 ==================== */
.media-library-modal-card {
    width: min(1180px, 94vw);
    max-width: none;
}

.media-library-body {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 1rem;
}

.media-library-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
}

.media-library-toolbar-main {
    min-width: 240px;
}

.media-library-toolbar-buttons {
    justify-content: flex-end;
}

.media-library-status {
    border-radius: 12px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.media-library-status.is-success {
    background: #ecfdf5;
    color: #166534;
}

.media-library-status.is-danger {
    background: #fef2f2;
    color: #991b1b;
}

.media-library-status.is-info {
    background: #eff6ff;
    color: #1d4ed8;
}

.media-library-empty {
    min-height: 320px;
    border: 1px dashed #d1d5db;
    border-radius: 16px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #64748b;
    padding: 2rem;
    grid-column: 1 / -1;
}

.media-library-folder-tile,
.media-library-tile {
    position: relative;
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #fff;
    padding: 0;
    overflow: hidden;
    text-align: left;
    transition: all 0.2s ease;
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.04);
}

.media-library-folder-tile:hover,
.media-library-tile:hover,
.media-library-tile.is-active,
.media-library-tile.is-selected {
    border-color: #667eea;
    transform: translateY(-1px);
    box-shadow: 0 16px 36px rgba(102, 126, 234, 0.14);
}

.media-library-folder-tile {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.35rem;
    min-height: 170px;
    padding: 1rem;
}

.media-library-folder-tile-icon > span {
    color: #f59e0b;
}

.media-library-folder-tile small {
    color: #64748b;
}

.media-library-thumb {
    position: relative;
    aspect-ratio: 1;
    background: #f8fafc;
}

.media-library-select-toggle {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.6rem;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 999px;
    font-size: 0.72rem;
    color: #334155;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.media-library-select-toggle input {
    margin: 0;
}

.media-library-thumb img,
.media-library-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.media-library-video-badge {
    position: absolute;
    right: 0.75rem;
    bottom: 0.75rem;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.media-library-tile-body {
    padding: 0.875rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.media-library-tile-body strong,
.media-library-tile-body span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-library-tile-body span {
    color: #64748b;
    font-size: 0.75rem;
}

.media-library-details {
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    background: #fff;
    padding: 1rem;
    min-height: 100%;
}

.media-library-details-placeholder {
    min-height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #94a3b8;
}

.media-library-details-preview {
    aspect-ratio: 4 / 3;
    border-radius: 14px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 1rem;
}

.media-library-details-preview img,
.media-library-details-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.media-library-detail-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.9rem;
}

.media-library-detail-row span {
    font-size: 0.75rem;
    color: #64748b;
}

.media-library-detail-row strong {
    font-size: 0.92rem;
    color: #111827;
    word-break: break-word;
}

.media-library-footer {
    justify-content: flex-end;
}

.media-library-window {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    gap: 0.9rem;
}

.media-library-window-nav,
.media-library-window-statusbar {
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: linear-gradient(180deg, #fbfdff 0%, #f8fafc 100%);
    padding: 0.4rem 1rem;
}

.media-library-window-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
}

.media-library-filter-bar {
    min-width: 360px;
    flex: 1;
}

.media-library-window-main {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr) 290px;
    flex: 1;
    min-height: 0;
    max-height: calc(100vh - 18rem);
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
}

.media-library-tree-panel,
.media-library-preview-panel {
    background: #f8fafc;
    padding: 1rem;
}

.media-library-tree-panel {
    border-right: 1px solid #e5e7eb;
}

.media-library-preview-panel {
    border-left: 1px solid #e5e7eb;
}

.media-library-tree-panel,
.media-library-preview-panel,
.media-library-files-panel {
    min-height: 0;
}

.media-library-tree-panel #media-library-tree,
.media-library-preview-panel .media-library-details,
.media-library-file-list {
    overflow: auto;
}

.media-library-pane-title {
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-bottom: 0.9rem;
}

.media-library-tree-root,
.media-library-tree-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 10px;
    padding: 0.42rem 0.6rem;
    color: #1e293b;
}

.media-library-tree-root:hover,
.media-library-tree-link:hover {
    background: #e8eefc;
}

.media-library-tree-root.is-current,
.media-library-tree-node.is-current > .media-library-tree-row .media-library-tree-link {
    background: #dbeafe;
    color: #1d4ed8;
    font-weight: 600;
}

.media-library-tree-list {
    margin: 0;
    padding-left: 0.85rem;
}

.media-library-tree-row {
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.media-library-tree-toggle {
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.media-library-tree-toggle:hover {
    background: #e2e8f0;
    color: #334155;
}

.media-library-tree-toggle > span {
    transition: transform 0.15s ease;
}

.media-library-tree-toggle.is-expanded > span {
    transform: rotate(90deg);
}

.media-library-tree-toggle.is-empty {
    visibility: hidden;
}

.media-library-tree-children.is-collapsed {
    display: none;
}

.media-library-tree-node {
    list-style: none;
}

.media-library-tree-node.is-ancestor > .media-library-tree-row .media-library-tree-link {
    background: rgba(219, 234, 254, 0.55);
}

.media-library-files-panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    height: 100%;
    background: #fff;
}

.media-library-file-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.media-library-file-header,
.media-library-file-row,
.media-library-folder-row {
    display: grid;
    grid-template-columns: 46px minmax(220px, 2fr) 90px minmax(130px, 1.1fr) 120px;
    gap: 0.75rem;
    align-items: center;
}

.media-library-file-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f8fafc;
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
}

.media-library-file-list {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.media-library-file-list.is-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 0.9rem;
    padding: 1rem;
    align-content: start;
    background: #f8fafc;
}

.media-library-file-row,
.media-library-folder-row {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid #eef2f7;
    background: #fff;
    transition: background 0.18s ease;
    cursor: pointer;
    text-align: left;
}

.media-library-file-row:hover,
.media-library-folder-row:hover,
.media-library-file-row.is-selected,
.media-library-file-row.is-active {
    background: #eef5ff;
}

.media-library-folder-row {
    color: #0f172a;
}

.media-library-file-col {
    min-width: 0;
}

.media-library-file-col.check {
    display: flex;
    align-items: center;
    justify-content: center;
}

.media-library-file-col.check .media-library-select-toggle {
    position: static;
    top: auto;
    left: auto;
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}

.media-library-file-col.name {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.media-library-row-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    overflow: hidden;
    flex-shrink: 0;
}

.media-library-row-icon.folder {
    color: #f59e0b;
}

.media-library-row-icon.video {
    color: #0f766e;
}

.media-library-row-icon.image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.media-library-row-name {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
}

.media-library-row-name strong,
.media-library-row-name span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-library-row-name span {
    font-size: 0.75rem;
    color: #64748b;
}

.media-library-folder-tile-explorer,
.media-library-file-tile {
    box-shadow: none;
    border-radius: 14px;
}

.media-library-folder-tile-explorer {
    min-height: 0;
    align-items: flex-start;
    padding: 1rem;
}

.media-library-folder-tile-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(180deg, #fff7d6 0%, #fde68a 100%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #b45309;
}

.media-library-file-tile .media-library-thumb {
    aspect-ratio: 4 / 3;
}

.media-library-file-tile.is-selected,
.media-library-file-tile.is-active {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14);
}

.media-library-file-tile .media-library-select-toggle {
    position: absolute;
}

.media-library-window-statusbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    color: #475569;
    font-size: 0.84rem;
}

/* 媒体网格样式 */
#media-container { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); 
    gap: 10px; 
}

.media-item { 
    aspect-ratio: 1/1; 
    border: 2px solid #e5e7eb; 
    border-radius: var(--border-radius-sm); 
    overflow: hidden; 
    background: #fff; 
    cursor: grab; 
    position: relative; 
    transition: all 0.2s; 
}

.media-item:hover { border-color: #667eea; }
.media-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-add-btn { 
    aspect-ratio: 1/1; 
    border: 2px dashed #d1d5db; 
    border-radius: var(--border-radius-sm); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    cursor: pointer; 
    background: #fafafa; 
    transition: all .2s; 
}

.media-add-btn:hover { 
    border-color: #667eea; 
    background: rgba(102, 126, 234, 0.05); 
}

.media-placeholder { 
    border: 2px dashed #d1d5db; 
    border-radius: var(--border-radius-sm); 
    padding: 40px; 
    text-align: center; 
    background: #fafafa; 
}



/* ==================== 统计卡片 ==================== */
.stat-mini {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: var(--border-radius-sm);
}

.stat-mini .icon-box {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
}

.stat-mini .stat-info .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1;
}

.stat-mini .stat-info .label {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.25rem;
}

/* ==================== 动画 ==================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* ==================== 登录页样式 ==================== */
body.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    min-height: 100vh;
}

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-card {
    background: white;
    border-radius: 24px;
    box-shadow: 0 25px 80px rgba(0,0,0,0.3);
    padding: 3rem;
    width: 100%;
    max-width: 420px;
    animation: slideUp 0.5s ease;
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo .icon-wrap {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    margin-bottom: 1rem;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.login-logo h1 {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.25rem;
}

.login-logo p {
    color: #94a3b8;
    font-size: 0.875rem;
}

.login-btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 0.5rem;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.login-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #f1f5f9;
}

.login-footer a {
    color: #667eea;
    font-size: 0.875rem;
}

/* ==================== 仪表盘样式 ==================== */
.dashboard-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
    color: white;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
}

.dashboard-header h1 {
    color: white !important;
    margin-bottom: 0.5rem;
}

.dashboard-header .subtitle {
    color: rgba(255,255,255,0.85);
}

/* 统计卡片 */
.stat-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(0,0,0,0.04);
    transition: all 0.3s ease;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-hover-shadow);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.stat-card.primary::before { background: linear-gradient(90deg, #667eea, #764ba2); }
.stat-card.info::before { background: linear-gradient(90deg, #17a2b8, #20c997); }
.stat-card.success::before { background: linear-gradient(90deg, #28a745, #20c997); }
.stat-card.warning::before { background: linear-gradient(90deg, #ffc107, #fd7e14); }
.stat-card.danger::before { background: linear-gradient(90deg, #dc3545, #e83e8c); }
.stat-card.link::before { background: linear-gradient(90deg, #3273dc, #667eea); }
.stat-card.dark::before { background: linear-gradient(90deg, #343a40, #495057); }

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.stat-icon.primary { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; }
.stat-icon.info { background: linear-gradient(135deg, #17a2b8 0%, #20c997 100%); color: white; }
.stat-icon.success { background: linear-gradient(135deg, #28a745 0%, #20c997 100%); color: white; }
.stat-icon.warning { background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%); color: white; }
.stat-icon.danger { background: linear-gradient(135deg, #dc3545 0%, #e83e8c 100%); color: white; }
.stat-icon.link { background: linear-gradient(135deg, #3273dc 0%, #667eea 100%); color: white; }
.stat-icon.dark { background: linear-gradient(135deg, #343a40 0%, #495057 100%); color: white; }

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.25rem;
    background: linear-gradient(135deg, #2d3748, #4a5568);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.875rem;
    color: #718096;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: var(--border-radius-pill);
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.75rem;
}

.stat-badge.up {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.stat-badge.down {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.stat-badge.neutral {
    background: rgba(108, 117, 125, 0.1);
    color: #6c757d;
}

/* 活动卡片 */
.activity-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(0,0,0,0.04);
}

.activity-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.activity-stat {
    text-align: center;
    padding: 1rem;
    border-radius: var(--border-radius-sm);
    background: #f7fafc;
    transition: all 0.2s;
}

.activity-stat:hover {
    background: #edf2f7;
}

.activity-stat .value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #2d3748;
}

.activity-stat .label {
    font-size: 0.75rem;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.25rem;
}

.activity-stat.highlight .value {
    color: #667eea;
}

/* 快捷操作 */
.quick-action {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    background: white;
    border-radius: var(--border-radius-sm);
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    border: 1px solid rgba(0,0,0,0.04);
    transition: all 0.3s ease;
    text-decoration: none;
    color: #4a5568;
    gap: 1rem;
}

.quick-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    color: #667eea;
}

.quick-action .action-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--border-radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    flex-shrink: 0;
}

.quick-action .action-text {
    font-weight: 600;
    font-size: 0.9375rem;
}

.quick-action .action-desc {
    font-size: 0.75rem;
    color: #a0aec0;
    margin-top: 0.125rem;
}

/* 迷你图表 */
.mini-chart {
    height: 60px;
    display: flex;
    align-items: flex-end;
    gap: 3px;
    margin-top: 1rem;
}

.mini-chart .bar {
    flex: 1;
    background: linear-gradient(180deg, #667eea, #764ba2);
    border-radius: 4px 4px 0 0;
    min-height: 4px;
    transition: height 0.3s ease;
    opacity: 0.7;
}

.mini-chart .bar:hover {
    opacity: 1;
}

/* ==================== 头像样式 ==================== */
.avatar-circle {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--border-radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

.avatar-circle.info {
    background: linear-gradient(135deg, #17a2b8 0%, #20c997 100%);
}

.avatar-circle.lg {
    width: 100px;
    height: 100px;
    font-size: 2.5rem;
    border-radius: 50%;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

/* ==================== 图片选择预览框 ==================== */
.logo-preview-box:hover,
.favicon-preview-box:hover,
.og-image-preview-box:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.logo-preview-box img,
.favicon-preview-box img,
.og-image-preview-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* ==================== 辅助工具类 ==================== */
.rounded-lg { border-radius: var(--border-radius); }

/* ==================== 移动端响应式 ==================== */
@media screen and (max-width: 1023px) {
    .admin-subnav .container {
        padding: 0 0.5rem;
    }

    .page-header {
        padding: 1.25rem 1.5rem;
        margin-bottom: 1.5rem;
    }
}

@media screen and (max-width: 768px) {
    .page-header {
        border-radius: var(--border-radius-sm);
        padding: 1rem 1.25rem;
    }
    
    .modern-tabs {
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    .modern-tabs::-webkit-scrollbar { display: none; }
    
    .stat-value {
        font-size: 2rem;
    }

    .media-library-modal-card {
        width: calc(100vw - 1rem);
    }

    .media-library-window-main {
        grid-template-columns: 1fr;
    }

    .media-library-tree-panel,
    .media-library-preview-panel {
        border: none;
        border-top: 1px solid #e5e7eb;
    }

    .media-library-file-header {
        display: none;
    }

    .media-library-file-toolbar {
        flex-wrap: wrap;
    }

    .media-library-file-row,
    .media-library-folder-row {
        grid-template-columns: 40px minmax(0, 1fr);
    }

    .media-library-toolbar-buttons {
        justify-content: stretch;
    }

    .media-library-toolbar-buttons > * {
        width: 100%;
    }

    .media-library-file-col.type,
    .media-library-file-col.folder,
    .media-library-file-col.size,
    .media-library-file-col.date {
        display: none;
    }
}


#editor-wrapper {
    border: 1px solid #e5e7eb;
    border-radius: var(--border-radius-xs);
    background: #fff;
    overflow: hidden;
}

#editor-wrapper .jodit-container:not(.jodit_inline) {
    border: none;
    border-radius: inherit;
}

#editor-wrapper .jodit-toolbar__box:not(:empty) {
    border-bottom: 1px solid #e5e7eb;
    background: #fafaf9;
}

#editor-wrapper .jodit-workplace {
    min-height: 600px;
}

#editor-wrapper .jodit-wysiwyg,
#editor-wrapper .jodit-source__mirror {
    font-size: 16px;
    line-height: 1.8;
    padding: 2rem;
}

#editor-wrapper .jodit-status-bar {
    border-top: 1px solid #e5e7eb;
}

.jodit_fullsize,
.jodit-container.jodit_fullsize {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    z-index: 100000 !important;
    border-radius: 0 !important;
    background: #fff !important;
}

.jodit_fullsize {
    display: flex !important;
    flex-direction: column !important;
}

.jodit_fullsize .jodit-workplace {
    flex: 1 1 auto;
    min-height: 0;
}

.jodit_fullsize .jodit-wysiwyg,
.jodit_fullsize .jodit-source__mirror {
    min-height: 100% !important;
}

.editor-fullscreen-active {
    overflow: hidden !important;
}

html.media-library-modal-open,
body.media-library-modal-open {
    overflow: hidden !important;
}

.editor-fullscreen-host {
    transform: none !important;
    animation: none !important;
    overflow: visible !important;
    opacity: 1 !important;
}

html.jodit_fullsize-box_true,
body.jodit_fullsize-box_true {
    overflow: hidden;
}

.category-tree-table .tree-line {
    opacity: 0.5;
}

.category-tree-table tr.level-1 {
    background: rgba(0, 0, 0, 0.01);
}

.category-tree-table tr.level-2 {
    background: rgba(0, 0, 0, 0.02);
}

.category-tree-table tr.level-3 {
    background: rgba(0, 0, 0, 0.03);
}

.media-preview-wrap {
    position: relative;
}

.media-preview {
    width: 100%;
    aspect-ratio: 1/1;
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
    transition: all 0.2s;
}

.media-preview:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.media-preview:not(.is-empty) {
    border-style: solid;
    border-color: #e5e7eb;
}

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

.explorer-shell {
    padding: 0;
    overflow: hidden;
}

.explorer-topbar,
.explorer-toolbar,
.explorer-statusbar {
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(180deg, #fafcff 0%, #f8fafc 100%);
}

.explorer-topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
}

.explorer-topbar-left {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.explorer-app-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: #dbeafe;
    color: #2563eb;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.explorer-app-title {
    font-size: 1rem;
    color: #0f172a;
}

.explorer-breadcrumbs {
    flex: 1;
    min-width: 280px;
}

.explorer-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1.25rem;
}

.explorer-filter-bar {
    min-width: 380px;
    flex: 1;
}

.explorer-main {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr) 310px;
    min-height: 720px;
}

.explorer-sidebar,
.explorer-content,
.explorer-preview-pane {
    min-width: 0;
}

.explorer-sidebar,
.explorer-preview-pane {
    background: #f8fafc;
}

.explorer-sidebar {
    border-right: 1px solid #e5e7eb;
}

.explorer-preview-pane {
    border-left: 1px solid #e5e7eb;
    padding: 1rem;
}

.explorer-pane-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    margin-bottom: 0.9rem;
}

.explorer-tree {
    padding: 1rem;
}

.explorer-tree-root,
.explorer-tree-link {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    border-radius: 10px;
    color: #1e293b;
    padding: 0.45rem 0.65rem;
    margin-bottom: 0.2rem;
}

.explorer-tree-root:hover,
.explorer-tree-link:hover {
    background: #e8eefc;
}

.explorer-tree-root.is-current,
.explorer-tree-node.is-current > .explorer-tree-link {
    background: #dbeafe;
    color: #1d4ed8;
    font-weight: 600;
}

.explorer-tree-list {
    margin: 0;
    padding-left: 0.85rem;
}

.explorer-tree-node {
    list-style: none;
}

.explorer-tree-node.is-ancestor > .explorer-tree-link {
    background: rgba(219, 234, 254, 0.55);
}

.explorer-content {
    background: #fff;
    display: flex;
    flex-direction: column;
}

.explorer-location-bar {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid #e5e7eb;
    color: #475569;
    font-size: 0.92rem;
}

.explorer-folder-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1rem 1.1rem 0;
}

.explorer-folder-chip {
    min-width: 150px;
    border: 1px solid #dbe4f0;
    border-radius: 12px;
    background: #f8fafc;
    color: #1e293b;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.7rem 0.85rem;
}

.explorer-folder-chip > span:first-child {
    color: #f59e0b;
}

.explorer-folder-chip small {
    margin-left: auto;
    color: #64748b;
}

.explorer-file-header,
.explorer-file-row {
    display: grid;
    grid-template-columns: 54px minmax(260px, 2fr) 110px 110px 140px 110px;
    align-items: center;
    gap: 0.75rem;
}

.explorer-file-header {
    padding: 0.75rem 1.1rem;
    margin-top: 1rem;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    background: #f8fafc;
    color: #475569;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.explorer-file-list {
    display: flex;
    flex-direction: column;
}

.explorer-file-row {
    padding: 0.8rem 1.1rem;
    border-bottom: 1px solid #eef2f7;
    transition: background 0.18s ease;
    cursor: pointer;
}

.explorer-file-row:hover,
.explorer-file-row.is-active {
    background: #eef5ff;
}

.explorer-check-cell {
    display: flex;
    align-items: center;
    justify-content: center;
}

.explorer-name-cell {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    min-width: 0;
}

.explorer-thumb {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    overflow: hidden;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    flex-shrink: 0;
}

.explorer-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.explorer-name-meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
}

.explorer-name-meta strong,
.explorer-name-meta span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.explorer-name-meta span {
    color: #64748b;
    font-size: 0.75rem;
}

.explorer-actions {
    display: flex;
    gap: 0.4rem;
    justify-content: flex-end;
}

.explorer-preview-empty,
.explorer-preview-panel {
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #fff;
}

.explorer-preview-empty {
    min-height: 520px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    text-align: center;
    padding: 1.5rem;
}

.explorer-preview-panel {
    padding: 1rem;
}

.explorer-preview-box {
    aspect-ratio: 4 / 3;
    border-radius: 14px;
    background: #f8fafc;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.explorer-preview-box img,
.explorer-preview-box video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.explorer-preview-meta {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.explorer-meta-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.explorer-meta-row span {
    font-size: 0.74rem;
    color: #64748b;
}

.explorer-meta-row strong {
    color: #0f172a;
    word-break: break-word;
}

.explorer-statusbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.1rem;
    padding: 0.75rem 1.1rem;
    border-top: 1px solid #e5e7eb;
    border-bottom: none;
    color: #475569;
    font-size: 0.84rem;
}

.explorer-empty-state {
    padding: 3rem 1.5rem;
    text-align: center;
    color: #94a3b8;
}
