body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f9f4;
    color: #333;
    display: flex;
    flex-direction: row;
    height: 100vh;
}

main {
    width: 100%;
    padding: 1rem;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: width 0.3s ease;
    display: flex;
    flex-direction: column;
}

.main-content {
    width: 100%;
    max-width: 800px;
    padding: 0 2rem;
    transition: all 0.3s ease;
}

.result-section {
    display: none;
    width: 50%;
    padding-left: 2rem;
    border-left: 1px solid #eee;
    transition: all 0.3s ease;
}

.main-container {
    display: flex;
    flex-direction: row;
    flex: 1;
    justify-content: center;
}

aside {
    width: 50%;
    background: #f9f9f9;
    border-left: 1px solid #ccc;
    padding: 1rem;
    overflow-y: auto;
    display: none;
    transition: all 0.3s ease;
}

header {
    text-align: center;
    margin: 0 auto;
    width: 100%;
}

header h1 {
    display: inline-block;
    background-color: #4CAF50;
    color: white;
    padding: 1rem 2rem;
    margin: 0;
    border-radius: 4px;
}

input, button {
    padding: 0.8rem;
    border: 1px solid #ccc;
    border-radius: 4px;
}

button {
    background-color: #4CAF50;
    color: white;
    border: none;
    cursor: pointer;
}

button:hover {
    background-color: #3E8E41;
}

.content-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 3rem;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1rem;
}

.content-text {
    width: 60%;
    max-width: 800px;
    text-align: left;
}

.content-image {
    width: 40%;
    text-align: center;
}

.content-image img {
    max-width: 200px;
    height: auto;
}

/* 悬浮按钮样式 */
.float-buttons {
    position: fixed;
    left: 20px;
    bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
}

.float-button {
    width: 50px;
    height: 50px;
    border-radius: 25px;
    background-color: #4CAF50;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.float-button:hover {
    transform: scale(1.1);
    background-color: #3E8E41;
}

/* 表单样式 */
#form {
    display: flex;
    gap: 0.5rem;
    position: relative;
    margin: 2rem auto;
    padding: 0 1rem;
    max-width: 600px;
}

.input-group {
    width: calc(100% - 150px);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

input {
    width: 100%;
    margin: 0;
}

button[type="submit"] {
    position: absolute;
    right: 1rem;
    top: -18px;
    width: 90px;
    height: 100%;
    white-space: nowrap;
    padding: 0.8rem 0.8rem;
}

.result {
    margin-top: 1rem;
    max-width: 500px;
    margin: 1rem auto;
    padding: 0 1rem;
}

.copy-input {
    width: calc(100% - 1rem);
    margin: 0.5rem 0;
    padding: 0.8rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #f9f9f9;
    cursor: pointer;
}

.copy-input:focus {
    outline: 2px solid #4CAF50;
}

/* WebSocket消息区域样式 */
.ws-message-container {
    display: none;
}

.ws-connected .ws-message-container {
    display: block;
    margin-top: 1rem;
}

.ws-message-container h3 {
    margin: 0;
    padding: 0.5rem;
    color: #333;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    background: #f0f0f0;
    border-radius: 4px 4px 0 0;
}

.ws-message-container h3::after {
    content: '▼';
    margin-left: auto;
    transition: transform 0.3s ease;
}

.ws-message-container.collapsed h3::after {
    transform: rotate(-90deg);
}

.ws-message-container.collapsed #payload-display {
    display: none;
}

#payload-display {
    font-family: monospace;
    font-size: 0.9rem;
    white-space: pre-wrap;
    padding: 1rem;
    background: #f9f9f9;
    border: 1px solid #eee;
    border-top: none;
    border-radius: 0 0 4px 4px;
    height: 200px;
    overflow-y: auto;
    margin-top: 0;
}

#payload-display::-webkit-scrollbar {
    width: 8px;
}

#payload-display::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#payload-display::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

#payload-display::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 生成结果区域样式 */
.result-container {
    margin-bottom: 1rem;
}

.result-container h3 {
    margin: 0;
    padding: 0.5rem;
    color: #333;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    background: #f0f0f0;
    border-radius: 4px 4px 0 0;
}

.result-container h3::after {
    content: '▼';
    margin-left: auto;
    transition: transform 0.3s ease;
}

.result-container.collapsed h3::after {
    transform: rotate(-90deg);
}

.result-container.collapsed .result {
    display: none;
}

/* 生成链接后的布局 */
.links-generated .main-content {
    width: 50%;
    padding-right: 2rem;
    border-right: 1px solid #eee;
}

.links-generated .result-section {
    display: block;
    width: 50%;
    padding-left: 2rem;
    max-width: 600px;
}

/* 移动端适配 */
@media (max-width: 768px) {
    body {
        flex-direction: column;
        height: auto;
    }

    main {
        width: 100%;
        box-shadow: none;
        margin-bottom: 1rem;
    }

    .main-container {
        flex-direction: column;
    }

    .links-generated .main-content,
    .links-generated .result-section {
        width: 100%;
        padding: 1rem;
        border: none;
    }

    .result-section {
        padding-left: 0;
        border-left: none;
    }

    .content-container {
        flex-direction: column;
        text-align: center;
    }

    .content-text {
        width: 100%;
        margin-bottom: 1rem;
    }

    .content-image {
        width: 100%;
        margin-bottom: 1rem;
    }

    .float-buttons {
        left: 10px;
        bottom: 10px;
    }
    
    .float-button {
        width: 40px;
        height: 40px;
        font-size: 10px;
    }

    .input-group {
        width: 100%;
    }

    #form {
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 0 1rem;
    }

    .input-group {
        flex: 1;
    }

    input {
        height: 42px;
        margin: 0 0 0.5rem 0;
        padding: 0;
        box-sizing: border-box;
    }

    input:last-child {
        margin-bottom: 0;
    }

    button[type="submit"] {
        position: static;
        width: 60px;
        height: 90px;
        margin: 0;
        padding: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        white-space: pre-line;
        line-height: 1.2;
        font-size: 14px;
    }

    button[type="submit"]::after {
        content: '';
        font-size: 14px;
        margin-top: 2px;
    }

    body.ws-connected button[type="submit"] {
        width: 60px;
        position: static;
    }

    /* 手机端结果区域的特殊样式 */
    .links-generated .result-section {
        order: 2;
    }

    .links-generated .main-content {
        order: 1;
    }

    #payload-display {
        height: 150px;
    }
} 