/* PC端主样式（原样100%还原） */
* {
    box-sizing: border-box;
    font-family: 'Microsoft YaHei', sans-serif;
    color: #666;
}
body {
    background-color: #DCDCDC;
    margin: 20px;
    color: #666;
}
h1{
    text-align: center;
    color: #666;
    margin: 0 auto;
    padding: 20px;
    background-color: #d2b1fe;
}
.app-container {
    width: 100%;
    max-width: 1200px;
    height: calc(100vh - 40px);
    margin: auto;
    background-color: #E9E8F2;
    padding: 10px;
    border: 1px solid #C0C0C0;
    display: flex;
    flex-direction: column;
}
main {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-grow: 1;
    min-height: 0;
}
.layout-row {
    display: flex;
    gap: 10px;
    min-height: 0;
    align-items: stretch;
}
main > .layout-row:nth-of-type(1) { flex: 2; }
main > .layout-row:nth-of-type(2) { flex: 2; }
main > .layout-row:nth-of-type(3) { flex: 3; }
.layout-row > .panel-block:first-child {
    width: 50%;
}
.layout-row > .panel-block:last-child {
    width: 50%;
}
.panel-block {
    background-color: #E9E8F2;
    border: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
}
.top-textarea, .bottom-textarea {
    width: 100%;
    border: 1px solid #c8cccf;
    resize: none;
    flex-grow: 1;
    padding: 6px 2%;
    background-color: #fff;
    background: linear-gradient(#fff, #f7f7f7);
    font-size: 20px;
    line-height: 26px;
    color: #064a7b;
    font-weight: bolder;
    box-sizing: border-box;
    border-radius: 6px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    outline: 0;
    text-decoration: none;
}
.top-textarea:focus, .bottom-textarea:focus {
    -moz-box-shadow: 0px 0px 8px #065792;
    -webkit-box-shadow: 0px 0px 8px #065792;
    box-shadow: 0px 0px 8px #065792;
    border: 1px solid #065792;
}

/* 输入错误状态样式 */
.top-textarea.input-error {
    border: 2px solid #ff4444 !important;
    background-color: #ffe6e6 !important;
    box-shadow: 0px 0px 8px #ff4444 !important;
}

.top-textarea.input-error:focus {
    border: 2px solid #ff4444 !important;
    box-shadow: 0px 0px 8px #ff4444 !important;
}
.controls {
    display: flex;
    gap: 10px;
    flex-grow: 1;
    align-items: stretch;
}
.clear-btn {
    background: linear-gradient(#f2f2f2, #c4c4c4);
    border: 1px solid #cecece;
    color: #000;
    font-size: 1.5vw;
    border-radius: 0.4vw;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 5vw;
    flex-shrink: 0;
    padding: 0.6vw;
    box-shadow: inset 0px 1px 0px rgba(255, 255, 255, 1), 0 1px 2px rgba(0, 0, 0, 0.15);
}
.clear-btn:focus, .clear-btn:hover {
    background: linear-gradient(#c4c4c4, #f2f2f2);
    box-shadow: inset 0px 1px 0px rgba(255, 255, 255, 0.6), 0 1px 2px rgba(0, 0, 0, 0.15);
    outline: none;
    border-radius: 0.4vw;
}
.main-controls {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex-grow: 1;
}
.button-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.3vw;
}
.button-grid button {
    padding: 0.3vw 0.5vw;
    border: 1px solid #cecece;
    background: linear-gradient(#f2f2f2, #c4c4c4);
    cursor: pointer;
    border-radius: 0.4vw;
    font-size: 1.2vw;
    color: #000;
    box-shadow: inset 0px 1px 0px rgba(255, 255, 255, 1), 0 1px 2px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
}
.button-grid button:focus, .button-grid button:hover {
    background: linear-gradient(#c4c4c4, #f2f2f2);
    box-shadow: inset 0px 1px 0px rgba(255, 255, 255, 0.6), 0 1px 2px rgba(0, 0, 0, 0.15);
    outline: none;
    border-radius: 0.4vw;
}
/* 禁用状态的按钮样式 */
.button-grid button.disabled {
    background: linear-gradient(#cccccc, #999999);
    color: #666666;
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: inset 0px 1px 0px rgba(255, 255, 255, 0.3), 0 1px 2px rgba(0, 0, 0, 0.1);
}
.button-grid button.disabled:focus, .button-grid button.disabled:hover {
    background: linear-gradient(#cccccc, #999999);
    color: #666666;
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: inset 0px 1px 0px rgba(255, 255, 255, 0.3), 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* 选中状态的按钮样式 */
.button-grid button.selected {
    background: linear-gradient(#87CEEB, #5F9EA0) !important;
    color: #000 !important;
    border-color: #4682B4 !important;
    box-shadow: inset 0px 1px 0px rgba(255, 255, 255, 0.8), 0 2px 4px rgba(0, 0, 0, 0.2) !important;
    transform: translateY(-1px);
}
.button-grid button.selected:focus, .button-grid button.selected:hover {
    background: linear-gradient(#5F9EA0, #87CEEB) !important;
    color: #000 !important;
    border-color: #4682B4 !important;
    box-shadow: inset 0px 1px 0px rgba(255, 255, 255, 0.6), 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}
.color-buttons {
    display: flex;
    gap: 5px;
}
.color-buttons button {
    padding: 6px 12px;
    color: white;
    border-radius: 6px;
    font-size: 1.1em;
    cursor: pointer;
    border: 1px solid;
    box-shadow: inset 0px 1px 0px rgba(255, 255, 255, 0.6), 0 1px 2px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
}
.color-buttons .red-wave {
    background: linear-gradient(#ff0000, #8e0001);
    border-color: #8e0001;
}
.color-buttons .red-wave:focus, .color-buttons .red-wave:hover {
    background: linear-gradient(#8e0001, #ff0000);
}
.color-buttons .blue-wave {
    background: linear-gradient(#478ef9, #004e90);
    border-color: #004e90;
}
.color-buttons .blue-wave:focus, .color-buttons .blue-wave:hover {
    background: linear-gradient(#004e90, #478ef9);
}
.color-buttons .green-wave {
    background: linear-gradient(#00d000, #006300);
    border-color: #006300;
}
.color-buttons .green-wave:focus, .color-buttons .green-wave:hover {
    background: linear-gradient(#006300, #00d000);
}
/* 禁用状态的波色按钮样式 */
.color-buttons button.disabled {
    background: linear-gradient(#cccccc, #999999) !important;
    color: #666666 !important;
    cursor: not-allowed;
    opacity: 0.6;
    border-color: #999999 !important;
    box-shadow: inset 0px 1px 0px rgba(255, 255, 255, 0.3), 0 1px 2px rgba(0, 0, 0, 0.1);
}
.color-buttons button.disabled:focus, .color-buttons button.disabled:hover {
    background: linear-gradient(#cccccc, #999999) !important;
    color: #666666 !important;
    cursor: not-allowed;
    opacity: 0.6;
    border-color: #999999 !important;
    box-shadow: inset 0px 1px 0px rgba(255, 255, 255, 0.3), 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* 选中状态的波色按钮样式 */
.color-buttons button.selected {
    background: linear-gradient(#87CEEB, #5F9EA0) !important;
    color: #000 !important;
    border-color: #4682B4 !important;
    box-shadow: inset 0px 1px 0px rgba(255, 255, 255, 0.8), 0 2px 4px rgba(0, 0, 0, 0.2) !important;
    transform: translateY(-1px);
}
.color-buttons button.selected:focus, .color-buttons button.selected:hover {
    background: linear-gradient(#5F9EA0, #87CEEB) !important;
    color: #000 !important;
    border-color: #4682B4 !important;
    box-shadow: inset 0px 1px 0px rgba(255, 255, 255, 0.6), 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}
.right-top-buttons {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 5px;
    flex-shrink: 0;
}

/* 按钮分组样式 */
.right-top-buttons button {
    flex-grow: 1;
    padding: 8px;
    border: 1px solid #cecece;
    background: linear-gradient(#f2f2f2, #c4c4c4);
    cursor: pointer;
    border-radius: 6px;
    font-size: 1em;
    color: #000;
    box-shadow: inset 0px 1px 0px rgba(255, 255, 255, 1), 0 1px 2px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
}

/* 第一组：平台选择按钮 - 蓝色边框 */
.right-top-buttons button:nth-child(-n+5) {
    border-color: #4a90e2;
}

/* 第二组：符号分隔按钮 - 绿色边框 */
.right-top-buttons button:nth-child(n+6):nth-child(-n+15) {
    border-color: #7ed321;
}

/* 第三组：格式按钮 - 橙色边框 */
.right-top-buttons button:nth-child(n+16) {
    border-color: #f5a623;
}

.right-top-buttons button:focus, .right-top-buttons button:hover {
    background: linear-gradient(#c4c4c4, #f2f2f2);
    box-shadow: inset 0px 1px 0px rgba(255, 255, 255, 0.6), 0 1px 2px rgba(0, 0, 0, 0.15);
    outline: none;
    border-radius: 6px;
    transform: translateY(-1px);
}

.right-top-buttons button:nth-child(16),
.right-top-buttons button:nth-child(17) {
    grid-column: span 2;
}

.right-top-buttons button.active {
    background: linear-gradient(#478ef9, #004e90);
    color: white;
    border-color: #004e90;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
.right-middle-buttons {
    display: flex;
    gap: 5px;
    margin-bottom: 5px;
}
.operators {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
    flex-grow: 1;
}
.operators button {
    padding: 8px;
    border: 1px solid #cecece;
    background: linear-gradient(#f2f2f2, #c4c4c4);
    cursor: pointer;
    border-radius: 6px;
    font-size: 1.2em;
    color: #000;
    box-shadow: inset 0px 1px 0px rgba(255, 255, 255, 1), 0 1px 2px rgba(0, 0, 0, 0.15);
}
.operators button:focus, .operators button:hover {
    background: linear-gradient(#c4c4c4, #f2f2f2);
    box-shadow: inset 0px 1px 0px rgba(255, 255, 255, 0.6), 0 1px 2px rgba(0, 0, 0, 0.15);
    outline: none;
    border-radius: 6px;
}
.zero-buttons {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
}
.zero-buttons button {
    padding: 8px 12px;
    border: 1px solid #cecece;
    background: linear-gradient(#f2f2f2, #c4c4c4);
    cursor: pointer;
    border-radius: 6px;
    font-size: 1em;
    color: #000;
    box-shadow: inset 0px 1px 0px rgba(255, 255, 255, 1), 0 1px 2px rgba(0, 0, 0, 0.15);
}
.zero-buttons button:focus, .zero-buttons button:hover {
    background: linear-gradient(#c4c4c4, #f2f2f2);
    box-shadow: inset 0px 1px 0px rgba(255, 255, 255, 0.6), 0 1px 2px rgba(0, 0, 0, 0.15);
    outline: none;
    border-radius: 6px;
}
.info-section {
    overflow: hidden;
}
.zodiac-info-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 10px;
    overflow: hidden;
}
.zodiac-info {
    flex-grow: 1;
    background-color: #fff;
    padding: 1px 4px 1px 10px;
    border-radius: 6px;
    border: 1px solid #c8cccf;
    font-size: 12px;
    line-height: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    max-height: 240px;
    overflow-y: auto;
}
.zodiac-info p {
    margin: 3px 0;
    font-size: 16px;
    font-weight: bold;
    padding: 1px 0;
    border-bottom: 1px solid #eee;
}
.side-controls {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
}
.side-controls button {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #cecece;
    background: linear-gradient(#f2f2f2, #c4c4c4);
    cursor: pointer;
    border-radius: 6px;
    font-size: 0.9em;
    color: #000;
    box-shadow: inset 0px 1px 0px rgba(255, 255, 255, 1), 0 1px 2px rgba(0, 0, 0, 0.15);
}
.side-controls button:focus, .side-controls button:hover {
    background: linear-gradient(#c4c4c4, #f2f2f2);
    box-shadow: inset 0px 1px 0px rgba(255, 255, 255, 0.6), 0 1px 2px rgba(0, 0, 0, 0.15);
    outline: none;
    border-radius: 6px;
}
.side-controls button:last-child {
    flex: 1.5;
}
.side-controls button:first-child {
    flex: 1;
}
.side-controls .clear-cache-btn {
    background: linear-gradient(#ff6b6b, #ee5a52);
    color: white;
    font-weight: bold;
}
.side-controls .clear-cache-btn:focus, .side-controls .clear-cache-btn:hover {
    background: linear-gradient(#ee5a52, #ff6b6b);
    color: white;
}
.order-buttons {
    display: flex;
    gap: 0.3vw;
    flex-shrink: 0;
}
.order-buttons button {
    flex: 1;
    padding: 0.5vw 0.7vw;
    border: 1px solid #cecece;
    background: linear-gradient(#f2f2f2, #c4c4c4);
    cursor: pointer;
    border-radius: 0.4vw;
    font-size: 1.4vw;
    color: #000;
    box-shadow: inset 0px 1px 0px rgba(255, 255, 255, 1), 0 1px 2px rgba(0, 0, 0, 0.15);
}
.order-buttons button:focus, .order-buttons button:hover {
    background: linear-gradient(#c4c4c4, #f2f2f2);
    box-shadow: inset 0px 1px 0px rgba(255, 255, 255, 0.6), 0 1px 2px rgba(0, 0, 0, 0.15);
    outline: none;
    border-radius: 0.4vw;
}
.copy-buttons {
    display: flex;
    gap: 5px;
    margin-top: 5px;
}
.video-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: hidden;
}
.video-container img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    border: 1px solid #c8cccf;
}
.insert-section {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
    padding: 10px;
    background-color: #fff;
    border-radius: 6px;
    border: 1px solid #c8cccf;
    font-size: 14px;
}
.insert-section input[type="text"] {
    width: 60px;
    padding: 5px;
    border: 1px solid #c8cccf;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
}
.insert-section input[type="text"]:focus, .insert-section input[type="text"]:hover {
    border-color: #065792;
    outline: none;
}
.insert-section button {
    padding: 5px 10px;
    border: 1px solid #cecece;
    background: linear-gradient(#f2f2f2, #c4c4c4);
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
}
.insert-section button:focus, .insert-section button:hover {
    background: linear-gradient(#c4c4c4, #f2f2f2);
    outline: none;
}
.bottom-textarea {
    display: flex;
    flex-direction: column;
    height: 200px;
    overflow: hidden;
}
.bottom-textarea1 {
    flex: 1 1 auto;
    width: 100%;
    min-height: 80px;
    max-height: 100%;
    resize: none;
    box-sizing: border-box;
    margin-top: 4px;
    font-size: 16px;
    overflow-y: auto;
    overflow-x: hidden;
    word-break: break-all;
    white-space: pre-wrap;
    background: transparent;
    border: none;
    outline: none;
    padding: 0;
}
.copy-bottom-btn {
    padding: 8px 16px;
    border: 1px solid #cecece;
    background: linear-gradient(#f2f2f2, #c4c4c4);
    cursor: pointer;
    border-radius: 6px;
    font-size: 1em;
    color: #000;
    margin-top: 5px;
    box-shadow: inset 0px 1px 0px rgba(255, 255, 255, 1), 0 1px 2px rgba(0, 0, 0, 0.15);
}
.copy-bottom-btn:focus, .copy-bottom-btn:hover {
    background: linear-gradient(#c4c4c4, #f2f2f2);
    box-shadow: inset 0px 1px 0px rgba(255, 255, 255, 0.6), 0 1px 2px rgba(0, 0, 0, 0.15);
    outline: none;
    border-radius: 6px;
}
.video-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: hidden;
}
.video-container video {
    width: 100%;
    height: auto;
    border-radius: 6px;
    border: 1px solid #c8cccf;
}
.panel-block {
    background-color: #E9E8F2;
    border: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
}

/* 移动端自适应，仅在max-width: 768px下生效 */
@media screen and (max-width: 768px) {
    body {
        margin: 0;
        padding: 5px;
    }
    .app-container {
        height: auto;
        min-height: 100vh;
        padding: 5px;
    }
    h1 {
        font-size: 1.2em;
        margin: 5px 0;
    }
    .layout-row {
        flex-direction: column;
        gap: 5px;
    }
    .layout-row > .panel-block:first-child,
    .layout-row > .panel-block:last-child {
        width: 100%;
    }
    main > .layout-row:nth-of-type(1),
    main > .layout-row:nth-of-type(2),
    main > .layout-row:nth-of-type(3) {
        flex: none;
    }
    .top-textarea, .bottom-textarea {
        font-size: 16px;
        line-height: 20px;
        min-height: 50px;
    }
    .button-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 3px;
    }
    .button-grid button {
        padding: 8px 4px;
        font-size: 1.2em;
        min-height: 40px;
    }
    .color-buttons {
        gap: 3px;
    }
    .color-buttons button {
        padding: 8px 6px;
        font-size: 0.9em;
    }
    .right-top-buttons {
        grid-template-columns: repeat(5, 1fr);
        gap: 3px;
    }
    .right-top-buttons button {
        padding: 6px 4px;
        font-size: 0.9em;
        min-height: 35px;
    }
    .clear-btn {
        width: 60px;
        font-size: 1.2em;
        padding: 8px;
        min-height: 40px;
    }
    .controls {
        gap: 5px;
    }
    .zodiac-info-container {
        gap: 5px;
    }
    .zodiac-info {
        font-size: 11px;
        padding: 6px;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 4px;
        max-height: 200px;
        overflow-y: auto;
        line-height: 1.1;
    }
    .zodiac-info p {
        margin: 3px 0;
        font-size: 11px;
    }
    .side-controls {
        gap: 3px;
    }
    .side-controls button {
        padding: 6px 8px;
        font-size: 0.8em;
        min-height: 35px;
    }
    .order-buttons {
        gap: 3px;
    }
    .order-buttons button {
        padding: 6px 8px;
        font-size: 0.9em;
        min-height: 35px;
    }
    .video-container {
        gap: 5px;
    }
    .insert-section {
        padding: 8px;
        font-size: 12px;
        flex-wrap: wrap;
    }
    .insert-section input[type="text"] {
        width: 50px;
        padding: 4px;
        font-size: 12px;
    }
    .insert-section button {
        padding: 4px 8px;
        font-size: 12px;
    }
    .copy-bottom-btn {
        padding: 6px 12px;
        font-size: 0.9em;
        margin-top: 3px;
    }
}
@media screen and (max-width: 480px) {
    body {
        padding: 3px;
    }
    .app-container {
        padding: 3px;
    }
    h1 {
        font-size: 1em;
        margin: 3px 0;
    }
    .button-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 2px;
    }
    .button-grid button {
        padding: 6px 2px;
        font-size: 0.9em;
        min-height: 35px;
    }
    .right-top-buttons {
        grid-template-columns: repeat(5, 1fr);
        gap: 2px;
    }
    .right-top-buttons button {
        padding: 4px 2px;
        font-size: 0.8em;
        min-height: 30px;
    }
    .zodiac-info {
        font-size: 10px;
        padding: 4px;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 3px;
        max-height: 180px;
        overflow-y: auto;
        line-height: 1.0;
    }
    .zodiac-info p {
        margin: 2px 0;
        font-size: 10px;
    }
    .side-controls {
        gap: 2px;
    }
    .side-controls button {
        padding: 4px 6px;
        font-size: 0.7em;
        min-height: 30px;
    }
    .video-container {
        gap: 3px;
    }
    .insert-section {
        padding: 6px;
        font-size: 11px;
    }
    .insert-section input[type="text"] {
        width: 45px;
        padding: 3px;
        font-size: 11px;
    }
    .insert-section button {
        padding: 3px 6px;
        font-size: 11px;
    }
}
.result-line {
    display: flex;
    align-items: flex-start;
    margin-bottom: 6px;
    gap: 8px;
    flex-wrap: wrap;
    word-break: break-all;
    width: 100%;
}
.result-line .nums {
    word-break: break-all;
    white-space: pre-wrap;
    flex: 1 1 0;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: break-word;
}
.result-line .copy-line-btn {
    margin-left: 8px;
    padding: 4px 12px;
    font-size: 12px;
    border-radius: 4px;
    border: 1px solid #ccc;
    background: #f2f2f2;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    min-width: 50px;
    text-align: center;
}

.result-line .copy-line-btn:hover {
    background: #e0e0e0;
    border-color: #999;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.result-line .copy-line-btn:active {
    background: #d0eaff;
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}