.user-page {
    max-width: 800px;
    padding-top: 30px;
    padding-bottom: 60px;
}

.user-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    overflow: hidden;
    margin-bottom: 24px;
}

.user-card-header {
    display: flex;
    align-items: center;
    padding: 30px;
    gap: 24px;
}

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

.avatar-wrapper {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid #e0e0e0;
    transition: border-color 0.2s;
}

.avatar-wrapper:hover {
    border-color: #4CAF50;
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.avatar-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.5);
    color: #fff;
    text-align: center;
    font-size: 12px;
    padding: 4px 0;
    transform: translateY(100%);
    transition: transform 0.2s;
}

.avatar-wrapper:hover .avatar-overlay {
    transform: translateY(0);
}

.user-basic-info h1 {
    font-size: 22px;
    margin: 0;
    color: #333;
}

.username-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.username-edit-input {
    font-size: 22px;
    font-weight: bold;
    color: #333;
    border: none;
    border-bottom: 2px solid #4CAF50;
    outline: none;
    padding: 0 4px;
    background: transparent;
    width: 200px;
}

.edit-username-btn {
    flex-shrink: 0;
    cursor: pointer;
    opacity: 0.4;
    transition: opacity 0.2s;
}

.edit-username-btn:hover {
    opacity: 0.8;
}

.user-email {
    color: #999;
    font-size: 14px;
    margin: 0;
}

.user-sections {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.section-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    padding: 24px;
}

.section-title {
    font-size: 18px;
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 14px;
    color: #666;
    margin-bottom: 6px;
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: #4CAF50;
}

.form-input:disabled {
    background: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

.input-row {
    display: flex;
    gap: 10px;
}

.input-row .form-input {
    flex: 1;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.btn-primary {
    background-color: #4CAF50;
    color: #fff;
}

.btn-primary:hover {
    background-color: #45a049;
}

.btn-primary:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.history-title {
    margin: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.history-search {
    flex-shrink: 0;
    width: 200px;
}

.history-search .form-input {
    padding-left: 30px;
    padding-top: 8px;
    padding-bottom: 8px;
    font-size: 13px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 8px center;
}

.history-pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 16px;
}

.history-pagination .page-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    color: #666;
    transition: all 0.2s;
}

.history-pagination .page-btn:hover {
    border-color: #4CAF50;
    color: #4CAF50;
}

.history-pagination .page-btn.active {
    background: #4CAF50;
    color: #fff;
    border-color: #4CAF50;
}

.history-pagination .page-btn.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.page-ellipsis {
    padding: 6px 4px;
    color: #999;
    font-size: 13px;
}

.watch-history {
    max-height: 500px;
    overflow-y: auto;
}

.watch-history::-webkit-scrollbar {
    width: 4px;
}

.watch-history::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 2px;
}

.history-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.15s;
}

.history-item:hover {
    background-color: #fafafa;
}

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

.history-item-cover {
    flex-shrink: 0;
    width: 60px;
    height: 80px;
    border-radius: 4px;
    overflow: hidden;
    margin-right: 12px;
    background: #f0f0f0;
}

.history-item-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.history-item-info {
    flex: 1;
    min-width: 0;
}

.history-item-name {
    font-size: 15px;
    color: #333;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-item-episode {
    font-size: 13px;
    color: #999;
}

.history-item-arrow {
    color: #ccc;
    font-size: 18px;
    margin-left: 10px;
}

.empty-text {
    text-align: center;
    color: #999;
    padding: 30px 0;
    font-size: 14px;
}

.password-wrapper {
    position: relative;
}

.password-wrapper .form-input {
    padding-right: 40px;
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 16px;
    opacity: 0.5;
    user-select: none;
    transition: opacity 0.2s;
}

.password-toggle:hover {
    opacity: 0.8;
}

@media (max-width: 600px) {
    .user-card-header {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }

    .avatar-wrapper {
        width: 80px;
        height: 80px;
    }

    .user-basic-info h1 {
        font-size: 18px;
    }

    .input-row {
        flex-direction: column;
    }

    .input-row .btn {
        width: 100%;
    }

    .history-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .history-search {
        width: 100%;
    }
}
