/* ==========================================================================
   次元大挑战 - 轻松木质风 CSS
   ========================================================================== */

/* --- 根容器设定 --- */
.ui-frame {
    max-width: 850px;
    margin: 20px auto;
    background-color: #fdf5e6; /* 羊皮纸底色 */
    background-image: 
        radial-gradient(#e8dcc8 1px, transparent 1px),
        radial-gradient(#e8dcc8 1px, transparent 1px);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
    color: #4e342e; /* 深褐色文字 */
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    border-radius: 12px;
    border: 3px solid #8b5a2b;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    padding: 25px;
    font-size: 15px;
    line-height: 1.8;
}

/* --- 正文与对话排版 --- */
.ui-frame p {
    margin-bottom: 18px;
    text-indent: 2em;
    font-size: 16px;
    color: #3e2723;
}

/* 角色对话染色 */
.ui-frame .host-speech {
    color: #8b0000; /* 主持人深红色 */
    font-weight: bold;
    text-shadow: 1px 1px 0px rgba(255,255,255,0.5);
}

.ui-frame .female-speech {
    color: #c2185b; /* 参赛者紫红色 */
    font-weight: 500;
}

/* --- 动态胜负大字报 (h2) --- */
.ui-frame h2 {
    background: linear-gradient(to bottom, #fffaf0, #fdf5e6);
    color: #b71c1c;
    text-align: center;
    padding: 20px;
    margin: 30px 0;
    border: 4px double #8b5a2b;
    border-radius: 8px;
    box-shadow: inset 0 0 10px rgba(139, 90, 43, 0.2), 0 4px 10px rgba(0,0,0,0.1);
    font-size: 22px;
    letter-spacing: 2px;
}

/* --- 栏位 (Details) 统一木质按钮设计 --- */
.ui-frame details {
    background: rgba(255, 255, 255, 0.7);
    border: 2px solid #a67c52;
    border-radius: 8px;
    margin-bottom: 18px;
    box-shadow: 0 4px 6px rgba(139, 90, 43, 0.1);
    transition: all 0.3s ease;
    overflow: hidden;
}

/* 占满一行的木质按钮 */
.ui-frame summary {
    background: linear-gradient(180deg, #b07e5b, #8b5a2b);
    color: #fffaf0;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    list-style: none; /* 隐藏默认三角 */
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #5c3a21;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.6);
    user-select: none;
}

.ui-frame summary:hover {
    background: linear-gradient(180deg, #bc8a66, #966436);
}

/* 自定义下拉箭头 */
.ui-frame summary::after {
    content: "▼";
    font-size: 14px;
    color: #fdf5e6;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ui-frame details[open] summary {
    border-bottom: 2px solid #8b5a2b;
}

.ui-frame details[open] summary::after {
    transform: rotate(180deg);
}

/* 修复Webkit浏览器的默认三角 */
.ui-frame summary::-webkit-details-marker {
    display: none;
}

/* --- 面板内部排版优化 --- */
/* 为 details 内部的内容添加间距 */
.ui-frame details > :not(summary) {
    padding: 0 20px;
    margin: 15px 0;
    color: #4e342e;
}

/* 针对由于 <br> 换行产生的文本流进行行高优化 */
.ui-frame details {
    line-height: 2;
}

/* --- 嵌套的隐私栏位设计 --- */
.ui-frame details details {
    margin: 15px 20px 20px 20px;
    border: 2px dashed #b07e5b;
    background: rgba(253, 245, 230, 0.9);
    box-shadow: none;
}

/* 嵌套栏位的按钮稍微变浅 */
.ui-frame details details summary {
    background: linear-gradient(180deg, #d2a679, #a67c52);
    font-size: 15px;
    padding: 10px 15px;
    border-bottom: 1px solid #8b5a2b;
}

.ui-frame details details > :not(summary) {
    padding: 0 15px;
    font-size: 14.5px;
    color: #5d4037;
}

/* --- 记忆区表格优化 --- */
.ui-frame table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 0 0 1px #d2a679;
}

.ui-frame th {
    background: #8b5a2b;
    color: #fdf5e6;
    padding: 10px;
    font-weight: bold;
    text-align: center;
    border: 1px solid #5c3a21;
}

.ui-frame td {
    padding: 10px;
    border: 1px solid #e8dcc8;
    color: #4e342e;
    text-align: center;
}

.ui-frame tr:nth-child(even) {
    background: #fdf5e6;
}

.ui-frame tr:hover td {
    background: #faebd7;
}

/* --- 行动建议列表优化 --- */
.ui-frame ol, .ui-frame ul {
    background: rgba(255, 255, 255, 0.6);
    border: 2px solid #d2a679;
    border-radius: 8px;
    padding: 20px 20px 20px 40px;
    margin: 20px 0 0 0;
}

.ui-frame li {
    margin-bottom: 10px;
    color: #3e2723;
    font-weight: 500;
}

.ui-frame li:last-child {
    margin-bottom: 0;
}

/* --- 响应式适配 --- */
@media (max-width: 768px) {
    .ui-frame {
        padding: 15px;
        margin: 10px;
        border-width: 2px;
    }
    
    .ui-frame summary {
        padding: 12px 15px;
        font-size: 15px;
    }
    
    .ui-frame h2 {
        font-size: 18px;
        padding: 15px;
    }
    
    .ui-frame details > :not(summary) {
        padding: 0 15px;
    }
}