* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    padding: 20px;
    background-color: #f5f5f5;
    min-height: 100vh;
    margin: 0;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 40px); /* 减去body的padding */
}

.input-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    flex-shrink: 0;
}

#inputText {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 10px;
    font-size: 16px;
}

.buttons {
    display: flex;
    gap: 10px;
}

button {
    padding: 8px 20px;
    border: none;
    border-radius: 4px;
    background-color: #4CAF50;
    color: white;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #45a049;
}

.history-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 0; /* 确保flex-grow生效 */
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-shrink: 0;
}

.history-section h3 {
    margin-bottom: 15px;
    color: #333;
}

#historyList {
    flex-grow: 1;
    overflow-y: auto;
    min-height: 0; /* 确保flex-grow生效 */
}

.history-item {
    padding: 10px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.history-item-content {
    flex-grow: 1;
    margin-right: 10px;
}

.timestamp {
    color: #666;
    font-size: 0.9em;
}

.delete-btn {
    background-color: #dc3545;
    padding: 3px 8px;
    font-size: 0.8em;
    opacity: 0.7;
}

.delete-btn:hover {
    opacity: 1;
    background-color: #c82333;
}

.history-item:last-child {
    border-bottom: none;
}

.clear-btn {
    background-color: #dc3545;
    padding: 5px 10px;
    font-size: 0.9em;
}

.clear-btn:hover {
    background-color: #c82333;
}

.result-section {
    margin: 15px 0;
    padding: 10px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.result-display {
    min-height: 40px;
    padding: 8px;
    background: white;
    border: 1px solid #eee;
    border-radius: 4px;
    margin-bottom: 10px;
    word-break: break-all;
}

.copy-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.copy-buttons .copy-btn {
    flex: 1;
    /* background-color: #6c757d; */
    border: 1px solid #ddd;
    background-color: transparent;
    color: #333;
    padding: 5px 10px;
    font-size: 0.9em;
    margin: 0;
}

.copy-buttons .copy-btn:hover {
    background-color: #0006070e;
}

#toastContainer {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    pointer-events: none;
    z-index: 1000;
}

.toast {
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 2px;
    opacity: 0;
    transition: all 0.3s ease-in-out;
    pointer-events: none;
    position: relative;
}

.toast.show {
    opacity: 1;
}
