/* ==============================================
   中国书法插件 - 模板隔离样式 (template.css)
   统一古典配色：背景 #d4d2ba / 卡片 #f0efe1
   ============================================== */

/* 面包屑（模板通用） */
.cc-template-wrapper .cc-breadcrumb {
    margin-bottom: 25px;
    padding: 12px 20px;
    background: #fff;
    border: 1px solid #dad7c5;
    border-radius: 12px;
}
.cc-template-wrapper .cc-breadcrumb ol {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.9em;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}
.cc-template-wrapper .cc-breadcrumb li {
    display: inline-flex;
    align-items: center;
}
.cc-template-wrapper .cc-breadcrumb li+li::before {
    content: "›";
    margin: 0 8px;
    color: #999;
}
.cc-template-wrapper .cc-breadcrumb a { color: #c2a15b; }
.cc-template-wrapper .cc-breadcrumb a:hover { color: #a88540; text-decoration: underline; }
.cc-template-wrapper .cc-breadcrumb .current { color: #4a4a4a; font-weight: 500; }

/* 基础容器 */
.cc-template-wrapper {
    font-family: "Noto Serif SC", "Songti SC", "KaiTi", "PingFang SC", "Microsoft YaHei", serif;
    color: #1e1e1e;
    line-height: 1.8;
    background: #f0efe1;
    padding: 0;
    max-width: 1200px;
    margin: 40px auto;
    border: 1px solid #dad7c5;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,0.05);
}
.cc-template-wrapper *,
.cc-template-wrapper *::before,
.cc-template-wrapper *::after { box-sizing: border-box; }
.cc-template-wrapper h1, .cc-template-wrapper h2, .cc-template-wrapper h3 {
    font-weight: 700;
    color: #1e1e1e;
    margin: 0.8em 0 0.3em;
    letter-spacing: 2px;
}
.cc-template-wrapper a { color: #c2a15b; text-decoration: none; }
.cc-template-wrapper a:hover { color: #a88540; text-decoration: underline; }

/* ===== 作品详情页 (single-calligraphy_work.php) ===== */
.cc-work-detail { padding: 30px; }
.cc-work-gallery {
    position: relative;
    background: #f0efe1;
    border-radius: 16px;
    margin-bottom: 30px;
    overflow: hidden;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    max-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cc-work-main-image { width: 100%; height: auto; }
.cc-work-main-image img {
    width: 100%; height: auto; max-height: 70vh;
    object-fit: contain; display: block; margin: 0 auto;
}
.cc-annotation-toggle {
    position: absolute; top: 15px; right: 15px;
    background: rgba(255,255,255,0.9); border: 1px solid #dad7c5;
    border-radius: 50%; width: 44px; height: 44px;
    font-size: 1.2em; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    z-index: 5; transition: all 0.2s;
}
.cc-annotation-toggle:hover { background: #fff; border-color: #c2a15b; }
.cc-annotation-floating {
    position: absolute; top: 15px; right: 70px;
    background: #fff; border: 1px solid #dad7c5;
    border-radius: 12px; padding: 20px; width: 280px;
    max-height: 60vh; overflow-y: auto;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    display: none; z-index: 10;
}
.cc-annotation-floating.open { display: block; }
.cc-annotation-floating h3 { font-size: 1.1em; margin-top: 0; border-bottom: 1px solid #dad7c5; padding-bottom: 8px; }
.cc-annotation-close { position: absolute; top: 10px; right: 10px; background: none; border: none; font-size: 1.1em; cursor: pointer; color: #999; }

.cc-work-header-detail { text-align: center; margin-bottom: 30px; padding-bottom: 20px; border-bottom: 2px solid #c2a15b; }
.cc-work-title-main { font-size: 2.8em; letter-spacing: 6px; margin: 0 0 10px; }
.cc-work-subtitle { font-size: 1.1em; color: #4a4a4a; }
.cc-work-subtitle span { margin: 0 12px; background: rgba(194,161,91,0.1); padding: 2px 12px; border-radius: 12px; }

.cc-work-info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}
.cc-info-card {
    background: #fff; border: 1px solid #dad7c5;
    border-radius: 12px; padding: 18px;
    display: flex; flex-direction: column; gap: 6px;
}
.cc-info-label { font-size: 0.85em; color: #7a6a5c; font-weight: 600; }
.cc-info-value { font-size: 1.05em; color: #1e1e1e; word-break: break-word; }

.cc-work-section { margin: 30px 0; padding: 25px; background: #fff; border: 1px solid #dad7c5; border-radius: 16px; }
.cc-work-section h2 { font-size: 1.4em; margin: 0 0 15px; padding-bottom: 10px; border-bottom: 1px solid #dad7c5; }
.cc-work-text { font-size: 1em; line-height: 2; color: #4a4a4a; }

.cc-work-footer-tags { margin-top: 20px; padding-top: 20px; border-top: 1px solid #dad7c5; display: flex; flex-wrap: wrap; gap: 10px; }
.cc-tag {
    display: inline-block; background: #f0efe1; border: 1px solid #dad7c5;
    color: #1e1e1e; padding: 4px 14px; border-radius: 20px; font-size: 0.9em;
    transition: all 0.2s;
}
.cc-tag:hover { background: #c2a15b; color: #fff; border-color: #c2a15b; text-decoration: none; }

/* ===== 作品存档页美化 ===== */
.cc-works-archive { padding: 30px; }

.cc-archive-header-v2 {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid #c2a15b;
}
.cc-archive-title { font-size: 2.8em; margin: 0; letter-spacing: 4px; color: #1e1e1e; }
.cc-archive-desc { margin: 10px 0 20px; color: #4a4a4a; font-size: 1.1em; }
.cc-dynasty-filter {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 10px;
    margin-top: 20px;
}
.cc-dynasty-filter span { color: #5c4b2b; font-weight: bold; }
.cc-dynasty-filter a {
    display: inline-block; padding: 4px 14px;
    border: 1px solid #dad7c5; border-radius: 20px;
    background: #fff; color: #1e1e1e; transition: all 0.2s;
}
.cc-dynasty-filter a:hover,
.cc-dynasty-filter a.active {
    background: #c2a15b; color: #fff; border-color: #c2a15b;
    text-decoration: none;
}

.cc-works-grid-archive {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
}
.cc-work-card-archive {
    background: linear-gradient(145deg, #f0efe1, #e6e4cf);
    border: 1px solid #dad7c5;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}
.cc-work-card-archive:hover {
    box-shadow: 0 12px 30px rgba(0,0,0,0.08);
    transform: translateY(-5px);
    border-color: #c2a15b;
}
.cc-work-thumb-archive {
    position: relative;
    width: 100%;
    padding-top: 75%;
    background: #f0efe1;
    overflow: hidden;
}
.cc-work-thumb-archive img {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: contain;
    transition: transform 0.5s ease;
}
.cc-work-card-archive:hover .cc-work-thumb-archive img { transform: scale(1.05); }
.cc-work-thumb-archive figcaption {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    color: #fff; padding: 20px 15px 15px; font-size: 1.1em; font-weight: 600;
    transform: translateY(100%); transition: transform 0.3s ease;
    z-index: 2;
}
.cc-work-card-archive:hover .cc-work-thumb-archive figcaption { transform: translateY(0); }

.cc-work-meta-archive {
    padding: 15px; display: flex; justify-content: center; gap: 15px; flex-wrap: wrap;
    font-size: 0.9em; color: #4a4a4a;
}
.cc-work-meta-archive span {
    background: rgba(194,161,91,0.1); padding: 4px 10px; border-radius: 12px;
}

/* ===== 书家详情 (single-calligrapher.php) ===== */
.cc-calligrapher-detail { padding: 0 !important; border-radius: 20px; overflow: hidden; }
.cc-detail-hero {
    background: #f0efe1; color: #1e1e1e; padding: 60px 30px 40px; text-align: center;
    border-bottom: 3px solid #c2a15b;
}
.cc-detail-avatar { width: 130px; height: 130px; margin: 0 auto 20px; border-radius: 50%; overflow: hidden; border: 3px solid #c2a15b; background: #fff; }
.cc-avatar-img { width: 100%; height: 100%; object-fit: cover; }
.cc-avatar-placeholder-lg { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 3.5em; color: #c2a15b; background: #f0efe1; }
.cc-detail-name { font-size: 2.8em; color: #1e1e1e; letter-spacing: 6px; }
.cc-detail-style { font-size: 1.2em; color: #4a4a4a; margin: 10px 0; }
.cc-detail-quick-info { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.cc-info-tag { background: #ffffff; padding: 4px 16px; border-radius: 20px; border: 1px solid #dad7c5; color: #1e1e1e; }

.cc-detail-tabs { padding: 30px; background: #fff; }
.cc-tab-nav { display: flex; justify-content: center; gap: 10px; border-bottom: 2px solid #dad7c5; margin-bottom: 30px; padding-bottom: 15px; }
.cc-tab-btn { background: none; border: none; padding: 8px 20px; font-size: 1.1em; color: #4a4a4a; cursor: pointer; border-radius: 20px; font-family: inherit; }
.cc-tab-btn:hover { background: #f0efe1; color: #1e1e1e; }
.cc-tab-btn.active { background: #c2a15b; color: #fff; }
.cc-tab-panel { display: none; }
.cc-tab-panel.active { display: block; }

.cc-works-grid-detail { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 20px; }
.cc-work-card-detail { background: #f0efe1; border: 1px solid #dad7c5; border-radius: 12px; text-align: center; overflow: hidden; }
.cc-work-img { height: 180px; overflow: hidden; }
.cc-work-img img { width: 100%; height: 100%; object-fit: cover; }
.cc-work-title { padding: 12px; font-weight: 600; }

.cc-legacy-block h3 { border-bottom: 1px solid #dad7c5; padding-bottom: 8px; }
.cc-evaluation-quote { background: #f0efe1; border-left: 4px solid #c2a15b; padding: 15px 20px; font-style: italic; color: #1e1e1e; }

/* ===== 碑帖详情 (single-rubbing.php) ===== */
.cc-rubbing-scroll-container { overflow-x: auto; white-space: nowrap; background: #fff; border: 1px solid #dad7c5; padding: 10px; margin: 20px 0; }
.cc-rubbing-scroll-container img { max-height: 400px; display: inline-block; }
.cc-rubbing-inscription, .cc-rubbing-colophons { background: #fff; padding: 15px; border: 1px solid #dad7c5; margin-top: 20px; }

/* ===== 教程详情 (single-calligraphy_course.php) ===== */
.cc-course-level-badge { background: #c2a15b; color: #fff; padding: 4px 12px; border-radius: 12px; display: inline-block; margin-bottom: 15px; }
.cc-course-download { background: #c2a15b; color: #fff !important; padding: 8px 18px; border-radius: 20px; display: inline-block; }

/* ===== 书家名录美化 (archive-calligrapher.php) ===== */
.cc-calligraphers-archive .cc-archive-header-v2 { text-align: center; padding-bottom: 20px; border-bottom: 2px solid #c2a15b; }
.cc-calligraphers-grid-v2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 30px; }
.cc-calligrapher-card-v3 { background: #f0efe1; border: 1px solid #dad7c5; border-radius: 16px; overflow: hidden; transition: all 0.3s; }
.cc-calligrapher-card-v3:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.05); transform: translateY(-5px); border-color: #c2a15b; }
.cc-card-avatar img { width: 100%; height: 220px; object-fit: cover; }
.cc-card-name { font-size: 1.6em; color: #1e1e1e; }
.cc-meta-item { background: #ffffff; padding: 2px 10px; border-radius: 12px; }

/* ===== 通用归档卡片 ===== */
.cc-archive-grid { display: flex; flex-wrap: wrap; gap: 25px; }
.cc-archive-card { flex: 1 1 calc(33.333% - 25px); background: #f0efe1; border: 1px solid #dad7c5; padding: 20px; border-radius: 16px; text-align: center; transition: all 0.2s; }
.cc-archive-card:hover { box-shadow: 0 6px 18px rgba(0,0,0,0.05); transform: translateY(-4px); border-color: #c2a15b; }
.cc-archive-card img { max-width: 100%; border-radius: 8px; }
.cc-archive-card h3 { font-size: 1.2em; color: #1e1e1e; }

/* 分页 */
.cc-template-wrapper .pagination { margin-top: 40px; text-align: center; }
.cc-template-wrapper .page-numbers { display: inline-block; padding: 6px 14px; margin: 0 4px; border: 1px solid #dad7c5; border-radius: 4px; color: #1e1e1e; }
.cc-template-wrapper .page-numbers.current { background: #c2a15b; color: #fff; border-color: #c2a15b; }

/* 响应式 */
@media (max-width: 768px) {
    .cc-template-wrapper { padding: 20px; margin: 10px; }
    .cc-work-detail, .cc-works-archive { padding: 20px; }
    .cc-work-title-main { font-size: 2em; }
    .cc-work-info-cards { grid-template-columns: 1fr; }
    .cc-annotation-floating { width: 200px; right: 10px; }
    .cc-calligraphers-grid-v2 { grid-template-columns: 1fr; }
    .cc-works-grid-detail { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .cc-archive-card { flex: 1 1 100%; }
    .cc-archive-title { font-size: 2.2em; }
}