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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.header {
    text-align: center;
    margin-bottom: 40px;
}

h1 {
    font-size: 2.5rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 30px;
}

.input-section {
    background: linear-gradient(135deg, #f8f9ff, #e8f0ff);
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.input-wrapper {
    flex: 1;
    position: relative;
}

textarea {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    resize: vertical;
    min-height: 120px;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.3s ease;
    background: white;
    box-sizing: border-box;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.button-group {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
}

.add-btn {
    padding: 15px 30px;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    height: 52px;
    box-sizing: border-box;
    width: 120px;
}

.add-btn:hover {
    box-shadow: 0 10px 20px rgba(40, 167, 69, 0.3);
}

.section-title {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.item-list {
    list-style: none;
    padding: 0;
}

.item {
    background: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    word-break: break-all;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.item:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.item-content {
    flex: 1;
    padding-right: 20px;
    min-width: 0;
    overflow: hidden;
}

.item-text {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 10px;
    white-space: pre;
    word-break: normal;
    max-height: 200px;
    overflow: auto;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

.timestamp {
    font-size: 0.85rem;
    color: #888;
    display: flex;
    align-items: center;
    gap: 5px;
}

.item-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.action-btn {
    padding: 10px 15px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.copy-button {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.copy-button:hover {
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

.delete-button {
    background: linear-gradient(135deg, #dc3545, #e74c3c);
    color: white;
}

.delete-button:hover {
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.3);
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.modal.is-visible {
    display: flex;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    max-width: 550px;
    width: 90%;
    animation: slideIn 0.3s ease;
}

.modal-content p {
    margin: 0 0 30px 0;
    font-size: 18px;
    color: #333;
    font-weight: 500;
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.modal-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    min-width: 100px;
}

.delete-confirm-btn {
    background: linear-gradient(135deg, #dc3545, #e74c3c);
    color: white;
}

.delete-confirm-btn:hover {
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.3);
}

.delete-cancel-btn {
    background: linear-gradient(135deg, #6c757d, #495057);
    color: white;
}

.delete-cancel-btn:hover {
    box-shadow: 0 5px 15px rgba(108, 117, 125, 0.3);
}

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

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

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 20px;
        margin: 10px;
    }

    h1 {
        font-size: 2rem;
    }

    .item {
        flex-direction: column;
        gap: 15px;
    }

    .item-content {
        padding-right: 0;
    }

    .item-actions {
        width: 100%;
        justify-content: center;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .search-section {
        max-width: 100%;
    }

    .user-code-fixed {
        top: 10px;
        right: 10px;
        padding: 8px 12px;
        gap: 8px;
    }

    .user-code-info {
        font-size: 11px;
    }

    .user-code-btn {
        padding: 5px 10px;
        font-size: 11px;
    }
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-state i {
    font-size: 4rem;
    color: #ddd;
    margin-bottom: 20px;
}

.empty-state p {
    font-size: 1.1rem;
}

/* 消息提示样式 */
.message-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 10px;
    color: white;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 10000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    max-width: 400px;
}

.message-toast.show {
    transform: translateX(0);
}

.message-success {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.message-warning {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
}

.message-error {
    background: linear-gradient(135deg, #dc3545, #e74c3c);
}

.message-info {
    background: linear-gradient(135deg, #17a2b8, #6f42c1);
}

.message-toast i {
    font-size: 1.2rem;
}

/* 自定义滚动条样式 */
.item-text::-webkit-scrollbar {
    width: 8px;
}

.item-text::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.item-text::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.item-text::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Firefox 滚动条样式 */
.item-text {
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 #f1f1f1;
}

/* 用户码功能样式 */
.user-code-fixed {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 25px;
    border: 1px solid rgba(102, 126, 234, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: all 0.3s ease;
}

.user-code-fixed:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15);
}

.user-code-info {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #495057;
    font-size: 12px;
}

.user-code-info i {
    color: #667eea;
    font-size: 14px;
}

.user-code-btn {
    padding: 6px 12px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.user-code-btn:hover {
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
}

.user-code-input-section {
    margin: 20px 0;
}

.user-code-input-wrapper {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    align-items: center;
    justify-content: center;
}

#user-code-input {
    width: 200px;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 18px;
    text-align: center;
    letter-spacing: 2px;
    font-family: 'Courier New', monospace;
    transition: all 0.3s ease;
}

#user-code-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.generate-code-btn {
    padding: 12px 16px;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.generate-code-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(40, 167, 69, 0.3);
}

.user-code-help {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6c757d;
    font-size: 13px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #667eea;
}

.user-code-help i {
    color: #667eea;
}

.user-code-confirm-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.user-code-cancel-btn {
    background: linear-gradient(135deg, #6c757d, #495057);
}


/* 搜索功能样式 */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0 30px 0;
    gap: 20px;
}

.section-title {
    flex-shrink: 0;
}

.search-section {
    flex: 1;
    max-width: 400px;
}

.search-wrapper {
    position: relative;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-size: 16px;
    z-index: 2;
}

#search-input {
    width: 100%;
    padding: 12px 45px 12px 45px;
    border: 2px solid #e1e5e9;
    border-radius: 25px;
    font-size: 16px;
    background: white;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

#search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.clear-search-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 2;
}

.clear-search-btn:hover {
    background: #f8f9fa;
    color: #495057;
}

.search-highlight {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 500;
}

.search-no-results {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.search-no-results i {
    font-size: 3rem;
    margin-bottom: 15px;
    color: #dee2e6;
}

/* 分页控件样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 30px 0 20px 0;
    flex-wrap: wrap;
}

.pagination-btn {
    padding: 8px 12px;
    border: 2px solid #e1e5e9;
    background: white;
    color: #495057;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 40px;
    justify-content: center;
}

.pagination-btn:hover:not(.disabled):not(.active) {
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.2);
}

.pagination-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-color: #667eea;
    color: white;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
}

.pagination-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f8f9fa;
    color: #6c757d;
}

.pagination-ellipsis {
    padding: 8px 4px;
    color: #6c757d;
    font-weight: 500;
}

.pagination-info {
    text-align: center;
    color: #6c757d;
    font-size: 14px;
    margin-bottom: 20px;
}
