/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 导航菜单样式 */
nav {
    margin: 20px 0;
    border-bottom: 1px solid rgba(165, 42, 42, 0.3);
    padding-bottom: 10px;
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

nav ul li {
    margin: 0 15px;
}

nav ul li a {
    text-decoration: none;
    color: #8B4513;
    font-weight: bold;
    font-size: 18px;
    padding: 5px 10px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

nav ul li a:hover {
    background-color: rgba(139, 69, 19, 0.1);
}

nav ul li a.active {
    color: #B22222;
    border-bottom: 2px solid #B22222;
}

body {
    font-family: 'Microsoft YaHei', 'SimHei', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f2eb;
    padding: 20px;
    background-image: url('../assets/images/111.jpg');
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 30px;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(210, 180, 140, 0.5);
    position: relative;
    overflow: hidden;
}

/* 添加中国传统元素 - 装饰花纹 */
.container::before,
.container::after {
    content: '';
    position: absolute;
    width: 100px;
    height: 100px;
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.1;
}

.container::before {
    top: 10px;
    left: 10px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath fill='%23A52A2A' d='M50,5 C70,20 80,50 95,50 C80,80 50,80 50,95 C20,80 20,50 5,50 C20,20 50,20 50,5 Z'/%3E%3C/svg%3E");
}

.container::after {
    bottom: 10px;
    right: 10px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath fill='%23A52A2A' d='M50,5 C70,20 80,50 95,50 C80,80 50,80 50,95 C20,80 20,50 5,50 C20,20 50,20 50,5 Z'/%3E%3C/svg%3E");
}

/* 头部样式 */
header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #d2b48c;
    position: relative;
}

header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 2px;
    background-color: #8b4513;
}

header h1 {
    color: #8b4513;
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    font-weight: bold;
    letter-spacing: 2px;
}

header h1::before,
header h1::after {
    content: '•';
    display: inline-block;
    margin: 0 15px;
    color: #d2b48c;
    font-size: 0.8em;
    vertical-align: middle;
}

/* 双语字幕样式 */
.subtitle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    margin-top: 15px;
}

.chinese {
    color: #5D2E0D;
    font-size: 1.1rem;
    font-weight: bold;
}

.english {
    color: #8B7355;
    font-size: 0.9rem;
    font-style: italic;
}

/* 主内容区样式 */
main {
    margin-bottom: 30px;
}

.abacus-container {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    padding: 20px;
    background-color: rgba(245, 242, 235, 0.7);
    border-radius: 10px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.abacus-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.2), transparent 70%);
    pointer-events: none;
}

canvas {
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    background-color: #f9f6f2;
    transition: transform 0.3s ease;
}

canvas:hover {
    transform: scale(1.01);
}

/* 控制区样式 */
.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding: 20px;
    background-color: rgba(245, 242, 235, 0.7);
    border-radius: 8px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(210, 180, 140, 0.3);
}

.buttons-group {
    display: flex;
    gap: 15px;
}

button {
    background-color: #8b4513;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.2);
    font-weight: bold;
    position: relative;
    overflow: hidden;
}

button::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

button:hover {
    background-color: #a0522d;
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3);
}

button:hover::after {
    opacity: 1;
}

button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.2);
}

.volume-control {
    display: flex;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.5);
    padding: 8px 15px;
    border-radius: 20px;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.1);
}

.volume-control label {
    margin-right: 10px;
    font-size: 1rem;
    color: #5D2E0D;
    font-weight: bold;
}

input[type="range"] {
    width: 150px;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, #8b4513, #d2b48c);
    border-radius: 3px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background-color: #8b4513;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    border: 2px solid #fff;
    transition: transform 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background-color: #8b4513;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    border: 2px solid #fff;
}

/* 全屏模式样式 */
.fullscreen-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    overflow: auto;
}

.fullscreen-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.fullscreen-abacus-container {
    width: 95%;
    height: 95%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

#fullscreen-abacus {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.close-fullscreen {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    transition: all 0.3s ease;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.close-fullscreen:hover {
    color: #a0522d;
    transform: scale(1.1);
}

/* 使用说明样式 */
.instructions {
    margin-top: 30px;
    padding: 20px;
    background-color: rgba(245, 242, 235, 0.7);
    border-radius: 8px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(210, 180, 140, 0.3);
    position: relative;
    overflow: hidden;
}

.instructions::after {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 100px;
    height: 100px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath fill='%23D2B48C' d='M20,20 L80,20 L80,80 L20,80 Z M30,30 L70,30 L70,70 L30,70 Z'/%3E%3C/svg%3E");
    background-size: contain;
    opacity: 0.1;
    pointer-events: none;
}

.instructions h3 {
    color: #8b4513;
    margin-bottom: 15px;
    font-size: 1.3rem;
    border-bottom: 1px solid #d2b48c;
    padding-bottom: 8px;
    position: relative;
}

.instructions h3::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 50px;
    height: 2px;
    background-color: #8b4513;
}

.instructions p {
    margin-bottom: 10px;
    color: #5D2E0D;
    line-height: 1.8;
}

/* 页脚样式 */
footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #d2b48c;
    color: #666;
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 900px) {
    canvas {
        width: 100%;
        height: auto;
    }
    
    .controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .buttons-group {
        width: 100%;
        justify-content: center;
    }
    
    .volume-control {
        width: 100%;
        justify-content: center;
        margin-top: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    header h1::before,
    header h1::after {
        margin: 0 8px;
    }
    
    .subtitle {
        flex-direction: column;
    }
    
    .chinese, .english {
        width: 100%;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    button {
        width: 100%;
    }
    
    .buttons-group {
        flex-direction: column;
    }
    
    .instructions p {
        font-size: 0.95rem;
    }
} 

.modal-content {
    background-color: #fff;
    margin: 15vh auto;
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-width: 600px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    max-height: 70vh;
    overflow-y: auto;
}

.modal {
    display: block;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #333;
}

.modal h2 {
    color: #8B4513;
    margin-bottom: 15px;
}

.modal h3 {
    color: #A0522D;
    margin: 15px 0 10px;
}

.modal ul {
    margin-left: 20px;
}

.modal li {
    margin-bottom: 5px;
}

/* FAQ部分样式 */
.faq {
    margin-top: 40px;
    padding: 20px;
    background-color: rgba(245, 242, 235, 0.7);
    border-radius: 8px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    border-left: 5px solid #A52A2A;
}

.faq h2 {
    color: #8B4513;
    margin-bottom: 20px;
    text-align: center;
    font-size: 24px;
    position: relative;
}

.faq h2::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 2px;
    background-color: #A52A2A;
}

.faq h3 {
    color: #A52A2A;
    margin: 15px 0 5px;
    font-size: 18px;
    border-bottom: 1px dashed rgba(165, 42, 42, 0.3);
    padding-bottom: 5px;
}

.faq p {
    margin: 10px 0;
    line-height: 1.6;
    color: #5D2E0D;
}

/* 中英文FAQ部分样式 */
.chinese-faq {
    margin-bottom: 30px;
}

.english-faq {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #D2B48C;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .faq {
        padding: 15px;
    }
    
    .faq h2 {
        font-size: 20px;
    }
    
    .faq h3 {
        font-size: 16px;
    }
    
    .faq p {
        font-size: 0.95rem;
    }
} 