新增产品公共内容模板

This commit is contained in:
张锐 committed 2026-11-26 11:00:45 +08:00
1 parent 4345bef876
commit f26b663e46
30 files changed
+1069 -18

No files matched your search

+178 -2
View File
@@ -58,6 +58,16 @@ type MediaItem = {
mediaType: string;
altText?: string;
};
type ContentTemplate = {
/** 模板业务编号。 */
templateCode: string;
/** 模板名称。 */
templateName: string;
/** 模板用途说明。 */
description: string;
/** 模板发布状态。 */
status: string;
};
type ProductCategory = {
categoryCode: string;
parentCategoryCode: string;
@@ -146,6 +156,8 @@ export default function ProductEditor({ productCode, onBack }: Props) {
slug: "",
model: "",
summary: "",
contentTemplateCode: "",
templatePosition: "AFTER",
primaryCategoryCode: "",
coverMediaCode: "",
coverMediaUrl: "",
@@ -160,6 +172,9 @@ export default function ProductEditor({ productCode, onBack }: Props) {
const [categories, setCategories] = useState<ProductCategoryOption[]>([]);
const [categoriesLoading, setCategoriesLoading] = useState(true);
const [categoriesError, setCategoriesError] = useState("");
const [contentTemplates, setContentTemplates] = useState<ContentTemplate[]>(
[],
);
const [seo, setSeo] = useState({
title: "",
description: "",
@@ -207,6 +222,13 @@ export default function ProductEditor({ productCode, onBack }: Props) {
active = false;
};
}, []);
useEffect(() => {
post("/products/templates/list", { siteCode: SITE })
.then((data) => setContentTemplates(data.items || []))
.catch((error) =>
setNotice(error instanceof Error ? error.message : "产品模板加载失败"),
);
}, []);
useEffect(() => {
if (!productCode) return;
post("/products/detail", { siteCode: SITE, productCode }).then((d) => {
@@ -357,6 +379,8 @@ export default function ProductEditor({ productCode, onBack }: Props) {
model: form.model,
summary: form.summary,
productContent: normalizeRichTextHtml(editor.getHTML()),
contentTemplateCode: form.contentTemplateCode,
templatePosition: form.templatePosition,
coverMediaCode: images[0]?.mediaCode || "",
images: images.map((image, index) => ({
mediaCode: image.mediaCode,
@@ -502,7 +526,14 @@ export default function ProductEditor({ productCode, onBack }: Props) {
<section className="edit-section product-cover-section">
<div className="section-head">
<h2>产品图片</h2>
<button type="button" className="gallery-upload-button" onClick={() => void openMediaLibrary()}><Plus size={16} />从素材库添加</button>
<button
type="button"
className="gallery-upload-button"
onClick={() => void openMediaLibrary()}
>
<Plus size={16} />
从素材库添加
</button>
<label
className={`gallery-upload-button${uploading ? " uploading" : ""}`}
>
@@ -739,6 +770,59 @@ export default function ProductEditor({ productCode, onBack }: Props) {
</div>
))}
</section>
<section className="edit-section">
<h2>公共内容模板</h2>
<div className="edit-grid">
<Field label="选择模板">
<select
value={form.contentTemplateCode || ""}
onChange={(event) =>
setForm({
...form,
contentTemplateCode: event.target.value,
})
}
>
<option value="">不使用公共模板</option>
{contentTemplates.map((template) => (
<option
key={template.templateCode}
value={template.templateCode}
disabled={template.status !== "PUBLISHED"}
>
{template.templateName}
{template.status !== "PUBLISHED" ? "(未发布)" : ""}
</option>
))}
</select>
</Field>
<Field label="插入位置">
<select
value={form.templatePosition || "AFTER"}
disabled={!form.contentTemplateCode}
onChange={(event) =>
setForm({
...form,
templatePosition: event.target.value,
})
}
>
<option value="BEFORE">产品独立详情之前</option>
<option value="AFTER">产品独立详情之后</option>
</select>
</Field>
{form.contentTemplateCode && (
<p className="wide template-selection-note">
{
contentTemplates.find(
(template) =>
template.templateCode === form.contentTemplateCode,
)?.description
}
</p>
)}
</div>
</section>
<section className="edit-section">
<h2>产品详情 *</h2>
<div className="rich-editor">
@@ -931,7 +1015,99 @@ export default function ProductEditor({ productCode, onBack }: Props) {
</section>
</aside>
</div>
{mediaOpen && <div className="media-picker-backdrop" onMouseDown={() => setMediaOpen(false)}><section className="media-picker" role="dialog" aria-modal="true" onMouseDown={(event) => event.stopPropagation()}><header><h2>素材库</h2><button type="button" onClick={() => setMediaOpen(false)}><X size={20}/></button></header><div className="media-picker-toolbar"><label><Search size={16}/><input placeholder="搜索图片名称" value={mediaQuery} onChange={(event) => setMediaQuery(event.target.value)}/></label><label className="media-local-upload"><Plus size={16}/>上传本地图片<input ref={coverInputRef} multiple disabled={uploading} type="file" accept=".jpg,.jpeg,.png,.webp,.gif,image/jpeg,image/png,image/webp,image/gif" onChange={(event) => void upload(event.currentTarget.files)}/></label></div><div className="media-picker-grid">{mediaLoading?<div className="media-picker-empty">加载中...</div>:mediaItems.filter(item => !mediaQuery || item.originalFileName.toLowerCase().includes(mediaQuery.toLowerCase())).map(item=><button type="button" className={`media-picker-item${selectedMedia.includes(item.mediaCode)?' selected':''}`} key={item.mediaCode} onClick={() => setSelectedMedia(current => current.includes(item.mediaCode)?current.filter(code => code!==item.mediaCode):[...current,item.mediaCode])}><img src={assetUrl(item.url)} alt={item.originalFileName}/><span>{selectedMedia.includes(item.mediaCode)&&<Check size={15}/>} {item.originalFileName}</span></button>)}</div><footer><button type="button" onClick={() => setMediaOpen(false)}>取消</button><button type="button" className="primary" onClick={confirmMediaSelection}>确定({selectedMedia.length})</button></footer></section></div>}
{mediaOpen && (
<div
className="media-picker-backdrop"
onMouseDown={() => setMediaOpen(false)}
>
<section
className="media-picker"
role="dialog"
aria-modal="true"
onMouseDown={(event) => event.stopPropagation()}
>
<header>
<h2>素材库</h2>
<button type="button" onClick={() => setMediaOpen(false)}>
<X size={20} />
</button>
</header>
<div className="media-picker-toolbar">
<label>
<Search size={16} />
<input
placeholder="搜索图片名称"
value={mediaQuery}
onChange={(event) => setMediaQuery(event.target.value)}
/>
</label>
<label className="media-local-upload">
<Plus size={16} />
上传本地图片
<input
ref={coverInputRef}
multiple
disabled={uploading}
type="file"
accept=".jpg,.jpeg,.png,.webp,.gif,image/jpeg,image/png,image/webp,image/gif"
onChange={(event) => void upload(event.currentTarget.files)}
/>
</label>
</div>
<div className="media-picker-grid">
{mediaLoading ? (
<div className="media-picker-empty">加载中...</div>
) : (
mediaItems
.filter(
(item) =>
!mediaQuery ||
item.originalFileName
.toLowerCase()
.includes(mediaQuery.toLowerCase()),
)
.map((item) => (
<button
type="button"
className={`media-picker-item${selectedMedia.includes(item.mediaCode) ? " selected" : ""}`}
key={item.mediaCode}
onClick={() =>
setSelectedMedia((current) =>
current.includes(item.mediaCode)
? current.filter((code) => code !== item.mediaCode)
: [...current, item.mediaCode],
)
}
>
<img
src={assetUrl(item.url)}
alt={item.originalFileName}
/>
<span>
{selectedMedia.includes(item.mediaCode) && (
<Check size={15} />
)}{" "}
{item.originalFileName}
</span>
</button>
))
)}
</div>
<footer>
<button type="button" onClick={() => setMediaOpen(false)}>
取消
</button>
<button
type="button"
className="primary"
onClick={confirmMediaSelection}
>
确定({selectedMedia.length})
</button>
</footer>
</section>
</div>
)}
</div>
);
}
+482
View File
@@ -0,0 +1,482 @@
import { useEffect, useState } from "react";
import { EditorContent, useEditor } from "@tiptap/react";
import StarterKit from "@tiptap/starter-kit";
import Image from "@tiptap/extension-image";
import {
Bold,
Check,
Heading2,
Heading3,
Image as ImageIcon,
Italic,
List,
Pencil,
Plus,
Redo2,
Save,
Search,
Trash2,
Undo2,
X,
} from "lucide-react";
import { apiPost, assetUrl } from "./api";
import { statusLabel } from "./statusLabels";
const SITE = "SIT0000000000001";
type ProductTemplate = {
/** 模板业务编号。 */ templateCode: string;
/** 模板名称。 */ templateName: string;
/** 模板用途说明。 */ description: string;
/** 模板英文富文本内容。 */ templateContent: string;
/** 发布状态。 */ status: string;
/** 排序值。 */ sortNo: number;
/** 更新时间毫秒时间戳。 */ updateTime?: number;
};
type MediaItem = {
/** 素材业务编号。 */ mediaCode: string;
/** 素材访问地址。 */ url: string;
/** 原始文件名。 */ originalFileName: string;
/** 图片替代文本。 */ altText?: string;
};
const emptyTemplate: ProductTemplate = {
templateCode: "",
templateName: "",
description: "",
templateContent: "<p></p>",
status: "DRAFT",
sortNo: 30,
};
/** 产品公共详情模板列表和编辑页面。 */
export default function ProductTemplateManager() {
const [items, setItems] = useState<ProductTemplate[]>([]);
const [editing, setEditing] = useState<ProductTemplate | null>(null);
const [loading, setLoading] = useState(true);
const [saving, setSaving] = useState(false);
const [notice, setNotice] = useState("");
const [query, setQuery] = useState("");
const [mediaOpen, setMediaOpen] = useState(false);
const [mediaItems, setMediaItems] = useState<MediaItem[]>([]);
const [selectedMediaCodes, setSelectedMediaCodes] = useState<string[]>([]);
const [mediaQuery, setMediaQuery] = useState("");
const editor = useEditor({
extensions: [StarterKit, Image],
content: "<p></p>",
});
/** 加载当前站点全部产品内容模板。 */
const loadTemplates = async () => {
setLoading(true);
try {
const data = await apiPost("/products/templates/list", {
siteCode: SITE,
});
setItems(data.items || []);
} catch (error) {
setNotice(error instanceof Error ? error.message : "模板加载失败");
} finally {
setLoading(false);
}
};
useEffect(() => {
void loadTemplates();
}, []);
/** 打开新增或编辑表单。 */
const openEditor = (template?: ProductTemplate) => {
const value = template ? { ...template } : { ...emptyTemplate };
setEditing(value);
editor?.commands.setContent(value.templateContent || "<p></p>");
setNotice("");
};
/** 保存产品公共详情模板。 */
const saveTemplate = async () => {
if (!editing || !editor) return;
try {
setSaving(true);
const result = await apiPost("/products/templates/save", {
templateCode: editing.templateCode || null,
siteCode: SITE,
templateName: editing.templateName,
description: editing.description,
templateContent: editor.getHTML(),
status: editing.status,
sortNo: editing.sortNo,
});
setNotice("产品内容模板已保存");
setEditing({ ...editing, templateCode: result.templateCode });
await loadTemplates();
} catch (error) {
setNotice(error instanceof Error ? error.message : "模板保存失败");
} finally {
setSaving(false);
}
};
/** 删除未被产品使用的模板。 */
const deleteTemplate = async (template: ProductTemplate) => {
if (!window.confirm(`确定删除模板“${template.templateName}”吗?`)) return;
try {
await apiPost("/products/templates/delete", {
siteCode: SITE,
templateCode: template.templateCode,
});
setNotice("模板已删除");
await loadTemplates();
} catch (error) {
setNotice(error instanceof Error ? error.message : "模板删除失败");
}
};
/** 打开素材库选择公共图片。 */
const openMediaLibrary = async () => {
setMediaOpen(true);
setSelectedMediaCodes([]);
try {
const data = await apiPost("/media/list", {
siteCode: SITE,
mediaType: "IMAGE",
});
setMediaItems(data.items || []);
} catch (error) {
setNotice(error instanceof Error ? error.message : "素材库加载失败");
}
};
/** 将选中的素材图片依次插入模板富文本。 */
const insertSelectedImages = () => {
selectedMediaCodes.forEach((mediaCode) => {
const item = mediaItems.find((media) => media.mediaCode === mediaCode);
if (item)
editor
?.chain()
.focus()
.setImage({
src: item.url,
alt: item.altText || item.originalFileName,
})
.run();
});
setMediaOpen(false);
};
const filteredItems = items.filter((item) =>
`${item.templateName} ${item.description || ""}`
.toLowerCase()
.includes(query.toLowerCase()),
);
if (editing) {
return (
<div className="product-editor">
<div className="editor-top">
<div className="breadcrumb-title">
<button className="back" onClick={() => setEditing(null)}>
产品模板
</button>
<span>/</span>
<h1>{editing.templateCode ? "编辑模板" : "新建模板"}</h1>
{notice && <em>{notice}</em>}
</div>
<div className="editor-actions">
<button onClick={() => setEditing(null)}>返回</button>
<button
className="primary"
disabled={saving || !editing.templateName}
onClick={() => void saveTemplate()}
>
<Save size={16} />
{saving ? "保存中" : "保存"}
</button>
</div>
</div>
<div className="template-editor-layout">
<section className="edit-section">
<h2>模板信息</h2>
<div className="edit-grid">
<label>
<span>模板名称 *</span>
<input
value={editing.templateName}
onChange={(event) =>
setEditing({ ...editing, templateName: event.target.value })
}
/>
</label>
<label>
<span>状态</span>
<select
value={editing.status}
onChange={(event) =>
setEditing({ ...editing, status: event.target.value })
}
>
<option value="DRAFT">草稿</option>
<option value="PUBLISHED">已发布</option>
<option value="OFFLINE">已下线</option>
</select>
</label>
<label className="wide">
<span>用途说明</span>
<textarea
rows={3}
value={editing.description || ""}
onChange={(event) =>
setEditing({ ...editing, description: event.target.value })
}
/>
</label>
<label>
<span>排序</span>
<input
type="number"
value={editing.sortNo}
onChange={(event) =>
setEditing({
...editing,
sortNo: Number(event.target.value),
})
}
/>
</label>
</div>
</section>
<section className="edit-section">
<div className="section-head">
<h2>公共富文本内容</h2>
<button type="button" onClick={() => void openMediaLibrary()}>
<ImageIcon size={16} />
从素材库插图
</button>
</div>
<p className="template-editor-tip">
模板将在前台动态插入产品详情前或详情后,修改一次即可同步影响所有关联产品。
</p>
<div className="rich-editor">
<div className="rich-toolbar">
<button
type="button"
title="撤销"
onClick={() => editor?.chain().focus().undo().run()}
>
<Undo2 size={16} />
</button>
<button
type="button"
title="重做"
onClick={() => editor?.chain().focus().redo().run()}
>
<Redo2 size={16} />
</button>
<button
type="button"
title="加粗"
className={editor?.isActive("bold") ? "active" : ""}
onClick={() => editor?.chain().focus().toggleBold().run()}
>
<Bold size={16} />
</button>
<button
type="button"
title="斜体"
className={editor?.isActive("italic") ? "active" : ""}
onClick={() => editor?.chain().focus().toggleItalic().run()}
>
<Italic size={16} />
</button>
<button
type="button"
title="二级标题"
className={
editor?.isActive("heading", { level: 2 }) ? "active" : ""
}
onClick={() =>
editor?.chain().focus().toggleHeading({ level: 2 }).run()
}
>
<Heading2 size={16} />
</button>
<button
type="button"
title="三级标题"
className={
editor?.isActive("heading", { level: 3 }) ? "active" : ""
}
onClick={() =>
editor?.chain().focus().toggleHeading({ level: 3 }).run()
}
>
<Heading3 size={16} />
</button>
<button
type="button"
title="无序列表"
className={editor?.isActive("bulletList") ? "active" : ""}
onClick={() =>
editor?.chain().focus().toggleBulletList().run()
}
>
<List size={16} />
</button>
</div>
<EditorContent editor={editor} />
</div>
</section>
</div>
{mediaOpen && (
<div
className="media-picker-backdrop"
onMouseDown={() => setMediaOpen(false)}
>
<section
className="media-picker"
role="dialog"
aria-modal="true"
onMouseDown={(event) => event.stopPropagation()}
>
<header>
<h2>选择公共图片</h2>
<button type="button" onClick={() => setMediaOpen(false)}>
<X size={20} />
</button>
</header>
<div className="media-picker-toolbar">
<label>
<Search size={16} />
<input
placeholder="搜索图片名称"
value={mediaQuery}
onChange={(event) => setMediaQuery(event.target.value)}
/>
</label>
</div>
<div className="media-picker-grid">
{mediaItems
.filter(
(item) =>
!mediaQuery ||
item.originalFileName
.toLowerCase()
.includes(mediaQuery.toLowerCase()),
)
.map((item) => (
<button
type="button"
className={`media-picker-item${selectedMediaCodes.includes(item.mediaCode) ? " selected" : ""}`}
key={item.mediaCode}
onClick={() =>
setSelectedMediaCodes((current) =>
current.includes(item.mediaCode)
? current.filter((code) => code !== item.mediaCode)
: [...current, item.mediaCode],
)
}
>
<img
src={assetUrl(item.url)}
alt={item.altText || item.originalFileName}
/>
<span>
{selectedMediaCodes.includes(item.mediaCode) && (
<Check size={15} />
)}{" "}
{item.originalFileName}
</span>
</button>
))}
</div>
<footer>
<button type="button" onClick={() => setMediaOpen(false)}>
取消
</button>
<button
type="button"
className="primary"
disabled={!selectedMediaCodes.length}
onClick={insertSelectedImages}
>
插入({selectedMediaCodes.length})
</button>
</footer>
</section>
</div>
)}
</div>
);
}
return (
<div>
<header>
<div>
<h1>产品模板管理</h1>
<p>统一维护可复用的产品详情前置或后置内容。</p>
</div>
<button className="primary" onClick={() => openEditor()}>
<Plus size={17} />
新建模板
</button>
</header>
{notice && <div className="notice">{notice}</div>}
<section className="toolbar">
<div className="search">
<Search size={17} />
<input
value={query}
onChange={(event) => setQuery(event.target.value)}
placeholder="搜索模板名称或说明"
/>
</div>
</section>
<section className="table template-table">
<div className="thead">
<span>模板</span>
<span>状态</span>
<span>排序</span>
<span>操作</span>
</div>
{loading ? (
<div className="empty">
<strong>模板加载中</strong>
</div>
) : filteredItems.length === 0 ? (
<div className="empty">
<strong>暂无产品模板</strong>
<p>新建模板后即可在产品编辑页选择使用。</p>
</div>
) : (
filteredItems.map((item) => (
<div className="row" key={item.templateCode}>
<span>
<strong>{item.templateName}</strong>
<small>{item.description || item.templateCode}</small>
</span>
<span className={`status ${item.status.toLowerCase()}`}>
{statusLabel(item.status)}
</span>
<span>{item.sortNo}</span>
<div className="row-actions">
<button className="link" onClick={() => openEditor(item)}>
<Pencil size={14} />
编辑
</button>
<button
className="link danger"
onClick={() => void deleteTemplate(item)}
>
<Trash2 size={14} />
删除
</button>
</div>
</div>
))
)}
</section>
</div>
);
}
+12 -1
View File
@@ -28,6 +28,7 @@ import {
} from "lucide-react";
import "./styles.css";
import ProductEditor from "./ProductEditor";
import ProductTemplateManager from "./ProductTemplateManager";
import ContentEditor from "./ContentEditor";
import CategoryManager from "./CategoryManager";
import InquirySettingsPanel from "./InquirySettingsPanel";
@@ -54,6 +55,7 @@ type Section =
| "dashboard"
| "products"
| "product-categories"
| "product-templates"
| "NEWS"
| "NEWS-categories"
| "CASE"
@@ -144,6 +146,7 @@ const sectionLabels: Record<Section, string> = {
dashboard: "数据概览",
products: "产品",
"product-categories": "产品分类",
"product-templates": "产品模板",
NEWS: "新闻",
"NEWS-categories": "新闻分类",
CASE: "案例",
@@ -449,7 +452,7 @@ function App({
<div className="nav-group">
<button
className={
["products", "product-categories"].includes(section)
["products", "product-categories", "product-templates"].includes(section)
? "group-active"
: ""
}
@@ -476,6 +479,12 @@ function App({
>
分类管理
</button>
<button
className={section === "product-templates" ? "active" : ""}
onClick={() => navigateSection("product-templates")}
>
内容模板
</button>
</div>
)}
</div>
@@ -629,6 +638,8 @@ function App({
<CustomCodeManager />
) : section === "media" ? (
<MediaCenter />
) : section === "product-templates" ? (
<ProductTemplateManager />
) : editingProduct !== null ? (
<ProductEditor
productCode={editingProduct || undefined}
+1
View File
@@ -443,4 +443,5 @@ header p {
.specification-row{display:grid;grid-template-columns:minmax(150px,.85fr) minmax(280px,1.65fr) minmax(130px,.7fr) minmax(110px,.55fr) 42px;gap:12px;align-items:end;padding:14px 0;border-top:1px solid #edf0f2}.specification-row label{display:grid;gap:7px;min-width:0}.specification-row label>span{font-size:12px;font-weight:600;color:#53616b}.specification-row input{box-sizing:border-box;border:1px solid #d8dee3;border-radius:5px;padding:10px 12px;font:inherit;width:100%}.specification-row button{height:43px;border:1px solid #ead6d6;background:#fff;color:#a93636;border-radius:5px;display:inline-grid;place-items:center;cursor:pointer}.specification-empty{border:1px dashed #d8dee3;border-radius:5px;padding:26px;text-align:center;color:#81908b;font-size:13px}
.pv-product-detail{padding:44px 5%;display:grid;grid-template-columns:minmax(0,1.05fr) minmax(300px,.95fr);gap:34px;align-items:start}.pv-product-image{aspect-ratio:1/1;background:#eef2f0;display:grid;place-items:center;color:#899691;overflow:hidden}.pv-product-image img{width:100%;height:100%;object-fit:contain}.pv-product-summary>span{font-size:11px;font-weight:800;color:#176b5d}.pv-product-detail h1{font-size:34px;line-height:1.12;margin:12px 0 18px}.pv-product-detail p{line-height:1.65;color:#61706b}.pv-product-detail button{border:0;color:#fff;padding:12px 20px;font-weight:700;margin-top:10px}.pv-product-information{margin:18px 0;max-height:210px;overflow:auto}.pv-product-information h2{font:500 14px Georgia,serif;margin:0 0 8px}.pv-product-information dl{margin:0}.pv-product-information dl>div{display:grid;grid-template-columns:90px minmax(0,1fr);gap:14px;padding:6px 0}.pv-product-information dt,.pv-product-information dd{margin:0;font-size:12px}.pv-product-information dt{color:#7a8783}.pv-product-information dd{font-weight:500;overflow-wrap:anywhere}.preview-frame[style*="390px"] .pv-product-detail{grid-template-columns:1fr;padding:28px 20px}.preview-frame[style*="390px"] .pv-product-detail h1{font-size:27px}
@media(max-width:900px){.specification-row{grid-template-columns:1fr 1fr}.specification-values{grid-column:1/-1}.specification-row button{grid-column:2;justify-self:end;width:42px}}
.template-editor-layout{max-width:1500px;margin:auto;display:grid;gap:20px}.template-editor-tip,.template-selection-note{margin:0;color:#73817d;font-size:13px;line-height:1.6}.template-table .thead,.template-table .row{grid-template-columns:minmax(0,2fr) 130px 90px 180px}.template-table .row-actions{display:flex;justify-content:flex-end;gap:12px}.template-table .row-actions .danger{color:#a93636}.template-table button svg{vertical-align:middle;margin-right:4px}@media(max-width:760px){.template-table .thead{display:none}.template-table .row{grid-template-columns:1fr}.template-table .row-actions{justify-content:flex-start}}
.dashboard-page{padding:34px 38px 48px;max-width:1600px;margin:0 auto}.dashboard-header{display:flex;align-items:flex-start;justify-content:space-between;margin-bottom:26px}.dashboard-header h1{font-size:30px;margin:0 0 7px;letter-spacing:0}.dashboard-header p{margin:0;color:#76827f}.dashboard-updated{display:flex;align-items:center;gap:12px;color:#7b8784;font-size:13px}.dashboard-updated button{width:38px;height:38px;border:1px solid #d9e0dd;background:#fff;display:grid;place-items:center;color:#176b5b}.spin{animation:dashboard-spin 1s linear infinite}@keyframes dashboard-spin{to{transform:rotate(360deg)}}.dashboard-inline-error{padding:10px 14px;margin-bottom:18px;background:#fff3f1;color:#a43d31;border-left:3px solid #c95043}.dashboard-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));border:1px solid #dfe5e2;background:#fff;margin-bottom:20px}.dashboard-metric{min-width:0;height:132px;border:0;border-right:1px solid #e5e9e7;background:#fff;padding:24px;display:flex;align-items:flex-start;gap:16px;text-align:left;color:#182522}.dashboard-metric:last-child{border-right:0}.dashboard-metric:not(:disabled){cursor:pointer}.dashboard-metric:not(:disabled):hover{background:#f7faf9}.dashboard-metric>span:nth-child(2){display:grid;gap:4px}.dashboard-metric small{color:#74817d;font-size:12px}.dashboard-metric strong{font-size:29px;letter-spacing:0}.dashboard-metric em{font-style:normal;color:#697672;font-size:12px}.dashboard-metric>svg{margin-left:auto;color:#176b5b}.metric-icon{width:38px;height:38px;display:grid;place-items:center;background:#e9f3ef;color:#176b5b}.metric-icon svg{width:19px}.dashboard-grid{display:grid;gap:20px;margin-bottom:20px}.dashboard-primary-grid{grid-template-columns:minmax(0,1.7fr) minmax(320px,.8fr)}.dashboard-secondary-grid{grid-template-columns:minmax(0,1.35fr) minmax(250px,.7fr) minmax(0,1.15fr)}.dashboard-panel{background:#fff;border:1px solid #dfe5e2;padding:24px;min-width:0}.dashboard-panel-title{height:30px;display:flex;align-items:start;justify-content:space-between}.dashboard-panel-title h2{font-size:17px;margin:0;letter-spacing:0}.dashboard-panel-title>span,.dashboard-panel-title button{font-size:12px;color:#7b8784}.dashboard-panel-title button{border:0;background:transparent;display:flex;align-items:center;gap:4px;cursor:pointer}.traffic-legend{display:flex;justify-content:flex-end;gap:16px;font-size:11px;color:#77837f}.traffic-legend span{display:flex;align-items:center;gap:5px}.traffic-legend i{width:8px;height:8px}.traffic-legend .pv,.traffic-bars .pv{background:#176b5b}.traffic-legend .uv,.traffic-bars .uv{background:#b9d6cc}.traffic-chart{height:230px;display:flex;align-items:end;gap:9px;border-bottom:1px solid #dfe5e2;padding-top:24px}.traffic-day{height:100%;flex:1;min-width:0;display:grid;grid-template-rows:1fr 22px;gap:8px}.traffic-bars{display:flex;align-items:end;justify-content:center;gap:3px}.traffic-bars i{width:min(12px,40%);min-height:3px}.traffic-day>span{text-align:center;font-size:10px;color:#83908c;white-space:nowrap}.content-stat-list{display:grid;gap:20px;margin-top:22px}.content-stat-list button{border:0;background:transparent;padding:0;text-align:left;cursor:pointer}.content-stat-list button>span{display:flex;justify-content:space-between}.content-stat-list b{font-size:13px}.content-stat-list small{color:#76827f}.content-stat-list i,.device-list i{display:block;height:5px;background:#edf1ef;margin-top:8px}.content-stat-list em,.device-list em{display:block;height:100%;background:#176b5b}.publish-summary{display:flex;gap:8px;align-items:center;margin-top:24px;padding-top:18px;border-top:1px solid #e2e7e5;color:#52615d;font-size:12px}.top-page-list{margin-top:14px}.top-page-list>div{display:grid;grid-template-columns:28px minmax(0,1fr) auto;gap:10px;align-items:center;padding:11px 0;border-bottom:1px solid #edf0ef}.top-page-list>div>b{color:#9aa5a1;font-size:11px}.top-page-list span{min-width:0;display:grid}.top-page-list strong,.top-page-list small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.top-page-list strong{font-size:13px}.top-page-list small{font-size:11px;color:#86918e}.top-page-list em{font-style:normal;font-size:12px;color:#52615d}.device-list{display:grid;gap:20px;margin-top:22px}.device-list>div{display:grid;grid-template-columns:1fr auto;align-items:center}.device-list span{display:flex;gap:7px;align-items:center;font-size:12px}.device-list b{font-size:12px}.device-list i{grid-column:1/-1}.recent-inquiries{margin-top:12px}.recent-inquiries button{width:100%;border:0;border-bottom:1px solid #edf0ef;background:transparent;padding:12px 0;display:flex;justify-content:space-between;gap:12px;text-align:left;cursor:pointer}.recent-inquiries button:hover strong{color:#176b5b}.recent-inquiries span,.recent-inquiries em{display:grid;gap:3px;min-width:0}.recent-inquiries strong{font-size:13px}.recent-inquiries small{font-size:11px;color:#83908c;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.recent-inquiries emLine truncated