/* 操作指南样式 */
.ac-game-menu-announcement {
    position: fixed;
    top: 9vh;
    right: 2vw;
    z-index: 1000;
    user-select: none;
    display: flex;
    flex-direction: row-reverse; /* 反转布局，按钮在右，内容在左 */
    align-items: flex-start;
    gap: 0.8vw;
}

.ac-game-menu-announcement-toggle {
    color: #e4e4e7;
    height: 4.5vh;
    min-height: 36px;
    width: auto;
    min-width: 100px;
    max-width: 120px;
    padding: 0 1.2vw;
    font-size: clamp(12px, 1.8vh, 16px);
    font-weight: 400;
    font-family: 'Inter', 'Roboto', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(25, 25, 35, 0.5), rgba(35, 35, 45, 0.4));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    letter-spacing: 0.05vw;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
    will-change: transform, box-shadow;
    backface-visibility: hidden;
}

.ac-game-menu-announcement-text {
    flex: 1;
    text-align: center;
    font-size: clamp(11px, 1.6vh, 14px);
}

.ac-game-menu-announcement-arrow {
    font-size: clamp(10px, 1.4vh, 14px);
    transition: transform 0.3s ease;
    display: inline-block;
    position: absolute;
    right: 0.4vw;
    transform: rotate(-90deg); /* 箭头向左 */
}

.ac-game-menu-announcement-arrow.active {
    transform: rotate(90deg); /* 展开时箭头向右 */
}

.ac-game-menu-announcement-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
    transparent,
    rgba(255, 255, 255, 0.03),
    rgba(255, 255, 255, 0.06),
    rgba(255, 255, 255, 0.03),
    transparent);
    transition: left 0.5s ease;
    will-change: transform;
}

.ac-game-menu-announcement-toggle::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #78b659, #2f4e2f);
    transition: width 0.3s ease;
    will-change: width;
}

.ac-game-menu-announcement-toggle:hover {
    transform: translateY(-1px);
    color: #ffffff;
    background: linear-gradient(135deg, rgba(30, 30, 40, 0.6), rgba(40, 40, 50, 0.5));
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.4),
    0 0 20px rgba(155, 89, 182, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.ac-game-menu-announcement-toggle:hover::before {
    left: 100%;
}

.ac-game-menu-announcement-toggle:hover::after {
    width: 100%;
}

.ac-game-menu-announcement-toggle:active {
    transform: translateY(0);
    background: linear-gradient(135deg, rgba(25, 25, 35, 0.7), rgba(35, 35, 45, 0.6));
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5),
    inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.ac-game-menu-announcement-content {
    background: linear-gradient(135deg, rgba(25, 25, 35, 0.8), rgba(35, 35, 45, 0.75));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 1.5vh 1.2vw;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    width: 0; /* 初始宽度为0 */
    max-width: 280px;
    min-width: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    white-space: nowrap; /* 防止文字在宽度动画时换行 */
}

.ac-game-menu-announcement-content.active {
    opacity: 1;
    width: 280px; /* 展开时设置宽度 */
    min-width: 240px;
    white-space: normal; /* 恢复正常换行 */
}

.ac-game-menu-announcement-content h3 {
    color: #f39c12;
    font-size: clamp(12px, 1.8vh, 15px);
    font-weight: 500;
    font-family: 'Inter', 'Roboto', sans-serif;
    margin: 0 0 1.2vh 0;
    text-transform: uppercase;
    letter-spacing: 0.08vw;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.ac-game-menu-announcement-item {
    color: #e4e4e7;
    font-size: clamp(11px, 1.5vh, 14px);
    font-family: 'Inter', 'Roboto', sans-serif;
    margin-bottom: 1vh;
    padding-left: 0.8vw;
    line-height: 1.4;
    position: relative;
}

.ac-game-menu-announcement-item::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: #3498db;
    font-size: clamp(10px, 1.5vh, 14px);
}

.ac-game-menu-announcement-item:last-child {
    margin-bottom: 0;
}

.ac-game-menu-announcement-key {
    display: inline-block;
    background: rgba(52, 152, 219, 0.15);
    border: 1px solid rgba(52, 152, 219, 0.3);
    border-radius: 3px;
    padding: 0.1vh 0.4vw;
    margin: 0 0.2vw;
    font-weight: 500;
    font-size: clamp(10px, 1.4vh, 13px);
    color: #5dade2;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

@media screen and (max-width: 1024px) {
    .ac-game-menu-announcement {
        top: 2.5vh;
        right: 2.5vw;
    }

    .ac-game-menu-announcement-toggle {
        min-width: 90px;
        padding: 0 1vw;
    }

    .ac-game-menu-announcement-content.active {
        width: 260px;
        min-width: 220px;
    }
}

@media screen and (max-width: 768px) {
    .ac-game-menu-announcement {
        top: 2vh;
        right: 2vw;
    }

    .ac-game-menu-announcement-toggle {
        height: 5vh;
        min-height: 40px;
        min-width: 85px;
        font-size: clamp(11px, 1.7vh, 15px);
    }

    .ac-game-menu-announcement-content {
        padding: 1.3vh 1vw;
    }

    .ac-game-menu-announcement-content.active {
        width: 240px;
        min-width: 200px;
    }
}

@media screen and (max-width: 667px) and (orientation: landscape) {
    .ac-game-menu-announcement {
        top: 1.5vh;
        right: 1.5vw;
    }

    .ac-game-menu-announcement-toggle {
        height: 6vh;
        min-height: 35px;
    }
}

@media screen and (max-width: 480px) {
    .ac-game-menu-announcement {
        top: 1.5vh;
        right: 2vw;
        gap: 0.5vw;
    }

    .ac-game-menu-announcement-toggle {
        height: 6vh;
        min-height: 38px;
        min-width: 80px;
        font-size: clamp(10px, 1.6vh, 14px);
        padding: 0 2vw;
    }

    .ac-game-menu-announcement-content {
        padding: 1.5vh 2vw;
    }

    .ac-game-menu-announcement-content.active {
        width: 65vw;
        max-width: 240px;
        min-width: 180px;
    }

    .ac-game-menu-announcement-item {
        font-size: clamp(10px, 1.4vh, 13px);
        padding-left: 3vw;
    }
}

@media screen and (max-width: 360px) {
    .ac-game-menu-announcement {
        right: 1vw;
    }

    .ac-game-menu-announcement-toggle {
        min-width: 75px;
    }

    .ac-game-menu-announcement-content.active {
        width: 60vw;
        max-width: 220px;
        min-width: 160px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ac-game-menu-announcement-arrow,
    .ac-game-menu-announcement-content {
        transition-duration: 0.01ms !important;
    }
}

/* 编辑按钮 */
.ac-game-menu-announcement-edit-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 28px;
    height: 28px;
    background: rgba(52, 152, 219, 0.2);
    border: 1px solid rgba(52, 152, 219, 0.3);
    border-radius: 6px;
    color: #3498db;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 14px;
}

.ac-game-menu-announcement-edit-btn:hover {
    background: rgba(52, 152, 219, 0.3);
    border-color: rgba(52, 152, 219, 0.5);
    transform: scale(1.05);
}

/* 编辑模态框 */
.ac-game-menu-announcement-edit-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.ac-game-menu-announcement-edit-modal.active {
    display: flex;
}

.edit-modal-content {
    width: 90%;
    max-width: 500px;
    background: linear-gradient(135deg, rgba(25, 25, 35, 0.95), rgba(35, 35, 45, 0.9));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.edit-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.edit-modal-title {
    color: #f39c12;
    font-size: 20px;
    font-weight: 500;
    margin: 0;
}

.edit-modal-close {
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.edit-modal-close:hover {
    color: rgba(255, 255, 255, 0.9);
    transform: rotate(90deg);
}

.edit-form-group {
    margin-bottom: 20px;
}

.edit-form-label {
    display: block;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    margin-bottom: 8px;
}

.edit-form-input,
.edit-form-textarea {
    width: 100%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #e4e4e7;
    font-size: 14px;
    font-family: 'Inter', 'Roboto', sans-serif;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.edit-form-textarea {
    min-height: 120px;
    resize: vertical;
}

.edit-form-input:focus,
.edit-form-textarea:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(52, 152, 219, 0.5);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

.edit-form-checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.edit-form-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.edit-form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 25px;
}

.edit-form-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.edit-form-btn-save {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.8), rgba(41, 128, 185, 0.7));
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.edit-form-btn-save:hover {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.9), rgba(41, 128, 185, 0.8));
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.edit-form-btn-cancel {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.edit-form-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.12);
}

.char-counter {
    text-align: right;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 5px;
}

/* 公告列表样式优化 */
.ac-game-menu-announcement-list {
    max-height: 300px;
    overflow-y: auto;
}

.ac-game-menu-announcement-item {
    color: #e4e4e7;
    font-size: 14px;
    margin-bottom: 1.2vh;
    padding: 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    border-left: 3px solid #3498db;
    transition: all 0.2s ease;
}

.ac-game-menu-announcement-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-left-color: #5dade2; /* 只改变边框颜色 */
}

.ac-game-menu-announcement-time {
    display: block;
    margin-top: 5px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
}

.ac-game-menu-announcement-loading {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.6);
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #f39c12;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.ac-game-menu-announcement-empty {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.4);
}

.announcement-empty-icon {
    font-size: 36px;
    margin-bottom: 10px;
}

/* 公告头部样式 */
.ac-game-menu-announcement-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 10px;
}

.ac-game-menu-announcement-header h3 {
    margin: 0;
}

/* 新增公告按钮 */
.ac-game-menu-announcement-add-btn {
    width: 28px;
    height: 28px;
    background: rgba(46, 204, 113, 0.2);
    border: 1px solid rgba(46, 204, 113, 0.3);
    border-radius: 6px;
    color: #2ecc71;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 16px;
}

.ac-game-menu-announcement-add-btn:hover {
    background: rgba(46, 204, 113, 0.3);
    border-color: rgba(46, 204, 113, 0.5);
    transform: scale(1.05);
}

/* 公告项样式调整 */
.ac-game-menu-announcement-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    color: #e4e4e7;
    font-size: 14px;
    margin-bottom: 1.2vh;
    padding: 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    border-left: 3px solid #3498db;
    transition: all 0.2s ease;
    position: relative;
}

.ac-game-menu-announcement-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-left-color: #5dade2;
    /* 移除 transform，避免横条问题 */
}

.announcement-item-content {
    flex: 1;
    padding-right: 10px;
}

.announcement-item-content > div {
    user-select: text;
}


/* 操作按钮组 */
.announcement-item-actions {
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.ac-game-menu-announcement-item:hover .announcement-item-actions {
    opacity: 1;
}

.announcement-action-btn {
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 12px;
}

.announcement-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.announcement-action-btn.edit-btn:hover {
    background: rgba(52, 152, 219, 0.2);
    border-color: rgba(52, 152, 219, 0.3);
}

.announcement-action-btn.delete-btn:hover {
    background: rgba(231, 76, 60, 0.2);
    border-color: rgba(231, 76, 60, 0.3);
}

/* 滚动条优化 */
.ac-game-menu-announcement-list::-webkit-scrollbar {
    width: 4px;
}

.ac-game-menu-announcement-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

.ac-game-menu-announcement-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.ac-game-menu-announcement-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}