:root{--red:#8f1d22;--red2:#b4282d;--ink:#231f20;--muted:#6f6662;--line:#eadfda;--paper:#fffaf6;--soft:#f6eee9}*{box-sizing:border-box}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",Arial,sans-serif;color:var(--ink);background:#fff;line-height:1.7}a{color:inherit;text-decoration:none}.container{max-width:1160px;margin:auto;padding:0 20px}.top{position:sticky;top:0;z-index:10;background:rgba(255,250,246,.94);border-bottom:1px solid var(--line);backdrop-filter:blur(10px)}.bar{height:72px;display:flex;align-items:center;justify-content:space-between}.brand{font-weight:800;font-size:26px;color:var(--red)}.brand small{display:block;font-size:12px;color:var(--muted);letter-spacing:4px}nav{display:flex;gap:22px;align-items:center;font-size:15px}nav a:hover{color:var(--red)}.adminlink{border:1px solid var(--line);padding:6px 12px;border-radius:99px}.navbtn{display:none}.hero{background:radial-gradient(circle at right top,#fff1e8,transparent 35%),linear-gradient(135deg,#5f1519,#9d2428 48%,#d9aa83);color:#fff}.hero-grid{min-height:560px;display:grid;grid-template-columns:1.2fr .8fr;gap:48px;align-items:center}.eyebrow{color:#d6a15f;font-weight:700;letter-spacing:2px}.hero h1{font-size:54px;line-height:1.12;margin:16px 0}.hero p{font-size:18px;color:#fff1ea;max-width:640px}.btn{display:inline-block;background:var(--red);color:#fff;border:0;border-radius:999px;padding:12px 22px;font-weight:700;cursor:pointer}.btn.ghost{background:#fff;color:var(--red);border:1px solid var(--line)}.actions{display:flex;gap:14px;margin-top:28px}.hero-card{background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.24);border-radius:24px;padding:30px;box-shadow:0 30px 80px rgba(0,0,0,.18)}.section{padding:72px 0}.section-title{display:flex;justify-content:space-between;align-items:end;margin-bottom:26px}.section h2,.section-title h2{font-size:24px;margin:0 0 16px}.cards{display:grid;grid-template-columns:repeat(3,1fr);gap:22px}.card{background:#fff;border:1px solid var(--line);border-radius:18px;padding:24px;box-shadow:0 12px 32px rgba(143,29,34,.06)}.card span{color:var(--red);font-weight:700}.card h3{font-size:21px;margin:10px 0}.card p{color:var(--muted)}.price{background:var(--paper);border-radius:14px;padding:14px;margin-top:18px;color:var(--muted)}.price b{display:inline-block;min-width:70px;color:var(--red)}.soft{background:var(--soft)}.case-list{display:grid;grid-template-columns:repeat(2,1fr);gap:22px}.case-list article{background:#fff;border-left:5px solid var(--red);padding:24px;border-radius:16px;box-shadow:0 10px 30px rgba(0,0,0,.04)}.case-list small{color:var(--red);font-weight:700}.case-list strong{color:var(--red)}.split{display:grid;grid-template-columns:1.2fr .8fr;gap:38px}.article-row{display:block;border-bottom:1px solid var(--line);padding:18px 0}.article-row b{display:block;font-size:20px}.article-row span{display:block;color:var(--muted)}.quote{background:var(--paper);border-radius:20px;padding:28px}blockquote{margin:0 0 18px;color:#423937}cite{display:block;margin-top:12px;color:var(--red);font-style:normal}.pagehead{background:linear-gradient(135deg,#fff7ef,#f2ded2);padding:72px 0}.pagehead h1{font-size:26px;margin:8px 0}.pagehead p{max-width:760px;color:var(--muted);font-size:18px}.detail{display:grid;grid-template-columns:1fr 320px;gap:34px;align-items:start}.detail article,.prose{font-size:18px}.pricebox,aside,.form{background:var(--paper);border:1px solid var(--line);border-radius:18px;padding:24px}.pill{display:inline-block;margin-right:10px;border:1px solid var(--red);color:var(--red);border-radius:999px;padding:8px 14px}.logos{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin:14px 0 34px}.logos span{background:var(--paper);border:1px solid var(--line);border-radius:12px;padding:16px;text-align:center;font-weight:700}.form input,.form textarea,.editor input,.editor textarea,.login input{width:100%;border:1px solid var(--line);border-radius:12px;padding:12px 14px;margin:8px 0 14px;font:inherit;background:#fff}.form textarea,.editor textarea{min-height:120px}.success{color:#0a7a3b}.error{color:#b00020}footer{background:#241819;color:#f8ece5;padding:38px 0}.foot{display:flex;justify-content:space-between;gap:20px}.adminbody{background:#f7f1ed}.login{max-width:420px;margin:10vh auto;background:#fff;border-radius:22px;padding:34px;box-shadow:0 20px 70px rgba(0,0,0,.08)}.admin{display:grid;grid-template-columns:230px 1fr;min-height:100vh}.admin aside{border-radius:0;background:#2a1719;color:#fff}.admin aside a{display:block;padding:12px 16px;border-radius:10px;margin:4px 0}.admin aside a.active,.admin aside a:hover{background:var(--red)}.admin main{padding:28px;overflow:auto}.editor{display:grid;grid-template-columns:repeat(2,1fr);gap:12px;background:#fff;border:1px solid var(--line);border-radius:18px;padding:20px}.editor label{font-weight:700}.editor textarea{grid-column:auto}.tablewrap{overflow:auto;background:#fff;border-radius:18px;margin-top:22px;border:1px solid var(--line)}table{width:100%;border-collapse:collapse}th,td{padding:12px;border-bottom:1px solid var(--line);text-align:left;vertical-align:top}th{background:var(--paper)}/* 案例详情页 - 项目成效区块 */
.case-result {
  margin-top: 36px;
  padding: 28px 30px;
  background: linear-gradient(135deg, #fff9f5 0%, #fef3ed 100%);
  border: 1px solid var(--line);
  border-left: 5px solid var(--red);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(143, 29, 34, 0.06);
}

.case-result-title {
  margin: 0 0 18px 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--red);
  display: flex;
  align-items: center;
  gap: 10px;
}

.case-result-title::before {
  content: "✓";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--red);
  color: #fff;
  border-radius: 50%;
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
}

.case-result-content {
  font-size: 16px;
  line-height: 1.8;
  color: var(--ink);
}

.case-result-content p {
  margin: 0 0 12px 0;
}

.case-result-content p:last-child {
  margin-bottom: 0;
}

.case-result-content ul,
.case-result-content ol {
  margin: 12px 0;
  padding-left: 24px;
}

.case-result-content li {
  margin-bottom: 8px;
}

.case-result-content strong {
  color: var(--red);
  font-weight: 600;
}

@media(max-width:768px){.navbtn{display:block;background:none;border:0;font-size:26px;color:var(--ink);cursor:pointer}.brand{font-size:20px}.brand small{font-size:10px;letter-spacing:3px}nav{display:none;position:absolute;right:20px;top:72px;background:#fff;padding:16px 20px;flex-direction:column;align-items:flex-start;border:1px solid var(--line);border-radius:12px;gap:12px;z-index:100;box-shadow:0 8px 24px rgba(0,0,0,0.1);min-width:140px}nav.open{display:flex}.hero-grid,.split,.detail,.admin{grid-template-columns:1fr}.hero h1{font-size:38px}.cards,.case-list,.logos{grid-template-columns:1fr}.foot{display:block}.editor{grid-template-columns:1fr}
  .case-result {
    padding: 20px 22px;
    margin-top: 28px;
  }
  .case-result-title {
    font-size: 18px;
  }
}.extra-img{max-width:100%;height:auto;border-radius:14px;margin:12px 0}.detail-img{max-width:100%;height:auto;border-radius:14px;margin:12px 0}.card-img{max-width:100%;height:auto;border-radius:12px;margin:8px 0}.card{display:flex;flex-direction:column}.card-img{order:-1}.navmenu{list-style:none;margin:0;padding:0;display:flex;gap:22px;align-items:center;font-size:17px;font-weight:500}.navmenu li{list-style:none;margin:0;padding:0}.navmenu>li{position:relative;display:inline-block}.navmenu>li>a{display:inline-block;padding:6px 0;text-decoration:none}.navmenu a:hover{color:var(--red)}.submenu{list-style:none;margin:0;padding:0;display:none;position:absolute;top:100%;left:0;margin-top:0;background:#fff;border:1px solid var(--line);border-radius:12px;padding:8px 0;box-shadow:0 12px 40px rgba(0,0,0,.12);min-width:170px;z-index:9999}.submenu li{display:block;margin:0;padding:0}.submenu li a{display:block;padding:10px 22px;font-size:14px;line-height:1.5;color:var(--ink);white-space:nowrap;text-decoration:none}.submenu li a:hover{color:var(--red);background:var(--paper)}.has-sub:hover>.submenu{display:block}.forum-layout{display:flex;gap:28px}.forum-sidebar{width:200px;flex-shrink:0}.forum-sidebar h3{font-size:18px;margin:0 0 12px}.forum-sidebar ul{list-style:none;margin:0;padding:0}.forum-sidebar li{margin:0;padding:0}.forum-sidebar a{display:block;padding:8px 12px;border-radius:8px;text-decoration:none;color:var(--ink)}.forum-sidebar a:hover{background:var(--paper)}.forum-sidebar a.active{background:var(--red);color:#fff}.forum-main{flex:1}.reply-box{display:none}.reply-box.show{display:block}.reply-toggle{font-size:13px;padding:6px 16px}@media(max-width:820px){.navmenu{flex-direction:column;align-items:flex-start;gap:0}.navmenu>li{display:block;width:100%}.navmenu>li>a{padding:8px 0;display:block}.submenu{display:none;position:static;margin-top:0;background:transparent;border:0;box-shadow:none;padding:4px 0 4px 18px;min-width:auto}.submenu li a{padding:6px 0;font-size:14px}.submenu li a:hover{background:transparent}.has-sub.open>.submenu{display:block}.forum-layout{flex-direction:column}.forum-sidebar{width:100%}}

/* ҳڵı */
.prose h1 { font-size: 24px !important; font-weight:500 !important;}
.prose h2 { font-size: 22px !important; font-weight:500 !important;}
.prose h3 { font-size: 20px !important; font-weight:500 !important;}

/* ҳ涥Ĵ */
.pagehead h1 { font-size: 32px !important; }
/* Logo图片样式 */
.logo-img {
    height: 36px;
    width: auto;
    display: inline-block;
    vertical-align: middle;
    margin-right: 10px;
    border-radius: 4px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}


/* ========================================
   文章内容排版优化 - 标题和段落间距
   ======================================== */
.prose h1 { margin: 1.2em 0 0.8em !important; }
.prose h2 { margin: 1.2em 0 0.8em !important; }
.prose h3 { margin: 1.2em 0 0.6em !important; }
.prose h4 { margin: 1.2em 0 0.5em !important; font-size: 18px !important; font-weight: 600 !important; }
.prose p { margin: 0 0 1.2em !important; }
.prose ul, .prose ol { margin: 0 0 1.2em !important; padding-left: 1.8em !important; }
.prose li { margin: 0.3em 0 !important; }
.prose blockquote { margin: 1.2em 0 !important; padding: 1em 1.5em !important; background: var(--paper) !important; border-left: 4px solid var(--red) !important; border-radius: 0 12px 12px 0 !important; }

/* 文章正文图片限制 */
.prose img,
.content-main img,
.detail img,
.detail-img {
    max-width: 100% !important;
    max-height: 600px !important;
    width: auto !important;
    height: auto !important;
    border-radius: 12px !important;
    margin: 16px 0 !important;
    object-fit: contain !important;
    display: block !important;
    float: none !important;
}

/* 案例列表卡片图片大小限制 */
.case-list .case-img,
.case-list img {
    width: 500px !important;
    max-width: 100% !important;
    height: 200px !important;
    max-height: 200px !important;
    object-fit: cover !important;
    display: block !important;
    border-radius: 12px !important;
}


/* ========================================
   侧边栏布局样式
   ======================================== */
.content-sidebar-layout {
    display: flex;
    gap: 28px;
    align-items: flex-start;
}

.content-main {
    flex: 1;
    min-width: 0;
}

.content-sidebar {
    width: 25%;
    flex-shrink: 0;
    position: sticky;
    top: 92px;
}

/* 论坛侧边栏也统一调整为1/4 */
.forum-layout {
    display: flex;
    gap: 28px;
    align-items: flex-start;
}

.forum-sidebar {
    width: 25% !important;
    flex-shrink: 0;
    position: sticky;
    top: 92px;
}

.forum-main {
    flex: 1;
    min-width: 0;
}

/* 侧边栏通用样式 */
.content-sidebar ul,
.forum-sidebar ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.content-sidebar li,
.forum-sidebar li {
    margin: 0;
    padding: 0;
}

.content-sidebar a,
.forum-sidebar a {
    display: block;
    padding: 10px 14px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--ink);
    font-size: 16px;
    line-height: 1.5;
}

.content-sidebar a:hover,
.forum-sidebar a:hover {
    background: var(--paper);
}

.content-sidebar a.active,
.forum-sidebar a.active {
    background: var(--red);
    color: #fff;
}

/* 最新文章/话题样式 */
.latest-article {
    margin-bottom: 12px;
}

.latest-article:last-child {
    margin-bottom: 0;
}

.latest-article a {
    display: block;
    padding: 0 !important;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 6px;
}

.latest-article a:hover {
    background: none !important;
    color: var(--red);
}

.latest-article .date {
    display: block;
    font-size: 14px;
    color: var(--muted);
}

/* ========================================
   响应式：移动端隐藏侧边栏
   ======================================== */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }
    .container {
        overflow-x: hidden;
    }
    
    .content-sidebar,
    .forum-sidebar {
        display: none !important;
    }
    
    .content-sidebar-layout,
    .forum-layout {
        flex-direction: column;
    }
    
    /* 移动端正文容器防溢出 */
    .prose,
    .content-main,
    .detail article,
    .topic-body,
    .reply-body {
        overflow-x: hidden;
        word-wrap: break-word;
        overflow-wrap: break-word;
        word-break: break-word;
    }
    
    /* 移动端长链接和代码换行 */
    .prose a,
    .content-main a,
    .detail article a {
        word-break: break-all;
        overflow-wrap: break-word;
    }
    .prose pre,
    .content-main pre,
    .detail article pre {
        overflow-x: auto;
        white-space: pre-wrap;
        word-wrap: break-word;
    }
    
    /* 移动端图片自适应 */
    .prose img,
    .content-main img,
    .detail img,
    .detail-img {
        max-width: 100% !important;
        max-height: 400px !important;
        height: auto !important;
    }
    
    /* 移动端表格优化 */
    .table-wrap {
        margin: 12px 0;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }
    .table-wrap table {
        width: auto !important;
        min-width: 100%;
        font-size: 13px;
    }
    .prose table th,
    .prose table td,
    .content-main table th,
    .content-main table td,
    .detail table th,
    .detail table td {
        padding: 8px 10px;
    }
}

/* sidebar widget no border */
.sidebar-widget {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin-bottom: 24px !important;
}

.sidebar-widget:last-child {
    margin-bottom: 0 !important;
}

.sidebar-widget h3 {
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 14px !important;
    font-size: 18px !important;
    font-weight: 600 !important;
}

/* pagination styles */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
    flex-wrap: wrap;
    grid-column: 1 / -1;
    width: 100%;
}

.pagination .page-prev,
.pagination .page-next,
.pagination .page-num {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    text-decoration: none;
    color: var(--ink);
    font-size: 14px;
    transition: all 0.2s;
    background: #fff;
}

.pagination .page-prev:hover,
.pagination .page-next:hover,
.pagination .page-num:hover {
    border-color: var(--red);
    color: var(--red);
    background: #fff5f5;
}

.pagination .page-current {
    display: inline-block;
    padding: 8px 16px;
    background: var(--red);
    color: #fff;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
}

.pagination .page-prev {
    margin-right: 8px;
}

.pagination .page-next {
    margin-left: 8px;
}

/* 文章列表 - 左图右文布局 */
.article-list-item {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 20px;
    padding: 20px 0;
    border-bottom: 1px solid var(--line);
    text-decoration: none;
    color: inherit;
    transition: background 0.2s;
    align-items: flex-start;
}

.article-list-item:hover {
    background: #faf8f6;
}

.article-list-item:last-child {
    border-bottom: none;
}

.article-thumb {
    flex: 0 0 200px !important;
    width: 200px !important;
    max-width: 200px !important;
    min-width: 200px !important;
    height: 150px !important;
    max-height: 150px !important;
    min-height: 150px !important;
    border-radius: 8px;
    overflow: hidden !important;
    background: #f0f0f0;
}

.article-thumb img,
.article-thumb-img {
    width: 200px !important;
    height: 150px !important;
    max-width: 200px !important;
    max-height: 150px !important;
    object-fit: cover !important;
    display: block !important;
}

.article-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.article-title {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--ink);
}

.article-list-item:hover .article-title {
    color: var(--red);
}

.article-meta {
    margin-bottom: 10px;
    font-size: 13px;
    color: var(--muted);
}

.article-meta span {
    margin-right: 15px;
}

.article-category {
    color: var(--red);
    font-weight: 500;
}

.article-summary {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: var(--muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .article-list-item {
        flex-direction: column;
        gap: 12px;
    }
    
    .article-thumb {
        width: 100%;
        height: 180px;
    }
}

/* 分类按钮选中状态 */
.pill.active {
    background-color: var(--red, #b00020) !important;
    color: #fff !important;
    border-color: var(--red, #b00020) !important;
}

/* ========================================
   首页数据展示区
   ======================================== */
.stats-section {
    padding: 48px 0;
    background: var(--paper, #faf8f6);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    text-align: center;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    color: var(--red, #b00020);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.stat-number {
    font-size: 36px;
    font-weight: 700;
    color: var(--red, #b00020);
    line-height: 1.2;
}

.stat-number span {
    font-size: 20px;
    font-weight: 600;
    margin-left: 2px;
    color: var(--red, #b00020);
}

.stat-label {
    font-size: 16px;
    color: var(--muted, #666);
    font-weight: 600;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .stats-section {
        padding: 32px 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }
    
    .stat-number {
        font-size: 32px;
    }
    
    .stat-number span {
        font-size: 18px;
    }
}

/* 返回顶部按钮 */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 60px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 9999;
}

#back-to-top.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

#back-to-top:hover {
    background-color: var(--red, #b00020);
    border-color: var(--red, #b00020);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(176,0,32,0.3);
}

#back-to-top .arrow {
    font-size: 20px;
    font-weight: bold;
    line-height: 1;
    color: var(--red, #b00020);
    transition: color 0.3s ease;
}

#back-to-top:hover .arrow {
    color: #fff;
}

#back-to-top .text {
    font-size: 12px;
    line-height: 1;
    color: #666;
    transition: color 0.3s ease;
}

#back-to-top:hover .text {
    color: #fff;
}

/* 移动端适配 */
@media (max-width: 768px) {
    #back-to-top {
        bottom: 20px;
        right: 20px;
        width: 44px;
        height: 52px;
    }
    
    #back-to-top .arrow {
        font-size: 18px;
    }
    
    #back-to-top .text {
        font-size: 11px;
    }
}

/* ========================================
   表格样式
   ======================================== */
.table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 16px 0;
    border: 1px solid var(--line, #e5e5e5);
    border-radius: 8px;
}

.table-wrap table {
    margin: 0 !important;
    width: auto !important;
    min-width: 100%;
    table-layout: auto;
}

/* 桌面端表格也做溢出保护 */
.prose,
.content-main,
.detail article,
.topic-body,
.reply-body {
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
}

.prose table th,
.content-main table th,
.detail table th,
.topic-body table th,
.reply-body table th {
    background-color: var(--paper, #faf8f6);
    font-weight: 600;
    text-align: left;
    padding: 10px 14px;
    border: 1px solid var(--line, #e5e5e5);
    color: var(--ink, #1a1a1a);
}

.prose table td,
.content-main table td,
.detail table td,
.topic-body table td,
.reply-body table td {
    padding: 10px 14px;
    border: 1px solid var(--line, #e5e5e5);
    color: var(--ink, #1a1a1a);
}

.prose table tr:nth-child(even) td,
.content-main table tr:nth-child(even) td,
.detail table tr:nth-child(even) td,
.topic-body table tr:nth-child(even) td,
.reply-body table tr:nth-child(even) td {
    background-color: #fafafa;
}

.prose table tr:hover td,
.content-main table tr:hover td,
.detail table tr:hover td,
.topic-body table tr:hover td,
.reply-body table tr:hover td {
    background-color: #fff5f5;
}

/* 分页省略号样式 */
.pagination .page-ellipsis {
    display: inline-block;
    padding: 8px 8px;
    color: #999;
    font-size: 14px;
    letter-spacing: 2px;
}

/* 客户名录卡片优化：图片在上，文字在下 */
.logos span {
    display: flex;
    flex-direction: column;  /* 垂直排列 */
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
}
.logos span img {
    display: block;
    max-width: 100%;
    max-height: 80px;
    height: auto;
    margin: 0 auto;
    float: none !important;   /* 防止浮动导致文字绕排 */
}/* ========================================
   在线客服聊天窗口样式
   ======================================== */

.chat-widget {
    position: fixed;
    bottom: 30px;
    right: 90px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ========== 悬浮按钮 ========== */
.chat-widget-toggle {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #b00020 0%, #d32f2f 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(176, 0, 32, 0.4);
    transition: all 0.3s ease;
    position: relative;
}

.chat-widget-toggle:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(176, 0, 32, 0.5);
}

.chat-widget-toggle .chat-icon {
    width: 28px;
    height: 24px;
    position: relative;
    background: #fff;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    outline: none;
    font-size: 14px;
    font-weight: 700;
    color: #b00020;
    letter-spacing: 1px;
}

.chat-widget-toggle .chat-icon::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 6px;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-top: 6px solid #fff;
    border-right: 5px solid transparent;
}

/* 未读消息角标 */
.chat-unread-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 20px;
    height: 20px;
    background: #ff4d4f;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* ========== 聊天面板 ========== */
.chat-widget-panel {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 360px;
    height: 500px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s ease;
}

.chat-widget-panel.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* 头部 */
.chat-widget-header {
    background: linear-gradient(135deg, #b00020 0%, #d32f2f 100%);
    color: #fff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.chat-widget-title {
    font-size: 16px;
    font-weight: 600;
}

.chat-widget-close {
    font-size: 24px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
    line-height: 1;
}

.chat-widget-close:hover {
    opacity: 1;
}

/* 消息列表 */
.chat-widget-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f7f8fa;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 滚动条样式 */
.chat-widget-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-widget-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-widget-messages::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

.chat-widget-messages::-webkit-scrollbar-thumb:hover {
    background: #ccc;
}

/* 消息气泡 */
.chat-message {
    display: flex;
    max-width: 80%;
}

.chat-message.visitor {
    align-self: flex-end;
    justify-content: flex-end;
}

.chat-message.agent {
    align-self: flex-start;
    justify-content: flex-start;
}

.chat-bubble {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.6;
    word-wrap: break-word;
    word-break: break-word;
}

.chat-message.visitor .chat-bubble {
    background: linear-gradient(135deg, #b00020 0%, #d32f2f 100%);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.chat-message.agent .chat-bubble {
    background: #fff;
    color: #333;
    border: 1px solid #e8e8e8;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* 输入区域 */
.chat-widget-input {
    padding: 12px 16px;
    background: #fff;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    align-items: flex-end;
    flex-shrink: 0;
}

.chat-widget-textarea {
    flex: 1;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    outline: none;
    transition: border-color 0.2s;
    max-height: 120px;
    line-height: 1.5;
}

.chat-widget-textarea:focus {
    border-color: #b00020;
}

.chat-widget-textarea::placeholder {
    color: #999;
}

.chat-widget-send {
    background: linear-gradient(135deg, #b00020 0%, #d32f2f 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    height: 40px;
}

.chat-widget-send:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(176, 0, 32, 0.3);
}

.chat-widget-send:active {
    transform: translateY(0);
}

/* ========== 移动端适配 ========== */
@media (max-width: 768px) {
    .chat-widget {
        bottom: 20px;
        right: 72px;
    }
    
    .chat-widget-toggle {
        width: 52px;
        height: 52px;
    }
    
    .chat-widget-toggle .chat-icon {
        font-size: 24px;
    }
    
    .chat-widget-panel {
        width: calc(100vw - 40px);
        height: 60vh;
        max-height: 500px;
        bottom: 62px;
        right: -52px; /* 往右偏移，让窗口整体在屏幕内，左右各留20px边距 */
    }
}

/* ========== 客服后台样式 ========== */
.chat-admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.chat-admin-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
    height: calc(100vh - 100px);
}

.chat-session-list {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e8e8e8;
    display: flex;
    flex-direction: column;
}

.chat-session-list-header {
    padding: 16px;
    background: #fafafa;
    border-bottom: 1px solid #e8e8e8;
    font-weight: 600;
}

.chat-session-items {
    flex: 1;
    overflow-y: auto;
}

.chat-session-item {
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
}

.chat-session-item:hover {
    background: #f5f5f5;
}

.chat-session-item.active {
    background: #fff5f5;
    border-left: 3px solid #b00020;
}

.chat-session-item .session-name {
    font-weight: 500;
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-session-item .session-unread {
    background: #ff4d4f;
    color: #fff;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.chat-session-item .session-preview {
    font-size: 13px;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-session-item .session-time {
    font-size: 12px;
    color: #bbb;
    margin-top: 4px;
}

/* 删除按钮 */
.chat-session-item .session-delete-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: #999;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    padding: 0;
}

.chat-session-item:hover .session-delete-btn {
    opacity: 1;
}

.chat-session-item .session-delete-btn:hover {
    color: #ff4d4f;
    background: #fff1f0;
}

.chat-session-item .session-delete-btn svg {
    width: 16px;
    height: 16px;
}

.chat-panel {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e8e8e8;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e8e8e8;
    font-weight: 600;
    background: #fafafa;
}

.chat-panel-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f7f8fa;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-panel-input {
    padding: 16px 20px;
    border-top: 1px solid #e8e8e8;
    display: flex;
    gap: 12px;
}

.chat-panel-input textarea {
    flex: 1;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    font-size: 14px;
    resize: none;
    outline: none;
    font-family: inherit;
}

.chat-panel-input textarea:focus {
    border-color: #b00020;
}

.chat-panel-input button {
    background: linear-gradient(135deg, #b00020 0%, #d32f2f 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0 24px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.chat-panel-input button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(176, 0, 32, 0.3);
}

.chat-empty-state {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 14px;
}
