/* ============================================================
   五行心理后台管理系统 — 公共样式
   登录页（五行暗夜禅） + 后台 Shell + Element 覆盖 + Quill 暗色
   ============================================================ */

/* ----- CSS 变量 ----- */
:root {
    --bg-deep: #080b0f;
    --bg-card: rgba(18, 20, 28, 0.88);
    --border-card: rgba(255, 255, 255, 0.06);
    --gold: #c9a96e;
    --gold-light: #e8d098;
    --wood: #5b8c5a;
    --water-1: #1a1a2e;
    --water-2: #16213e;
    --water-3: #0f3460;
    --fire: #c4564a;
    --fire-glow: #e8734a;
    --earth: #b8a088;
    --text-primary: #e8e0d5;
    --text-secondary: #9c9588;
    --text-muted: #6b6458;
    --radius: 16px;
    --font-display: 'Noto Serif SC', 'STSong', 'SimSun', serif;
}

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

/* ============================================================
   登录页 — 五行暗夜禅
   ============================================================ */
.login-wrapper {
    min-height: 100vh;
    background: var(--bg-deep);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    font-family: var(--font-display);
}

/* 水墨纹理背景层 */
.login-bg-layer {
    position: absolute; inset: 0;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(201, 169, 110, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 30%, rgba(91, 140, 90, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(15, 52, 96, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(196, 86, 74, 0.04) 0%, transparent 40%),
        radial-gradient(ellipse at 10% 70%, rgba(184, 160, 136, 0.04) 0%, transparent 40%);
}

/* 粒子层 */
.particles { position: absolute; inset: 0; pointer-events: none; }
.particle {
    position: absolute; border-radius: 50%;
    animation: floatUp linear infinite;
    opacity: 0;
}
@keyframes floatUp {
    0% { transform: translateY(0) scale(1); opacity: 0; }
    10% { opacity: 0.7; }
    90% { opacity: 0.1; }
    100% { transform: translateY(-100vh) scale(0.3); opacity: 0; }
}

/* 五行圆环装饰 */
.wuxing-ring {
    position: absolute; border-radius: 50%;
    border: 1px solid transparent;
    animation: ringRotate 30s linear infinite;
}
.wuxing-ring:nth-child(1) {
    width: 600px; height: 600px;
    border-color: rgba(201, 169, 110, 0.08);
    top: 50%; left: 50%; transform: translate(-50%, -50%);
    animation-duration: 40s;
}
.wuxing-ring:nth-child(2) {
    width: 450px; height: 450px;
    border-color: rgba(91, 140, 90, 0.06);
    top: 50%; left: 50%; transform: translate(-50%, -50%);
    animation-duration: 35s; animation-direction: reverse;
}
.wuxing-ring:nth-child(3) {
    width: 300px; height: 300px;
    border-color: rgba(15, 52, 96, 0.1);
    top: 50%; left: 50%; transform: translate(-50%, -50%);
    animation-duration: 25s;
}
@keyframes ringRotate {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* 五元素浮动标记 */
.element-mark {
    position: absolute; font-size: 14px; color: var(--text-muted);
    animation: elementFloat 6s ease-in-out infinite;
    pointer-events: none; user-select: none;
    font-family: var(--font-display);
    letter-spacing: 4px;
    writing-mode: vertical-rl;
}
.element-mark.jin { top: 15%; left: 8%; color: rgba(201, 169, 110, 0.25); animation-delay: 0s; }
.element-mark.mu  { top: 20%; right: 8%; color: rgba(91, 140, 90, 0.25); animation-delay: 1s; }
.element-mark.shui{ bottom: 18%; left: 10%; color: rgba(100, 140, 200, 0.25); animation-delay: 2s; }
.element-mark.huo { bottom: 15%; right: 10%; color: rgba(196, 86, 74, 0.25); animation-delay: 3s; }
.element-mark.tu  { top: 50%; left: 4%; color: rgba(184, 160, 136, 0.25); animation-delay: 4s; }
@keyframes elementFloat {
    0%, 100% { transform: translateY(0); opacity: 0.25; }
    50% { transform: translateY(-18px); opacity: 0.55; }
}

/* 登录卡片 */
.login-card-wrap {
    position: relative; z-index: 10;
    width: 420px; padding: 48px 44px 40px;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: 0 8px 40px rgba(0,0,0,0.5), 0 0 80px rgba(201,169,110,0.04);
    animation: cardIn 0.8s ease-out;
}
@keyframes cardIn {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 顶部五行图标 */
.wuxing-icon-row {
    display: flex; justify-content: center; gap: 16px; margin-bottom: 28px;
}
.wx-dot {
    width: 10px; height: 10px; border-radius: 50%;
    animation: dotPulse 2s ease-in-out infinite;
}
.wx-dot:nth-child(1) { background: #c9a96e; animation-delay: 0s; }    /* 金 */
.wx-dot:nth-child(2) { background: #5b8c5a; animation-delay: 0.2s; }  /* 木 */
.wx-dot:nth-child(3) { background: #4a8bbf; animation-delay: 0.4s; }  /* 水 */
.wx-dot:nth-child(4) { background: #c4564a; animation-delay: 0.6s; }  /* 火 */
.wx-dot:nth-child(5) { background: #b8a088; animation-delay: 0.8s; }  /* 土 */
@keyframes dotPulse {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.8); opacity: 1; }
}

/* 登录标题 */
.login-title {
    text-align: center; margin-bottom: 8px;
    font-size: 28px; font-weight: 700; color: var(--text-primary);
    letter-spacing: 6px;
}
.login-title .accent { color: var(--gold); }
.login-subtitle {
    text-align: center; margin-bottom: 32px;
    font-size: 13px; color: var(--text-secondary);
    letter-spacing: 4px;
}

/* 登录表单：覆盖 Element UI */
.login-card-wrap .el-form-item { margin-bottom: 22px; }
.login-card-wrap .el-input__inner {
    background: rgba(255,255,255,0.04) !important;
    border: 1px solid rgba(255,255,255,0.08) !important;
    border-radius: 10px !important;
    color: var(--text-primary) !important;
    height: 48px !important;
    font-size: 15px !important;
    padding-left: 44px !important;
    transition: border-color 0.3s, box-shadow 0.3s;
}
.login-card-wrap .el-input__inner:focus {
    border-color: var(--gold) !important;
    box-shadow: 0 0 0 3px rgba(201, 169, 110, 0.1) !important;
}
.login-card-wrap .el-input__inner::placeholder { color: var(--text-muted) !important; }
.login-card-wrap .el-input__prefix { left: 14px; color: var(--text-muted); }

/* 登录按钮 */
.btn-login {
    width: 100%; height: 48px; border: none !important;
    border-radius: 10px !important;
    font-size: 16px !important; font-weight: 600 !important;
    letter-spacing: 6px;
    background: linear-gradient(135deg, #8b7340 0%, #c9a96e 50%, #8b7340 100%) !important;
    background-size: 200% 100% !important;
    color: #1a1a1a !important;
    transition: all 0.4s !important;
    font-family: var(--font-display);
    margin-top: 4px;
}
.btn-login:hover {
    background-size: 200% 100% !important;
    animation: shimmer 1.2s ease infinite;
    box-shadow: 0 4px 24px rgba(201, 169, 110, 0.3) !important;
}
@keyframes shimmer {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 登录错误 */
.login-error-wrap { margin-bottom: 18px; }
.login-error-wrap .el-alert {
    background: rgba(196, 86, 74, 0.12) !important;
    border: 1px solid rgba(196, 86, 74, 0.2) !important;
    border-radius: 10px !important;
}
.login-error-wrap .el-alert__title { color: #e8a090 !important; font-size: 13px; }

/* 登录底部 */
.login-footer {
    text-align: center; margin-top: 28px;
    font-size: 11px; color: var(--text-muted);
    letter-spacing: 2px;
}

/* ============================================================
   后台 Shell
   ============================================================ */
body { font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif; }

/* 侧边栏 */
.sidebar { width: 220px; position: fixed; left: 0; top: 0; bottom: 0; background: #1a1f2e; overflow-y: auto; z-index: 100; }
.logo { height: 60px; display: flex; align-items: center; justify-content: center; color: #e8e0d5; font-size: 17px; font-weight: bold; background: rgba(0,0,0,0.2); font-family: var(--font-display); letter-spacing: 4px; }
.logo span { color: var(--gold); }
.sidebar .el-menu { border-right: none; background: #1a1f2e !important; }
.sidebar .el-menu .el-menu-item,
.sidebar .el-menu .el-submenu__title { color: #9c9588 !important; }
.sidebar .el-menu .el-menu-item:hover,
.sidebar .el-menu .el-submenu__title:hover { background: rgba(201,169,110,0.08) !important; color: #e8e0d5 !important; }
.sidebar .el-menu .el-menu-item.is-active { color: var(--gold) !important; background: rgba(201,169,110,0.1) !important; }

/* 主内容区 */
.main { margin-left: 220px; min-height: 100vh; background: #f0f2f5; }
.header { height: 60px; background: #fff; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.header-right { display: flex; align-items: center; gap: 15px; }
.content { padding: 20px; }
.page-header { margin-bottom: 20px; }
.page-header h2 { font-size: 20px; color: #303133; }
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.stat-card .num { font-size: 28px; font-weight: bold; margin: 8px 0 4px; }
.stat-card .label { color: #909399; font-size: 14px; }
.stat-card .sub { font-size: 12px; color: #909399; }

/* 颜色工具 */
.blue { color: #409EFF; }
.green { color: #67C23A; }
.orange { color: #E6A23C; }
.red { color: #F56C6C; }

/* 标签栏 */
.tab-bar-wrap { background: #fff; border-bottom: 1px solid #e4e7ed; padding: 0 16px; display: flex; align-items: center; }
/* min-width:0 是关键：flex 子项默认 min-width:auto，会让 el-tabs 撑到所有 tab 的总宽，
   把右侧「关闭所有」按钮挤出可视区；设为 0 后 el-tabs 可收缩，内部 nav 自动出现左右滚动箭头 */
.tab-bar-wrap .el-tabs { flex: 1; min-width: 0; }
.tab-bar-wrap .el-tabs--card>.el-tabs__header { border-bottom: none; margin-bottom: 0; }
.tab-bar-wrap .el-tabs--card>.el-tabs__header .el-tabs__nav { border: none; border-radius: 0; }
.tab-bar-wrap .el-tabs--card>.el-tabs__header .el-tabs__item { border: none; border-right: 1px solid #ebeef5; border-radius: 0; height: 34px; line-height: 34px; color: #606266; font-size: 12px; margin-right: 0; }
.tab-bar-wrap .el-tabs--card>.el-tabs__header .el-tabs__item.is-active { background: #f0f2f5; color: #409EFF; font-weight: 500; }
.tab-bar-wrap .el-tabs--card>.el-tabs__header .el-tabs__item:first-child { border-left: 1px solid #ebeef5; }
.tab-bar-wrap .el-tabs--card>.el-tabs__header .el-tabs__item .el-icon-close { font-size: 10px; color: #909399; width: 14px; height: 14px; line-height: 14px; text-align: center; border-radius: 50%; transition: all .2s; }
.tab-bar-wrap .el-tabs--card>.el-tabs__header .el-tabs__item .el-icon-close:hover { color: #fff; background: #f56c6c; }
.close-all-btn { font-size: 12px; color: #909399; flex-shrink: 0; margin-left: 8px; }
.close-all-btn:hover { color: #f56c6c; }
.close-all-btn i { font-size: 13px; margin-right: 2px; }
.clear-cache-btn { font-size: 12px; color: #909399; }
.clear-cache-btn:hover { color: #409EFF; }
.clear-cache-btn i { font-size: 13px; margin-right: 2px; }

/* 表格工具栏 */
.toolbar { margin-bottom: 15px; display: flex; gap: 10px; }

/* ============================================================
   Quill 富文本编辑器 — 暗色主题覆盖
   ============================================================ */
.ql-toolbar.ql-snow {
    border-color: rgb(0 0 0 / 18%);
    border-radius: var(--radius) var(--radius) 0 0;
    background: rgba(255,255,255,0.04);
}
.ql-container.ql-snow {
    border-color: rgb(0 0 0 / 18%);
    border-radius: 0 0 var(--radius) var(--radius);
    background: transparent;
    font-size: 14px;
}
.ql-editor { color: #000; }
.ql-snow .ql-stroke { stroke: var(--text-secondary); }
.ql-snow .ql-fill { fill: var(--text-secondary); }
.ql-snow .ql-picker { color: var(--text-secondary); }
.ql-snow .ql-picker-options {
    background: #1a1d24;
    border-color: rgba(255,255,255,0.1);
}
.ql-snow .ql-tooltip {
    background: #1a1d24;
    border-color: rgba(255,255,255,0.1);
    color: var(--text-primary);
}
.ql-snow .ql-tooltip input[type=text] {
    background: rgba(0,0,0,0.4);
    border-color: rgba(255,255,255,0.15);
    color: var(--text-primary);
}
.ql-editor.ql-blank::before { color: var(--text-muted); font-style: normal; }
#articleDrawerEditor .ql-editor { min-height: 300px; }
#productEditor .ql-editor { min-height: 160px; }
#productEditEditor .ql-editor { min-height: 160px; }

/* ============================================================
   管理列表页统一设计系统（东方美学 · 金色主题）
   通过全局覆盖让所有列表页自动统一，无需逐页改 HTML
   ============================================================ */

/* 页面标题：金色竖条装饰，去冗余突兀感 */
.page-header {
    margin-bottom: 16px;
    padding-left: 12px;
    border-left: 3px solid var(--gold);
}
.page-header h2 {
    font-size: 18px;
    color: #1a1f2e;
    font-weight: 600;
    letter-spacing: 1px;
}

/* 卡片容器：去默认灰色边框，统一白底圆角 + 轻阴影 */
.content .el-card {
    border: none !important;
    border-radius: 8px !important;
    box-shadow: 0 1px 4px rgba(20, 24, 40, 0.06) !important;
}

/* 卡片头部：浅金底 + 加粗（用于仪表盘"近7天趋势""最近订单"等） */
.content .el-card__header {
    background: #faf7f0;
    border-bottom: 1px solid #f0ead9;
    font-weight: 600;
    color: #4a4032;
    border-radius: 8px 8px 0 0;
}

/* 表格表头：浅金底 + 深棕字，呼应侧边栏金色 */
.content .el-table th {
    background: #faf7f0 !important;
    color: #5a4f3c !important;
    font-weight: 600;
}

/* 表格行分隔线：柔和的米金，替代默认冷灰 */
.content .el-table th,
.content .el-table td {
    border-bottom: 1px solid #f2ecdc;
}

/* 工具栏：统一间距，操作按钮与筛选控件同行 */
.toolbar {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* 工具栏右侧操作区（新增/调整等主操作按钮右置） */
.toolbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 余额/结果提示条（积分余额查询等只读结果展示） */
.balance-tip {
    margin-bottom: 12px;
    padding: 10px 14px;
    background: #faf7f0;
    border: 1px solid #f0ead9;
    border-radius: 6px;
    color: #5a4f3c;
    font-size: 13px;
}
.balance-tip strong {
    color: #c9a96e;
    font-size: 16px;
    margin: 0 4px;
}

/* ============================================================
   媒体缩略图（素材/Banner/商品封面等列表的「预览」列通用形态）
   图片渲染本体、视频叠播放角标、音频与文件退化为图标，
   让运营一眼分辨行的媒体类型，而不是看一个「视频」「音频」文字标签。
   ============================================================ */
.media-thumb {
    position: relative;
    width: 52px;
    height: 52px;
    border-radius: 6px;
    border: 1px solid #efe8d8;
    background: #faf7f0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.media-thumb .el-image,
.media-thumb img {
    width: 100%;
    height: 100%;
    display: block;
}
.media-thumb img { object-fit: cover; }

/* 类型图标：无图可显示时的兜底形态 */
.media-thumb-icon { font-size: 22px; color: #b9b2a2; }
.is-video .media-thumb-icon { color: #c9a96e; }
.is-audio .media-thumb-icon { color: #5a9e8f; }
.is-file  .media-thumb-icon { color: #8a8fa3; }

/* 视频播放角标：压在封面右下，示意「点开是播放器」 */
.media-thumb-play {
    position: absolute;
    right: 3px;
    bottom: 3px;
    font-size: 14px;
    color: #fff;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.6);
    pointer-events: none;
}

/* 详情抽屉内的媒体展示区 */
.media-detail-stage {
    background: #1a1f2e;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}
.media-detail-stage img,
.media-detail-stage video {
    max-width: 100%;
    max-height: 320px;
    border-radius: 6px;
    display: block;
    margin: 0 auto;
}
.media-detail-file {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 26px 12px;
    background: #faf7f0;
    border: 1px dashed #e6dcc6;
    border-radius: 8px;
}
.media-detail-file i { font-size: 40px; color: #8a8fa3; }
.media-detail-file .media-detail-filename {
    font-size: 13px;
    color: #5a4f3c;
    word-break: break-all;
    text-align: center;
}
