/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Cambria', 'Georgia', 'Times New Roman', serif;
    transition: all 0.3s ease;
}

/* 维多利亚风格深色主题 */
body {
    background-color: #1a1a1a;
    color: #d4c0a1;
    background-image: 
        url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23d4c0a1' fill-opacity='0.05' fill-rule='evenodd'/%3E%3C/svg%3E"),
        linear-gradient(45deg, rgba(85, 63, 35, 0.1) 0%, rgba(26, 26, 26, 0.1) 50%, rgba(85, 63, 35, 0.1) 100%);
    min-height: 100vh;
    position: relative;
}

/* 添加微妙的纹理覆盖 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h20v20H0V0zm20 20h20v20H20V20z' fill='%23d4c0a1' fill-opacity='0.02'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}"}]}}}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* 提升容器视觉效果 */
.main-content {
    background-color: rgba(26, 26, 26, 0.85);
    border: 1px solid #553f23;
    border-radius: 8px;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(212, 192, 161, 0.1),
        inset 0 0 50px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

/* 添加微妙的装饰边框 */
.main-content::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    background: linear-gradient(45deg, #553f23 0%, transparent 25%, transparent 75%, #553f23 100%);
    border-radius: 9px;
    z-index: -1;
    pointer-events: none;
    opacity: 0.3;
}

/* 页眉样式 */
.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px;
    background-color: rgba(85, 63, 35, 0.8);
    border: 2px solid #8b5a2b;
    border-radius: 8px;
}

.header h1 {
    font-size: 2.5rem;
    color: #f0e6d2;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1rem;
    color: #c8b69a;
}

/* 主内容区域 */
.main-content {
    background-color: rgba(26, 26, 26, 0.9);
    border: 2px solid #8b5a2b;
    border-radius: 8px;
    padding: 30px;
}

.nations-section {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* 国家选择器容器，让两个国家选择器并排显示 */
.nations-selectors-container {
    display: flex;
    justify-content: space-between;
    gap: 30px;
}

/* 国家选择器 */
.nation-selector {
    flex: 1;
    background-color: rgba(85, 63, 35, 0.5);
    padding: 20px;
    border: 1px solid #8b5a2b;
    border-radius: 6px;
}

/* 国家选择器 */
.nation-selector {
    flex: 1;
    background-color: rgba(85, 63, 35, 0.5);
    padding: 20px;
    border: 1px solid #8b5a2b;
    border-radius: 6px;
}

.nation-selector h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #f0e6d2;
}

/* 国家名称输入框样式 */
.nation-input {
    width: 100%;
    padding: 12px 15px;
    background-color: rgba(240, 230, 210, 0.9);
    border: 2px solid #8b5a2b;
    border-radius: 4px;
    font-size: 16px;
    color: #333;
    font-weight: 500;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.nation-input:focus {
    outline: none;
    border-color: #d2b48c;
    background-color: #f0e6d2;
    box-shadow: 0 0 0 3px rgba(210, 180, 140, 0.2);
}

.nation-input.selected {
    border-color: #cd853f;
    background-color: #f5f0e6;
}

.nation-input.error {
    border-color: #ff4444;
    background-color: rgba(255, 68, 68, 0.1);
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.nation-input::placeholder {
    color: #8b7d6b;
    font-style: italic;
}
    border-bottom: 1px solid #8b5a2b;
    padding-bottom: 10px;
}

.nation-dropdown {
    width: 100%;
    padding: 12px;
    background-color: #2a2a2a;
    color: #d4c0a1;
    border: 1px solid #8b5a2b;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
}

.nation-dropdown:hover {
    border-color: #a67c52;
}

.nation-dropdown.selected {
    border-color: #5a9128;
    background-color: rgba(90, 145, 40, 0.1);
    box-shadow: 0 0 5px rgba(90, 145, 40, 0.3);
}

.nation-dropdown.error {
    border-color: #c93737;
    background-color: rgba(201, 55, 55, 0.1);
    box-shadow: 0 0 5px rgba(201, 55, 55, 0.3);
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

/* 协议内容区域 */
.treaty-content {
    flex: 2;
    background-color: rgba(85, 63, 35, 0.5);
    padding: 25px;
    border: 1px solid #8b5a2b;
    border-radius: 6px;
}

.treaty-content h2 {
    text-align: center;
    margin-bottom: 25px;
    color: #f0e6d2;
    border-bottom: 1px solid #8b5a2b;
    padding-bottom: 10px;
}

.agreement-type,
.agreement-details,
.date-section {
    margin-bottom: 20px;
}

.agreement-type label,
.agreement-details label {
    display: block;
    margin-bottom: 8px;
    color: #f0e6d2;
    font-weight: bold;
}

.agreement-type select {
    width: 100%;
    padding: 10px;
    background-color: #d4c0a1;
    color: #000;
    border: 1px solid #8b5a2b;
    border-radius: 4px;
    font-size: 1rem;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23fff' viewBox='0 0 16 16'%3E%3Cpath d='M8 12a.5.5 0 0 0 .5-.5V5.707l2.146 2.147a.5.5 0 0 0 .708-.708l-3-3a.5.5 0 0 0-.708 0l-3 3a.5.5 0 1 0 .708.708L7.5 5.707V11.5a.5.5 0 0 0 .5.5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px 16px;
}

/* 日期时间选择器样式 */
.date-section {
    margin-top: 20px;
}

.date-section label {
    display: block;
    margin-bottom: 10px;
    color: #f0e6d2;
    font-weight: bold;
    font-size: 1.1rem;
}

.datetime-container {
    display: flex;
    gap: 15px;
    margin-bottom: 8px;
}

.datetime-container input {
    flex: 1;
    padding: 10px;
    background-color: rgba(85, 63, 35, 0.3);
    border: 1px solid #8b5a2b;
    border-radius: 4px;
    color: #d4c0a1;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.datetime-container input:focus {
    border-color: #d4c0a1;
    box-shadow: 0 0 8px rgba(212, 192, 161, 0.3);
    outline: none;
}

.datetime-container input.error {
    border-color: #a83232;
    box-shadow: 0 0 8px rgba(168, 50, 50, 0.3);
}

.form-hint {
    display: block;
    margin-top: 5px;
    font-size: 0.9rem;
    color: #8b7d6b;
    font-style: italic;
}

/* 协议有效期选择器样式 */
.agreement-duration-container {
    margin-top: 20px;
    margin-bottom: 20px;
}

.agreement-duration-container label {
    display: block;
    margin-bottom: 10px;
    color: #f0e6d2;
    font-weight: bold;
    font-size: 1.1rem;
}

#agreement-duration {
    width: 100%;
    padding: 10px;
    background-color: #d4c0a1;
    border: 1px solid #8b5a2b;
    border-radius: 4px;
    color: #000;
    font-size: 1rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23000' viewBox='0 0 16 16'%3E%3Cpath d='M8 12a.5.5 0 0 0 .5-.5V5.707l2.146 2.147a.5.5 0 0 0 .708-.708l-3-3a.5.5 0 0 0-.708 0l-3 3a.5.5 0 1 0 .708.708L7.5 5.707V11.5a.5.5 0 0 0 .5.5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px 16px;
    appearance: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* 设置选项内部为灰色 */
select option {
    background-color: #555;
    color: #fff;
}

#agreement-duration:hover {
    border-color: #a67c52;
    background-color: #b8a280;
}

.agreement-type select:hover {
    border-color: #a67c52;
    background-color: #b8a280;
}

#agreement-duration:focus {
    outline: none;
    border-color: #8b5a2b;
    box-shadow: 0 0 8px rgba(212, 192, 161, 0.5);
}

.agreement-type select:focus {
    outline: none;
    border-color: #8b5a2b;
    box-shadow: 0 0 8px rgba(212, 192, 161, 0.5);
    background-color: #d4c0a1;
}

#agreement-duration.error {
    border-color: #a83232;
    box-shadow: 0 0 8px rgba(168, 50, 50, 0.3);
    animation: shake 0.5s;
}

/* 游戏时间显示样式 */
.game-time-display {
    margin-top: 10px;
    padding: 12px;
    background-color: rgba(85, 63, 35, 0.2);
    border: 1px solid #8b5a2b;
    border-radius: 4px;
    color: #c8b69a;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.game-time-display:hover {
    background-color: rgba(85, 63, 35, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.game-time-display .icon {
    color: #d4c0a1;
    font-size: 1.2rem;
}

#agreement-text {
    width: 100%;
    padding: 12px;
    background-color: #2a2a2a;
    color: #d4c0a1;
    border: 1px solid #8b5a2b;
    border-radius: 4px;
    font-size: 1rem;
    resize: vertical;
    min-height: 150px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

#agreement-text:focus {
    outline: none;
    border-color: #a67c52;
    box-shadow: 0 0 5px rgba(166, 124, 82, 0.3);
}

.text-area-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.word-count {
    color: #a67c52;
    font-size: 0.9rem;
}

.content-tools {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.tool-button {
    padding: 8px 16px;
    background-color: #5d3a1a;
    color: #f0e6d2;
    border: 1px solid #8b5a2b;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s, transform 0.1s;
}

.tool-button:hover {
    background-color: #8b5a2b;
    transform: translateY(-1px);
}

.tool-button:active {
    transform: translateY(0);
}

/* 按钮样式 */
.save-button,
.back-button {
    display: block;
    width: 100%;
    padding: 15px;
    background-color: #8b5a2b;
    color: #f0e6d2;
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
    margin-top: 10px;
}

.save-button:hover,
.back-button:hover {
    background-color: #a67c52;
    transform: translateY(-2px);
}

.save-button:active,
.back-button:active {
    transform: translateY(0);
}

/* 操作区域样式 */
.action-section {
    position: relative;
    margin-top: 25px;
}

/* 确认签订按钮样式 */
.sign-button {
    width: 100%;
    padding: 15px;
    background-color: #8b5a2b;
    color: #f0e6d2;
    border: none;
    border-radius: 5px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.sign-button:hover {
    background-color: #a67c52;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.sign-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.sign-button:disabled {
    background-color: #5d3a1a;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.button-icon {
    font-size: 1.3rem;
}

/* 通知区域样式 */
.notification {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(85, 63, 35, 0.95);
    color: #f0e6d2;
    padding: 15px 20px;
    border-radius: 5px;
    margin-top: 10px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 250px;
    justify-content: space-between;
    z-index: 100;
    animation: slideDown 0.3s ease-out;
}

.notification.success {
    background-color: rgba(46, 125, 50, 0.95);
    border: 1px solid #388e3c;
}

.notification.error {
    background-color: rgba(198, 40, 40, 0.95);
    border: 1px solid #d32f2f;
}

#close-notification {
    background: none;
    border: none;
    color: #f0e6d2;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

#close-notification:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* 维多利亚3风格卷轴样式 */
.scroll-container {
    margin-top: 40px;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.scroll-wrapper {
    width: 90%;
    max-width: 850px;
    background-color: #d4c5a1;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='100' height='100' fill='%23d4c5a1'/%3E%3Cpath d='M0,0 L100,0 L100,100 L0,100 Z' fill='none' stroke='%23b8a67b' stroke-width='0.5' opacity='0.3'/%3E%3C/svg%3E");
    color: #2a1f10;
    border-radius: 5px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    position: relative;
    border-left: 1px solid #a67c52;
    border-right: 1px solid #a67c52;
}

/* 卷轴装饰 - 顶部和底部 */
.scroll-header,
.scroll-footer {
    height: 40px;
    background-color: #8b5a2b;
    background-image: linear-gradient(135deg, #8b5a2b 0%, #6d4c2f 50%, #8b5a2b 100%);
    position: relative;
    border-bottom: 3px solid #5d3a1a;
}

.scroll-footer {
    border-bottom: none;
    border-top: 3px solid #5d3a1a;
}

/* 卷轴顶部装饰条 */
.scroll-header::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background-color: rgba(255, 255, 255, 0.2);
}

/* 卷轴内容区域 */
.scroll-content {
    padding: 50px;
    position: relative;
    z-index: 1;
    background-color: #d4c5a1;
    background-image: 
        linear-gradient(to right, transparent 0%, rgba(0, 0, 0, 0.02) 50%, transparent 100%),
        linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.01) 50%, transparent 100%);
}

/* 卷轴标题 */
#scroll-agreement-title {
    text-align: center;
    color: #3a2a1a;
    margin-bottom: 40px;
    font-size: 2.5rem;
    font-family: 'Cambria', 'Georgia', serif;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    padding-bottom: 20px;
    position: relative;
}

#scroll-agreement-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20%;
    right: 20%;
    height: 3px;
    background: linear-gradient(to right, transparent, #8b5a2b, transparent);
}

/* 卷轴正文 */
.scroll-body {
    font-size: 1.5rem;
    line-height: 1.9;
    margin-bottom: 50px;
    text-align: justify;
    padding: 0 20px;
    text-indent: 2em;
    font-family: 'Garamond', 'Times New Roman', serif;
    font-weight: 500;
}

/* 国家名称标题样式 */
.scroll-body h1 {
    font-size: 2.1rem;
    color: #8b5a2b;
    text-align: center;
    margin-bottom: 25px;
    font-weight: bold;
    border-bottom: 2px solid #8b5a2b;
    padding-bottom: 15px;
    line-height: 1.3;
    text-indent: 0;
}

/* 签订日期 */
.scroll-date {
    text-align: right;
    font-style: italic;
    margin-bottom: 60px;
    color: #5d3a1a;
    font-size: 1.3rem;
    font-family: 'Garamond', serif;
    font-weight: bold;
    padding: 15px 20px;
    background-color: rgba(85, 63, 35, 0.1);
    border-radius: 4px;
    border-right: 3px solid #8b5a2b;
}

/* 签名区域 */
.signatures {
    display: flex;
    justify-content: space-between;
    margin-top: 60px;
    padding-top: 40px;
    position: relative;
}

.signatures::before {
    content: '';
    position: absolute;
    top: 0;
    left: 5%;
    right: 5%;
    height: 2px;
    background: linear-gradient(to right, transparent, #8b5a2b, transparent);
}

.signature-box {
    text-align: center;
    width: 45%;
    padding: 25px;
    background-color: rgba(212, 197, 161, 0.5);
    border-radius: 5px;
    border: 1px solid #a67c52;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.signature-box p:first-child {
    font-weight: bold;
    margin-bottom: 20px;
    color: #3a2a1a;
    font-size: 1.3rem;
    font-family: 'Cambria', serif;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.signature-line {
    height: 3px;
    background: linear-gradient(to right, transparent, #8b5a2b, transparent);
    margin: 25px 0 15px 0;
    position: relative;
    font-style: italic;
    color: #5d3a1a;
    font-family: 'Garamond', serif;
    padding-top: 5px;
}

.signature-line::before {
    content: 'Signature';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    color: #8b5a2b;
    font-size: 0.9rem;
    font-family: 'Cambria', serif;
    letter-spacing: 1px;
}

/* 卷轴侧边装饰 */
.scroll-wrapper::before,
.scroll-wrapper::after {
    content: '';
    position: absolute;
    top: 40px;
    bottom: 40px;
    width: 15px;
    background-image: linear-gradient(to bottom, #8b5a2b 50%, transparent 50%);
    background-size: 100% 30px;
    opacity: 0.3;
    z-index: 1;
}

.scroll-wrapper::before {
    left: 0;
}

.scroll-wrapper::after {
    right: 0;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .container {
        width: 90%;
    }
    
    .scroll-wrapper {
        width: 95%;
        max-width: 700px;
    }
    
    .scroll-content {
        padding: 40px 30px;
    }
    
    #scroll-agreement-title {
        font-size: 2rem;
    }
    
    .signature-box {
        padding: 20px;
    }
}

@media (max-width: 992px) {
    .nations-section {
        flex-direction: column;
    }
    
    .nation-selector,
    .treaty-content {
        width: 100%;
    }
    
    .signatures {
        flex-direction: column;
        align-items: center;
        gap: 30px;
    }
    
    .signature-box {
        width: 80%;
    }
}

@media (max-width: 768px) {
    .container {
        width: 95%;
        padding: 10px;
    }
    
    .header h1 {
        font-size: 1.8rem;
        margin-bottom: 20px;
    }
    
    .main-content {
        padding: 20px 15px;
        margin-bottom: 25px;
    }
    
    .content-tools {
        flex-direction: column;
        gap: 10px;
    }
    
    .tool-button {
        width: 100%;
    }
    
    .datetime-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .sign-button {
        width: 100%;
        padding: 15px;
        font-size: 1.1rem;
    }
    
    .notification {
        width: 90%;
        left: 5%;
        padding: 15px;
        font-size: 0.9rem;
    }
    
    /* 卷轴响应式样式 */
    .scroll-container {
        overflow-x: auto;
        padding: 10px 0;
        width: 100%;
    }
    
    .scroll-wrapper {
        width: 98%;
        max-width: none;
        min-width: 300px;
    }
    
    .scroll-content {
        padding: 30px 15px;
    }
    
    #scroll-agreement-title {
        font-size: 1.6rem;
        padding-bottom: 15px;
        margin-bottom: 30px;
    }
    
    #scroll-agreement-title::after {
        left: 10%;
        right: 10%;
    }
    
    .scroll-body {
        font-size: 1rem;
        line-height: 1.8;
        padding: 0 10px;
        margin-bottom: 40px;
    }
    
    .scroll-date {
        font-size: 0.95rem;
        padding: 10px 15px;
        margin-bottom: 40px;
    }
    
    .signatures {
        flex-direction: column;
        gap: 25px;
        margin-top: 40px;
        padding-top: 30px;
    }
    
    .signature-box {
        width: 100%;
        padding: 15px;
    }
    
    .signature-box p:first-child {
        font-size: 1.1rem;
    }
    
    .signature-line {
        margin: 20px 0 15px 0;
    }
    
    /* 隐藏侧边装饰 */
    .scroll-wrapper::before,
    .scroll-wrapper::after {
        display: none;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.6rem;
    }
    
    .main-content {
        padding: 15px 10px;
    }
    
    #agreement-text {
        min-height: 200px;
        font-size: 0.9rem;
    }
    
    .word-count {
        font-size: 0.8rem;
    }
    
    /* 卷轴样式进一步优化 */
    .scroll-container {
        overflow-x: auto;
        padding: 5px 0;
        width: 100%;
    }
    
    .scroll-wrapper {
        width: 98%;
        max-width: none;
        min-width: 280px;
    }
    
    .scroll-content {
        padding: 25px 10px;
        font-size: 0.85rem;
        line-height: 1.4;
    }
    
    #scroll-agreement-title {
        font-size: 1.4rem;
    }
    
    .scroll-body {
        font-size: 0.9rem;
        line-height: 1.7;
        text-indent: 1.5em;
    }
    
    .signature-line::before {
        font-size: 0.8rem;
    }
    
    .notification {
        width: 95%;
        left: 2.5%;
        font-size: 0.85rem;
        padding: 10px;
    }
}

/* 打印友好样式 */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .container {
        box-shadow: none;
        border: none;
        padding: 0;
    }
    
    .action-section,
    .notification {
        display: none !important;
    }
    
    .scroll-container {
        display: block !important;
    }
    
    .scroll-wrapper {
        box-shadow: none;
        max-width: 100%;
    }
}

/* 动画效果 */
/* 对话框样式 */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-out;
}

.template-dialog,
.template-preview-dialog {
    background-color: #2a2a2a;
    border: 2px solid #8b5a2b;
    border-radius: 8px;
    padding: 25px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease-out;
}

.template-dialog h3,
.template-preview-dialog h3 {
    color: #f0e6d2;
    border-bottom: 1px solid #8b5a2b;
    padding-bottom: 15px;
    margin-bottom: 20px;
    text-align: center;
}

.template-option {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px;
    background-color: rgba(85, 63, 35, 0.3);
    border-radius: 4px;
}

.template-option input[type="radio"] {
    margin-right: 10px;
    cursor: pointer;
}

.template-option label {
    flex: 1;
    color: #d4c0a1;
    cursor: pointer;
    font-size: 1.1rem;
}

.preview-template {
    padding: 6px 12px;
    background-color: #5d3a1a;
    color: #f0e6d2;
    border: 1px solid #8b5a2b;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

.preview-template:hover {
    background-color: #8b5a2b;
}

.template-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid #8b5a2b;
}

.template-actions button,
.template-preview-dialog button {
    padding: 10px 20px;
    background-color: #8b5a2b;
    color: #f0e6d2;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.template-actions button:hover,
.template-preview-dialog button:hover {
    background-color: #a67c52;
}

#cancel-template,
#close-preview {
    background-color: #5d3a1a;
}

#cancel-template:hover,
#close-preview:hover {
    background-color: #7d552a;
}

.template-preview-content {
    background-color: rgba(85, 63, 35, 0.3);
    padding: 20px;
    border-radius: 4px;
    max-height: 60vh;
    overflow-y: auto;
    font-family: 'Times New Roman', serif;
    line-height: 1.6;
    color: #d4c0a1;
    margin-bottom: 20px;
    white-space: pre-wrap;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.scroll-container {
    animation: fadeIn 0.6s ease-out;
}