:root {
    --primary: #2c3e50;
    --secondary: #3498db;
    --accent: #e74c3c;
    --light: #f8f9fa;
    --dark: #343a40;
    --gray: #6c757d;
    --border: #dee2e6;
    --shadow: rgba(0, 0, 0, 0.1);
    --light-blue: #e8f4fd;
    --light-gray: #f5f7fa;
}

/* 移动端基础设置 */
html {
    font-size: 16px;
}

body {
    margin: 0;
    font-family: 'Segoe UI', 'Hiragino Sans', 'Meiryo', sans-serif;
    line-height: 1.7;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #333;
    padding: 10px;
    min-height: 100vh;
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

body.mobile-device {
    padding: 8px;
}

*,
*::before,
*::after {
    box-sizing: inherit;
}

.summary-container {
    max-width: 100%;
    margin: 10px auto;
    border: none;
    padding: 0;
    border-radius: 8px;
    background: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    box-sizing: border-box;
}

/* 标题区域 */
.article-header-container {
    background: linear-gradient(135deg, var(--primary), #1a2530);
    color: white;
    padding: 20px 15px 15px;
}

.sertitle {
    font-size: 0.75rem;
    opacity: 0.9;
    margin-bottom: 4px;
}

.sertitle a {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s;
}

.sertitle a:hover {
    opacity: 0.8;
}

.sertitle span {
    margin-left: 6px;
    font-weight: 600;
    color: #3498db;
    font-size: 0.75rem;
}

.subtitle {
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.95;
    margin: 8px 0 6px 0;
    color: #ecf0f1;
}

h1 {
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 10px 0;
    color: white;
}

.artdata {
    font-size: 0.7rem;
    opacity: 0.8;
    margin-top: 10px;
    color: #bdc3c7;
}

.header-separator {
    margin: 0;
    border: 0;
    border-top: 1px solid rgba(255,255,255,0.3);
}

.page-section {
    padding: 0;
}

.page-content {
    padding: 20px 20px;
    box-sizing: border-box;
}

/* 顶部大图片 */
.photo.single img[height="401"], 
img[height="401"] {
    max-width: 570px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin: 15px auto;
    display: block;
}

/* 对话框布局 */
.dialogue-block {
    margin: 15px 0;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
}

/* 对话框头像 - 简化修复 */
.dialogue-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    box-sizing: border-box;
    flex-shrink: 0; /* 仅此一个flex属性，防止压缩 */
}

.dialogue-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.dialogue-content {
    flex: 0 1 auto;
    background: var(--light-gray);
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    position: relative;
    margin-left: 8px;
    margin-right: 8px;
    max-width: calc(100% - 90px);
    min-width: min-content;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
    width: auto;
}

.dialogue-content p {
    margin: 0;
    line-height: 1.6;
    font-size: 0.9rem;
}

/* 三角形样式 */
.dialogue-triangle {
    position: absolute;
    width: 0;
    height: 0;
    z-index: 1;
}

/* 角色介绍 */
.character-intro-block {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 12px 0;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
}

/* 角色介绍头像 - 简化修复 */
.character-intro-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    overflow: hidden;
    box-sizing: border-box;
    flex-shrink: 0; /* 仅此一个flex属性，防止压缩 */
}

.character-intro-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.character-intro-content {
    flex: 1;
    position: relative;
    max-width: calc(100% - 78px);
    box-sizing: border-box;
}

.character-intro-content h3 {
    color: var(--primary);
    margin: 0 0 6px 0;
    font-size: 1.1rem;
    border-bottom: 2px solid var(--secondary);
    padding-bottom: 4px;
}

.character-intro-content p {
    margin: 0;
    line-height: 1.5;
    font-size: 0.85rem;
}

/* 隐藏原始头像图片 */
.imgphoto.inleft img[height="100"],
.imgphoto.inright img[height="100"],
.photo.single img[height="100"] {
    display: none;
}

/* 其他图片样式 */
.photo.single img[height="96"],
img[height="96"] {
    border-radius: 6px;
    border: 2px solid var(--border);
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
    max-width: 100%;
    height: auto;
}

.column.blue {
    background: var(--light-blue);
    border-left: 4px solid var(--secondary);
    padding: 15px;
    margin: 15px 0;
    border-radius: 0 6px 6px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    box-sizing: border-box;
}

.column.blue p {
    margin: 0;
    line-height: 1.6;
}

.column.blue p[align="center"] {
    text-align: center;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
    margin: 6px 0;
}

.column {
    background: var(--light-gray);
    padding: 15px;
    margin: 15px 0;
    border-radius: 6px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    box-sizing: border-box;
}

.column h3 {
    color: var(--primary);
    margin-bottom: 10px;
    font-size: 1.1rem;
    border-bottom: 2px solid var(--secondary);
    padding-bottom: 5px;
}

p {
    margin: 12px 0;
    line-height: 1.6;
    font-size: 0.9rem;
}

.cb {
    clear: both;
}

.page-break {
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--secondary), transparent);
    margin: 20px 0;
    border: none;
}

.imgphoto.inright {
    float: none;
    margin: 10px auto;
    background: white;
    padding: 10px;
    border-radius: 6px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    max-width: 100%;
    border: 1px solid var(--border);
    box-sizing: border-box;
}

.imgphoto.inright img {
    width: 100%;
    height: auto;
    border-radius: 4px;
}

.imgphoto.inright td {
    padding: 4px 3px;
    font-size: 0.75rem;
    color: var(--gray);
    text-align: center;
}

.imgphoto.inright a {
    color: var(--secondary);
    text-decoration: none;
    font-weight: 500;
}

.imgphoto.inright a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.relatedarticle {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 2px solid var(--border);
}

.headname {
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.relatedarticle ul {
    list-style: none;
    padding-left: 0;
}

.relatedarticle li {
    margin-bottom: 8px;
    padding-left: 10px;
    border-left: 3px solid var(--secondary);
}

.relatedarticle a {
    color: var(--secondary);
    text-decoration: none;
    transition: all 0.3s;
    font-weight: 500;
}

.relatedarticle a:hover {
    color: var(--primary);
    text-decoration: underline;
    padding-left: 5px;
}

strong {
    font-weight: 600;
}

/* 脚注样式 */
p[style*="background-color:#FFFFFF;border:1px solid #999999;padding:5px;"] {
    background: var(--light-gray) !important;
    border: 1px solid var(--border) !important;
    padding: 12px !important;
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--gray);
    margin: 15px 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    box-sizing: border-box;
}

/* 响应式设计 - 移动端 */
@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
    
    body {
        padding: 8px;
    }
    
    .summary-container {
        margin: 5px auto;
        border-radius: 6px;
    }
    
    .article-header-container {
        padding: 15px 10px 10px;
    }
    
    h1 {
        font-size: 1.2rem;
    }
    
    .subtitle {
        font-size: 0.85rem;
    }
    
    .page-content {
        padding: 15px 15px;
    }
    
    .dialogue-block {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 8px;
    }
    
    .dialogue-avatar {
        width: 55px;
        height: 55px;
    }
    
    .dialogue-content {
        margin-left: 5px;
        margin-right: 5px;
        margin-top: 5px;
        max-width: calc(100% - 10px);
        padding: 12px;
        width: auto;
        min-width: 120px;
    }
    
    .character-intro-block {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 5px;
    }
    
    .character-intro-avatar {
        width: 65px;
        height: 65px;
    }
    
    .character-intro-content {
        margin-top: 5px;
        width: 100%;
        max-width: 100%;
    }
    
    .photo.single img[height="401"],
    img[height="401"] {
        max-width: 100%;
        height: auto;
    }
    
    .column.blue p[align="center"] {
        font-size: 1.2rem;
    }
    
    .column, .column.blue {
        padding: 12px;
        margin: 12px 0;
    }
}

/* 响应式设计 - 平板 */
@media (min-width: 481px) and (max-width: 768px) {
    body {
        padding: 15px;
    }
    
    .summary-container {
        max-width: 95%;
    }
    
    .page-content {
        padding: 25px 25px;
    }
    
    .dialogue-avatar {
        width: 65px;
        height: 65px;
    }
    
    .dialogue-content {
        margin-left: 10px;
        margin-right: 10px;
        max-width: calc(100% - 85px);
        width: auto;
        min-width: 150px;
    }
    
    .character-intro-avatar {
        width: 75px;
        height: 75px;
    }
    
    .character-intro-content {
        max-width: calc(100% - 83px);
    }
}

/* 响应式设计 - 桌面 */
@media (min-width: 769px) {
    body {
        padding: 20px;
    }
    
    .summary-container {
        max-width: 900px;
    }
    
    .page-content {
        padding: 30px 40px;
    }
    
    .dialogue-avatar {
        width: 70px;
        height: 70px;
    }
    
    .dialogue-content {
        margin-left: 10px;
        margin-right: 10px;
        max-width: calc(100% - 90px);
        width: auto;
        min-width: 160px;
    }
    
    .character-intro-avatar {
        width: 80px;
        height: 80px;
    }
    
    .character-intro-content {
        max-width: calc(100% - 88px);
    }
    
    .imgphoto.inright {
        float: right;
        margin: 0 0 15px 15px;
        max-width: 180px;
    }
}

/* 超大屏幕优化 */
@media (min-width: 1200px) {
    .summary-container {
        max-width: 1000px;
    }
    
    .page-content {
        padding: 35px 50px;
    }
    
    .dialogue-content {
        max-width: calc(100% - 100px);
    }
}

/* 三角形样式 */
@media (max-width: 480px) {
    .dialogue-triangle {
        border-left: 10px solid transparent !important;
        border-right: 10px solid transparent !important;
        border-bottom: 20px solid inherit !important;
        border-top: none !important;
        border-right: none !important;
        left: 50% !important;
        top: -20px !important;
        transform: translateX(-50%) !important;
    }
}

@media (min-width: 769px) {
    .dialogue-triangle {
        border-top: 10px solid transparent !important;
        border-bottom: 10px solid transparent !important;
        border-right: 20px solid inherit !important;
        left: -20px !important;
        top: 20px !important;
    }
}